# relation-graph **Repository Path**: ghostgeek/relation-graph ## Basic Information - **Project Name**: relation-graph - **Description**: 学习使用 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-12 - **Last Updated**: 2025-09-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # relation-graph [English ](README.md) | [简体中文](README-zh.md) - **relation-graph** 是支持Vue2、Vue3、React的关系数据展示组件,支持通过【插槽】让使用者使用"普通HTML元素、Vue组件、React组件"来完全自定义图形元素,并提供实用的API接口让使用者轻松构建可交互的图形应用。
- 除了典型的关系数据展示功能,relation-graph还支持作为一个画板来使用,你可以在画板上放置任何内容,只需要为想要连接的元素设置id,同时定义"元素连线(Element Lines)"即可。轻松实现一个可任意创建连线、可缩放与拖动、支持通过API轻松实现动态交互的画板。 ### Docs & Examples 文档 & 示例: - [https://relation-graph.com](https://relation-graph.com) (国内用户,无需科学上网) 上面的网站中包含使用文档、在线示例,以及可视化的配置工具。
### Getting Started 快速使用: ```shell script npm install --save relation-graph ``` ```shell script # 注意:relation-graph支持Vue2、Vue3、React, 引入的包名称都是"relation-graph" 但在使用时,根据你的环境,需要引入不同的名称 # Note: relation-graph supports Vue2, Vue3, React, but the package name for import is always "relation-graph". # # Vue2: import RelationGraph from 'relation-graph' # Vue3: import RelationGraph from 'relation-graph/vue3' # React: import RelationGraph from 'relation-graph/react' ``` ```vue ``` ### Sample code effects 上面代码的效果: ![简单示例效果图](doc/images/relation-graph-simple.png) ### Example Projects 完整的示例代码: - Vue3完整小示例: - https://github.com/seeksdream/relation-graph-vue3-demo - React完整小示例: - https://github.com/seeksdream/relation-graph-react-demo - vue2完整小示例: - https://github.com/seeksdream/relation-graph-vue2-demo ### More Examples 更多示例: - [https://relation-graph.com/#/demo](https://relation-graph.com/#/demo) (国内用户,无需科学上网) ![relation-graph](doc/relation-graph-images-m.png) ![center-层级距离设置](doc/demo-images/distance_coefficient.gif) ![力学布局(force)](doc/demo-images/layout-force.gif) ![节点展开/收缩的用法](doc/demo-images/adv-expand.gif) ![节点筛选 & 关系筛选](doc/demo-images/adv-data-filter.gif) ![节点/连线点击效果2](doc/demo-images/adv-effect2.gif) ![展开/收缩 时动画效果](doc/demo-images/expand-animation.gif) ![展开/关闭所有](doc/demo-images/open-all-close-all.gif) ![布局切换事件](doc/demo-images/before-change-layout.gif) ### 完整的、可运行的示例项目: - Vue2完整小示例: - [https://github.com/seeksdream/relation-graph-vue2-demo(Vite)](https://github.com/seeksdream/relation-graph-vue2-demo) - [https://github.com/seeksdream/relation-graph-vue2-demo(Webpack)](https://github.com/seeksdream/relation-graph-webpack) - Vue3完整小示例: - https://github.com/seeksdream/relation-graph-vue3-demo - React完整小示例: - https://github.com/seeksdream/relation-graph-react-demo ### More info 更多效果及使用方法: - [https://relation-graph.com](https://relation-graph.com) (国内用户,无需科学上网) ### Contact me 与我联系: - 我的QQ:3235808353 - My WhatsApp: