代码拉取完成,页面将自动刷新
English | 简体中文
A lighteight React toolkit for graph analysis based on G6.
把 graphin
当作一个普通的 React 组件来使用即可,通过 NPM 或 Yarn 等包管理器来安装。
$ npm install @antv/graphin
$ yarn add @antv/graphin
成功安装之后,可以通过 import 导入 Graphin
组件。
import React from 'react';
import { Graphin } from '@antv/graphin';
export function Demo() {
return (
<Graphin
id="my-graphin-demo"
className="my-graphin-container"
style={{ width: '100%', height: '100%' }}
options={{
data,
node: {
style: {
labelText: (d) => d.id,
},
palette: {
type: 'group',
field: 'cluster',
},
},
layout: {
type: 'd3force',
collide: {
strength: 0.5,
},
},
behaviors: ['zoom-canvas', 'drag-canvas'],
animation: true,
}}
>
</Graphin>
/>
);
}
Property | Description | Type | Default |
---|---|---|---|
id | 设置图画布容器的 id 属性。 | string |
- |
className | 设置图画布容器的 class 属性。 | string |
- |
style | 设置图画布容器的 style 样式属性。 | CSSProperties |
- |
options | 设置图画布的配置项,参考 G6 配置 文档,在 graph.setOptions(options) 中调用 |
GraphOptions | null
|
- |
onInit | 当图实例初始化之后调用,在 new Graph() 之后。 |
(graph: Graph) => void |
- |
onReady | 当图实例渲染完成之后调用,在 graph.render() 之后。 |
(graph: Graph) => void |
- |
onDestroy | 当图实例被销毁的时候调用,在 graph.destroy() 之后。 |
() => {} |
- |
graphin
的问题,欢迎提交 Issue,并附上可以复现问题的最小案例代码。graphin
的开发和贡献。MIT.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型