{"id":13349751,"url":"https://github.com/antvis/g2","last_synced_at":"2026-01-06T12:11:01.732Z","repository":{"id":36966570,"uuid":"59737212","full_name":"antvis/G2","owner":"antvis","description":"📊 The concise and progressive visualization grammar.","archived":false,"fork":false,"pushed_at":"2025-04-29T09:19:09.000Z","size":343766,"stargazers_count":12293,"open_issues_count":233,"forks_count":1629,"subscribers_count":248,"default_branch":"v5","last_synced_at":"2025-05-05T16:05:24.053Z","etag":null,"topics":["animation","canvas","chart","grammar","graphics","hacktoberfest","interaction","svg","visualization","webgl"],"latest_commit_sha":null,"homepage":"https://g2.antv.antgroup.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antvis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-26T09:21:04.000Z","updated_at":"2025-05-02T20:34:38.000Z","dependencies_parsed_at":"2023-12-15T21:18:05.579Z","dependency_job_id":"a43ac71d-e0c4-42c6-a69b-f3aec6b9caa1","html_url":"https://github.com/antvis/G2","commit_stats":{"total_commits":4148,"total_committers":217,"mean_commits":19.11520737327189,"dds":0.7099807135969142,"last_synced_commit":"6013d72881276aca9d17d93908d33b21194979c6"},"previous_names":[],"tags_count":263,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2FG2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2FG2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2FG2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2FG2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antvis","download_url":"https://codeload.github.com/antvis/G2/tar.gz/refs/heads/v5","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253702373,"owners_count":21949961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","canvas","chart","grammar","graphics","hacktoberfest","interaction","svg","visualization","webgl"],"created_at":"2024-07-29T20:02:16.255Z","updated_at":"2026-01-06T12:11:01.726Z","avatar_url":"https://github.com/antvis.png","language":"TypeScript","readme":"\u003cimg src=\"https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg\" width=\"18\"\u003e English | [简体中文](./README.zh-CN.md)\n\n\u003ch1 align=\"center\"\u003e\n\u003cb\u003eG2: The Concise and Progressive Visualization Grammar\u003c/b\u003e\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nG2 is a visualization grammar for dashboard building, data exploration and storytelling.\n\n\u003ca href=\"https://trendshift.io/repositories/4408\" target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/4408\" alt=\"antvis%2FG2 | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/\u003e\u003c/a\u003e\n\n[![Build Status](https://github.com/antvis/G2/actions/workflows/build.yml/badge.svg)](https://github.com/antvis/G2/actions/workflows/build.yml)\n[![Coverage Status](https://img.shields.io/coveralls/github/antvis/g2/v5.svg)](https://coveralls.io/github/antvis/g2?branch=v5)\n[![npm Version](https://img.shields.io/npm/v/@antv/g2.svg)](https://www.npmjs.com/package/@antv/g2)\n[![npm Download](https://img.shields.io/npm/dm/@antv/g2.svg)](https://www.npmjs.com/package/@antv/g2)\n[![npm License](https://img.shields.io/npm/l/@antv/g2.svg)](https://www.npmjs.com/package/@antv/g2)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/antvis/G2)\n\n![examples](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_GfqQoRCqQkAAAAAAAAAAAAADmJ7AQ/fmt.webp)\n\n\u003c/div\u003e\n\nG2 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:\n\n- [Introduction](https://g2.antv.antgroup.com/manual/introduction/what-is-g2) - a brief overview and G2's motivations\n- [Examples](https://g2.antv.antgroup.com/examples) - a large number of demos to learn from and copy-paste\n- [Tutorials](https://g2.antv.antgroup.com/manual/quick-start) - interactive case-driven guides of G2's core concepts\n- [API Reference](https://g2.antv.antgroup.com/api/overview) - complete documentation for all visualization components\n- [Editor](https://editor.antv.antgroup.com/) - an intelligent generation tool based on AntV. It utilizes AI to reduce the development cost of data visualization, and can quickly generate visual charts through natural language.\n\n## ✨ Features\n\n- **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.\n- **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.\n- **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.\n- **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.\n- **Powerful Renderer** - There is a powerful renderer [G](https://github.com/antvis/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](https://github.com/d3/d3).\n\n## 🔨 Getting Started\n\nG2 is usually installed via a package manager such as npm or Yarn.\n\n```bash\n$ npm install @antv/g2\n```\n\n```bash\n$ yarn add @antv/g2\n```\n\nThe Chart object then can be imported from G2.\n\n```html\n\u003cdiv id=\"container\"\u003e\u003c/div\u003e\n```\n\n```js\nimport { Chart } from '@antv/g2';\n\n// A tabular data to be visualized.\nconst data = [\n  { genre: 'Sports', sold: 275 },\n  { genre: 'Strategy', sold: 115 },\n  { genre: 'Action', sold: 120 },\n  { genre: 'Shooter', sold: 350 },\n  { genre: 'Other', sold: 150 },\n];\n\n// Instantiate a new chart.\nconst chart = new Chart({\n  container: 'container',\n});\n\n// Specify visualization.\nchart\n  .interval() // Create an interval mark and add it to the chart.\n  .data(data) // Bind data for this mark.\n  .encode('x', 'genre') // Assign genre column to x position channel.\n  .encode('y', 'sold') // Assign sold column to y position channel.\n  .encode('color', 'genre'); // Assign genre column to color channel.\n\n// Render visualization.\nchart.render();\n```\n\nIf all goes well, you can get the following lovely bar chart!\n\n\u003cimg src=\"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XqCnTbkpAkQAAAAAAAAAAAAADmJ7AQ/fmt.webp\" width=\"640\" alt=\"example\"\u003e\n\n## 🌍 Ecosystem\n\n- [g2-react](https://github.com/pearmini/g2-react) - The lightweight React component for G2, without extra features.\n- [g2-extensions](https://github.com/antvis/g2-extensions) - The one-stop shop for official G2 extensions, such as 3d visualization, automated visual analytics, etc.\n- [ant-design-charts](https://github.com/ant-design/ant-design-charts) - The React chart library, based on [G2](https://github.com/antvis/G2), [G6](https://github.com/antvis/G6), [X6](https://github.com/antvis/X6), [L7Plot](https://github.com/antvis/L7Plot).\n- [More...](https://github.com/antvis/G2/discussions/5772)\n\n## 📮 Contributing\n\nThis project exists thanks to all the people who contribute.\n\nAnd thank you to all our backers! 🙏\n\n\u003ca href=\"https://openomy.app/github/antvis/G2\" target=\"_blank\" style=\"display: block; width: 100%;\" align=\"center\"\u003e\n  \u003cimg src=\"https://openomy.app/svg?repo=antvis/G2\u0026chart=bubble\u0026latestMonth=3\" target=\"_blank\" alt=\"Contribution Leaderboard\" style=\"display: block; width: 100%;\" /\u003e\n \u003c/a\u003e\n\n- [Issues](https://github.com/antvis/g2/issues) - report bugs or request features\n- [Contributing Guide](https://github.com/antvis/g2/blob/v5/CONTRIBUTING.md) - help build G2\n- [Discussions](https://github.com/antvis/G2/discussions) - discuss on GitHub or in DingTalk group(30233731, 35686967, 44788198)\n\n\u003cimg src=\"https://gw.alipayobjects.com/zos/antfincdn/hTzzaqgHgQ/Antv%252520G2%252520%26%252520G2Plot.png\" width=\"200\" height=\"266\" alt=\"code\"/\u003e\n\n\n## 📄 License\n\nMIT@[AntV](https://github.com/antvis).\n","funding_links":[],"categories":["Libraries","大厂开源","目录","Repository","JavaScript Libs","Visualization"],"sub_categories":["Charts Libraries","阿里开源","canvas/数据可视化","Data Visualization","JavaScript Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fg2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantvis%2Fg2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fg2/lists"}