g6-for-react
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

NPM PackageNPM Downloads

g6-for-react

基于蚂蚁金服关系数据可视化引擎g6的react版封装

安装

npm install g6-for-react // or
yarn add g6-for-react

dev build

$ git clone https://github.com/hihl/g6-for-react.git
cd g6-for-react
$ npm install
$ npm run build

dev demo

$ sudo vi /etc/hosts
// 加入 127.0.0.1 localhost
$ npm run demo
// 浏览器打开 http://localhost:3510/

快速开始

import { Graph } from 'g6-for-react';
 
const data = {
  nodes: [{
    id: 'node1',
    x: 100,
    y: 200,
    label: '节点1'
  }, {
    id: 'node2',
    x: 300,
    y: 200,
    label: '节点2'
  }],
  edges: [{
    target: 'node2',
    source: 'node1'
  }]
};
 
<Graph fitView="cc" animate={true} height={window.innerHeight} data={data}></Graph>

文档

教程

API

Package Sidebar

Install

npm i g6-for-react

Weekly Downloads

15

Version

0.1.4

License

MIT

Unpacked Size

8.22 MB

Total Files

143

Last publish

Collaborators

  • hiihl