| | |
| | | animationDurationUpdate: 1500, |
| | | animationEasingUpdate: "quinticInOut", |
| | | series: [ |
| | | { |
| | | type: "graph", |
| | | layout: "force", |
| | | roam: true, |
| | | symbolSize: SymbolSize, // 调整节点大小 |
| | | label: { |
| | | show: true, |
| | | color: "black", // 设置节点文字颜色为黑色 |
| | | fontSize: FontSize, // 设置文字大小 |
| | | }, |
| | | edgeSymbol: ["circle", "arrow"], |
| | | edgeSymbolSize: [4, 10], |
| | | data: nodeData, |
| | | links: links, |
| | | categories: this.categories, |
| | | lineStyle: { |
| | | opacity: 0.9, |
| | | width: 2, |
| | | curveness: 0.3, |
| | | }, |
| | | emphasis: { |
| | | focus: "adjacency", |
| | | lineStyle: { |
| | | width: 10, |
| | | }, |
| | | }, |
| | | force: { |
| | | // layoutAnimation: false, |
| | | // friction: 1, |
| | | repulsion: 800, |
| | | edgeLength: 400, |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "Les Miserables", |
| | | // type: "graph", |
| | | // legendHoverLink: false, |
| | | // layout: "none", |
| | | // data: nodeData, |
| | | // links: links, |
| | | // categories: this.categories, |
| | | // layout: "force", |
| | | // roam: true, |
| | | // symbolSize: SymbolSize, // 调整节点大小 |
| | | // label: { |
| | | // position: "right", |
| | | // formatter: "{b}", |
| | | // show: true, |
| | | // color: "black", // 设置节点文字颜色为黑色 |
| | | // fontSize: FontSize, // 设置文字大小 |
| | | // }, |
| | | // edgeSymbol: ["circle", "arrow"], |
| | | // edgeSymbolSize: [4, 10], |
| | | // data: nodeData, |
| | | // links, |
| | | // categories: this.categories, |
| | | // lineStyle: { |
| | | // color: "source", |
| | | // opacity: 0.9, |
| | | // width: 2, |
| | | // curveness: 0.3, |
| | | // }, |
| | | // emphasis: { |
| | |
| | | // width: 10, |
| | | // }, |
| | | // }, |
| | | // force: { |
| | | // // layoutAnimation: false, |
| | | // // friction: 1, |
| | | // repulsion: 800, |
| | | // edgeLength: 400, |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "Les Miserables", |
| | | type: "graph", |
| | | legendHoverLink: false, |
| | | layout: "none", |
| | | data: nodeData, |
| | | links: links, |
| | | categories: this.categories, |
| | | roam: true, |
| | | label: { |
| | | position: "right", |
| | | formatter: "{b}", |
| | | }, |
| | | lineStyle: { |
| | | color: "source", |
| | | curveness: 0.3, |
| | | }, |
| | | emphasis: { |
| | | focus: "adjacency", |
| | | lineStyle: { |
| | | width: 10, |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | }; |
| | | // 将生成的连接线添加到echarts图表的option中 |
| | | option.series[0].links = links; |
| | | // option.series[0].links = links; |
| | | // 设置点击事件监听 |
| | | myChart.off("click"); |
| | | myChart.on("click", (params) => { |
| | |
| | | this.spaceTimeArr(params.data.id); |
| | | } |
| | | }); |
| | | option && myChart.setOption(option); |
| | | console.log(option,'option') |
| | | myChart.setOption(option); |
| | | }, |
| | | // 基础搜索 |
| | | onSearch(val, index) { |