如何在HighChart中动态更改鼠标事件功能?
我正在使用Highchart NetworkGraph作为有向图。
我希望用户能够在节点悬停点突出显示“开始节点”的最短路径。 我还有一些复选框,可以突出显示从启动到指定节点的最短节点。我设法做到了。但是,我遇到的一点问题是,选择一个复选框后,我想“禁用” BFS算法,保持突出显示的路径并让用户探索节点(每个节点都在悬停时都有一个工具提示弹出窗口)
i Ve进行了一个小型演示,展示了我的问题。 demo
我试图禁用所有状态(无效,无效,Hover,Hover,Hover,Hover,Hover,Hover,Hover,Hover,Hover,Hover选择)并使用node.update()方法更新每个标记,但没有成功。我还试图将ChartOptions状态中的Events更改为未定义或其他功能,但是默认状态会干扰该功能。我已经用完了想法。
提前致谢。
I'm using Highchart networkgraph for a directed graph.
I want the users to be able to on node hover highlight the shortest path from the start node.
I also have some checkboxes that would highlight the shortest node from start to the specified node. I've managed to do it. but the bit I'm having some issue with is that upon selecting a checkbox I want to 'disable' the BFS algorithm, keeping the highlighted path and letting the user explore the nodes (each node has a tooltip popup as well on hover)
I've made a small demo that showcases my issue. Demo
I've tried to disable all states (inactive, hover, selected) and update each marker with the node.update() method, but without success. I've also tried to change the point.events in the chartOptions state to undefined or to another function, but then the default states interfere with the functionality. I've ran out of ideas.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于所有状态,您可以使用
enableMousEtracking:false
,它将关闭所有状态。 https://api.highcharts.com/highcharts/plotOptions.networkgraph.enableMouseTrackinghttps://stackblitz.com/editz.com/edit/react-ewhvow?file= index index in 。
。标记状态是否可见。
For disabled all state you can use
enableMouseTracking: false
, which will turn off all states. https://api.highcharts.com/highcharts/plotOptions.networkgraph.enableMouseTrackinghttps://stackblitz.com/edit/react-ewhvow?file=index.js
Another option would be to add an event in series, events.mouseOut, events.mouseOver, and there change the state of the marker to visible or not.
https://jsfiddle.net/BlackLabel/shxo8Lj6/