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

add @mermaid-js/parser separate package #4450

Closed
wants to merge 190 commits into from
Closed
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
2eac93c
build(deps): add mermaid-parser, vscode-uri, and langium to deps
Yokozuna59 Jun 3, 2023
cd8612f
chore: implement parse in `mermaid-parser`
Yokozuna59 Jun 3, 2023
cebc40e
fix: resolve pnpm-lock-.yaml conflicts
Yokozuna59 Jun 4, 2023
8caaf7c
fix: resolve pnpm-lock.yaml conflicts by downgrading local pnpm version
Yokozuna59 Jun 4, 2023
4fc6cd3
Add pie back into mermaid
sidharthv96 Jun 4, 2023
6831d26
Fix imports
sidharthv96 Jun 4, 2023
281d2a6
chore: ignore generated directory from `langium-cli`
Yokozuna59 Jun 4, 2023
fc216cc
chore: add all files for `parser` from `mermaid-lint` repo
Yokozuna59 Jun 4, 2023
7083ecb
perf(pie): remove duplicate `NEWLINE*` pie entry grammar
Yokozuna59 Jun 4, 2023
584d722
style: indent langium files with `2` instead of `4` spaces
Yokozuna59 Jun 4, 2023
6f40ce4
build(deps): bump `mermaid-parser` version to 0.2.0
Yokozuna59 Jun 5, 2023
16811c7
Make Diagram.parse async
sidharthv96 Jun 4, 2023
c99e439
docs: change `packages/parser` license into `MIT`
Yokozuna59 Jun 5, 2023
19e87a3
chore!: rename `PieChart` into `Pie` for consistent naming convention
Yokozuna59 Jun 5, 2023
73b6607
fix: remove more than whitespace in `ValueConverter`
Yokozuna59 Jun 5, 2023
2665220
build: update `langium-cli` to `v1.2.1` with setting import exntesion…
Yokozuna59 Jun 5, 2023
90f48db
chore: add types to `pieDb.ts` resolving type issues
Yokozuna59 Jun 5, 2023
f3e0a86
fix: update `pie.spec.ts` imports from `.ts` to `.js`
Yokozuna59 Jun 5, 2023
da66754
chore: rename `PieChart` into `Pie` for parser in `mermaid` package
Yokozuna59 Jun 5, 2023
de007a3
chore: remove `parser` moduleResolution option in `tsconfig.json`
Yokozuna59 Jun 5, 2023
afe00a7
style: rename `.ts` files to `camalCase` in `parser`
Yokozuna59 Jun 5, 2023
af4cc4b
chore: rename `PieChart` into `Pie` other use
Yokozuna59 Jun 5, 2023
040e3b5
feat: support `timeline` diagram in `parser` package
Yokozuna59 Jun 5, 2023
a1b86e2
fix: separate spaces and newlines removing for value converter
Yokozuna59 Jun 5, 2023
b82fc64
style: add diagram keyword to rules to prevent rules naming conflicts
Yokozuna59 Jun 5, 2023
6ec1860
style: add diagram keyword to terminal rules to prevent rules naming …
Yokozuna59 Jun 5, 2023
2583960
chore: use `GrammarAST` instead of `lib` imports
Yokozuna59 Jun 6, 2023
2a62ae2
chore: add `ES2022` in lib to `parser` tsconfig to resolve `dependenc…
Yokozuna59 Jun 6, 2023
a24032d
chore: remove ` --emitDeclarationOnly` in build script of `parser`
Yokozuna59 Jun 6, 2023
9982e72
style: rename langium parser rules to pascal case style
Yokozuna59 Jun 6, 2023
0be855e
style: remove duplicate whitespace in timeline.langium
Yokozuna59 Jun 6, 2023
7d4262d
fix: remove `vscode-uri` in parser, modify `createTestServices` not t…
Yokozuna59 Jun 6, 2023
7477025
fix: remove `vscode-uri` in mermaid package and async in parse function
Yokozuna59 Jun 6, 2023
88e3f39
Fix build
sidharthv96 Jun 7, 2023
06c5404
chore: execlude generated ast dir from vitest coverage
Yokozuna59 Jun 7, 2023
a8ba4c5
perf: save `services` and `parser` from createMermaidServices to stop…
Yokozuna59 Jun 7, 2023
44e587c
update pnpm-lock.yaml
Yokozuna59 Jun 7, 2023
e4bb86b
style: remove unnecessary generic type in pie parse function
Yokozuna59 Jun 7, 2023
3c3174a
create `ParseDirectiveDefinition` interface
Yokozuna59 Jun 8, 2023
79b7cf6
standardized pieDb directions with types
Yokozuna59 Jun 8, 2023
01a5192
convert pieRenderer from js into ts
Yokozuna59 Jun 8, 2023
4017056
remove parser empty validator checker
Yokozuna59 Jun 9, 2023
b2abb54
move `matchers` dir into `services` dir
Yokozuna59 Jun 9, 2023
cc90ad6
separate token builders by diagram and add them to services dir
Yokozuna59 Jun 9, 2023
bb702ad
move mermaid lexer into services dir
Yokozuna59 Jun 9, 2023
b9966f6
separate value converter by diagram and add them to services dir
Yokozuna59 Jun 9, 2023
f82ab58
separate each diagram grammar in `langium-config.json`
Yokozuna59 Jun 9, 2023
f0e4fd2
separate modules by diagram and add them to modules dir
Yokozuna59 Jun 9, 2023
33a3739
export modules and services in parser package
Yokozuna59 Jun 9, 2023
c0a0e26
use `createPieServices` in mermaid package for pie parser
Yokozuna59 Jun 9, 2023
8ce4fc2
create custom pie section label terminal rule
Yokozuna59 Jun 9, 2023
0f0817b
use value converter in pie and timeline class
Yokozuna59 Jun 9, 2023
3bb7701
annotate pie and timeline valueconverter classes with override
Yokozuna59 Jun 10, 2023
6a8e10e
combine null and undefined in one if statement of timeline value conv…
Yokozuna59 Jun 10, 2023
03bb132
remove duplicate parser build
Yokozuna59 Jun 10, 2023
01dd311
Merge branch develop into add-mermaid-parser
Yokozuna59 Jun 21, 2023
794d4cb
update pnpm-lock.yaml
Yokozuna59 Jun 21, 2023
058b08d
resolve ts error when merging from develop
Yokozuna59 Jun 21, 2023
ab3fd48
update pnpm-lock.yaml
Yokozuna59 Jul 17, 2023
d241c2a
Merge remote-tracking branch upstream/develop into add-mermaid-parser
Yokozuna59 Jul 17, 2023
3123f32
update pnpm-lock.yaml
Yokozuna59 Jul 17, 2023
45b620f
run `docs:build` to fix linting
Yokozuna59 Jul 17, 2023
ac87289
add info diagram to `mermaid-parser`
Yokozuna59 Jul 17, 2023
41de56c
move common files into a separate directory
Yokozuna59 Jul 17, 2023
a8f7fc2
move pie files into a separate directory
Yokozuna59 Jul 17, 2023
6525e7f
move timeline files into a separate directory
Yokozuna59 Jul 17, 2023
b2378cf
move mermaid files into a separate directory
Yokozuna59 Jul 17, 2023
8f11f2a
remove MermaidLexer
Yokozuna59 Jul 17, 2023
e71a5e9
unexport matcher files
Yokozuna59 Jul 17, 2023
35cfa84
change `public` into `protected` of `ValueConverter` and `TokenBuilder`
Yokozuna59 Jul 17, 2023
05662bf
add types to mermaid-parser
Yokozuna59 Jul 17, 2023
63a389e
update mermaid grammar path
Yokozuna59 Jul 17, 2023
e2785f4
add `CommonLexer` to diagram parsers
Yokozuna59 Jul 17, 2023
4176faf
change `NUMBER` into `PIE_SECTION_VALUE`
Yokozuna59 Jul 17, 2023
4b58845
add `_KEYWORD` prefix to diagrams keywords
Yokozuna59 Jul 17, 2023
898233a
change type of empty parsed title and acc from `undefined` into empty…
Yokozuna59 Jul 18, 2023
af135c0
remove unnecessary `PieTokenBuilder`
Yokozuna59 Jul 18, 2023
e5711ba
force new line before section in `pie` and `timeline`
Yokozuna59 Jul 18, 2023
8939763
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 18, 2023
08bbf11
unexeclude folder of parser packages
Yokozuna59 Jul 18, 2023
4beb56a
remove info assignment in info diagram
Yokozuna59 Jul 18, 2023
3a7354c
shorten timeline grammar by creating section and period fragment
Yokozuna59 Jul 19, 2023
d18e4e4
resolve pie section ambiguous alternatives
Yokozuna59 Jul 19, 2023
cc883c6
rename title and accessibilities regexes to prevent conflict
Yokozuna59 Jul 19, 2023
a066bac
make info diagram use `CommonValueConverter`
Yokozuna59 Jul 19, 2023
2cee862
make `info` diagram as keyword
Yokozuna59 Jul 19, 2023
aeed845
make `pie` and `showData` as keywords
Yokozuna59 Jul 19, 2023
95036a3
make `timeline` as keyword
Yokozuna59 Jul 19, 2023
891b644
use `buildTerminalTokens` instead of `buildTerminalToken`
Yokozuna59 Jul 19, 2023
12c0371
Merge branch 'mermaid-js:develop' into add-mermaid-parser
Yokozuna59 Jul 19, 2023
c54ccfe
make `timeline` as keyword in grammar
Yokozuna59 Jul 19, 2023
7f23e4f
support `<br>` in timeline diagram
Yokozuna59 Jul 19, 2023
9860e93
fix: `timeilne` keyword typo
Yokozuna59 Jul 20, 2023
bb41a56
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 20, 2023
3a957c6
add `.mermaid` to fileExtensions
Yokozuna59 Jul 20, 2023
7eb0973
Merge branch 'add-mermaid-parser' of https://github.com/Yokozuna59/me…
Yokozuna59 Jul 20, 2023
459b37d
add `vscode-uri` to `parser`
Yokozuna59 Jul 20, 2023
822e4d3
create `MermaidServiceRegistry` and inject other diagrams
Yokozuna59 Jul 21, 2023
aeac18f
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 21, 2023
7c4a7a5
update pnpm-lock.yaml
Yokozuna59 Jul 21, 2023
f4f1ead
fix `Peroid` typo into `Period`
Yokozuna59 Jul 21, 2023
3434091
rename timelne parser test cases
Yokozuna59 Jul 21, 2023
2732451
resolve timeline `TimelineSectionAndPeriod` ambiguous alternatives
Yokozuna59 Jul 21, 2023
d06b44a
partially make `TIMELINE_PERIOD_EVENT` tokenize berfore `TIMELINE_PER…
Yokozuna59 Jul 21, 2023
06c6561
export `commonLexer
Yokozuna59 Jul 21, 2023
87acf70
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 21, 2023
6658b44
Merge branch 'add-mermaid-parser' of https://github.com/Yokozuna59/me…
Yokozuna59 Jul 21, 2023
795bc4a
fix `NEWLINE` after `TIMELINE_SECTION_TITLE` cardinality
Yokozuna59 Jul 21, 2023
13c60bc
reintegrate `TIMELINE_SECTION_TITLE` regex into langium grammar
Yokozuna59 Jul 21, 2023
5a05f6d
optimize `info` grammar
Yokozuna59 Jul 21, 2023
43ca81e
remove `mermaid.langium` with all related stuff
Yokozuna59 Jul 21, 2023
7c74892
reintegrate `TIMELINE_PERIOD_EVENT` regex into langium grammar
Yokozuna59 Jul 21, 2023
6c94beb
support `journey` diagram
Yokozuna59 Jul 21, 2023
6a7ce1e
rename parser test cases
Yokozuna59 Jul 22, 2023
a36104a
handle comments in `timeline` and `journey`
Yokozuna59 Jul 22, 2023
4a5d6df
remove multiline in parser for now
Yokozuna59 Jul 22, 2023
05d1b89
remove `customBuildTerminalTokens` and `customBuildKeywordTokens`
Yokozuna59 Jul 22, 2023
2c90b04
bump `chevrotain` and `@chevrotain/types` versions to `v11.0.1`
Yokozuna59 Jul 23, 2023
5810b3b
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 24, 2023
8b9b3d8
update pnpm-lock.yaml
Yokozuna59 Jul 24, 2023
d6a50cb
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 25, 2023
6cfb1da
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 25, 2023
dc5a2e5
update `NEWLINE` terminal rule
Yokozuna59 Jul 25, 2023
11604e3
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Jul 26, 2023
7912597
Merge branch 'add-mermaid-parser' of https://github.com/Yokozuna59/me…
Yokozuna59 Jul 26, 2023
b61c80c
update pnpm-lock.yaml
Yokozuna59 Jul 26, 2023
8d253e2
partially support `mindmap` diagram
Yokozuna59 Jul 26, 2023
53928a8
use `MINDMAP_OUTDENT` same instance
Yokozuna59 Jul 26, 2023
d31c6dd
use `createToken` for `MINDMAP_OUTDENT`
Yokozuna59 Jul 26, 2023
7bd0e07
reintegrate `title` and `accessibilities` regexes into langium grammar
Yokozuna59 Jul 27, 2023
cadc452
make comments and directives match prevois whitespaces for `mindmap`
Yokozuna59 Jul 27, 2023
6638a02
match until comment in title and accessibilities
Yokozuna59 Jul 27, 2023
0510eb7
overwrite `MINDMAP_OUTDENT` reference correctly
Yokozuna59 Jul 27, 2023
ea517e0
resolve `MINDMAP_OUTDENT` with `NaN` values only
Yokozuna59 Jul 28, 2023
c13e249
add `version` in `info` AST
Yokozuna59 Jul 28, 2023
673cc93
assign `version` after `info` parsed
Yokozuna59 Jul 28, 2023
d14a0de
resolve `rootDir` issue
Yokozuna59 Jul 28, 2023
6c05a94
assign `version` after `info` parsed correctly
Yokozuna59 Jul 29, 2023
becbe4b
unmatch whitespaces after comment for `mindmap`
Yokozuna59 Jul 29, 2023
30ca44f
match whitespace before title and accessibilities for `mindmap`
Yokozuna59 Jul 29, 2023
0359bba
remove duplicated assignment in `MindmapValueConverter`
Yokozuna59 Jul 29, 2023
d815c10
make `mindmap` could have possible indent at the end
Yokozuna59 Jul 29, 2023
7672069
create `isRegExpAhead` helper function for `mindmap`
Yokozuna59 Jul 29, 2023
e12b3b2
support multiline nodes in `mindmap`
Yokozuna59 Jul 29, 2023
9d33272
create `createOutdentInstance` healper function
Yokozuna59 Jul 30, 2023
42a595c
remove overriden mindmap title and accessibilities
Yokozuna59 Jul 30, 2023
53088d0
update minimum indent level when the root node is matched
Yokozuna59 Jul 30, 2023
d54ad15
add `nodes` and `decorations` test cases for `mindmap`
Yokozuna59 Jul 30, 2023
46c5eda
create `MINDMAP_WHITESPACE` hidden rule
Yokozuna59 Jul 30, 2023
186959d
support double quotes in `mindmap` nodes
Yokozuna59 Jul 30, 2023
b16d89c
remove `y` flag in title and accessibilities regexps
Yokozuna59 Jul 31, 2023
db269b8
support title and accessibilities in `mindmap`
Yokozuna59 Jul 31, 2023
550af7f
add more unit test for `mindmap`
Yokozuna59 Jul 31, 2023
a8f86fd
support title and accessibilities in `timeline`
Yokozuna59 Aug 1, 2023
ec3a968
support title and accessibilities in `journey`
Yokozuna59 Aug 1, 2023
f1e3697
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Aug 1, 2023
0942f90
update pnpm-lock.yaml
Yokozuna59 Aug 1, 2023
342c352
support `sankey` diagram
Yokozuna59 Aug 1, 2023
eb98dbe
support title and accessibilities in `mindmap`
Yokozuna59 Aug 1, 2023
10679e9
add `nodes` to `sankey` diagram
Yokozuna59 Aug 1, 2023
216be57
check if source and target are in nodes list
Yokozuna59 Aug 1, 2023
adc710c
support `quadrant` diagram
Yokozuna59 Aug 1, 2023
ef13ec0
Merge branch 'add-mermaid-parser' of https://github.com/Yokozuna59/me…
Yokozuna59 Aug 1, 2023
24a0d9d
format `mindmap.langium` and `sankey.langium`
Yokozuna59 Aug 1, 2023
d556829
add node `type` to `mindmap` AST
Yokozuna59 Aug 1, 2023
1be7bed
manually order `mindmap` tokens
Yokozuna59 Aug 1, 2023
7b2ef0c
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Aug 2, 2023
c87771e
change x and y axis AST to have `xAxi`s and `yAxis`
Yokozuna59 Aug 2, 2023
b0edfab
move `swapByIndex` to `utils.ts` instead of `mindmapUtils.ts`
Yokozuna59 Aug 2, 2023
9603650
remove `@chevrotain/types` and update `langium` to `1.2.1
Yokozuna59 Aug 2, 2023
c184e38
add `Pie` to RHS in parse function
Yokozuna59 Aug 2, 2023
b0e5209
remove unnecessary config in parser `tsconfig.ts`
Yokozuna59 Aug 3, 2023
4370f38
Merge branch 'mermaid-js:develop' into add-mermaid-parser
Yokozuna59 Aug 3, 2023
323f2d0
Merge branch 'mermaid-js:develop' into add-mermaid-parser
Yokozuna59 Aug 5, 2023
5a37953
remove whitespaces before double quotes in `sankey`
Yokozuna59 Aug 5, 2023
4f236f3
support doable quotes for `sankey` link value
Yokozuna59 Aug 5, 2023
e66dce7
Merge remote-tracking branch upstream/develop into add-mermaid-parser
Yokozuna59 Aug 6, 2023
de1dcab
Merge branch 'develop' into add-mermaid-parser
Yokozuna59 Aug 8, 2023
1673761
remove newline after comment and whitespace before title
Yokozuna59 Aug 8, 2023
cea125a
match until comment in `journey` diagram
Yokozuna59 Aug 8, 2023
f92b72b
match until comment in `quadrant` diagram
Yokozuna59 Aug 8, 2023
e9f7fc7
match until comment in `timeline` diagram
Yokozuna59 Aug 8, 2023
c4553e6
export `infoParser` and `mermaidServiceRegistry` and add type imports…
Yokozuna59 Aug 8, 2023
3678b94
update langium to `v2` pre-release and remove `vscode-uri`
Yokozuna59 Aug 8, 2023
df4adfb
match `journey` peroid task until comment
Yokozuna59 Aug 8, 2023
1366ed3
Merge remote-tracking branch upstream/develop into add-mermaid-parser
Yokozuna59 Aug 11, 2023
eb64324
format langium files
Yokozuna59 Aug 11, 2023
486d97f
add `actors` to `journey` AST
Yokozuna59 Aug 12, 2023
91318c3
clean `sankeyParser`
Yokozuna59 Aug 12, 2023
1fa9dd7
refactor `MermaidServiceRegistry` if else into switch
Yokozuna59 Aug 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ cypress/plugins/index.js
coverage
*.json
node_modules
# autogenereated by langium-cli
generated/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ stats/

**/user-avatars/*
**/contributor-names.json
# autogenereated by langium-cli
generated/

.pnpm-store
.nyc_output
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ coverage
# Autogenerated by PNPM
pnpm-lock.yaml
stats

# autogenereated by langium-cli
generated/

**/.vitepress/components.d.ts
**/.vitepress/cache
.nyc_output

# Autogenerated by `pnpm run --filter mermaid types:build-config`
packages/mermaid/src/config.type.ts
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"knut",
"knutsveidqvist",
"laganeckas",
"langium",
"linetype",
"lintstagedrc",
"logmsg",
Expand Down
20 changes: 10 additions & 10 deletions docs/config/setup/modules/mermaidAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mermaid.initialize(config);

#### Defined in

[mermaidAPI.ts:667](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L667)
[mermaidAPI.ts:666](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L666)

## Functions

Expand Down Expand Up @@ -127,7 +127,7 @@ Return the last node appended

#### Defined in

[mermaidAPI.ts:308](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L308)
[mermaidAPI.ts:307](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L307)

---

Expand All @@ -153,7 +153,7 @@ the cleaned up svgCode

#### Defined in

[mermaidAPI.ts:256](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L256)
[mermaidAPI.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L255)

---

Expand All @@ -179,7 +179,7 @@ the string with all the user styles

#### Defined in

[mermaidAPI.ts:185](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L185)
[mermaidAPI.ts:184](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L184)

---

Expand All @@ -202,7 +202,7 @@ the string with all the user styles

#### Defined in

[mermaidAPI.ts:233](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L233)
[mermaidAPI.ts:232](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L232)

---

Expand All @@ -229,7 +229,7 @@ with an enclosing block that has each of the cssClasses followed by !important;

#### Defined in

[mermaidAPI.ts:169](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L169)
[mermaidAPI.ts:168](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L168)

---

Expand All @@ -249,7 +249,7 @@ with an enclosing block that has each of the cssClasses followed by !important;

#### Defined in

[mermaidAPI.ts:155](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L155)
[mermaidAPI.ts:154](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L154)

---

Expand All @@ -269,7 +269,7 @@ with an enclosing block that has each of the cssClasses followed by !important;

#### Defined in

[mermaidAPI.ts:126](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L126)
[mermaidAPI.ts:125](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L125)

---

Expand All @@ -295,7 +295,7 @@ Put the svgCode into an iFrame. Return the iFrame code

#### Defined in

[mermaidAPI.ts:287](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L287)
[mermaidAPI.ts:286](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L286)

---

Expand All @@ -320,4 +320,4 @@ Remove any existing elements from the given document

#### Defined in

[mermaidAPI.ts:358](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L358)
[mermaidAPI.ts:357](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L357)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"build:viz": "pnpm build:mermaid --visualize",
"build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-zenuml/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-example-diagram/tsconfig.json --emitDeclarationOnly",
"build:watch": "pnpm build:vite --watch",
"build": "pnpm run -r clean && pnpm build:types && pnpm build:vite",
"build:parser": "pnpm --filter mermaid-parser build",
"build": "pnpm run -r clean && pnpm build:parser && pnpm build:types && pnpm build:vite",
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"",
"dev:coverage": "pnpm coverage:cypress:clean && VITE_COVERAGE=true pnpm dev",
"release": "pnpm build",
Expand Down
2 changes: 2 additions & 0 deletions packages/mermaid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@
"dompurify": "3.0.5",
"elkjs": "^0.8.2",
"khroma": "^2.0.0",
"langium": "1.2.0",
"lodash-es": "^4.17.21",
"mdast-util-from-markdown": "^1.3.0",
"mermaid-parser": "workspace:*",
"non-layered-tidy-tree-layout": "^2.0.2",
"stylis": "^4.1.3",
"ts-dedent": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/src/Diagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class Diagram {
diagram.init(cnf);
log.info('Initialized diagram ' + this.type, cnf);
}
this.parse();
}

parse() {
Expand All @@ -62,6 +61,7 @@ export class Diagram {
}
this.db.clear?.();
this.parser.parse(this.text);
return this;
}

async render(id: string, version: string) {
Expand Down Expand Up @@ -101,5 +101,5 @@ export const getDiagramFromText = async (text: string): Promise<Diagram> => {
const { id, diagram } = await loader();
registerDiagram(id, diagram);
}
return new Diagram(text);
return new Diagram(text).parse();
};
10 changes: 0 additions & 10 deletions packages/mermaid/src/diagrams/pie/amonts.csv

This file was deleted.

106 changes: 0 additions & 106 deletions packages/mermaid/src/diagrams/pie/parser/pie.jison

This file was deleted.

Loading