Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

G2

> 编程语言
Open source

The concise and progressive visualization grammar.

12.6K stars0 likes1 views
WebsiteGitHub

About

The concise and progressive visualization grammar.

English | 简体中文

G2: The Concise and Progressive Visualization Grammar

G2 is named after Leland Wilkinson’s book The Grammar of Graphics and was profoundly inspired by it in the very beginning. Here are some resources you can begin with:

  • Introduction - a brief overview and G2's motivations
  • Examples - a large number of demos to learn from and copy-paste
  • Tutorials - interactive case-driven guides of G2's core concepts
  • API Reference - complete documentation for all visualization components

✨ Features

  • Progressive Usage - The main objective of G2 is to help you get meaningful visualizations quickly with concise declarations and it infers the rest. But you can configure much more for complex and advanced situations.
  • Declarative API - We employs a functional declarative API to specify chart options in a programmatic fashion, which contributes to better logic reuse and more flexible code organization.
  • High Extensibility - To satisfy specific needs, G2 provides a convenient and consistent mechanism to extend everything you can imagine, whether a scale, a transform, a mark, etc,. You can even customize a brand new visualization tool based on this mechanism.
  • Comprehensive Grammar - G2 rejects a chart typology in favor of marks, transforms, scales, coordinates, and compositions. In addition to static visual representations, it's possible to declare data-driven animations and apply well-designed action-based interactions to plots as well.
  • Powerful Renderer - There is a powerful renderer G under G2 to generate web-based visualizations using Canvas, SVG or WebGL. The plenty of plugins it has benefit G2 from rendering charts with novel styles such as hand-drawn and fully embracing the ecosystem of D3.

Getting Started

G2 is usually installed via a package manager such as npm or Yarn.

bash
$ npm install @antv/g2
bash
$ yarn add @antv/g2

The Chart object then can be imported from G2.

xml
…

If all goes well, you can get the following lovely bar chart!

Ecosystem

  • g2-react - The lightweight React component for G2, without extra features.
  • g2-extensions - The one-stop shop for official G2 extensions, such as 3d visualization, automated visual analytics, etc.
  • ant-design-charts - The React chart library, based on G2, G6, X6, L7Plot.
  • More...

Contributing

This project exists thanks to all the people who contribute.

And thank you to all our backers!

  • Issues - report bugs or request features
  • Contributing Guide - help build G2
  • Discussions - discuss on GitHub or in DingTalk group(30233731, 35686967, 44788198)

Paper

Bairui Su, Zhiwei Wang, Zhifeng Lin, Xiaojuan Liao, Zihan Zhou, Minfeng Zhu, Wei Chen. G2: A customizable web-based framework for authoring interactive visualizations. Visual Informatics, 2026.

@article{su2026g2,
  author={Bairui Su, Zhiwei Wang, Zhifeng Lin, Xiaojuan Liao, Zihan Zhou, Minfeng Zhu, Wei Chen},
  title={G2: A customizable web-based framework for authoring interactive visualizations},
  journal={Visual Informatics},
  year={2026},
  url={https://doi.org/10.1016/j.visinf.2026.100307}
}

License

MIT@AntV.

Issues· 182 open

View all issuesOpen on GitHub
  • #8520

    [Bug]: Axis中关于label的auto*配置,与Slider的配置冲突。导致Slider配置values之后,Axis的label相关配置失效。

    waiting for maintainerUpdated Sep 17, 2026
  • #6725

    [Docs]: 缺少「坐标系- radar」文档

    OSCPdocumentation 📖Updated Aug 19, 2026
  • #7263

    [Feat]: 优化坐标轴轴线在存在正负数据时的表现

    OSCPfeature 💡P3Updated Jul 27, 2026
  • #8003

    [Feat]: 建议支持“曲界线柱状图/相态碰撞判定”机制 (Curved-Boundary Phase Bar Spec)

    waiting for maintainerUpdated Jul 22, 2026
  • #7307

    [Bug]: 图表布局中padding自动计算的尺寸溢出了

    waiting for maintainerUpdated May 6, 2026
  • #7286

    [Bug]: 图例与正图中的点 shape 不一致

    waiting for maintainerresolved pending releaseUpdated Apr 30, 2026
  • #7299

    [Bug]: 仪表盘把Y轴改到内侧后,轴刻度是反的

    bug 🐛P2Updated Apr 29, 2026
  • #7300

    [Bug]: 仪表盘默认效果是靠上的,通过margin调整位置,坐标轴如果使用inner,坐标轴位置会错乱

    bug 🐛P2Updated Apr 29, 2026
  • #7297

    [Bug]: 仪表盘调整角度不生效

    waiting for maintainerUpdated Apr 29, 2026
  • #7294

    [Bug]: 双轴图的图例分类异常

    waiting for maintainerUpdated Apr 21, 2026

> Tags

TypeScriptanimationcanvaschartgrammar

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言