# G2

> AntV's grammar-of-graphics JavaScript library for building charts and dashboards on Canvas, SVG or WebGL

Source: https://talira.ai/catalog/g2-gerqp34m
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / charts](https://talira.ai/categories/libraries/charts)
- Platforms: web[^1]
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [AntV](https://talira.ai/orgs/antv.md)

G2 is AntV's visualization grammar for JavaScript, named after Leland Wilkinson's The Grammar of Graphics, for building dashboards, exploring data and telling stories with charts. Instead of a fixed set of chart types it composes marks, transforms, scales, coordinates and compositions through a declarative, functional API, infers sensible defaults so a short declaration gives a meaningful chart, and can declare data-driven animation and interaction. Scales, transforms and marks can all be extended. It renders on Canvas, SVG or WebGL through AntV's G renderer. It installs from npm as `@antv/g2`. It isn't the G2 software review site.

## Links

- Website: https://g2.antv.antgroup.com/
- GitHub: https://github.com/antvis/G2

## Problems it solves

- build interactive charts for a dashboard in JavaScript with a grammar of graphics
- a chart library that composes marks and scales instead of fixed chart types
- render large charts on Canvas or WebGL in the browser

## Features

- a grammar of graphics with marks, transforms, scales, coordinates and compositions
- a declarative API that infers defaults from short declarations
- data-driven animation and interaction
- Canvas, SVG or WebGL rendering through AntV's G renderer

## Trust

Overall: 0.63 out of 1.
Signals: maintenance 0.75, adoption 0.82, momentum 0.61, community 0.96, backing 0.30, extensibility 0.00.

- last commit 5 days ago
- 22 commits in the last 90 days
- latest release v5.4.8 10 months ago
- 12.7k GitHub stars
- 248 contributors
- backed by AntV

## Alternatives

- [Apache ECharts](https://talira.ai/catalog/apache-echarts-9ctm8dbq.md): Open source JavaScript library for interactive charts and visualization
- [Recharts](https://talira.ai/catalog/recharts-rmnrac46.md): Composable charting library built from React components on SVG and D3
- [ApexCharts](https://talira.ai/catalog/apexcharts-04syhgtm.md): Interactive SVG charts for the web, free under M revenue
- [Vega](https://talira.ai/catalog/vega-qr1bn6jp.md): Visualization grammar: describe interactive charts in JSON and render them to Canvas or SVG
- [Vega-Lite](https://talira.ai/catalog/vega-lite-n9j6t80x.md): A high-level grammar of interactive graphics
- [ChartGPU](https://talira.ai/catalog/chartgpu-snkpmxfs.md): A WebGPU charting library for millions of points and real-time streaming

## Sources

[^1]: https://github.com/antvis/G2/blob/v5/README.md (checked 30 Nov 2026)
[^2]: https://github.com/antvis/G2/blob/v5/LICENSE (checked 30 Nov 2026)
