14 Star 69 Fork 22

antv / Graphin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

English | 简体中文

Graphin

A lighteight React toolkit for graph analysis based on G6.

Version NPM downloads Latest commit

✨ 功能特性

  • 🎨 轻量级:不做过度封装,尽量保持 G6 能力同步,尽量不新增概念,整体核心代码 <200 行。
  • 🎗️ React 风格:舒心的开发体验,符合 React 用户心智,基于 React 扩展组件更容易。
  • 🚀 丰富组件:丰富的组件,源于业务沉淀,让用户定制自己的图应用更快更容易。

component

🔨 快速使用

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>
    />
  );
}

📖 API Reference

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() 之后。 () => {} -

🗂 Examples

📮 贡献

  • 问题反馈:使用过程遇到的 graphin 的问题,欢迎提交 Issue,并附上可以复现问题的最小案例代码。
  • 贡献指南:如何参与到 graphin开发和贡献
  • 想法讨论:在 GitHub Discussion 上或者钉钉群里面讨论。

📄 License

MIT.

MIT License Copyright (c) 2019 Alipay.inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Graphin 取名意为 Graph Insight(图的分析洞察),是一个基于 G6 封装的 React 组件库。简单,高效,开箱即用。它的 Logo 是一个石墨烯(Graphene),意为蕴藏未来的潜力 展开 收起
JavaScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/antv/graphin.git
git@gitee.com:antv/graphin.git
antv
graphin
Graphin
v3

搜索帮助