Description
G2 is a visualization library from AntV built on a concise, progressive visualization grammar, named after Leland Wilkinson's book The Grammar of Graphics. It is meant for dashboard building, data exploration and storytelling. You get meaningful charts quickly with short declarations, and G2 infers the rest. For complex cases you can configure much more. Its API is declarative and functional, which makes chart options easier to reuse and organise in code. G2 can be extended with custom scales, transforms, marks and more, and you can build a new visualisation tool on the same mechanism. Instead of a fixed list of chart types, it is built from marks, transforms, scales, coordinates and compositions, and it supports data-driven animations and action-based interactions. Its renderer, called G, draws with Canvas, SVG or WebGL and has plugins for styles such as hand-drawn charts and integration with the D3 ecosystem. G2 is usually installed from npm or Yarn. The project's ecosystem includes g2-react, a lightweight React component, g2-extensions for 3D and automated visual analytics, and ant-design-charts, a React chart library built on G2. The site offers an introduction, many examples, interactive tutorials and a full API reference.…
Highlights
- Declarative, concise chart API
- Marks, scales, transforms and coordinates
- Extensible scales, marks and transforms
- Canvas, SVG and WebGL rendering
- Animations and interactions
- React bindings and extensions
Ratings & Reviews
No ratings yet
Be the first to rate G2.
People also visit
Plot
A concise API for exploratory data visualization implementing a layered grammar
G2 FAQ
What is G2?
A visualization grammar for building dashboards, exploring data and telling stories with charts, from the AntV family.
How do I install it?
G2 is usually installed through npm or Yarn, and the Getting Started section shows how to import the Chart object.
Can I make custom charts?
Yes. G2 lets you extend scales, transforms and marks, and you can build your own visualization tool on the same mechanism.
Does it work with React?
Yes, through g2-react, a lightweight React component, or ant-design-charts, a React chart library built on G2.
Which rendering options are there?
Canvas, SVG or WebGL, through the G renderer.
Where can I learn it?
The site offers an introduction, a large number of examples, interactive tutorials and the API reference.
What are the best G2 alternatives?
Popular alternatives to G2 include Visx, ZoomCharts and nivo. See all G2 alternatives








