Skip to content

Commit 375ee74

Browse files
authored
Update README.md
readme draft
1 parent 5f49650 commit 375ee74

File tree

1 file changed

+87
-1
lines changed

1 file changed

+87
-1
lines changed

README.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,88 @@
11
# GraphicsJS
2-
A lightweight JavaScript graphics library with the intuitive API, based on SVG/VML technology.
2+
GraphicsJS is a lightweight JavaScript graphics library with the intuitive API, based on SVG/VML technology.
3+
4+
* [Overview](#overview)
5+
* [Quick Start](#quick_start)
6+
* [Articles](#articles)
7+
* [Building](#building)
8+
* [Links](#articles)
9+
10+
# Overview
11+
12+
[GraphicsJS](http://www.graphicsjs.org/) is a JavaScript graphics library that allows you to draw absolutely anything, including any sort of interactive and animated graphics with any visual effects.
13+
14+
You can think of GraphicsJS as a paintbox with a brush, GraphicsJS may be used for data visualization, charting, game design or else. [AnyChart charting libraries](https://www.anychart.com/) rendering is based fully on it.
15+
16+
You can find some specific samples at [http://www.graphicsjs.org/](http://www.graphicsjs.org/), along with source code: [galaxy](https://playground.anychart.com/gallery/latest/Graphics/Galaxy-plain), [rain](https://playground.anychart.com/gallery/latest/Graphics/Rain-plain), [bonfire](https://playground.anychart.com/gallery/latest/Graphics/Bonfire-plain), [Bender](https://playground.anychart.com/gallery/latest/Graphics/Bender-plain), and a [playable 15-puzzle](https://playground.anychart.com/gallery/latest/Graphics/Puzzle_15-plain). All of these were created with GraphicsJS only.
17+
18+
GraphicsJS allows to visualize complicated mathematical algorithms very conveniently and easily, e.g. the [galaxy](https://playground.anychart.com/gallery/latest/Graphics/Galaxy-plain) demo is based on [Archimedean spiral](https://en.wikipedia.org/wiki/Archimedean_spiral).
19+
20+
GraphicsJS has one the most powerful [line drawing features](https://docs.anychart.com/Graphics/Paths) among SVG/VML based graphics libraries that provide only Bezier curves out of the box. But GraphicsJS is great at working with mathematical functions. As a result, GraphicsJS allows you to draw not only Bezier curves out of the box, but literally anything; for example, you can draw some arc very quickly, whereas other graphics libraries will make you arrange it through numerous different curves. And surely there are [basic shapes available](https://docs.anychart.com/Graphics/Shapes)
21+
22+
GraphicsJS has the richest [text features](https://docs.anychart.com/Graphics/Text_and_Fonts), for example, SVG/VML technologies do not provide this out of the box, as well as most of other JavaScript drawing libraries. GraphicsJS supports multiline texts and also offers text measurement, including width, height, as well as wrap, overflow, indent, spacing, align, etc.
23+
24+
GraphicsJS has implements the [Virtual DOM](https://docs.anychart.com/Graphics/Virtual_DOM) which makes drawing more robust and manageable.
25+
26+
GraphicsJS uses smart layering system for elements and [layers](https://docs.anychart.com/Graphics/Layers).
27+
28+
GraphicsJS supports z-index. Typically, if you ever decided to change the overlapping order, you would have to erase everything and draw the whole picture again, from scratch. With GraphicsJS, you are given the power to arrange this dynamically, which is extremely helpful when you are creating some big graphical thing and it is important for you to specify which elements must be seen at one moment or another.
29+
30+
GraphicsJS provides a convenient [Transformations](https://docs.anychart.com/Graphics/Transformations) API that allows to move, scale, rotate and shear both elements and groups of elements. Transformations, in good hands, when used along with [flexible Event Model](https://docs.anychart.com/Graphics/Events) and [Virtual DOM](https://docs.anychart.com/Graphics/Virtual_DOM), is a very powerfull tool.
31+
32+
GraphicsJS [supports legacy browsers including IE6+](https://docs.anychart.com/Graphics/Browser_Support).
33+
34+
GraphicsJS API is very convenient to use. [GraphicsJS API](https://api.anychart.com/latest/anychart.graphics) is very concise and provides chaining support, which makes it possible to use a dozen lines of code where other libraries require a hundred.
35+
36+
GraphicsJS is built on a very reliable technology, Google Closure, just like Google Mail, Google Calendar, Google Drive, and so on.
37+
38+
# Quick Start
39+
40+
To get started with GraphicsJS create simple HTML document and copy paste the following code (or just grab the sample from [playground](https://playground.anychart.com/docs/7.14.0/samples/GFX_quick_start-plain)):
41+
42+
```html
43+
<!DOCTYPE html>
44+
<html lang="en">
45+
<head>
46+
<meta charset="utf-8" />
47+
<script src="https://cdn.anychart.com/js/latest/graphics.min.js"></script>
48+
</head>
49+
<body>
50+
<div id="stage-container" style="width: 400px; height: 375px;"></div>
51+
<script>
52+
// create a stage for the Deathly Hallows symbol
53+
stage = acgraph.create('stage-container');
54+
// draw the square
55+
stage.rect(5, 5, 350, 300);
56+
// draw the circle
57+
stage.circle(177.5, 205, 100);
58+
// draw the triangle
59+
stage.path()
60+
.moveTo(5, 305)
61+
.lineTo(175, 5)
62+
.lineTo(355, 305);
63+
// draw the wand in the middle
64+
stage.path()
65+
.moveTo(175, 5)
66+
.lineTo(175, 305);
67+
</script>
68+
</body>
69+
</html>
70+
```
71+
72+
Launch the page in your browser and here you are: you have created your first drawing with GraphicsJS. See [documentation](https://docs.anychart.com/Graphics/Basics) and [API](https://api.anychart.com/latest/anychart.graphics) to learn more.
73+
74+
# Articles
75+
- [Introducing GraphicsJS, a Powerful Lightweight Graphics Library](https://www.sitepoint.com/introducing-graphicsjs-a-powerful-lightweight-graphics-library/) by @RomanLubushkin
76+
- [GraphicsJS Overview](https://docs.anychart.com/Graphics/Overview) by [AnyChart](http://www.anychart.com/)
77+
78+
# Building
79+
80+
*Coming soon.*
81+
82+
# Links
83+
- [GraphicsJS Website](http://www.graphicsjs.org/)
84+
- [GraphicsJS Users's Guide](https://docs.anychart.com/Graphics/Basics)
85+
- [GraphicsJS API](https://api.anychart.com/latest/anychart.graphics)
86+
- [GraphicsJS at GitHub](https://github.com/anychart/graphicsjs)
87+
- [Report a bug or an issue](https://github.com/anychart/graphicsjs/issues)
88+

0 commit comments

Comments
 (0)