forked from mermaid-js/mermaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d8f09c
commit a83f88b
Showing
40 changed files
with
2,133 additions
and
1,723 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 |
---|---|---|
|
@@ -32,3 +32,6 @@ cypress/snapshots/ | |
.eslintcache | ||
.tsbuildinfo | ||
tsconfig.tsbuildinfo | ||
|
||
knsv*.html | ||
local*.html |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
auto-install-peers=true | ||
auto-install-peers=true | ||
strict-peer-dependencies=false |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
describe('mermaid', () => { | ||
describe('registerDiagram', () => { | ||
it('should work on @mermaid-js/mermaid-mindmap and mermaid-example-diagram', () => { | ||
const url = 'http://localhost:9000/external-diagrams-mindmap.html'; | ||
cy.visit(url); | ||
|
||
cy.get('svg', { | ||
// may be a bit slower than normal, since vite might need to re-compile mermaid/mermaid-mindmap/mermaid-example-diagram | ||
timeout: 10000, | ||
}).matchImageSnapshot(); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<html> | ||
<body> | ||
<h1>Should correctly load a third-party diagram using registerDiagram</h1> | ||
<pre id="diagram" class="mermaid"> | ||
mindmap | ||
root | ||
A | ||
B | ||
C | ||
D | ||
E | ||
A2 | ||
B2 | ||
C2 | ||
D2 | ||
E2 | ||
child1((Circle)) | ||
grandchild 1 | ||
grandchild 2 | ||
child2(Round rectangle) | ||
grandchild 3 | ||
grandchild 4 | ||
child3[Square] | ||
grandchild 5 | ||
::icon(mdi mdi-fire) | ||
gc6((grand<br/>child 6)) | ||
::icon(mdi mdi-fire) | ||
gc7((grand<br/>grand<br/>child 8)) | ||
</pre> | ||
<!-- <pre id="diagram" class="mermaid2"> | ||
example-diagram | ||
</pre> --> | ||
|
||
<!-- <div id="cy"></div> --> | ||
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> --> | ||
<!-- <script src="./mermaid-example-diagram-detector.js"></script> --> | ||
<!-- <script src="//cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js"></script> --> | ||
<!-- <script type="module" src="./external-diagrams-mindmap.mjs" /> --> | ||
<script type="module"> | ||
import mindmap from '../../packages/mermaid-mindmap/src/detector'; | ||
// import example from '../../packages/mermaid-example-diagram/src/detector'; | ||
import mermaid from '../../packages/mermaid/src/mermaid'; | ||
|
||
await mermaid.registerExternalDiagrams([mindmap]); | ||
await mermaid.initialize({ logLevel: 0 }); | ||
await mermaid.initThrowsErrorsAsync(); | ||
</script> | ||
</body> | ||
</html> |
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
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
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.