antvis /X6
๐ JavaScript diagramming library that uses SVG and HTML for rendering.
โ
6,751โ 1,895๐ 61โ 1,512โ 2,780โค 104
+0
Daily
+0
Weekly
+21
Monthly
6,751
stars
1,895
forks
61
watchers
1,512
prs
2,780
issues
104
releases
README
English | ็ฎไฝไธญๆ
X6: Graph Editing and Visualization Engine
Official Documentation โข
Quick Start โข
Graph Examples โข
FAQ โข
Demo Template โข
Awesome X6
AntV X6 is a graph editing engine based on HTML and SVG, providing low-cost customization capabilities and out-of-the-box built-in extensions that make it easy to quickly build applications such as DAG diagrams, ER diagrams, flowcharts, lineage graphs, and more. We hope developers can use X6 to rapidly build various graph editing applications they need, making process relationship data controllable, interactive, and visualized.
โจ Features
As a professional graph editing and visualization engine, X6 has the following features:
- ๐ฑ _Highly Customizable_: Supports customizing node styles and interactions using SVG / HTML / React / Vue / Angular, with a comprehensive event system that allows listening to any events occurring within the chart.
- ๐ _Out-of-the-Box_: Built-in 10+ graph editing extensions, such as lasso selection, alignment lines, minimap, etc.
- ๐งฒ _Data-Driven_: Based on the MVC architecture, allowing users to focus more on data logic and business logic.
- ๐ฏ _Server-Side Rendering_: Supports server-side rendering with good browser compatibility.
๐จ Getting Started
You can install via package managers like NPM or Yarn.
bash
npm
$ npm install @antv/x6 --save
yarn
$ yarn add @antv/x6
After successful installation, you can import the Graph object using import.
html
ts
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,
});
If everything goes smoothly, you will get a simple flowchart canvas as shown below.
๐ง๐ปโ๐ป Local Development
shell
Install project dependencies and initialize build
$ pnpm install
Start examples to view results
pnpm run start:examples
๐ฎ Contribution
Thank you to everyone who has contributed to this project and all supporters! ๐
- Issue Feedback: If you encounter any issues with X6 during use, feel free to submit an Issue along with minimal reproducible code.
- Contribution Guide: How to participate in the development and contribution of X6.
- Discussion Ideas: Discuss on GitHub Discussion or DingTalk group.
๐ License
MIT.