Skip to content

SankeyChart: Add chart for displaying dataflow#11919

Merged
danielchalmers merged 13 commits intoMudBlazor:devfrom
91378246:feature/sankey-chart
Oct 19, 2025
Merged

SankeyChart: Add chart for displaying dataflow#11919
danielchalmers merged 13 commits intoMudBlazor:devfrom
91378246:feature/sankey-chart

Conversation

@91378246
Copy link
Contributor

@91378246 91378246 commented Sep 29, 2025

Often used in finances or life sciences, a sankey chart visualizes data flow between multiple states, allowing flows to di- and converge:

image image

Overlapping edges:
image

Due to the nature of the sankey chart it may be required to display many chart tool tips at once. Therefore I had to implement a way to adjust the font size (which was hard coded).

image image

The dynamic changing of the font size then resulted in alignment issues (as the pixel values of the background where also hardcoded) which required reworking the ChartTooltip component.
There are no visual differences for the existing charts as far as i can tell besides a smaller min-width (it was hardcoded before to hide the overlapping triangle at the bottom):
image

This is my very first PR so feedback would be greatly appreciated.

@mudbot mudbot bot added the new component Proposal or addition of a new component (apply this instead of enhancement) label Sep 29, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Sankey chart component, which is a fantastic addition to the library. The implementation is comprehensive, including the component logic, data models, documentation with examples, and unit tests. I've identified a few areas for improvement. There's a critical bug in color handling that could cause a crash, a logical error in how node values are calculated, and missing input validation on chart options. Additionally, I've provided suggestions to enhance performance, improve the documentation's accuracy, and make the examples more robust. Overall, this is a very impressive first contribution, and addressing these points will make it even stronger.

Copy link
Contributor

@Anu6is Anu6is left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks pretty solid.

@91378246 91378246 requested a review from Anu6is October 1, 2025 20:21
@Anu6is Anu6is requested a review from versile2 October 10, 2025 11:26
Copy link
Contributor

@versile2 versile2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see a new chart and it looks pretty good. I too want to see and understand the Chart Tooltip Changes, in particular how it affects other charts. Please include that in the opening of the PR. The only visual thing I noticed was adjusting the sizing did not move the labels so you could easily adjust sizing and have the labels just show up in odd spots. Is it possible to adjust the labels when these are resized?

Image

@91378246
Copy link
Contributor Author

@versile2 Update the PR-description (hope that was what you ment). Also made the labels adjust their position while changing vertical spacing (this also worked previously but only if the vertical spacing was set at the initial chart render).

@91378246 91378246 requested a review from versile2 October 16, 2025 18:13
Copy link
Contributor

@versile2 versile2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, great job.

@Garderoben
Copy link
Member

Love it!

@danielchalmers danielchalmers changed the title SankeyChart: A chart to display data-flow SankeyChart: Add chart for displaying dataflow Oct 19, 2025
@danielchalmers danielchalmers merged commit f97e1a3 into MudBlazor:dev Oct 19, 2025
6 checks passed
@danielchalmers
Copy link
Member

Thank you!

@91378246 91378246 deleted the feature/sankey-chart branch November 4, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new component Proposal or addition of a new component (apply this instead of enhancement)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants