The Wayback Machine - https://web.archive.org/web/20231229141019/https://github.com/antvis/x6
Skip to content

antvis/X6

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 18, 2023 21:22
November 3, 2022 15:29
January 6, 2020 19:30
November 2, 2022 12:04
November 3, 2022 16:20
November 9, 2022 13:58

简体中文 | English

flow

X6 是 AntV 旗下的图编辑引擎

�??供简�?�易用的节点定制能力和开箱�?�用的交互组件,方便我们快速�?�建�?程图�?DAG 图�?ER 图等图应用

build NPM Package NPM Downloads

MIT License Language PRs Welcome website

特性

  • 🌱  �?易定制:支�?使用 SVG/HTML/React/Vue/Angular 定制节点样�?和交互
  • 🚀  开箱�?�用:内置 10+ 图编辑�?套扩展,如框选�?对�?线�?�?地图等
  • 🧲  数�?�驱动:基于 MVC 架构,用户更加专注于数�?�逻辑和业务逻辑
  • 💯  事件驱动:完备的事件系统,�?�以监�?�图表内�?�生的任何事件

兼容环境

  • 现代�?览器
  • 支�?�?务端渲染。
Firefox
Firefox
Chrome
Chrome
Safari
Safari
last 2 versions last 2 versions last 2 versions

安装

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

# yarn
$ yarn add @antv/x6

示例

<div id="container" style="width: 600px; height: 400px"></div>
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

# 进入到指定项目开�?�和调试
cd packages/x6
pnpm run build:watch

# �?�动 example 查看效果
cd examples/x6-example-features
pnpm run start

�?�与共建

如果希望�?�与到 X6 的开�?�中,请�?�从我们的贡献指�?�。如果你贡献度足够活跃,你�?�以申请�?为社区�??作者。

Contributors

开�?�??议

该项目的代�?和文档基于 MIT License 开�?�??议。