MCPcopy
hub / github.com/antvis/Infographic

github.com/antvis/Infographic @0.2.19 sqlite

repository ↗ · DeepWiki ↗ · release 0.2.19 ↗
1,770 symbols 4,541 edges 610 files 38 documented · 2%
README

简体中文 | English

Infographic, bring words to life!

🦋 新一代信息图可视化引擎,让文字信息栩栩如生!

antvis%2FInfographic | Trendshift

npm version build status Visitors license

AntV Infographic 是 AntV 推出的新一代声明式信息图可视化引擎,通过精心设计的信息图语法,能够快速、灵活地渲染出高质量的信息图,让信息表达更高效,让数据叙事更简单。

官网 GitHub 文档 示例 Skills AI Agent

AntV Infographic 预览

✨ 特性

  • 🤖 AI 友好:配置和语法更适合 AI 生成,提供简洁有效的 Prompt,支持 AI 流式输出和渲染
  • 📦 开箱即用:内置 ~200 信息图模板、数据项组件与布局,快速构建专业信息图
  • 🎨 主题系统:支持手绘、渐变、图案、多套预设主题,允许深度自定义
  • 🧑🏻‍💻 内置编辑器:内置信息图的编辑器,让 AI 生成之后可以二次编辑
  • 📐 高质量 SVG 输出:默认基于 SVG 渲染,保证视觉品质与可编辑性

🚀 安装

npm install @antv/infographic

📝 快速开始

import { Infographic } from '@antv/infographic';

const infographic = new Infographic({
  container: '#container',
  width: '100%',
  height: '100%',
  editable: true,
});

infographic.render(`
infographic list-row-simple-horizontal-arrow
data
  lists
    - label Step 1
      desc Start
    - label Step 2
      desc In Progress
    - label Step 3
      desc Complete
`);

渲染结果如下:

AntV Infographic DEMO

流式渲染

使用具有高容错性的信息图语法能够实时接收 AI 流式输出并逐步渲染信息图。

let buffer = '';
for (const chunk of chunks) {
  buffer += chunk;
  infographic.render(buffer);
}

AntV Infographic 流式渲染

🔧 Skills 集成

AntV Infographic 提供了多项能力,便于与 AI 大模型集成:

  • infographic-creator:创建一个渲染信息图的 HTML 文件
  • infographic-syntax-creator:根据描述生成信息图语法
  • infographic-structure-creator:生成自定义的结构设计
  • infographic-item-creator:生成自定义的数据项设计
  • infographic-template-updater:(开发者使用)用于更新信息图模板库

Claude Code

已提供 Claude marketplace,可通过 marketplace 安装,也可继续手动集成。

/plugin marketplace add https://github.com/antvis/Infographic.git
/plugin install antv-infographic-skills@antv-infographic

手动集成:

set -e

VERSION=0.2.4 # 替换为最新版本号,例如 0.2.14
BASE_URL=https://github.com/antvis/Infographic/releases/download
mkdir -p .claude/skills

curl -L --fail -o skills.zip "$BASE_URL/$VERSION/skills.zip"
unzip -q -o skills.zip -d .claude/skills
rm -f skills.zip

Codex

进入 codex

# 将 <SKILL> 替换为需要安装的 skill 名称,例如 infographic-creator
# https://github.com/antvis/Infographic/tree/main/skills/<SKILL>
$skill-installer install https://github.com/antvis/Infographic/tree/main/skills/infographic-creator

🌐 生态周边

社区基于 AntV Infographic 构建的项目和产品:

💡 有使用 AntV Infographic 的项目?欢迎在 Issue #99 中分享!

💬 社区与交流

  • 在 GitHub 提交你的问题或建议
  • 参与 GitHub Discussions 与社区交流
  • 欢迎参与贡献,一起完善 AntV Infographic!

如有任何建议,欢迎在 GitHub 上与我们交流!欢迎 Star ⭐ 支持我们。

📄 许可证

本项目基于 MIT 许可开源,详见 LICENSE

Extension points exported contracts — how you extend this code

IPlugin (Interface)
(no doc) [21 implementers]
src/editor/types/plugin.ts
IRenderer (Interface)
(no doc) [2 implementers]
src/renderer/types/renderer.ts
InfographicHandle (Interface)
(no doc)
dev/src/Infographic.tsx
StackFrame (Interface)
(no doc)
src/syntax/parser.ts
DesignOptions (Interface)
(no doc)
src/designs/types.ts
BaseDatum (Interface)
(no doc)
src/types/data.ts
CachedResponseEntry (Interface)
(no doc)
src/utils/fetch.ts
IntrinsicElements (Interface)
(no doc)
src/jsx/global.ts

Core symbols most depended-on inside this repo

forEach
called by 217
src/editor/utils/extension.ts
getElementBounds
called by 151
src/jsx/utils/bounds.ts
get
called by 113
src/editor/utils/extension.ts
isNumber
called by 85
src/jsx/utils/is-number.ts
createElement
called by 75
src/utils/svg.ts
destroy
called by 71
src/editor/types/plugin.ts
has
called by 65
src/editor/utils/extension.ts
getRenderableChildrenOf
called by 61
src/jsx/utils/children.ts

Shape

Function 1,163
Interface 271
Method 265
Class 68
Enum 3

Languages

TypeScript100%

Modules by API surface

src/exporter/svg.ts42 symbols
src/utils/recognizer.ts29 symbols
src/editor/interactions/drag-element.ts22 symbols
src/editor/plugins/resize-element.ts21 symbols
src/editor/plugins/edit-bar/edit-bar.ts21 symbols
site/src/components/Layout/HomeContent.tsx21 symbols
src/editor/interactions/dblclick-edit-text.ts20 symbols
site/src/components/LiveEditor/EditorPanel.tsx20 symbols
src/editor/plugins/components/color-picker.ts19 symbols
site/src/components/MDX/MDXComponents.tsx19 symbols
src/editor/types/interaction.ts17 symbols
src/editor/types/command.ts17 symbols

Dependencies from manifests, versioned

@antv/hierarchy0.7.0 · 1×
@antv/infographicfile:../ · 1×
@antv/layout2.0.0-beta.0 · 1×
@babel/core7.12.9 · 1×
@babel/plugin-transform-modules-commonjs7.18.6 · 1×
@babel/preset-react7.18.6 · 1×
@codemirror/commands6.10.1 · 1×
@codemirror/lang-css6.3.1 · 1×
@codemirror/lang-html6.4.11 · 1×
@codemirror/lang-yaml6.1.2 · 1×
@codemirror/lint6.9.2 · 1×
@codemirror/state6.5.3 · 1×

For agents

$ claude mcp add Infographic \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact