MCPcopy Index your code
hub / github.com/antvis/X6

github.com/antvis/X6 @v3.1.7

repository ↗ · DeepWiki ↗ · release v3.1.7 ↗ · + Follow
13,035 symbols 49,779 edges 992 files 165 documented · 1% 2 cross-repo links
README

English | 简体中文

X6:图编辑可视化引擎

x6 flow

NPM Package build coverage Package size NPM Downloads MIT License Language PRs Welcome website Ask DeepWiki

antvis%2FX6 | Trendshift

官网文档快速开始图表示例常见问题Demo 模板Awesome X6

AntV X6 是基于 HTML 和 SVG 的图编辑引擎,提供低成本的定制能力和开箱即用的内置扩展,方便我们快速搭建 DAG 图、ER 图、流程图、血缘图等应用。我们期望开发者基于 X6 可以快速构建自己需要的各种图编辑应用,让流程关系数据变得可控、可交互,以及可视化。

✨ 特性

X6 作为一款专业的图编辑可视化引擎,具有以下特性:

  • 🌱 极易定制:支持使用 SVG / HTML / React / Vue / Angular 定制节点样式和交互,完备的事件系统,可以监听图表内发生的任何事件
  • 🚀 开箱即用:内置 10+ 图编辑配套扩展,如框选、对齐线、小地图等
  • 🧲 数据驱动:基于 MVC 架构,用户更加专注于数据逻辑和业务逻辑
  • 💯 服务端渲染:支持服务端渲染,且有不错的浏览器兼容性。

🔨 开始使用

可以通过 NPM 或 Yarn 等包管理器来安装。

# npm
$ npm install @antv/x6 --save

# yarn
$ yarn add @antv/x6

成功安装之后,可以通过 import 导入 Graph 对象。






import { Graph } from '@antv/x6'

const graph = new Graph({
  container: document.getElementById('container'),
  grid: true,
})

const source = graph.addNode({
  x: 300,
  y: 40,
  width: 80,
  height: 40,
  label: 'Hello',
});

const target = graph.addNode({
  x: 420,
  y: 180,
  width: 80,
  height: 40,
  label: 'World',
});

graph.addEdge({
  source,
  target,
});

一切顺利,你可以得到下面的简单的流程图画布。

🧑🏻‍💻 本地开发

# 安装项目依赖和初始化构建
$ pnpm install

# 启动 examples 查看效果
pnpm run start:examples

📮 贡献

感谢所有为这个项目做出贡献的人,感谢所有支持者!🙏

Contribution Leaderboard

  • 问题反馈:使用过程遇到的 X6 的问题,欢迎提交 Issue,并附上可以复现问题的最小案例代码。
  • 贡献指南:如何参与到 X6 的开发和贡献
  • 想法讨论:在 GitHub Discussion 上或者钉钉群里面讨论。

📄 License

MIT.

Extension points exported contracts — how you extend this code

IDisposable (Interface)
(no doc) [81 implementers]
src/common/base/disposable.ts
PointLike (Interface)
(no doc) [1 implementers]
src/types/index.ts
RectangleLike (Interface)
(no doc) [1 implementers]
src/geometry/rectangle.ts
Window (Interface)
(no doc)
setup-env.ts
RegistryOptions (Interface)
(no doc)
src/registry/registry.ts
MiniMapViewGeometry (Interface)
(no doc)
src/plugin/minimap/type.ts
SchedulerView (Interface)
(no doc)
src/renderer/scheduler.ts
Options (Interface)
(no doc)
src/model/collection.ts

Core symbols most depended-on inside this repo

push
called by 918
site/public/demos/vue/basic/js/chunk-vendors.880e1021.js
create
called by 784
src/model/edge.ts
n
called by 771
site/public/demos/vue/update/js/chunk-vendors.880e1021.js
n
called by 771
site/public/demos/vue/basic/js/chunk-vendors.880e1021.js
push
called by 534
site/public/demos/vue/update/js/chunk-vendors.880e1021.js
n
called by 526
site/public/demos/performance/static/js/2.1d843bce.chunk.js
p
called by 492
site/public/demos/vue/update/js/chunk-vendors.880e1021.js
p
called by 492
site/public/demos/vue/basic/js/chunk-vendors.880e1021.js

Shape

Method 6,601
Function 4,726
Class 1,114
Interface 590
Enum 4

Languages

TypeScript100%

Modules by API surface

site/public/demos/vue/update/js/chunk-vendors.880e1021.js3,464 symbols
site/public/demos/vue/basic/js/chunk-vendors.880e1021.js3,464 symbols
site/public/demos/performance/static/js/2.1d843bce.chunk.js700 symbols
src/model/cell.ts147 symbols
src/graph/graph.ts130 symbols
src/view/edge/index.ts104 symbols
src/model/model.ts96 symbols
src/model/edge.ts95 symbols
src/plugin/selection/selection.ts93 symbols
src/view/cell/index.ts82 symbols
src/model/node.ts80 symbols
src/plugin/scroller/scroller.ts75 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

@ant-design/icons6.0.1 · 1×
@antv/dumi-theme-antv0.7.10 · 1×
@antv/hierarchy0.6.14 · 1×
@antv/layout0.3.12 · 1×
@antv/x6workspace:* · 1×
@antv/x6-react-components2.x · 1×
@antv/x6-react-shape3.x · 1×
@biomejs/biome2.2.2 · 1×
@commitlint/config-conventional19.8.1 · 1×
@eslint/js9.33.0 · 1×
@napi-rs/canvas0.1.77 · 1×
@rollup/plugin-commonjs28.0.6 · 1×

For agents

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

⬇ download graph artifact