Setonix
Posts: 16
Joined: Thu Dec 23, 2021 9:14 am

networkgraph drag drop

Hi,

I'd like to keep in memory when the user drags the center node to another location, so that when I update and rebuild the chart, I can start the first node at the previous location.
So far I've been using the render-event to keep track of the last position, but this event renders every time I update the chart. I figured I could use the plotOptions.series.point.drop event, when a user actively drags a node to a different location, but that doesn't seem to work for a networkgraph.

Is there any other event or maybe at another level in the chartInput where I can keep track if the user moved a node?

Kind regards, Setonix
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: networkgraph drag drop

Hi Setonix,
Thanks for contacting us!

You can wrap the prototype function, from Network graph module, which is responsible for detecting if user is finalizing the drag&drop of the node. In this wrap, you can detect whether the point is the centre point and then save its position.

Demo: https://jsfiddle.net/BlackLabel/236a1wdx/
API reference: https://www.highcharts.com/docs/extendi ... highcharts

Feel free to ask any further questions!
Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Stock”