🍡 An interactive and responsive charting library based on G2.
Installations
npm install @antv/g2plot
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.20.3
NPM Version
10.7.0
Score
76.8
Supply Chain
92.5
Quality
81.4
Maintenance
50
Vulnerability
97.6
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (98.09%)
JavaScript (1.12%)
CSS (0.79%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
Download Statistics
Total Downloads
16,649,492
Last Day
17,073
Last Week
91,652
Last Month
385,249
Last Year
4,456,859
GitHub Statistics
MIT License
2,585 Stars
993 Commits
602 Forks
62 Watchers
14 Branches
117 Contributors
Updated on Mar 12, 2025
Bundle Size
894.14 kB
Minified
250.18 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.4.32
Package Id
@antv/g2plot@2.4.32
Unpacked Size
9.07 MB
Size
2.09 MB
File Count
2,134
NPM Version
10.7.0
Node Version
18.20.3
Published on
Jul 30, 2024
Total Downloads
Cumulative downloads
Total Downloads
16,649,492
Last Day
7.5%
17,073
Compared to previous day
Last Week
2.1%
91,652
Compared to previous week
Last Month
15.7%
385,249
Compared to previous month
Last Year
-20.2%
4,456,859
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
14
Dev Dependencies
41
English | 简体中文
G2Plot
基于 G2 4.x 版本二次封装的图表库。
📢 新版本 G2 v5 已经发布,未来不会基于 G2 v5 封装 G2Plot v3 版本,但是可以使用 Ant Design Charts 代替。
网站 • 快速开始 • 博客 • AntV ThemeSet
一套简单、易用、并具备一定扩展能力和组合能力的统计图表库,基于图形语法理论搭建而成,『G2Plot』中的 G2 即意指图形语法 (the Grammar of Graphics),同时也致敬了 ggplot2。我们想做的事有三件:
- 使用户不用成为可视化专家也能够轻松制作出优雅美观的图表。
- 保证图表能够经受得起业务的检验,在真实的场景中易用、好用。
- 探索统计图表的更多可能性,使统计图表变得更好玩、更酷。
✨ 特性
📦 开箱即用、体验优雅的高质量统计图表
G2Plot 呈现给用户的是一套提炼自企业级产品的视觉语言和设计规范。不仅对图表的整体视觉样式进行了优化,并且针对每一个图表自身的特点,沉淀出一套最佳配置,保证用户能够通过最少的配置制作出优雅、标准的图表。
📊 响应式:让图表更聪明
在现实的图表应用场景中,一个棘手的难题是图表的展示空间往往并不足够显示图表的数据量,造成极值情况下文本的重叠遮挡、内容无法自适应、内容裁剪等问题。G2Plot 借鉴宽容性设计的思想,在图表的信息密度过高时,对图表辅助信息进行抽稀,保证图表主要信息的展示和基本可读性。
🔳 向前一步:会讲故事的图表
在 G2Plot 体系下,图表不仅仅只是各不相关的实例,图层概念的引入提供了多图表组合、叠加、联动,共同讲述一个数据故事的可能性。未来,我们还将探索统计图表转化信息图的可能性,丰富统计图表的表现能力。
📦 安装
1$ npm install @antv/g2plot
🔨 使用
1<div id="container"></div>
1import { Bar } from '@antv/g2plot'; 2 3const data = [ 4 { year: '1951 年', sales: 38 }, 5 { year: '1952 年', sales: 52 }, 6 { year: '1956 年', sales: 61 }, 7 { year: '1957 年', sales: 145 }, 8 { year: '1958 年', sales: 48 }, 9]; 10 11const bar = new Bar('container', { 12 data, 13 xField: 'sales', 14 yField: 'year', 15 seriesField: 'year', 16}); 17 18bar.render();
🤝 参与贡献
我们非常欢迎你的贡献!无论是 issue 还是 PR。
反馈问题请先阅读 issues。
提交代码请遵循 贡献指引。
感谢下面这些贡献者 (emoji key):
🔗 相关链接
ChartCube - 基于 G2Plot 的在线图表制作工具,交互简单,一键导出图表代码!
许可证
MIT

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 25/30 approved changesets -- score normalized to 8
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/build.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/build.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/build.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/conventional-labels.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/conventional-labels.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/deploy.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/deploy.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/emoji-helper.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/emoji-helper.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-notify.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/antvis/G2Plot/release-notify.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/build.yml:20
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 6 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
SAST tool is not run on all commits -- score normalized to 1
Details
- Warn: 4 commits out of 30 are checked with a SAST tool
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/auto-merge.yml:1
- Warn: no topLevel permission defined: .github/workflows/build.yml:1
- Warn: no topLevel permission defined: .github/workflows/conventional-labels.yml:1
- Warn: no topLevel permission defined: .github/workflows/deploy.yml:1
- Warn: no topLevel permission defined: .github/workflows/emoji-helper.yml:1
- Warn: no topLevel permission defined: .github/workflows/release-notify.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Score
4.8
/10
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More