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

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

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.

None yet

2 participants