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

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

Merged

Conversation

igorwessel
Copy link
Contributor

@igorwessel igorwessel commented May 4, 2024

📑 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

📏 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.

📋 Tasks

Make sure you

@github-actions github-actions bot added the Type: Enhancement New feature or request label May 4, 2024
Copy link

netlify bot commented May 4, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit da150e8
🔍 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.

@igorwessel igorwessel changed the title feat(state): add from, to ids in edge feat(state): add from, to ids for edge May 4, 2024
Copy link

codecov bot commented May 4, 2024

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%) ⬆️

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%) ⬇️

@igorwessel igorwessel requested a review from sidharthv96 May 6, 2024 16:57
@sidharthv96 sidharthv96 added this pull request to the merge queue May 8, 2024
github-actions bot pushed a commit that referenced this pull request May 8, 2024
github-actions bot pushed a commit that referenced this pull request May 8, 2024
github-actions bot pushed a commit that referenced this pull request May 8, 2024
Merged via the queue into mermaid-js:develop with commit 4a12c46 May 8, 2024
19 checks passed
Copy link

mermaid-bot bot commented May 8, 2024

@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.

@igorwessel
Copy link
Contributor Author

@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.

@sidharthv96
Copy link
Member

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.

@ad1992
Copy link
Contributor

ad1992 commented Jul 8, 2024

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

@igorwessel
Copy link
Contributor Author

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

@sidharthv96
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants