Skip to content

Commit

Permalink
add new demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
seeksdream committed Nov 23, 2020
1 parent ee0aed5 commit 287030b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npm install --save relation-graph
allowSwitchLineShape: true,
allowSwitchJunctionPoint: true,
defaultJunctionPoint: 'border'
// 这里可以参考"Graph 图谱"中的参数进行设置
// 这里可以参考"Graph 图谱"中的参数进行设置:http://relation-graph.com/#/docs/graph
}
}
},
Expand All @@ -42,27 +42,24 @@ npm install --save relation-graph
},
methods: {
showSeeksGraph() {
/**
图谱数据__graph_json_data不要放在Vue data()中,也不要引用Vue data()中的变量,否则在当前版本中会有问题,以后版本会解决这个问题。
如果需要__graph_json_data是一个全局变量,暂时的解决方法是把他放在 export default之前,具体问题可以加我QQ:3235808353
**/
var __graph_json_data = {
rootId: 'a',
nodes: [
// node配置选项:http://relation-graph.com/#/docs/node
// node支持通过插槽slot完全自定义,示例:http://relation-graph.com/#/demo/adv-slot
{ id: 'a', text: 'A', borderColor: 'yellow' },
{ id: 'b', text: 'B', color: '#43a2f1', fontColor: 'yellow' },
{ id: 'c', text: 'C', nodeShape: 1, width: 80, height: 60 },
{ id: 'e', text: 'E', nodeShape: 0, width: 150, height: 150 }
],
links: [
// link配置选项:http://relation-graph.com/#/docs/link
{ from: 'a', to: 'b', text: '关系1', color: '#43a2f1' },
{ from: 'a', to: 'c', text: '关系2' },
{ from: 'a', to: 'e', text: '关系3' },
{ from: 'b', to: 'e', color: '#67C23A' }
]
}
// 以上数据中的node和link可以参考"Node节点"和"Link关系"中的参数进行配置
this.$refs.seeksRelationGraph.setJsonData(__graph_json_data, (seeksRGGraph) => {
// Called when the relation-graph is completed
})
Expand Down

0 comments on commit 287030b

Please sign in to comment.