@antv/infographic 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -12
- package/README.zh-CN.md +8 -9
- package/dist/infographic.min.js +45 -34
- package/dist/infographic.min.js.map +1 -1
- package/esm/designs/components/BtnsGroup.js +1 -1
- package/esm/designs/structures/hierarchy-tree.js +13 -6
- package/esm/exporter/font.d.ts +18 -0
- package/esm/exporter/font.js +202 -0
- package/esm/exporter/index.d.ts +3 -0
- package/esm/exporter/index.js +2 -0
- package/esm/exporter/png.d.ts +2 -0
- package/esm/exporter/png.js +42 -0
- package/esm/exporter/svg.d.ts +3 -0
- package/esm/exporter/svg.js +72 -0
- package/esm/exporter/types.d.ts +17 -0
- package/esm/index.d.ts +2 -2
- package/esm/renderer/composites/text.js +1 -3
- package/esm/renderer/fonts/built-in.d.ts +1 -1
- package/esm/renderer/fonts/index.d.ts +0 -2
- package/esm/renderer/fonts/index.js +0 -1
- package/esm/renderer/fonts/loader.js +1 -2
- package/esm/renderer/fonts/registry.d.ts +1 -1
- package/esm/renderer/fonts/registry.js +1 -1
- package/esm/renderer/renderer.js +1 -50
- package/esm/resource/utils/ref.js +1 -1
- package/esm/runtime/Infographic.d.ts +10 -0
- package/esm/runtime/Infographic.js +23 -2
- package/esm/types/font.js +1 -0
- package/esm/types/index.d.ts +1 -0
- package/{lib/renderer/fonts/utils.d.ts → esm/utils/font.d.ts} +1 -1
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/index.js +2 -0
- package/esm/utils/is-node.d.ts +4 -0
- package/esm/utils/is-node.js +6 -0
- package/esm/utils/padding.d.ts +1 -0
- package/esm/utils/padding.js +70 -0
- package/esm/utils/svg.d.ts +0 -1
- package/esm/utils/svg.js +3 -18
- package/esm/utils/text.js +1 -1
- package/esm/utils/viewbox.d.ts +6 -0
- package/esm/utils/viewbox.js +12 -0
- package/lib/designs/components/BtnsGroup.js +1 -1
- package/lib/designs/structures/hierarchy-tree.js +31 -24
- package/lib/exporter/font.d.ts +18 -0
- package/lib/exporter/font.js +210 -0
- package/lib/exporter/index.d.ts +3 -0
- package/lib/exporter/index.js +7 -0
- package/lib/exporter/png.d.ts +2 -0
- package/lib/exporter/png.js +45 -0
- package/lib/exporter/svg.d.ts +3 -0
- package/lib/exporter/svg.js +76 -0
- package/lib/exporter/types.d.ts +17 -0
- package/lib/index.d.ts +2 -2
- package/lib/renderer/composites/text.js +1 -3
- package/lib/renderer/fonts/built-in.d.ts +1 -1
- package/lib/renderer/fonts/index.d.ts +0 -2
- package/lib/renderer/fonts/index.js +1 -4
- package/lib/renderer/fonts/loader.js +1 -2
- package/lib/renderer/fonts/registry.d.ts +1 -1
- package/lib/renderer/fonts/registry.js +1 -1
- package/lib/renderer/renderer.js +1 -50
- package/lib/resource/utils/ref.js +1 -1
- package/lib/runtime/Infographic.d.ts +10 -0
- package/lib/runtime/Infographic.js +23 -2
- package/lib/types/font.js +2 -0
- package/lib/types/index.d.ts +1 -0
- package/{esm/renderer/fonts/utils.d.ts → lib/utils/font.d.ts} +1 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/is-node.d.ts +4 -0
- package/lib/utils/is-node.js +9 -0
- package/lib/utils/padding.d.ts +1 -0
- package/lib/utils/padding.js +71 -0
- package/lib/utils/svg.d.ts +0 -1
- package/lib/utils/svg.js +3 -19
- package/lib/utils/text.js +2 -2
- package/lib/utils/viewbox.d.ts +6 -0
- package/lib/utils/viewbox.js +15 -0
- package/package.json +5 -2
- package/src/designs/components/BtnsGroup.tsx +7 -1
- package/src/designs/structures/hierarchy-tree.tsx +14 -8
- package/src/exporter/font.ts +273 -0
- package/src/exporter/index.ts +7 -0
- package/src/exporter/png.ts +58 -0
- package/src/exporter/svg.ts +94 -0
- package/src/exporter/types.ts +19 -0
- package/src/index.ts +7 -3
- package/src/renderer/composites/text.ts +1 -2
- package/src/renderer/fonts/built-in.ts +1 -1
- package/src/renderer/fonts/index.ts +1 -3
- package/src/renderer/fonts/loader.ts +1 -2
- package/src/renderer/fonts/registry.ts +2 -2
- package/src/renderer/renderer.ts +1 -69
- package/src/resource/utils/ref.ts +1 -1
- package/src/runtime/Infographic.tsx +30 -2
- package/src/types/index.ts +1 -0
- package/src/{renderer/fonts/utils.ts → utils/font.ts} +1 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/is-node.ts +8 -0
- package/src/utils/padding.ts +79 -0
- package/src/utils/svg.ts +5 -19
- package/src/utils/text.ts +2 -2
- package/src/utils/viewbox.ts +12 -0
- /package/esm/{renderer/fonts → exporter}/types.js +0 -0
- /package/esm/{renderer/fonts/types.d.ts → types/font.d.ts} +0 -0
- /package/esm/{renderer/fonts/utils.js → utils/font.js} +0 -0
- /package/lib/{renderer/fonts → exporter}/types.js +0 -0
- /package/lib/{renderer/fonts/types.d.ts → types/font.d.ts} +0 -0
- /package/lib/{renderer/fonts/utils.js → utils/font.js} +0 -0
- /package/src/{renderer/fonts/types.ts → types/font.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> [中文](./README.zh-CN.md) | English
|
|
3
2
|
|
|
4
3
|
<div align="center">
|
|
@@ -11,7 +10,6 @@
|
|
|
11
10
|
[](https://github.com/antvis/infographic/actions)
|
|
12
11
|
[](./LICENSE)
|
|
13
12
|
|
|
14
|
-
|
|
15
13
|
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*EdkXSojOxqsAAAAAQHAAAAgAemJ7AQ/original" width="256">
|
|
16
14
|
|
|
17
15
|
</div>
|
|
@@ -23,18 +21,19 @@ With unified syntax and component architecture, you can render structured data i
|
|
|
23
21
|
|
|
24
22
|
[Website](https://infographic.antv.vision) · [GitHub](https://github.com/antvis/infographic) · [Document](https://infographic.antv.vision/learn) · [Gallery](https://infographic.antv.vision/examples) · [AI Agent](https://infographic.antv.vision/ai)
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ZdeISZWHuyIAAAAAbEAAAAgAemJ7AQ/fmt.webp" width="768" alt="AntV Infographic Preview">
|
|
27
25
|
|
|
26
|
+
</div>
|
|
28
27
|
|
|
29
28
|
## ✨ Features
|
|
30
29
|
|
|
31
|
-
- 📦 **Ready to
|
|
32
|
-
- 🎨 **
|
|
33
|
-
- 🧩 **
|
|
34
|
-
- 📐 **High-Quality SVG Output**: SVG-based rendering by default, ensuring visual quality and editability
|
|
30
|
+
- 📦 **Ready to use**: 100+ built-in templates, data-item components, and layouts to assemble infographics in minutes
|
|
31
|
+
- 🎨 **Themeable**: Hand-drawn (rough), gradients, patterns, multiple presets, and deep customization
|
|
32
|
+
- 🧩 **Composable**: Structures, items, and render units are fully componentized for flexible extension
|
|
35
33
|
- 🎯 **Declarative Configuration**: Simple and clear configuration approach, ideal for AI generation, machine understanding, and automated workflows
|
|
36
|
-
- 🤖 **AI-Friendly**: Complete JSON Schema definitions enable large language models to automatically generate usable configurations
|
|
37
34
|
|
|
35
|
+
- 🤖 **AI-friendly**: Declarative config with JSON Schema, ideal for AI generation and automated workflows
|
|
36
|
+
- 📐 **High-quality SVG**: Default SVG output for crisp visuals and easy editing/export
|
|
38
37
|
|
|
39
38
|
## 🚀 Installation
|
|
40
39
|
|
|
@@ -42,7 +41,6 @@ With unified syntax and component architecture, you can render structured data i
|
|
|
42
41
|
npm install @antv/infographic
|
|
43
42
|
```
|
|
44
43
|
|
|
45
|
-
|
|
46
44
|
## 📝 Quick Start
|
|
47
45
|
|
|
48
46
|
```ts
|
|
@@ -65,13 +63,12 @@ const infographic = new Infographic({
|
|
|
65
63
|
infographic.render();
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
Render the infographic in the target container.
|
|
69
67
|
|
|
70
68
|

|
|
71
69
|
|
|
72
70
|
For more examples, please refer to the [documentation](https://infographic.antv.vision/examples) site.
|
|
73
71
|
|
|
74
|
-
|
|
75
72
|
## 💬 Community & Communication
|
|
76
73
|
|
|
77
74
|
- Submit your questions or suggestions on GitHub
|
|
@@ -84,7 +81,6 @@ If you have any suggestions, feel free to communicate with us on GitHub! Star
|
|
|
84
81
|
- [GitHub Repository](https://github.com/antvis/infographic)
|
|
85
82
|
- [Issue Tracker](https://github.com/antvis/infographic/issues)
|
|
86
83
|
|
|
87
|
-
|
|
88
84
|
## 📄 License
|
|
89
85
|
|
|
90
86
|
This project is open source under the **MIT** license. See [LICENSE](./LICENSE) for details.
|
package/README.zh-CN.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> 简体中文 | [English](/README.md)
|
|
2
2
|
|
|
3
|
-
<div align="center">
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
5
|
# Infographic, bring words to life!
|
|
6
6
|
|
|
7
7
|
🦋 新一代信息图可视化引擎,让文字信息栩栩如生!
|
|
8
8
|
|
|
9
|
-
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*EdkXSojOxqsAAAAAQHAAAAgAemJ7AQ/original" width="256">
|
|
10
|
-
|
|
11
9
|
[](https://www.npmjs.com/package/@antv/infographic)
|
|
12
10
|
[](https://github.com/antvis/infographic/actions)
|
|
13
11
|
[](./LICENSE)
|
|
14
12
|
|
|
13
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*EdkXSojOxqsAAAAAQHAAAAgAemJ7AQ/original" width="256">
|
|
14
|
+
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
**AntV Infographic** 是 AntV 推出的新一代**声明式信息图可视化引擎**。
|
|
@@ -19,19 +19,20 @@
|
|
|
19
19
|
|
|
20
20
|
<div align="center">
|
|
21
21
|
|
|
22
|
-
[
|
|
22
|
+
[官网](https://infographic.antv.vision) · [GitHub](https://github.com/antvis/infographic) · [文档](https://infographic.antv.vision/learn) · [示例](https://infographic.antv.vision/examples) · [AI 生成](https://infographic.antv.vision/ai)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ZdeISZWHuyIAAAAAbEAAAAgAemJ7AQ/fmt.webp" width="768" alt="AntV Infographic 预览">
|
|
25
25
|
|
|
26
|
+
</div>
|
|
26
27
|
|
|
27
28
|
## ✨ 特性
|
|
28
29
|
|
|
29
30
|
- 📦 **开箱即用**:内置 100+ 信息图模板、数据项组件与布局,快速构建专业信息图
|
|
30
31
|
- 🎨 **主题系统**:支持手绘(rough)、渐变、图案、多套预设主题,并支持深度自定义
|
|
31
32
|
- 🧩 **组件化架构**:数据项、结构布局、渲染单元完全组件化,可灵活组合与扩展
|
|
32
|
-
- 📐 **高质量 SVG 输出**:默认基于 SVG 渲染,保证视觉品质与可编辑性
|
|
33
33
|
- 🎯 **声明式配置**:简单清晰的配置方式,更适合 AI 生成、机器理解与自动化流程
|
|
34
34
|
- 🤖 **AI 友好**:完善的 JSON Schema 定义,使大模型可自动生成可用配置
|
|
35
|
+
- 📐 **高质量 SVG 输出**:默认基于 SVG 渲染,保证视觉品质与可编辑性
|
|
35
36
|
|
|
36
37
|
## 🚀 安装
|
|
37
38
|
|
|
@@ -67,7 +68,6 @@ infographic.render();
|
|
|
67
68
|
|
|
68
69
|
更多示例请参考[文档站点](https://infographic.antv.vision/examples)。
|
|
69
70
|
|
|
70
|
-
|
|
71
71
|
## 💬 社区与交流
|
|
72
72
|
|
|
73
73
|
- 在 GitHub 提交你的问题或建议
|
|
@@ -78,8 +78,7 @@ infographic.render();
|
|
|
78
78
|
|
|
79
79
|
- [AntV 官网](https://antv.antgroup.com/)
|
|
80
80
|
- [GitHub 仓库](https://github.com/antvis/infographic)
|
|
81
|
-
- [问题反馈
|
|
82
|
-
|
|
81
|
+
- [问题反馈](https://github.com/antvis/infographic/issues)
|
|
83
82
|
|
|
84
83
|
## 📄 许可证
|
|
85
84
|
|