Replies: 6 comments 7 replies
-
Hi @zaneho, While the doc doesn't explicitly mention it, you can already use mouse events on nodes/links, however events like right click aren't supported, if you go to https://nivo.rocks/sankey/, you can try clicking on the nodes/links and you'll see your actions logged. Regarding text wrap/alignment, it's SVG so it's a bit constraining, nivo being a high level lib, it's a bit difficult to cover every use case, the doc also doesn't mention it, but you can use an extra layer in this chart and render whatever you want. I'll see if I find some time to actually demonstrate this feature with a concrete example. |
Beta Was this translation helpful? Give feedback.
-
Please have a look at https://codesandbox.io/s/sankey-custom-b4iyi |
Beta Was this translation helpful? Give feedback.
-
Hi @plouc Qn: May I know how I can make the links 'overlap'/'converge' for multiple outgoing/incoming links? I tried changing this in hooks.ts but the alignment is still off. https://codesandbox.io/s/sankey-nivo-0-78-forked-author-suggestion-zg17t?file=/src/App.js Thanks. |
Beta Was this translation helpful? Give feedback.
-
No you cannot, the thickness of each link is tied to the value it corresponds to, doing this would somehow defeat the purpose of using a sankey diagram I think. |
Beta Was this translation helpful? Give feedback.
-
@plouc your above suggestion for customLayer does not seem to work as It does not allow to pass a anything else beside the mentioned |
Beta Was this translation helpful? Give feedback.
-
Hi @plouc , why can not properties like -
etc, accept a function similar to colors prop? If that would be possible, then we can easily customise each node and link's opacity, width,hover opacity etc according to our needs. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I hope to have more customisation for Sankey.
Or do let me know how I can achieve the following features.
Feature 1) Align text in node
Feature 2) Wrap text of label
Feature 3) Add icons (eg SVG) infront/behind the text label.
Feature 4) Add badge on node
Feature 5) Mouse events (hover, right click)
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Feature 1) I adjusted node width and label padding, but text are not aligned. eg Center.
Feature 3) Currently only support text, such as unicode for icons
Additional context
What I hope to achieve
What I manage to do so far
Beta Was this translation helpful? Give feedback.
All reactions