org-chart icon indicating copy to clipboard operation
org-chart copied to clipboard

Question: Mouseup event

Open agtenr opened this issue 1 year ago • 4 comments

Hi,

Is there an option to expose the 'mouseup' event. currently I can see that the mousedown event is exposed on the zoomBehavior of the chart state. I would like to update the cursor based on the mousedown and mouseup event (grab and grabbing). Is this possible?

I tried registering my own mouseup event on the svg, but this seems to be prevented;

Any ideas?

agtenr avatar Oct 25 '23 09:10 agtenr

Hi, I think you can receive it in zoomEnd handler, let me know if it works

https://github.com/bumbeishvili/org-chart/blob/61d458c028ffeb0e023dfe675f137b002a5209b2/src/d3-org-chart.js#L75

bumbeishvili avatar Oct 25 '23 12:10 bumbeishvili

Where can I access this. I'm using it in react/typescript, and the OrgChart does not have a onZoomEnd prop.

agtenr avatar Oct 25 '23 13:10 agtenr

You can access it using

chart.onZoomEnd(event=>console.log('event'))

This was added from v3, so make sure you are using the latest version and have a look at breaking changes too

https://github.com/bumbeishvili/org-chart/pull/213

bumbeishvili avatar Oct 25 '23 15:10 bumbeishvili

Awesome, got it. Thank for the quick response

agtenr avatar Oct 25 '23 18:10 agtenr