# G2: The Grammar of Graphics in JavaScript [](https://travis-ci.org/antvis/g2)   [](https://www.npmjs.com/package/@antv/g2) [](https://npmjs.org/package/@antv/g2) [](http://isitmaintained.com/project/antvis/g2 "Percentage of issues still open") [中文 README](./README.zh-CN.md) G2 is a visualization grammar, a data-driven visual language with a high level of usability and scalability. It provides a set of grammars, takes users beyond a limited set of charts to an almost unlimited world of graphical forms. With G2, users can describe the visual appearance of a visualization just by one statement. **Special thanks to [Leland Wilkinson](https://en.wikipedia.org/wiki/Leland_Wilkinson), the author of [*The Grammar Of Graphics*](https://www.cs.uic.edu/~wilkinson/TheGrammarOfGraphics/GOG.html), whose book served as the foundation for G2.**
## Installation ```bash $ npm install @antv/g2 ``` ### Usage
```html
```
```js
import G2 from '@antv/g2';
const data = [
{ genre: 'Sports', sold: 275 },
{ genre: 'Strategy', sold: 1150 },
{ genre: 'Action', sold: 120 },
{ genre: 'Shooter', sold: 350 },
{ genre: 'Other', sold: 150 },
];
const chart = new G2.Chart({
container: 'c1',
width: 500,
height: 500
});
chart.source(data);
chart.interval().position('genre*sold').color('genre');
chart.render();
```
[More examples](https://antv.alipay.com/zh-cn/g2/3.x/demo/index.html)
## Development
```bash
$ npm install
# run test case
$ npm run test-live
# build watching file changes and run demos
$ npm run dev
# run demos
$ npm run demos
```
## How to Contribute
Please let us know how can we help. Do check out [issues](https://github.com/antvis/g2/issues) for bug reports or suggestions first.
To become a contributor, please follow our [contributing guide](https://github.com/antvis/g2/blob/master/CONTRIBUTING.md).
## Contributors
|[