feat: Add Ishikawa diagram#7387
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 52dfde9 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 |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
08b1295 to
14ccd6c
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #7387 +/- ##
==========================================
- Coverage 3.58% 3.56% -0.03%
==========================================
Files 482 490 +8
Lines 48121 48675 +554
Branches 758 765 +7
==========================================
+ Hits 1726 1734 +8
- Misses 46395 46941 +546
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Hey @exoego this is really cool! I tried it out with some data from https://en.wikipedia.org/wiki/Ishikawa_diagram and it looks great. I noticed something about the order of the items. It seems in the top half of the diagram, they are displayed in reverse order. In the bottom half they are displayed in the order they were entered. Is it expected?
Additionally I noticed each section is displayed in a different order to how its entered in the syntax. I don't know if this is expected or not, but I thought I'd ask. actually I think it's in order, just a different order than I expected. seems the order relates to proximity to cause, which is clear from your example going from I'm new to this diagram type but it looks super useful! |
|
Good catch. Right now, the rendering order follows the internal logic: level 1 bones are drawn from the base of the spine up, which reverses the order for the top section compared to the Mermaid syntax. I assume that Mermaid syntax should be WYSIWYG. |
|
@exoego I'm not a maintainer though, just a fan of your PR, so please feel free to do what you think is right or the maintainers ask :) I think generally it is true that Mermaid syntax should be WYSIWYG. |
|
@exoego I tried the new commit, looks great, thanks! |
knsv
left a comment
There was a problem hiding this comment.
First of all — thank you so much for this contribution! The Ishikawa/fishbone diagram is one of the most requested diagram types, and it's really exciting to see it come together. The effort you've put into this is clear and appreciated.
I've done an initial review and have some feedback:
What's working well:
- The unit tests for parsing are great — solid foundation. I'd love to see more test cases added to cover edge cases, but the approach is spot on.
- Theme support working out of the box is excellent.
- The syntax is close to mindmaps and feels clean and intuitive.
Things to address:
- Margins/padding: The diagram doesn't currently apply the configured margins. Take a look at the draw method in journeyDiagram as a reference — specifically how it adds padding and uses configureSvgSize. This ensures the diagram respects the user's configuration and renders consistently with other diagram types.
- Visual regression tests: It would be really valuable to add visual snapshot tests. Check out cypress/rendering/xyz.spec.js for examples — it's surprisingly easy. You just add a diagram per test, and the image snapshot comparison catches any future regressions automatically. This is one of our most important quality safeguards across all diagram types.
- Handdrawn mode: I noticed handdrawn/rough look isn't supported yet. This isn't necessarily a blocker for merging, but it should be documented so users know it's not available for this diagram type yet.
Looking forward to seeing this land. Great work!
… in text (WYSIWYG)
9202fa9 to
7afc33e
Compare
|
Thanks @exoego Will look at it! |
knsv
left a comment
There was a problem hiding this comment.
Great work @exoego - all three items from my previous review are addressed, and the handdrawn mode implementation went above and beyond. Really impressed by that.
What's working well:
The plugin contract is complete and properly structured — parser, db, renderer, styles, detector, and registration all present. DB is stateless per render, no cross-diagram imports, theme variables used throughout, text sanitization in place, docs with MERMAID_RELEASE_VERSION placeholder, and changeset included. Clean work.
Approving! Thanks for the thorough work on this, especially the visual regression test coverage and the full rough.js implementation. 🎉
|
@exoego Awesome work! Could resolve the conflicts, so that we can merge this and push out with our new release version. |
5959fc0
|
So cool that this is out. There's no link to it yet on the sidebar so I've raised a PR to fix #7460 |



📑 Summary
Resolves #4784
Added
ishikawa-betasyntaxDemo:
📏 Design Decisions
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.