-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support sequence diagrams 🚀 (#34)
* feat: support sequence diagrams * remove endArrowhead for solid and dotted stroke styles * cleanup playground UI * add some sequence testcases and support name attribute in test cases * add playground for sequence * support actor symbols * display correct text message * fix types and use mermaid font size as is for better calculations * support identifiers * add test cases for identifier and also beautify playground a bit :p * support notes * support activations * fix message * Support loops * support alternate paths and add bg to loop labels * Add testcase for parallel actions * calculate width of container based on label for loop labels * Add a testcase for comment * support critical regions and self loop * use svg for arrow text as json is not consistent * support background highlights * use message json for computing arrowtype * use note text from message json * make sure critical label doesn't overlap with loop text * remove font customization * support box/grouping * group the actor symbols * support sequence numbers * support grouping for actors too and move away from mermaid group rect instead draw ours :) * move computeGroupIds to flowchart as its flowchart specific * assign frame id to bound text elements * upgrade exclaidraw * fix styling * cleanup * support entity codes * update excalidraw package to use the frames api * stop using directive as we don't support custom font size hence using config * make code more typesafe * update changelog and make more typesafe * remove unused code * update changelog * upgrade version to 0.1.2
- Loading branch information
Showing
22 changed files
with
1,389 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.vscode | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,30 +9,26 @@ | |
<body> | ||
<section id="custom-test"> | ||
<h1>Custom Test</h1> | ||
<ul> | ||
<li> | ||
Support only flowchart diagram (the input must started with | ||
"flowchart") | ||
</li> | ||
<li> | ||
See supported and unsupported features at | ||
<a | ||
target="_blank" | ||
href="https://github.com/excalidraw/mermaid-to-excalidraw/pull/1#issue-1686226562" | ||
>PR's description</a | ||
> | ||
</li> | ||
</ul> | ||
Supports only | ||
<a target="_blank" href="https://mermaid.js.org/syntax/flowchart.html" | ||
>Flowchart</a | ||
> | ||
and | ||
<a | ||
target="_blank" | ||
href="https://mermaid.js.org/syntax/sequenceDiagram.html" | ||
> | ||
Sequence </a | ||
>diagrams. | ||
<br /> | ||
<textarea | ||
id="mermaid-input" | ||
rows="10" | ||
cols="50" | ||
style="margin-top: 1rem" | ||
placeholder="Input Mermaid Syntax" | ||
></textarea | ||
><br /> | ||
<label for="font-size-input">Custom Font Size: </label> | ||
<input type="number" id="font-size-input" value="20" /><br /> | ||
<button id="render-excalidraw-btn">Render to Excalidraw</button> | ||
<div id="custom-diagram"></div> | ||
<details id="parsed-data-details"> | ||
|
@@ -48,8 +44,23 @@ <h1>Custom Test</h1> | |
id="diagram-loading-spinner" | ||
width="50" | ||
/> | ||
<div id="flowchart-container"></div> | ||
<div id="unsupported"></div> | ||
<h2>Flowchart Diagrams</h2> | ||
<details> | ||
<summary>Flowchart Examples</summary> | ||
<div id="flowchart-container"></div> | ||
</details> | ||
|
||
<h2>Sequence Diagrams</h2> | ||
<details> | ||
<summary>Sequence Diagram Examples</summary> | ||
<div id="sequence-container"></div> | ||
</details> | ||
<h2 style="margin-top: 50px">Unsupported diagrams</h2> | ||
<details> | ||
<summary>Unsupported Diagram Examples</summary> | ||
<div id="unsupported"></div> | ||
</details> | ||
|
||
<script | ||
crossorigin | ||
src="https://unpkg.com/react@18/umd/react.development.js" | ||
|
@@ -60,7 +71,7 @@ <h1>Custom Test</h1> | |
></script> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/@excalidraw/[email protected].0/dist/excalidraw.development.js" | ||
src="https://unpkg.com/@excalidraw/[email protected].1-6920-d3d0bd0/dist/excalidraw.development.js" | ||
></script> | ||
<script type="module" src="index.ts"></script> | ||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
75ead98
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.
Successfully deployed to the following URLs:
mermaid-to-excalidraw – ./
mermaid-to-excalidraw.vercel.app
mermaid-to-excalidraw-excalidraw.vercel.app
mermaid-to-excalidraw-git-master-excalidraw.vercel.app