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()
.moveTo(5,305)
.lineTo(175,5)
.lineTo(355,305);
// draw the wand in the middle
stage.path()
.moveTo(175,5)
.lineTo(175,305);
</script>
</body>
</html>
网站地址:http://www.graphicsjs.org/
GitHub:https://github.com/anychart/graphicsjs
网站描述:一个强大的Js绘图库,基于SVG/VML技术
GraphicsJS
官方网站:http://www.graphicsjs.org/
小编说
以上是编程之家为你收集整理的GraphicsJS全部内容。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。