Skip to content
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

Sankey diagrams with negative values #5995

Open
CAFxX opened this issue Oct 25, 2024 · 0 comments
Open

Sankey diagrams with negative values #5995

CAFxX opened this issue Oct 25, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@CAFxX
Copy link

CAFxX commented Oct 25, 2024

Description

When one of the entries in a sankey diagram is negative the result is correctly summed, but the chart is rendered incorrectly.

Steps to reproduce

  • Paste the code sample below into the live editor
  • Notice the misrendered chart (negative value of "liabilities" is shown as 0, band is not rendered)

Screenshots

image

Code Sample

sankey-beta

"stocks","financial assets",100
"cash","financial assets",20
"financial assets","net financial assets",120
"liabilities","net financial assets",-50
"real estate","net worth",100
"net financial assets","net worth",70

Setup

  • Mermaid version: 11.3.0
  • Browser and Version: Chrome 130.0.6723.58 (Official Build) (64-bit)

Suggested Solutions

No response

Additional Context

It would be great if negative values were correctly handled and rendered to mean "subtract" the negative value from the target.

@CAFxX CAFxX added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant