-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@nivo/sankey turn off node legend text and custom nodes #2624
Comments
@shellyscheng, I think you posted before the upload of the screenshot could complete. |
@plouc opps! I just updated it! I figured it out by giving But now I have encountered two different questions for labels:
For my use case, I hope the top label to have both source name and % of the total
For my use case, I'm hoping to add two images at the center of the bottom two nodes Thank you so much! |
@shellyscheng, line breaks are not supported (SVG limitation), regarding customization, it's doable if you're familiar with SVG, while not exactly the same, you can have a look at this example: https://codesandbox.io/p/sandbox/sankey-custom-b4iyi?file=%2Fsrc%2FApp.js which uses a custom layer for the nodes, it could be a good start, but you'll have to figure out things by yourself as custom layers aren't documented. |
@plouc, that's super helpful! I have a follow-up question about using Nivo with custom layers. Once I added a custom layer for the nodes, the original labels set within the Nivo config got overwritten (pic 1 is Nivo label settings, pic 2 with CutomNodeLayer). Is there a way to keep both the original labels and my custom elements? Like what I will for label 1 - 4 in the pic 1, target 1 and 2 below my headshot images in pic 2 if possible. Or is is possible to only use custom nodes for target 1 and 2 (with nodeThickness 100), not using custom nodefor label 1 -4 (with nodeThickness 0) Additionally, the custom node layer seems to have a very fixed width restriction, which is not ideal for my labels. Would appreciate any insights that I could help improve the look! Thank you! Here's my code for achieving pic 2:
|
@shellyscheng, you can pass the following layers: |
Thank you, @plouc! I made it work now! |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Is there a way to hide node labels on the bottom right corner?
Describe the solution you'd like
A clear and concise description of what you want to happen.
I'm working on a chart which I set the
nodeThickness
to be 0, so I don't need the legend box at the bottom right corner. Would appreciate it if there's a way to turn it off.Thanks a lot!
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: