-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add elk layout support to mermaid
#36486
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
Merged
+197
−12
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
52f2bc7
Add `layout: elk` support to mermaid
silverwind 8bb2500
rename var
silverwind bfb614d
use same webpackChunkName
silverwind 3cde6c5
add lazy-loading elk
silverwind 6311159
add unit tests
silverwind 2e85fd0
fix review comments
silverwind 67de5a3
simplify loadMermaid
silverwind a6204c7
fix lint
silverwind 2712389
add test
silverwind cbd2f87
add return when no els
silverwind 723632f
move check
silverwind 1393f42
refine regex and add tests
silverwind 41f0028
support yaml quotes
silverwind 2ec40ac
use continue to attempt render other diagrams
silverwind 3cd3acf
init once per markup element
silverwind aa5ee6f
parallel render
silverwind 1973e47
use index from map
silverwind 0d909d3
Merge remote-tracking branch 'origin/main' into mermaidelk
silverwind bf830fe
Merge branch 'main' into mermaidelk
silverwind 846ac7e
use json and yaml parsers
silverwind dfc36d3
value.defaultRenderer can only be elk as per mermaid types
silverwind 23f84af
use valid json
silverwind 26a75e1
use for-of
silverwind 176fd16
add test
silverwind 69b6e3a
add test
silverwind c4e699c
check source limit in sourcesContainElk
silverwind 4c5a7e5
Merge branch 'main' into mermaidelk
wxiaoguang 28d70cc
fix
wxiaoguang 313c895
fix
wxiaoguang 02a8093
fix
wxiaoguang 2d5a66a
fix
wxiaoguang a7bfdb7
restore Object.values method
silverwind 9bb7e28
rename variable
silverwind f68d5a0
add dedent test helper
silverwind d74878c
Apply suggestion from @silverwind
silverwind 5766550
Apply suggestion from @silverwind
silverwind ddcd933
Apply suggestion from @silverwind
silverwind 9ed216b
fix
wxiaoguang 4fc1094
Merge branch 'main' into mermaidelk
wxiaoguang bcfb75c
fix
wxiaoguang 47424c4
Merge branch 'main' into mermaidelk
wxiaoguang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,59 @@ | ||
| import {sourcesContainElk} from './mermaid.ts'; | ||
| import {dedent} from '../utils/testhelper.ts'; | ||
|
|
||
| test('sourcesContainElk', () => { | ||
| expect(sourcesContainElk([dedent(` | ||
| flowchart TB | ||
| elk --> B | ||
| `)])).toEqual(false); | ||
|
|
||
| expect(sourcesContainElk([dedent(` | ||
| --- | ||
| config: | ||
| layout : elk | ||
| --- | ||
| flowchart TB | ||
| A --> B | ||
| `)])).toEqual(true); | ||
|
|
||
| expect(sourcesContainElk([dedent(` | ||
| --- | ||
| config: | ||
| layout: elk.layered | ||
| --- | ||
| flowchart TB | ||
| A --> B | ||
| `)])).toEqual(true); | ||
|
|
||
| expect(sourcesContainElk([` | ||
| %%{ init : { "flowchart": { "defaultRenderer": "elk" } } }%% | ||
| flowchart TB | ||
| A --> B | ||
| `])).toEqual(true); | ||
|
|
||
| expect(sourcesContainElk([` | ||
| --- | ||
| config: | ||
| layout: 123 | ||
| --- | ||
| %%{ init : { "class": { "defaultRenderer": "elk.any" } } }%% | ||
| flowchart TB | ||
| A --> B | ||
| `])).toEqual(true); | ||
|
|
||
| expect(sourcesContainElk([` | ||
| %%{init:{ | ||
| "layout" : "elk.layered" | ||
| }}%% | ||
| flowchart TB | ||
| A --> B | ||
| `])).toEqual(true); | ||
|
|
||
| expect(sourcesContainElk([` | ||
| %%{ initialize: { | ||
| 'layout' : 'elk.layered' | ||
| }}%% | ||
| flowchart TB | ||
| A --> B | ||
| `])).toEqual(true); | ||
| }); |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.