christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
650 stars 269 forks source link

forceNetwork - clickAction feature for the links #243

Open aaronxs opened 6 years ago

aaronxs commented 6 years ago

Hi,

Based on my limited understanding of JavaScript, the clickAction for the nodes currently allows you to show in text the characteristics (such as node name, node size or node group) when you click on a particular node, depends on how user write the JavaScript expression for clickAction (i.e. the MyClickScript in example of forceNetwork in the R documentation).

Would it be possible to add a similar clickAction feature for the links? In particular one that allows the user to show variables in the Links input such as link length/width, source/targer or refer to a the corresponding value in a user-specified column in the Links input?

Or alternatively, a hoverAction on the links where it would show a text box (similar to the one in sandkeyNetwork) defined by a user-specified JavaScript expression based on variables in the Links input when user hovers on the links?

Thanks! Aaron

cjyetman commented 5 years ago

tooltip text when you hover over a link would be customizable once #239 is resolved. Click action would be a new feature