-
-
Notifications
You must be signed in to change notification settings - Fork 8k
6584: prevent pie chart crash on zero or negative values #6651
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
Conversation
🦋 Changeset detectedLatest commit: 0823e08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6651 +/- ##
=======================================
Coverage 3.70% 3.71%
=======================================
Files 454 453 -1
Lines 44724 44715 -9
Branches 707 707
=======================================
Hits 1659 1659
+ Misses 43065 43056 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the screenshots for doc server changes you made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and all previus comments have been fixed
📑 Summary
This PR adds validation to handle negative values in pie charts:
Prevents parser crashes caused by negative values by introducing validation during parsing.
Provides clearer error messaging to guide users when invalid input is detected.
Resolves #6584
📏 Design Decisions
Validation moved to the AST level:
Instead of rejecting values in the grammar, the parser accepts all numbers and performs validation during AST traversal. This allows more informative and user-friendly error messages.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Screenshots
Before

After
