AntV's grammar-of-graphics JavaScript library for building charts and dashboards on Canvas, SVG or WebGL
open sourceMITfree
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.
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
Alternatives
The same job
These do what G2 does.
- Apache ECharts Open source JavaScript library for interactive charts and visualization
- Recharts Composable charting library built from React components on SVG and D3
- ApexCharts Interactive SVG charts for the web, free under M revenue
- Vega Visualization grammar: describe interactive charts in JSON and render them to Canvas or SVG
- Vega-Lite A high-level grammar of interactive graphics
- ChartGPU A WebGPU charting library for millions of points and real-time streaming
