Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GreatZoe/g2

Repository files navigation

G2: The Grammar of Graphics in JavaScript

NPM Package NPM Downloads Percentage of issues still open

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, the author of The Grammar Of Graphics, whose book served as the foundation for G2.

More details about G2.

Installation

$ npm install @antv/g2

Usage

<div id="c1"></div>
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

demos

Development

$ 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 for bug reports or suggestions first.

To become a contributor, please follow our contributing guide.

(削除) Experience Improvement Program Description (削除ここまで)

(削除) In order to serve the users better, G2 will send the URL and version information back to the AntV server: (削除ここまで)

(削除) https://kcart.alipay.com/web/bi.do (削除ここまで)

(削除) Except for URL and G2 version information, no other information will be collected. You can also turn it off with the following code: (削除ここまで)

// disable tracking
G2.track(false)

update:

We decided to terminate the "Experience Improvement Program". In verson @antv/g2@3.4.7 and above, all tracking code is removed, no unexpected remote request will be sent while you are using G2.

Contributors


leungwensen


simaQ


dxq613


elaine1234


guisturdy


paleface001


chenshuai2144


xile611


maplor


zhfanrui


Frezc


Leannechn


janjakubnanista


ParryQiu


Sai0514


liximomo


wensen-lws


xudafeng


wangyu-kelly


BlackGanglion


illumen


DanielRuf


huacnlee


0nza1101


RaoHai


tbroadley


charleyw


Hazyzh


forbreak


nekocode

This project follows the git-contributor spec, auto updated at Sat Jul 27 2019 14:06:08 GMT+0800.

About

The Grammar of Graphics in JavaScript

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.9%
  • TypeScript 1.6%
  • Other 0.5%

AltStyle によって変換されたページ (->オリジナル) /