mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

feat(state): add from, to ids for edge

Open igorwessel opened this issue 9 months ago • 2 comments

:bookmark_tabs: Summary

The ID of the from-to relationship was added to the diagram's edges. Another denominator "_" was used to make the extraction of these respective IDs easier.

Captura de Tela 2024-05-04 às 06 26 26

:straight_ruler: Design Decisions

I am currently working on converting state diagram to Excalidraw, and I felt the need to have an easier way to find the edges.

I tried some alternative paths but without success, for example:

  1. Manually tracking each edge, and using it as an index to search in .edgePaths, however, the index does not always reflect how we iterate through the parser.doc.
  2. Using the respective graphCount id to get the edge, but in cases where we have multiple relationships for the same state, it may not find the correct edge because we do not have access to the graphCount in the parser.doc, only to the node id.

:clipboard: Tasks

Make sure you

  • [x] :book: have read the contribution guidelines
  • [ ] :computer: have added necessary unit/e2e tests.
  • [ ] :notebook: have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • [x] :bookmark: targeted develop branch

igorwessel avatar May 04 '24 09:05 igorwessel

Deploy Preview for mermaid-js ready!

Name Link
Latest commit da150e8767eab63ef9e95be73a6696f34ffca161
Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/6638ba5d184fe10008ebd40c
Deploy Preview https://deploy-preview-5503--mermaid-js.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar May 04 '24 09:05 netlify[bot]

Codecov Report

Attention: Patch coverage is 4.54545% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 5.73%. Comparing base (e68125e) to head (da150e8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5503   +/-   ##
=======================================
  Coverage     5.73%   5.73%           
=======================================
  Files          277     277           
  Lines        41999   42033   +34     
  Branches       515     515           
=======================================
+ Hits          2407    2409    +2     
- Misses       39592   39624   +32     
Flag Coverage Δ
unit 5.73% <4.54%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ges/mermaid/src/diagrams/class/classRenderer-v2.ts 0.00% <0.00%> (ø)
...ges/mermaid/src/diagrams/flowchart/flowRenderer.js 0.00% <0.00%> (ø)
.../mermaid/src/diagrams/flowchart/flowRenderer-v2.js 0.00% <0.00%> (ø)
...ges/mermaid/src/diagrams/state/stateRenderer-v2.js 0.00% <0.00%> (ø)
packages/mermaid/src/utils.ts 41.60% <12.50%> (-0.51%) :arrow_down:

codecov[bot] avatar May 04 '24 09:05 codecov[bot]

@igorwessel, Thank you for the contribution! You are now eligible for a year of Premium account on MermaidChart. Sign up with your GitHub account to activate.

mermaid-bot[bot] avatar May 08 '24 06:05 mermaid-bot[bot]

@sidharthv96 could we include it in a minor release? I can do a double-check and look to see if any breaking changes were introduced.

igorwessel avatar May 20 '24 16:05 igorwessel

Current develop has breaking changes, slotted for v11. So we'll have to extract your changes and rebase onto master to make a new release. We are only doing v10 security releases now.

sidharthv96 avatar May 21 '24 09:05 sidharthv96

@sidharthv96 is there an RC version that we can use to unblock and test these changes ?

ad1992 avatar Jul 08 '24 14:07 ad1992

@sidharthv96 I realized that this modification was not in the release, I will open a PR again by inserting the IDs. 😆

igorwessel avatar Sep 05 '24 12:09 igorwessel

Everything that was merged should have been out in v11 release. I'm on my mobile rn, so can't check what happened.

sidharthv96 avatar Sep 05 '24 12:09 sidharthv96