question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extending nivo.rocks sankey diagram functionality

See original GitHub issue

I’m using nivo’s Sankey diagram, and I need to trigger click/mouseover events programmatically.

I assume it shouldn’t be a problem since nivo is built upon d3 library, which already implements this functionality using the dispatch method: https://stackoverflow.com/a/40289334/12099841 But it’s not included in nivo’s API.

Is it possible to add this functionality manually?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
plouccommented, Nov 9, 2020

@realraif, while that’s possible when relying on d3 for the rendering, nivo uses React for rendering and only rely on d3 for computations, which works quite differently, and unless you use refs, you cannot access nodes this way.

Unfortunately, you cannot do this, or you could do it by creating a custom layer and implementing elements by yourself creating refs for everything, but it would be a lot of work.

1reaction
wyzecommented, Nov 9, 2020

Ah I see, my fault for the misunderstanding. I’m not sure if it works or not. It definitely would be a challenge to select certain things currently with the DOM structure we render out. Not sure if we would want to modify it for this use case.

/cc @plouc

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sankey chart | nivo
Computes a sankey diagram from nodes and links, built on top of d3-sankey. The responsive alternative of this component is ResponsiveSankey .
Read more >
Sankey diagrams | Drop-Offs · Discussion #1800 · plouc/nivo
I am looking for a good library for plotting complex sankey diagrams. I came across Nivo's implementation which seems working quite well, ...
Read more >
@nivo/sankey examples - CodeSandbox
@nivo/sankey Examples. Learn how to use @nivo/sankey by viewing and forking example apps that make use of @nivo/sankey on CodeSandbox.
Read more >
Using Sankey diagrams in Amazon QuickSight
Use Sankey diagrams to show flows from one category to another, or paths from one stage to the next. For example, a Sankey...
Read more >
Top 5 @nivo/sankey Code Examples - Snyk
description: ` how to compute label text color, [see dedicated documentation](self:/guides/colors). `, type: 'string | object | Function', required: false, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found