@antv/g2
the Grammar of Graphics in Javascript
Last updated 2 months ago by atool .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @antv/g2 
SYNC missed versions from official npm registry.

English | 简体中文

G2

A highly interactive data-driven visualization grammar for statistical charts.

CI Coverage Status NPM Package NPM Downloads Dependencies Percentage of issues still open PRs Welcome

WebsiteTutorial DocsBlog

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, you can describe the visual appearance and interactive behavior of a visualization just by one statement, and generate web-based views using Canvas or SVG.

???? Live Demos

✨ Features

  • ????Stable grammar of graphics: enable to draw all kinds of charts by mapping data to graphics.
  • ????New grammar of interaction: interaction behaviors combined with Trigger and Action mechanisms are used to exploring data.
  • ????Advanced View module: with the ability to develop customized multi-dimension data analysis graphics.
  • ????Dual-engine rendering: with the ability to switch Canvas and SVG freely.
  • ????Visual components: interaction-oriented, elegant experience.
  • ????Fully embrace Typescript: Complete type definition files are provided.

???? Installation

$ npm install @antv/g2

???? Getting Started

Before drawing we need to prepare a DOM container for G2:

<div id="c1"></div>
import { Chart } from '@antv/g2';

const data = [
  { genre: 'Sports', sold: 275 },
  { genre: 'Strategy', sold: 115 },
  { genre: 'Action', sold: 120 },
  { genre: 'Shooter', sold: 350 },
  { genre: 'Other', sold: 150 },
];

// Step 1: Create a Chart instance.
const chart = new Chart({
  container: 'c1', // Specify chart container ID
  width: 600, // Specify chart width
  height: 300, // Specify chart height
});

// Step 2: Load the data.
chart.data(data);

// Step 3: Declare the grammar of graphics, draw column chart.
chart.interval().position('genre*sold');

// Step 4: Render chart.
chart.render();

⌨️ Development

# Install dependencies
$ npm install

# Run test cases
$ npm run test

# Open electron to run test cases and listen to file changes
$ npm run test-live

# Run CI
$ npm run ci

# Run website
$ npm start

????️ Releases

???? 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.

Current Tags

  • 4.0.0-alpha.1                                ...           alpha (a year ago)
  • 4.1.0-beta.14                                ...           beta (5 days ago)
  • 4.0.15                                ...           latest (2 months ago)
  • 3.5.17                                ...           v3-latest (5 months ago)

216 Versions

  • 4.1.0-beta.14                                ...           5 days ago
  • 4.1.0-beta.13                                ...           9 days ago
  • 4.1.0-beta.12                                ...           15 days ago
  • 4.1.0-beta.11                                ...           18 days ago
  • 4.1.0-beta.10                                ...           a month ago
  • 4.1.0-beta.9                                ...           a month ago
  • 4.1.0-beta.8                                ...           a month ago
  • 4.1.0-beta.7                                ...           a month ago
  • 4.1.0-beta.6                                ...           a month ago
  • 4.1.0-beta.5                                ...           a month ago
  • 4.1.0-beta.4                                ...           a month ago
  • 4.1.0-beta.3                                ...           a month ago
  • 4.1.0-beta.2                                ...           2 months ago
  • 4.1.0-beta.1                                ...           2 months ago
  • 4.0.16-beta.5                                ...           2 months ago
  • 4.0.16-beta.4                                ...           2 months ago
  • 4.0.16-beta.3                                ...           2 months ago
  • 4.0.16-beta.2                                ...           2 months ago
  • 4.0.16-beta.1                                ...           2 months ago
  • 4.0.16-beta.0                                ...           2 months ago
  • 4.0.15                                ...           2 months ago
  • 4.0.15-beta.0                                ...           3 months ago
  • 4.0.14                                ...           3 months ago
  • 4.0.14-beta.2                                ...           3 months ago
  • 4.0.14-beta.1                                ...           3 months ago
  • 4.0.13                                ...           3 months ago
  • 4.0.13-beta.1                                ...           4 months ago
  • 4.0.12                                ...           4 months ago
  • 4.0.11                                ...           4 months ago
  • 4.0.11-beta.0                                ...           4 months ago
  • 4.0.10                                ...           5 months ago
  • 3.5.17                                ...           5 months ago
  • 4.0.9                                ...           5 months ago
  • 4.0.9-beta.1                                ...           5 months ago
  • 4.0.8                                ...           5 months ago
  • 3.5.16                                ...           5 months ago
  • 4.0.8-beta.1                                ...           6 months ago
  • 4.0.8-beta                                ...           6 months ago
  • 4.0.7                                ...           6 months ago
  • 4.0.6                                ...           7 months ago
  • 4.0.5                                ...           7 months ago
  • 3.5.15                                ...           7 months ago
  • 4.0.4                                ...           7 months ago
  • 4.0.4-beta.2                                ...           7 months ago
  • 4.0.4-beta.1                                ...           7 months ago
  • 3.5.14                                ...           7 months ago
  • 3.5.14-beta.1                                ...           7 months ago
  • 4.0.3                                ...           7 months ago
  • 4.0.2                                ...           7 months ago
  • 3.6.0-beta.21                                ...           8 months ago
  • 4.0.1                                ...           8 months ago
  • 3.5.13                                ...           8 months ago
  • 3.6.0-beta.20                                ...           8 months ago
  • 4.0.0                                ...           8 months ago
  • 4.0.0-beta.18                                ...           8 months ago
  • 4.0.0-beta.17                                ...           8 months ago
  • 4.0.0-beta.16                                ...           8 months ago
  • 3.6.0-beta.19                                ...           8 months ago
  • 4.0.0-beta.15                                ...           8 months ago
  • 4.0.0-beta.14                                ...           8 months ago
  • 4.0.0-beta.13                                ...           8 months ago
  • 3.5.12                                ...           8 months ago
  • 3.6.0-beta.18                                ...           9 months ago
  • 4.0.0-beta.12                                ...           9 months ago
  • 4.0.0-beta.11                                ...           9 months ago
  • 4.0.0-beta.10                                ...           9 months ago
  • 4.0.0-beta.9                                ...           9 months ago
  • 4.0.0-beta.8                                ...           9 months ago
  • 3.6.0-beta.17                                ...           9 months ago
  • 3.6.0-beta.16                                ...           9 months ago
  • 4.0.0-beta.7                                ...           9 months ago
  • 4.0.0-beta.6                                ...           9 months ago
  • 4.0.0-beta.5                                ...           9 months ago
  • 4.0.0-beta.3                                ...           9 months ago
  • 4.0.0-beta.1                                ...           10 months ago
  • 3.6.0-beta.14                                ...           10 months ago
  • 3.6.0-beta.11                                ...           10 months ago
  • 3.6.0-beta.10                                ...           10 months ago
  • 3.6.0-beta.9                                ...           10 months ago
  • 3.6.0-beta.8                                ...           10 months ago
  • 3.6.0-beta.7                                ...           10 months ago
  • 3.6.0-beta.6                                ...           a year ago
  • 4.0.0-alpha.1                                ...           a year ago
  • 3.6.0-beta.5                                ...           a year ago
  • 3.5.11                                ...           a year ago
  • 3.5.10                                ...           a year ago
  • 3.6.0-beta.4                                ...           a year ago
  • 3.6.0-beta.3                                ...           a year ago
  • 3.5.9                                ...           a year ago
  • 3.5.9-beta.3                                ...           a year ago
  • 3.5.9-beta.2                                ...           a year ago
  • 3.5.9-beta.1                                ...           a year ago
  • 3.5.8                                ...           a year ago
  • 3.6.0-beta.2                                ...           a year ago
  • 3.5.8-beta.4                                ...           a year ago
  • 3.5.8-beta.3                                ...           a year ago
  • 3.5.8-beta.2                                ...           a year ago
  • 3.5.8-beta.1                                ...           a year ago
  • 3.5.7                                ...           a year ago
  • 3.5.6                                ...           a year ago
  • 3.5.5                                ...           a year ago
  • 3.5.4                                ...           a year ago
  • 3.5.3                                ...           2 years ago
  • 3.5.2                                ...           2 years ago
  • 3.5.1                                ...           2 years ago
  • 3.5.0                                ...           2 years ago
  • 3.5.0-beta.5                                ...           2 years ago
  • 3.5.0-beta.4                                ...           2 years ago
  • 3.5.0-beta.3                                ...           2 years ago
  • 3.5.0-beta.2                                ...           2 years ago
  • 3.5.0-beta.1                                ...           2 years ago
  • 3.4.10                                ...           2 years ago
  • 3.4.9                                ...           2 years ago
  • 3.4.8                                ...           2 years ago
  • 3.4.7                                ...           2 years ago
  • 3.4.6                                ...           2 years ago
  • 3.4.5                                ...           2 years ago
  • 3.4.4                                ...           2 years ago
  • 3.4.3                                ...           2 years ago
  • 3.4.2                                ...           2 years ago
  • 3.4.1                                ...           2 years ago
  • 3.4.0                                ...           2 years ago
  • 3.4.0-beta.12                                ...           2 years ago
  • 3.4.0-beta.11                                ...           2 years ago
  • 3.4.0-beta.10                                ...           2 years ago
  • 3.4.0-beta.9                                ...           2 years ago
  • 3.4.0-beta.8                                ...           2 years ago
  • 3.4.0-beta.7                                ...           2 years ago
  • 3.4.0-beta.6                                ...           2 years ago
  • 3.4.0-beta.5                                ...           2 years ago
  • 3.4.0-beta.4                                ...           2 years ago
  • 3.4.0-beta.3                                ...           2 years ago
  • 3.4.0-beta.2                                ...           2 years ago
  • 3.4.0-beta.1                                ...           2 years ago
  • 3.3.4                                ...           2 years ago
  • 3.3.3                                ...           2 years ago
  • 3.3.2                                ...           2 years ago
  • 3.3.1                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.3.0-beta.5                                ...           2 years ago
  • 3.3.0-beta.4                                ...           2 years ago
  • 3.3.0-beta.2                                ...           2 years ago
  • 3.3.0-beta.1                                ...           2 years ago
  • 3.2.8                                ...           2 years ago
  • 3.2.8-beta.6                                ...           2 years ago
  • 3.2.8-beta.5                                ...           2 years ago
  • 3.2.8-beta.4                                ...           2 years ago
  • 3.2.8-beta.3                                ...           2 years ago
  • 3.2.8-beta.2                                ...           2 years ago
  • 3.2.8-beta.1                                ...           2 years ago
  • 3.2.7                                ...           2 years ago
  • 3.2.7-beta.6                                ...           2 years ago
  • 3.2.7-beta.5                                ...           2 years ago
  • 3.2.7-beta.4                                ...           2 years ago
  • 3.2.7-beta.3                                ...           2 years ago
  • 3.2.7-beta.2                                ...           2 years ago
  • 3.2.7-beta.1                                ...           2 years ago
  • 3.2.6                                ...           2 years ago
  • 3.2.6-beta.1                                ...           2 years ago
  • 3.2.5                                ...           2 years ago
  • 3.2.4                                ...           2 years ago
  • 3.2.3                                ...           2 years ago
  • 3.2.2                                ...           2 years ago
  • 3.2.1                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.2.0-beta.7                                ...           2 years ago
  • 3.2.0-beta.6                                ...           2 years ago
  • 3.2.0-beta.5                                ...           2 years ago
  • 3.2.0-beta.4                                ...           2 years ago
  • 3.2.0-beta.3                                ...           2 years ago
  • 3.2.0-beta.2                                ...           2 years ago
  • 3.2.0-beta.1                                ...           2 years ago
  • 3.1.2                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.12                                ...           2 years ago
  • 3.0.11                                ...           2 years ago
  • 3.0.10                                ...           2 years ago
  • 3.0.9                                ...           2 years ago
  • 3.0.8                                ...           3 years ago
  • 3.0.7                                ...           3 years ago
  • 3.0.6                                ...           3 years ago
  • 3.0.5                                ...           3 years ago
  • 3.0.5-beta.7                                ...           3 years ago
  • 3.0.5-beta.6                                ...           3 years ago
  • 3.0.5-beta.5                                ...           3 years ago
  • 3.0.5-beta.4                                ...           3 years ago
  • 3.0.5-beta.3                                ...           3 years ago
  • 3.0.5-beta.2                                ...           3 years ago
  • 3.0.5-beta.1                                ...           3 years ago
  • 3.0.4                                ...           3 years ago
  • 3.0.4-beta.4                                ...           3 years ago
  • 3.0.4-beta.3                                ...           3 years ago
  • 3.0.4-beta.2                                ...           3 years ago
  • 3.0.4-beta.1                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.3-beta.1                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.2-beta.1                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 3.0.0-rc5.14                                ...           3 years ago
  • 3.0.0-rc5.13                                ...           3 years ago
  • 3.0.0-rc5.12                                ...           3 years ago
  • 3.0.0-rc5.11                                ...           3 years ago
  • 3.0.0-rc5.10                                ...           3 years ago
  • 3.0.0-rc5.9                                ...           3 years ago
  • 3.0.0-rc5.8                                ...           3 years ago
  • 3.0.0-rc5.7                                ...           3 years ago
  • 3.0.0-rc5.6                                ...           3 years ago
  • 3.0.0-rc5.5                                ...           3 years ago
  • 3.0.0-rc5.4                                ...           3 years ago
  • 3.0.0-rc5.3                                ...           3 years ago
  • 3.0.0-rc5.2                                ...           3 years ago
  • 3.0.0-rc5.1                                ...           3 years ago
  • 3.0.0-rc5                                ...           3 years ago
Downloads
Today 4,387
This Week 9,118
This Month 79,074
Last Day 4,731
Last Week 26,739
Last Month 122,560
Dependencies (14)
Dev Dependencies (29)
Dependents (136)

Copyright 2014 - 2016 © taobao.org |