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

Shape to mermaid #30

Merged
merged 13 commits into from
May 6, 2024
Merged

Shape to mermaid #30

merged 13 commits into from
May 6, 2024

Conversation

pheyvaer
Copy link
Collaborator

@pheyvaer pheyvaer commented May 2, 2024

No description provided.

@pheyvaer pheyvaer marked this pull request as ready for review May 2, 2024 12:15
@pheyvaer
Copy link
Collaborator Author

pheyvaer commented May 2, 2024

@pietercolpaert Can you have a look at this PR? The code to generate the Mermaid representation is in lib/ShapesGraph.ts. You find the corresponding tests at tests/07 - mermaid/mermaid.test.ts.

@ajuvercr
Copy link
Collaborator

ajuvercr commented May 2, 2024

@pheyvaer Looking pretty cool!
Would it be possible to change 'shape' in the diagram to the last part of the named node of the shape id?

ex:SequencePathShape a sh:NodeShape ;
    sh:property [
        sh:path (ex:p1 ex:p2 ) ;
        sh:minCount 1
    ] .
flowchart TD
  S1((SequencePathShape))
  S1-->|"http://example.org/p1/http://example.org/p2"|S1_0[ ]
Loading

For me this would be more clear, but I don't know if people share my opinion.

@pietercolpaert
Copy link
Member

I like the idea, but do we keep that information in our structure? Not sure

@julianrojas87
Copy link
Contributor

julianrojas87 commented May 2, 2024

I made some changes locally, following @ajuvercr's suggestion and it can produce this:
image
Full shape here

It adds an optional label property to the ShapeTemplate class. If this is approved, I can push the changes (@pietercolpaert?)

@pietercolpaert
Copy link
Member

pietercolpaert commented May 2, 2024 via email

@ajuvercr ajuvercr merged commit 66e3978 into main May 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants