Skip to content

lyn-boyu/x6

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x6

JavaScript diagramming library

MIT License Language

build coverage Language grade: JavaScript

NPM Package NPM Downloads NPM Dependencies

Installation

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

# yarn
$ yarn add @antv/x6

Usage

<div id="container" style="width: 600px; height: 400px"></div>
import { x6 } from '@antv/x6'

const container = document.getElementById('container')
const graph = x6.render(container, {
  nodes: [
    {
      id: 'node-0',
      x: 60,
      y: 60,
      width: 80,
      height: 30,
      label: 'Hello',
    },
    {
      id: 'node-1',
      x: 240,
      y: 240,
      width: 80,
      height: 30,
      label: 'World',
    },
  ],
  edges: [
    {
      id: 'edge-0',
      source: 'node-0',
      target: 'node-1',
      label: 'Edge Label',
    },
  ],
})

const graphData = graph.toJSON()
const graphDataString = JSON.stringify(graphData)
graph.render(JSON.parse(graphDataString))

Development

# install yarn and lerna
$ npm install yarn -g
$ npm install lerna -g

# install deps and build
$ yarn bootstrap

# run tests
$ yarn test

# build 
$ yarn build

Experience Improvement Program Description

In order to serve the users better, x6 will send the URL and version information back to the AntV server:

https://kcart.alipay.com/web/bi.do

Except for URL and x6 version information, no other information will be collected. You can also turn it off with the following code:

x6.track(false)

Contributing

Please let us know how can we help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide

About

🌵JavaScript diagramming library.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.1%
  • CSS 3.7%
  • Other 0.2%