|
|
@@ -76,6 +76,10 @@ function A9knowlege() {
|
|
|
links: graph.links,
|
|
|
categories: graph.categories,
|
|
|
roam: true,
|
|
|
+ scaleLimit: {
|
|
|
+ min: 0.5,
|
|
|
+ max: 3
|
|
|
+ },
|
|
|
label: { position: 'right' },
|
|
|
emphasis: { focus: 'adjacency' },
|
|
|
force: { repulsion: 200, edgeLength: [50, 120] },
|
|
|
@@ -85,9 +89,20 @@ function A9knowlege() {
|
|
|
}
|
|
|
|
|
|
myChart.setOption(option, true)
|
|
|
- myChart.off('click')
|
|
|
+ myChart.on('mouseover', function (params: any) {
|
|
|
+ myChart.dispatchAction({
|
|
|
+ type: 'downplay'
|
|
|
+ })
|
|
|
+ })
|
|
|
myChart.on('click', function (params: any) {
|
|
|
if (!params || !params.data) return
|
|
|
+
|
|
|
+ // 高亮相关节点连线
|
|
|
+ myChart.dispatchAction({
|
|
|
+ type: 'highlight',
|
|
|
+ dataIndex: params.dataIndex
|
|
|
+ })
|
|
|
+
|
|
|
const node = params.data
|
|
|
if (node && node.raw && node.raw.type) {
|
|
|
setDetail(node.raw)
|