-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Give markers unique id's per graph #4825
Give markers unique id's per graph #4825
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #4825 +/- ##
===========================================
+ Coverage 73.11% 79.70% +6.59%
===========================================
Files 138 148 +10
Lines 12544 13024 +480
Branches 603 612 +9
===========================================
+ Hits 9171 10381 +1210
+ Misses 3225 2510 -715
+ Partials 148 133 -15
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
@chadfawcett the changes looks great!
Can you please add an integration test to verify that the issue is solved?
The content from #1871 can be in the html file.
You can refer https://github.com/mermaid-js/mermaid/blob/bf18f25c820fb9264fe70ce5113a85f676cfd306/cypress/integration/other/ghsa.spec.js on how it should be done.
@sidharthv96 I didn't see any documentation around contributing to the tests, so I did my best guess at what you might want. It'd be nice to see some documentation about what you expect in the CONTRIBUTING.md doc with best practices around naming and file location etc. Here's a screenshot of what I see in Cypress. Let me know if you need me to make changes to what I've done. |
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.
The test is great.
I've added 2 more cases.
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
* develop: chore: Fix type in 'getLineFunctionsWithOffset' refactor: Add getLineFunctionsWithOffset function refactor: Move EdgeData to types fix: PointStart marker refX chore(deps): update all patch dependencies refactor: Fix typings in utils.ts chore: Add @internal to createCSSStyles chore: Bump version refactor: Remove unused variables fix: mermaid-js#4818 support `getClasses` in external diagrams.
@chadfawcett, Thank you for the contribution! |
Thanks @sidharthv96 and @knsv for getting this merged in. Any idea when I could expect this fix to be released in a new version on npm? |
Our plan was to release today, but we discovered some bugs while testing. So that has blocked the release. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [mermaid](https://github.com/mermaid-js/mermaid) | [`10.4.0` -> `10.5.0`](https://renovatebot.com/diffs/npm/mermaid/10.4.0/10.5.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/mermaid/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/mermaid/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/mermaid/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/mermaid/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mermaid-js/mermaid (mermaid)</summary> ### [`v10.5.0`](https://github.com/mermaid-js/mermaid/releases/tag/v10.5.0): 10.5.0 [Compare Source](https://github.com/mermaid-js/mermaid/compare/v10.4.0...v10.5.0) #### What's Changed ##### Features - feat(er): add entity name alias by [@​tomperr](https://github.com/tomperr) in [https://github.com/mermaid-js/mermaid/pull/4758](https://github.com/mermaid-js/mermaid/pull/4758) ##### Bugfixes - Fix Twitter fontawesome class in flowchart.md by [@​GingerNinjaNicko](https://github.com/GingerNinjaNicko) in [https://github.com/mermaid-js/mermaid/pull/4723](https://github.com/mermaid-js/mermaid/pull/4723) - fix(pie): align slices and legend orders by [@​Yokozuna59](https://github.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4774](https://github.com/mermaid-js/mermaid/pull/4774) - Update class member handling by [@​jgreywolf](https://github.com/jgreywolf) in [https://github.com/mermaid-js/mermaid/pull/4534](https://github.com/mermaid-js/mermaid/pull/4534) - fix(er): allow underscore as leading char by [@​tomperr](https://github.com/tomperr) in [https://github.com/mermaid-js/mermaid/pull/4776](https://github.com/mermaid-js/mermaid/pull/4776) - Align arrows on sequence diagram by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4804](https://github.com/mermaid-js/mermaid/pull/4804) - fix: Allow hollow markers on edges by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4788](https://github.com/mermaid-js/mermaid/pull/4788) - fix: Fix for vulnerability making it possible to add javascript in class names by [@​knsv](https://github.com/knsv) ##### Documentation - Docs/2910 Remove n00b and fix some docs by [@​nirname](https://github.com/nirname) in [https://github.com/mermaid-js/mermaid/pull/4767](https://github.com/mermaid-js/mermaid/pull/4767) - fix: typos by [@​omahs](https://github.com/omahs) in [https://github.com/mermaid-js/mermaid/pull/4801](https://github.com/mermaid-js/mermaid/pull/4801) - "CSS" instead of "css" in flowchart.md by [@​jakeboone02](https://github.com/jakeboone02) in [https://github.com/mermaid-js/mermaid/pull/4797](https://github.com/mermaid-js/mermaid/pull/4797) - fix(docs): Correct repeated text in flowchart.md by [@​andriy-koz](https://github.com/andriy-koz) in [https://github.com/mermaid-js/mermaid/pull/4810](https://github.com/mermaid-js/mermaid/pull/4810) - Update link to Discourse theme component by [@​gschlager](https://github.com/gschlager) in [https://github.com/mermaid-js/mermaid/pull/4811](https://github.com/mermaid-js/mermaid/pull/4811) - New Mermaid Live Editor for Confluence Cloud by [@​zhifeiyue](https://github.com/zhifeiyue) in [https://github.com/mermaid-js/mermaid/pull/4814](https://github.com/mermaid-js/mermaid/pull/4814) - Update classDiagram.md by [@​jgreywolf](https://github.com/jgreywolf) in [https://github.com/mermaid-js/mermaid/pull/4781](https://github.com/mermaid-js/mermaid/pull/4781) - Support member definition to initialize class by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4786](https://github.com/mermaid-js/mermaid/pull/4786) - fix: Add support for `~test Array~string~` back in Class by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4805](https://github.com/mermaid-js/mermaid/pull/4805) - Added support for millisecond and second to gantt tickInterval by [@​vertxxyz](https://github.com/vertxxyz) in [https://github.com/mermaid-js/mermaid/pull/4778](https://github.com/mermaid-js/mermaid/pull/4778) - Add directive support to all diagrams by preprocessing by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4759](https://github.com/mermaid-js/mermaid/pull/4759) - Update README.md by [@​jgreywolf](https://github.com/jgreywolf) in [https://github.com/mermaid-js/mermaid/pull/4780](https://github.com/mermaid-js/mermaid/pull/4780) ##### Chores - chore(deps): update all minor dependencies (minor) by [@​renovate](https://github.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4783](https://github.com/mermaid-js/mermaid/pull/4783) - chore(deps): update all patch dependencies (patch) by [@​renovate](https://github.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4782](https://github.com/mermaid-js/mermaid/pull/4782) - chore(deps): update all patch dependencies (patch) by [@​renovate](https://github.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4809](https://github.com/mermaid-js/mermaid/pull/4809) - chore: move `commonDb` into `diagrams/common/commonDb` by [@​Yokozuna59](https://github.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4802](https://github.com/mermaid-js/mermaid/pull/4802) - Use utf8 encoding in Jupyter example by [@​jonashaag](https://github.com/jonashaag) in [https://github.com/mermaid-js/mermaid/pull/4701](https://github.com/mermaid-js/mermaid/pull/4701) - Update flowchart.md by [@​Ogglas](https://github.com/Ogglas) in [https://github.com/mermaid-js/mermaid/pull/4792](https://github.com/mermaid-js/mermaid/pull/4792) - Update flowchart.md by [@​dsblank](https://github.com/dsblank) in [https://github.com/mermaid-js/mermaid/pull/4798](https://github.com/mermaid-js/mermaid/pull/4798) - Refactor `cypress/helpers/util.ts` by [@​RohanHandore](https://github.com/RohanHandore) in [https://github.com/mermaid-js/mermaid/pull/4340](https://github.com/mermaid-js/mermaid/pull/4340) - refactor: Fix typings in utils.ts by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4826](https://github.com/mermaid-js/mermaid/pull/4826) - Support ClassDefs in external diagrams by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4819](https://github.com/mermaid-js/mermaid/pull/4819) - Fix: flowchartElk Arrow overlap by [@​sidharthv96](https://github.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4830](https://github.com/mermaid-js/mermaid/pull/4830) - Give markers unique id's per graph by [@​chadfawcett](https://github.com/chadfawcett) in [https://github.com/mermaid-js/mermaid/pull/4825](https://github.com/mermaid-js/mermaid/pull/4825) #### New Contributors - [@​GingerNinjaNicko](https://github.com/GingerNinjaNicko) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4723](https://github.com/mermaid-js/mermaid/pull/4723) - [@​omahs](https://github.com/omahs) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4801](https://github.com/mermaid-js/mermaid/pull/4801) - [@​jakeboone02](https://github.com/jakeboone02) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4797](https://github.com/mermaid-js/mermaid/pull/4797) - [@​andriy-koz](https://github.com/andriy-koz) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4810](https://github.com/mermaid-js/mermaid/pull/4810) - [@​gschlager](https://github.com/gschlager) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4811](https://github.com/mermaid-js/mermaid/pull/4811) - [@​zhifeiyue](https://github.com/zhifeiyue) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4814](https://github.com/mermaid-js/mermaid/pull/4814) - [@​vertxxyz](https://github.com/vertxxyz) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4778](https://github.com/mermaid-js/mermaid/pull/4778) - [@​jonashaag](https://github.com/jonashaag) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4701](https://github.com/mermaid-js/mermaid/pull/4701) - [@​Ogglas](https://github.com/Ogglas) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4792](https://github.com/mermaid-js/mermaid/pull/4792) - [@​dsblank](https://github.com/dsblank) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4798](https://github.com/mermaid-js/mermaid/pull/4798) - [@​RohanHandore](https://github.com/RohanHandore) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4340](https://github.com/mermaid-js/mermaid/pull/4340) - [@​chadfawcett](https://github.com/chadfawcett) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4825](https://github.com/mermaid-js/mermaid/pull/4825) **Full Changelog**: mermaid-js/mermaid@v10.4.0...v10.5.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/levaintech/contented). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjMiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
📑 Summary
This PR makes markers have unique IDs based on the graph they are within.
Resolves #1871
Supersedes #3546 - This PR seemed abandoned
📏 Design Decisions
While #3546 seemed to resolve #1871, it appeared to be abandoned and also had a lot of syntax changes. I decided to keep the fix simple so hopefully it's easier to review and quicker to merge.
This implementation gives markers unique IDs based on the graph they are within. By using the ID, rather than some random string, we are able to reference the markers based on graph container ID when re-positioning.
📋 Tasks
Make sure you
📓 have added documentation. Make sureMERMAID_RELEASE_VERSION
is used for all new features.develop
branch