plotly / dash-cytoscape

Interactive network visualization in Python and Dash, powered by Cytoscape.js
https://dash.plot.ly/cytoscape
MIT License
601 stars 119 forks source link

[Feature request]: clickNodeData callback #186

Open pgruening opened 1 year ago

pgruening commented 1 year ago

It would be helpful to have a custom event called, for example, 'clickNodeData' that always triggers a callback function, regardless of whether the node has been clicked before.

I'm trying to create a simple Treeviewer in Dash. In my app, the root node is shown, and when I click on it, a callback function is triggered to visualize the root node and all of its children nodes. This works well using the 'tapNodeData' or 'selectedNodeData' properties.

However, I would like to be able to click on the root node again to hide the children nodes. Currently, neither 'tapNodeData' nor 'selectedNodeData' triggers the callback function when the root node is clicked a second time. My current workaround is to deselect and then reselect the root node, which causes the 'selectedNodeData' property to trigger the callback function.