GraphicsJS 介绍
Graphicsjs 一个 新的强大的开源JavaScript绘图库,它基于SVG(对于旧的IE版本使用 VML 回退)。 我将首先简要介绍其基础知识,然后通过两个简短而又精彩的示例来展示该库的 功能 :第 一个 是关于艺术,第二个说明如何使用不到50行 代码 编写 一个 简单的时间 - 杀手艺术游戏。Graphicsjs是轻量级的,并有 一个 非常灵活的JavaScript API。 它实现了许多富文本 功能 ,以及 一个 虚拟DOM - 并从浏览器特定的html DOM实现中分离出来。?
使用
<!DOCTYPE html>
<html lang="en">
<head>
< Meta charset="utf-8" />
<script src="https://cdn.anychart.com/releases/v8/js/graphics.min.js"></script>
</head>
<body>
<div id="stage-container" width: 400px; height: 375px;"></div>
<script>
// create a stage for the Deathly Hallows symbol
stage = acgraph.create('stage-container');
// draw the square
stage.rect(5,5,350,300);
// draw the circle
stage.circle(177.5,205,100);
// draw the triangle
stage.path()
.mov eto (5,305)
.lin eto (175,5)
.lin eto (355,305);
// draw the wand in the middle
stage.path()
.mov eto (175,5)
.lin eto (175,305);
</script>
</body>
</html>
?
网站地址 : http://www.graphicsjs.org/
GitHub: https://github.com/anychart/graphicsjs
网站描述: 一个 强大的Js绘图库,基于SVG/VML技术
GraphicsJS官方网站
官方网站: http://www.graphicsjs.org/
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。