Compare commits

..

481 Commits

Author SHA1 Message Date
Knut Sveidqvist
75f9de3d4a UPdated version to 10.2.3 2023-06-08 16:24:25 +02:00
Knut Sveidqvist
81e86bc87c Merge branch '10.2.2' into develop 2023-06-08 15:07:31 +02:00
Sidharth Vinod
f464212dc0 Merge pull request #4416 from MikeJeffers/bug/4408
Fix #4408: Handle wrapping long words
2023-06-08 11:46:09 +05:30
Sidharth Vinod
0ad084182a Remove old changelog 2023-06-08 11:42:14 +05:30
Sidharth Vinod
e2e9d0f1f3 Remove old changelog 2023-06-08 11:36:47 +05:30
Sidharth Vinod
ac488dd800 Merge branch 'develop' into pr/MikeJeffers/4416
* develop:
  Update docs
2023-06-08 11:13:51 +05:30
sidharthv96
d00d20fc37 Update docs 2023-06-07 18:49:51 +00:00
Sidharth Vinod
88b94dea66 Merge branch 'develop' into pr/MikeJeffers/4416
* develop: (45 commits)
  Add nextra to cSpell
  Update docs: Added Nextra to Blogs category on integrations page
  Render empty lines correctly
  Restore classes on edges for elk
  Update diagram proposal
  Update docs
  Added CKEditor and GitHub Writer to available integrations.
  Fix exceptions for empty lines
  chore(deps): update all patch dependencies
  build(deps): fix broken pnpm-lock.yaml file
  Mermaid version 10.2.0
  Mermaid Version 10.2.0-rc.4
  Label background fix
  Test commit
  Fix for regression error in sequenceDiagrams
  Update all minor dependencies
  Update all patch dependencies
  Update docs
  Add contributors profile url
  ignore ZenUML types
  ...
2023-06-08 00:16:49 +05:30
Sidharth Vinod
9896402be6 Merge branch 'develop' of https://github.com/mermaid-js/mermaid into develop
* 'develop' of https://github.com/mermaid-js/mermaid:
  Update docs: Added Nextra to Blogs category on integrations page
2023-06-08 00:16:16 +05:30
Sidharth Vinod
e9b76bba9b Add nextra to cSpell 2023-06-08 00:16:12 +05:30
Sidharth Vinod
ad09d63f65 only split if string is over length. 2023-06-08 00:07:33 +05:30
Sidharth Vinod
af7531d08a Merge pull request #4463 from try-to-fly/add-nextra-to-blogs-integrations
Update docs: Added Nextra to Blogs category on integrations page
2023-06-07 20:28:40 +05:30
微笑
eef6745272 Update docs: Added Nextra to Blogs category on integrations page 2023-06-07 16:06:52 +08:00
mikejeffers
0cb6df1ef8 refactor text width computing func 2023-06-06 23:11:07 -04:00
Sidharth Vinod
f20ff4d580 Merge pull request #4436 from slab/zh-mermaid-empty-text
Fix exceptions for empty lines
2023-06-05 11:43:43 +05:30
Zihua Li
2a6603b33a Render empty lines correctly 2023-06-04 16:24:41 +08:00
Sidharth Vinod
6115f6976a Merge pull request #4452 from yoavst/feature/restore-classes-on-edges-for-elk
Restore classes on edges for elk
2023-06-04 12:02:54 +05:30
Yoav Sternberg
da1beb36bf Restore classes on edges for elk 2023-06-02 22:10:39 +03:00
Knut Sveidqvist
d2409dc163 Setting version to 10.2.2 2023-06-02 08:50:59 +02:00
Knut Sveidqvist
1b40f552b2 Merge pull request #4334 from mermaid-js/sidv/zenuml
Add `@mermaid-js/mermaid-zenuml` package for zenuml Integration
2023-06-02 08:41:49 +02:00
Knut Sveidqvist
5b696a72f8 Merge pull request #4448 from mermaid-js/sidv/diagramProposal
Update diagram proposal
2023-06-02 08:40:35 +02:00
Sidharth Vinod
d148a65967 Merge branch 'develop' into sidv/zenuml
* develop: (22 commits)
  Update docs
  Added CKEditor and GitHub Writer to available integrations.
  chore(deps): update all patch dependencies
  build(deps): fix broken pnpm-lock.yaml file
  Mermaid version 10.2.0
  Mermaid Version 10.2.0-rc.4
  Label background fix
  Test commit
  Fix for regression error in sequenceDiagrams
  Fix visibility issue for fields
  fix parsing issue with class diagrams
  fix: Use unicode arrows in quadrant chart axis
  fix: Use unicode arrows in quadrant chart axis
  fix lint command
  Bump version
  Back to JS with jsdoc types
  Add unsupported text
  Reduce changes in test
  Fix deps
  Fix lockfile
  ...
2023-06-02 11:59:12 +05:30
Sidharth Vinod
74ccf6410d Update diagram proposal 2023-06-02 11:50:49 +05:30
Knut Sveidqvist
7cdb15c526 Merge pull request #4447 from mermaid-js/4446-handling-of-arrowMarker-urls
#4446 Updating the cleanup criteria
2023-06-01 17:55:45 +02:00
Knut Sveidqvist
55092f532f #4446 Improved regular expression 2023-06-01 17:39:54 +02:00
Knut Sveidqvist
7b6cb4f974 #4446 Updating the cleanup criteria 2023-06-01 16:30:57 +02:00
Knut Sveidqvist
0cd1c5de97 Merge branch 'release/10.2.1' 2023-06-01 13:12:20 +02:00
Knut Sveidqvist
48e5d743b3 Merge pull request #4445 from mermaid-js/4438-revering-to-non-esm-use-of-dayjs
#4438 Reverted to the changes from #4285
2023-06-01 13:03:14 +02:00
Knut Sveidqvist
98e75959cc #4438 Reverted to the changes from #4285 2023-06-01 12:53:21 +02:00
Sidharth Vinod
0cec854f3b Fix download 2023-05-31 19:33:30 +05:30
Sidharth Vinod
abcae14fa7 Fix compile error in docs. 2023-05-31 19:10:42 +05:30
Sidharth Vinod
641098e602 Fix Contributor link in homepage 2023-05-31 19:06:36 +05:30
sidharthv96
c2c8024718 Update docs 2023-05-31 11:11:04 +00:00
Sidharth Vinod
5338d90077 Merge pull request #4440 from AnnaTomanek/patch-1
Add CKEditor and GitHub Writer to available integrations
2023-05-31 16:36:30 +05:30
Anna Tomanek
180c695f2f Added CKEditor and GitHub Writer to available integrations. 2023-05-31 12:15:40 +02:00
Zihua Li
ce9bdcc53f Fix exceptions for empty lines 2023-05-29 21:00:37 +08:00
renovate[bot]
38d9ebc5da chore(deps): update all patch dependencies 2023-05-29 05:19:50 +00:00
Sidharth Vinod
5fd5de10b5 Merge pull request #4400 from mermaid-js/sidv/quadrantArrows
Quadrant chart unicode arrows
2023-05-26 17:21:26 +05:30
Sidharth Vinod
ca5d78098e Merge pull request #4426 from aloisklink/chore/fix-broken-lockfile
Merge PR #4425 to `master` to fix uploading v10.2.0 docs to `mermaid.js.org` website
2023-05-25 07:13:58 +05:30
Alois Klink
cb2bc2a587 Merge pull request #4425 from aloisklink/chore/fix-broken-lockfile
Fix broken `pnpm-lock.yaml` file to fix CI
2023-05-24 23:03:54 +01:00
Alois Klink
6093383d45 build(deps): fix broken pnpm-lock.yaml file
Looks like a bad merge conflict resolution broke this file,
and for some reason, the `packages/mermaid/src/vitepress` bit got
removed when releasing v10.2.0-rc.4.

Fixes: bd1343648e
Fixes: 9c12c42a26
2023-05-24 22:19:49 +01:00
Knut Sveidqvist
bd1343648e Merge branch 'master' into develop 2023-05-24 19:20:47 +02:00
Knut Sveidqvist
3517314390 Merge branch 'release/10.2.0' 2023-05-24 19:19:41 +02:00
Knut Sveidqvist
8d43b87200 Mermaid version 10.2.0 2023-05-24 19:03:22 +02:00
Knut Sveidqvist
9c12c42a26 Mermaid Version 10.2.0-rc.4 2023-05-24 18:18:54 +02:00
Knut Sveidqvist
5bfe32524d Label background fix 2023-05-24 12:53:28 +02:00
Knut Sveidqvist
bd616e0ef5 Test commit 2023-05-24 12:27:30 +02:00
Knut Sveidqvist
9fb25310e8 Fix for regression error in sequenceDiagrams 2023-05-24 11:27:17 +02:00
Sidharth Vinod
102b9bc8c3 Merge branch 'develop' into sidv/zenuml
* develop:
  Update all minor dependencies
  Update all patch dependencies
2023-05-23 10:36:02 +05:30
Sidharth Vinod
9cec5ae1c4 Merge branch 'sidv/zenuml' of https://github.com/mermaid-js/mermaid into sidv/zenuml
* 'sidv/zenuml' of https://github.com/mermaid-js/mermaid:
  Update docs
  Add contributors profile url
  ignore ZenUML types
  fixed typo and update peerDependencies version
  update pnpm-lock.yaml
  Address mermaid-zenuml PR comments
  Update all minor dependencies
  Update all patch dependencies
  Fix vitepress build
2023-05-23 10:34:08 +05:30
renovate[bot]
ac23787084 Update all minor dependencies 2023-05-22 07:53:27 +00:00
renovate[bot]
ad61f4c6b1 Update all patch dependencies 2023-05-22 06:06:37 +00:00
mikejeffers
496585b543 handle trailing whitespace on lines 2023-05-20 16:04:58 -04:00
mikejeffers
9e6168111f add e2e test 2023-05-20 15:20:28 -04:00
mikejeffers
f535640c1e Fixes #4408: solve infinite loop on words that exceed width constraint with word break 2023-05-20 14:59:04 -04:00
Alois Klink
acc19db5bb Merge branch 'develop' into sidv/zenuml
Conflicts:
	pnpm-lock.yaml
2023-05-17 19:59:58 +01:00
aloisklink
6cce1b20fb Update docs 2023-05-17 18:46:58 +00:00
dontry
a00616863d Add contributors profile url 2023-05-17 19:26:43 +01:00
dontry
49c97dad4c ignore ZenUML types 2023-05-17 19:26:43 +01:00
Alois Klink
e984b34af4 Merge branch 'develop' into sidv/zenuml
* develop: (66 commits)
  Update docs
  Update docs
  Improve the wording of security level values
  Added quadrantChart to the side bar
  Added e2e test cases with some fixes
  Added documentation for the quadrantChart
  Restructured the build function and addressed more review comment
  Fixed some parser issue and added test cases for the parser
  Fixed review comment
  Update docs
  Converted files to typescript and added proper types
  Fix blog linting
  Debug fetch-contributors
  Fix lockfile
  Revert "Replace esno & ts-node with tsx"
  [draft] Added support for quadrant chart
  Fix lockfile
  Fix build
  Update pnpm-lock
  Replace esno & ts-node with tsx
  ...

Merge conflicts:
  - pnpm-lock.yaml
2023-05-17 19:25:29 +01:00
Sidharth Vinod
c255d95ae2 Merge pull request #4405 from ZenUml/dongc/zenuml
Address mermaid-zenuml PR comments
2023-05-17 19:10:25 +01:00
Dong Cai
27e59e5adc fixed typo and update peerDependencies version 2023-05-17 19:10:19 +01:00
Dong Cai
507e24cc72 update pnpm-lock.yaml 2023-05-17 19:10:03 +01:00
Dong Cai
bb400d53b9 Address mermaid-zenuml PR comments 2023-05-17 19:09:48 +01:00
renovate[bot]
b1590c2211 Update all minor dependencies 2023-05-17 13:32:09 +00:00
renovate[bot]
9eeeb97e15 Update all patch dependencies 2023-05-17 09:17:43 +00:00
Sidharth Vinod
0ef115f69a Fix vitepress build 2023-05-17 11:28:17 +05:30
Sidharth Vinod
6a89ef94f7 Cleanup 2023-05-17 11:21:03 +05:30
Sidharth Vinod
97be4983f0 Merge branch 'develop' into sidv/zenuml
* develop: (66 commits)
  Update docs
  Update docs
  Improve the wording of security level values
  Added quadrantChart to the side bar
  Added e2e test cases with some fixes
  Added documentation for the quadrantChart
  Restructured the build function and addressed more review comment
  Fixed some parser issue and added test cases for the parser
  Fixed review comment
  Update docs
  Converted files to typescript and added proper types
  Fix blog linting
  Debug fetch-contributors
  Fix lockfile
  Revert "Replace esno & ts-node with tsx"
  [draft] Added support for quadrant chart
  Fix lockfile
  Fix build
  Update pnpm-lock
  Replace esno & ts-node with tsx
  ...
2023-05-16 23:26:35 +05:30
Sidharth Vinod
c7affbe33b Merge pull request #4405 from ZenUml/dongc/zenuml
Address mermaid-zenuml PR comments
2023-05-16 23:25:29 +05:30
Dong Cai
82eccb70fa fixed typo and update peerDependencies version 2023-05-16 23:41:53 +10:00
Justin Greywolf
78efac2c51 Fix visibility issue for fields 2023-05-16 06:13:37 -07:00
Justin Greywolf
58ec2686da Merge branch 'release/10.2.0' of https://github.com/mermaid-js/mermaid into release/10.2.0 2023-05-16 04:12:27 -07:00
Justin Greywolf
3a5c4a149f fix parsing issue with class diagrams 2023-05-16 04:12:03 -07:00
Dong Cai
c889ef0c30 update pnpm-lock.yaml 2023-05-16 21:08:25 +10:00
Dong Cai
cce5505662 Address mermaid-zenuml PR comments 2023-05-16 20:30:25 +10:00
Sidharth Vinod
b925849893 fix: Use unicode arrows in quadrant chart axis 2023-05-15 13:36:35 +05:30
Sidharth Vinod
d86d1e7887 fix: Use unicode arrows in quadrant chart axis 2023-05-15 13:32:59 +05:30
Knut Sveidqvist
132ce2fb4b Merge branch 'develop' into release/10.2.0 2023-05-15 09:50:02 +02:00
Knut Sveidqvist
458ac84749 Merge pull request #4383 from amsubhash/feature/4282_add_quadrant_chart
Added support for quadrant chart
2023-05-15 09:49:23 +02:00
Knut Sveidqvist
fa3e800802 Merge remote-tracking branch 'origin/release/10.2.0' into release/10.2.0 2023-05-15 08:52:13 +02:00
Knut Sveidqvist
f616663f2f Merge branch 'develop' into release/10.2.0 2023-05-15 08:51:47 +02:00
knsv
b563ddc19d Update docs 2023-05-15 06:49:56 +00:00
Knut Sveidqvist
c755e45961 Merge pull request #4349 from danielcompton/patch-1
Indent subgraph sections
2023-05-15 08:46:38 +02:00
knsv
de34a06718 Update docs 2023-05-15 06:22:10 +00:00
Knut Sveidqvist
040827d95d Merge pull request #4395 from Gusted/docs-sec
Improve the wording of security level values
2023-05-15 08:18:45 +02:00
Gusted
a991c32732 Improve the wording of security level values
- The current wording can be misinterpreted because, for some people
'tags' might not be associated with HTML tags.
- Improve the wording to make it clear that HTML tags are intended.
2023-05-13 20:25:04 +02:00
Subhash Halder
c4aebe6d57 Added quadrantChart to the side bar 2023-05-13 20:28:49 +05:30
Subhash Halder
0f354ff974 Added e2e test cases with some fixes 2023-05-13 19:45:45 +05:30
Subhash Halder
b2a5ddcd85 Added documentation for the quadrantChart 2023-05-13 17:33:31 +05:30
Subhash Halder
816800adcd Restructured the build function and addressed more review comment 2023-05-12 20:16:26 +05:30
Subhash Halder
fe9c109837 Fixed some parser issue and added test cases for the parser 2023-05-12 17:09:14 +05:30
Subhash Halder
1253733962 Fixed review comment 2023-05-11 12:19:59 +05:30
amsubhash
4cbcfa054e Update docs 2023-05-09 14:50:54 +00:00
Subhash Halder
9a7dbab5ed Converted files to typescript and added proper types 2023-05-09 20:17:04 +05:30
Sidharth Vinod
6eef09661d Merge branch 'develop' into release/10.2.0
* develop:
  Fix blog linting
2023-05-09 10:25:27 +05:30
Sidharth Vinod
10a66030b9 Fix blog linting 2023-05-09 10:25:16 +05:30
Sidharth Vinod
93370a8e11 Merge branch 'develop' into release/10.2.0
* develop:
  Updated url
  Updated url
  Updated url
  Updated url
  add blog post to blog page
  add the latest blog post
2023-05-09 10:24:38 +05:30
Sidharth Vinod
4e3c2adffc Merge branch 'master' into develop
* master:
  Updated url
  Updated url
  Updated url
  Updated url
  add blog post to blog page
  add the latest blog post
2023-05-09 10:24:14 +05:30
Sidharth Vinod
fbd35ae95a fix lint command 2023-05-09 10:24:05 +05:30
Sidharth Vinod
75e73a4f03 Bump version 2023-05-09 10:20:33 +05:30
Sidharth Vinod
17c798a1b3 Merge branch 'develop' into release/10.2.0
* develop: (49 commits)
  Debug fetch-contributors
  Fix lockfile
  Revert "Replace esno & ts-node with tsx"
  Fix lockfile
  Fix build
  Update pnpm-lock
  Replace esno & ts-node with tsx
  chore(deps): update all minor dependencies
  chore(deps): update all patch dependencies
  Fix missing `await` in usage document
  Add integrations
  test: fix classDiagramGrammer unit test
  restore path calculation for grammar test
  Allow overlapping notes
  remove spellcheck warnings
  Fix path in test
  fix import issue
  requested update
  Reject ridiculous years in Gantt charts.
  Remove unnecessary dependencies
  ...
2023-05-09 10:13:15 +05:30
Sidharth Vinod
c0b7ba305f Merge pull request #4356 from mermaid-js/sidv/contributors
Show all contributors in homepage
2023-05-09 10:02:08 +05:30
Sidharth Vinod
bd53e9d449 Debug fetch-contributors 2023-05-09 09:56:40 +05:30
Sidharth Vinod
45139470a3 Fix lockfile 2023-05-08 22:08:47 +05:30
Sidharth Vinod
3677d44a58 Revert "Replace esno & ts-node with tsx"
This reverts commit 75337287ea.
2023-05-08 22:08:11 +05:30
Subhash Halder
272ccded93 [draft] Added support for quadrant chart 2023-05-08 19:23:58 +05:30
Sidharth Vinod
b27d018c09 Fix lockfile 2023-05-08 19:04:21 +05:30
Sidharth Vinod
a1fe7222ac Fix build 2023-05-08 18:52:03 +05:30
Sidharth Vinod
1b48c19897 Merge branch 'develop' into sidv/contributors
* develop:
  chore(deps): update all minor dependencies
  requested update
  Update packages/mermaid/src/docs/syntax/flowchart.md
  Update docs
  Docs: Flowchart - minor verbiage update
2023-05-08 18:51:10 +05:30
Sidharth Vinod
2dc780a766 Merge pull request #4315 from mermaid-js/huynhicode-docs-flowchart
Docs: Flowchart - minor verbiage update
2023-05-08 18:49:47 +05:30
Sidharth Vinod
0b73d40ca1 Merge pull request #4380 from mermaid-js/renovate/all-minor
chore(deps): update all minor dependencies (minor)
2023-05-08 18:47:54 +05:30
Sidharth Vinod
500efda8d6 Update pnpm-lock 2023-05-08 18:47:22 +05:30
Sidharth Vinod
8e9d1bfc35 Merge branch 'develop' into sidv/contributors
* develop:
  chore(deps): update all patch dependencies
2023-05-08 18:46:39 +05:30
Sidharth Vinod
75337287ea Replace esno & ts-node with tsx 2023-05-08 18:46:14 +05:30
renovate[bot]
b04155178a chore(deps): update all minor dependencies 2023-05-08 10:09:26 +00:00
renovate[bot]
d7e140a829 chore(deps): update all patch dependencies 2023-05-08 10:08:10 +00:00
Knut Sveidqvist
25a7164df2 Merge branch 'develop' into sidv/contributors 2023-05-08 09:17:49 +02:00
Knut Sveidqvist
29c8f8c867 Merge pull request #4350 from mermaid-js/sidv/removeSimpleMarkdown
remove SimpleMarkdown
2023-05-08 09:16:28 +02:00
Knut Sveidqvist
a226b073a0 Merge pull request #4374 from remcohaszing/add-integrations
Add integrations
2023-05-08 09:13:16 +02:00
Knut Sveidqvist
0c18f26dc0 Merge pull request #4370 from mermaid-js/Overlap-notes-messages
Allow overlapping notes
2023-05-08 09:11:33 +02:00
Knut Sveidqvist
4d0447574a Merge pull request #4366 from mermaid-js/update-latest-news
Latest News section: update content
2023-05-08 09:11:11 +02:00
Knut Sveidqvist
40176f9bef Updated url 2023-05-08 09:10:45 +02:00
Knut Sveidqvist
97a34a0cfc Updated url 2023-05-08 09:10:21 +02:00
Knut Sveidqvist
d1690a03db Updated url 2023-05-08 09:09:32 +02:00
Knut Sveidqvist
d8c67cd2c9 Updated url 2023-05-08 09:08:18 +02:00
Knut Sveidqvist
ccc87be462 Merge branch 'develop' into Overlap-notes-messages 2023-05-08 09:04:19 +02:00
Knut Sveidqvist
f8b029de0e Merge pull request #4376 from rhysd/doc/missing_await
Fix missing `await` in usage document
2023-05-08 09:01:22 +02:00
Knut Sveidqvist
8573db5114 Merge pull request #4378 from aloisklink/fix/fix-broken-unit-tests
test: fix classDiagramGrammer unit test
2023-05-08 09:00:49 +02:00
rhysd
c6c3b07c33 Fix missing await in usage document 2023-05-08 13:44:40 +09:00
Remco Haszing
7df21c01ec Add integrations
This adds the projects `mermaid-isomorphic`, `rehype-mermaidjs`, and
`gatsby-remark-mermaid` to the integrations page.

This also removes `remark-mermaid`. This project is outdated and
unmaintained.
2023-05-07 21:00:17 +02:00
Alois Klink
a1e64c2102 test: fix classDiagramGrammer unit test
The classDiagramGrammer.spec.ts unit test had some bad filepath
manipulation that fails on UNIX platforms.

Instead, we can use the recommended method from the Node.JS
documentation, see https://nodejs.org/api/esm.html#importmetaurl.

Fixes: 221640aa25
2023-05-07 18:05:43 +01:00
Knut Sveidqvist
7f9ebcf2c6 Merge pull request #4361 from tcbuzor/feature-4146-eraggregation
add master detail relationship support
2023-05-07 08:04:07 +02:00
Justin Greywolf
7e240dac22 restore path calculation for grammar test 2023-05-04 09:15:21 -07:00
Justin Greywolf
06fdb95389 Allow overlapping notes 2023-05-03 22:15:59 -07:00
Justin Greywolf
2216bbad25 remove spellcheck warnings 2023-05-03 17:02:44 -07:00
Justin Greywolf
43819f1bd8 Merge branch 'develop' of https://github.com/mermaid-js/mermaid into develop 2023-05-03 17:01:43 -07:00
Justin Greywolf
221640aa25 Fix path in test 2023-05-03 17:01:27 -07:00
Justin Greywolf
5f1a507820 Merge pull request #4206 from ksilverwall/feature/class-namespace
Implement `package` on class diagram
2023-05-03 16:58:08 -07:00
Justin Greywolf
7fd4814abc Merge pull request #4259 from mermaid-js/svgDrawRefactor
Refactor to consolidate shared svgDraw components
2023-05-03 16:57:09 -07:00
Justin Greywolf
61e31b3fe6 fix import issue 2023-05-03 16:29:57 -07:00
Justin Greywolf
e903f06f75 Merge branch 'develop' into svgDrawRefactor 2023-05-03 16:18:17 -07:00
Steph
35051f1946 add blog post to blog page 2023-05-02 23:50:14 -07:00
Steph
a5e0630e21 requested update 2023-05-02 23:41:14 -07:00
Sidharth Vinod
bf37956528 Merge pull request #4367 from toolness/bug/4353_reject_ridiculous_dates
Reject ridiculous years in Gantt charts.
2023-05-03 00:37:05 +05:30
Atul Varma
725b80831e Reject ridiculous years in Gantt charts. 2023-05-02 09:46:59 -04:00
Sidharth Vinod
cb3982de7e Remove unnecessary dependencies
Co-authored-by: Alois Klink <alois.klink@gmail.com>
2023-05-02 14:16:35 +05:30
Steph
b30e9620f4 Update packages/mermaid/src/docs/syntax/flowchart.md
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-05-01 23:04:04 -07:00
Steph
4c9e35e269 add the latest blog post 2023-05-01 22:48:29 -07:00
eopaant
18571052ad added style to reflect true aggregation 2023-05-01 22:34:36 -05:00
Kazuki Tsunemi
0d373f3a6a Modify jsdoc of addClasses 2023-05-01 19:12:39 +09:00
Kazuki Tsunemi
70a52da393 namespace rect is not filled 2023-05-01 19:06:46 +09:00
eopaant
3549ffc4ac add master detail relationship support 2023-04-30 13:19:35 -05:00
Sidharth Vinod
c79be5d829 Merge pull request #4357 from agentraghav/code-improvment
updating es6 rules in flowchart diagram
2023-04-30 22:14:59 +05:30
raghvendra
38efaf93c8 updating es6 rules in flowchart diagram 2023-04-29 16:06:17 +05:30
Sidharth Vinod
dfa65c5fc8 remove nr 2023-04-29 11:30:11 +05:30
Sidharth Vinod
32928224e5 Remove contributor-names from git 2023-04-29 10:55:24 +05:30
Sidharth Vinod
4456c2a267 Fix user-avatar copying 2023-04-29 10:55:06 +05:30
Sidharth Vinod
9e0410e0d3 Simplify contributors 2023-04-29 10:51:03 +05:30
Sidharth Vinod
cdc68d99fe Cleanup 2023-04-29 10:50:30 +05:30
Sidharth Vinod
110cd61c64 Fix lockfile 2023-04-29 10:17:51 +05:30
Sidharth Vinod
baf5e8f6b2 Fix docs, mmd -> mermaid 2023-04-29 10:13:00 +05:30
Sidharth Vinod
99abd4c31b Fix avatar fetching 2023-04-29 10:12:47 +05:30
Sidharth Vinod
9238deaf00 Merge branch 'develop' into sidv/contributors
* develop: (237 commits)
  submit built docs
  update Font Awesome Version
  Clarify FontAwesome support
  Update version
  Fix classParser
  Check for conflict when linting jison
  Update class grammar test
  fix Class diagram grammar
  Skip sourcemap
  Bump version
  Update deps
  Fix unit tests
  Update vite
  Fix applitools cypress
  Update packages/mermaid/package.json
  chore(deps): update dependency typescript to v5
  fix typedoc
  fix(deps): update all minor dependencies
  chore(deps): update pnpm to v8
  chore(deps): update fregante/setup-git-user action to v2
  ...
2023-04-29 09:32:07 +05:30
Sidharth Vinod
a01343bf1b Fix lockfile 2023-04-27 10:37:35 +05:30
Sidharth Vinod
88f9233aa8 Merge branch 'develop' into sidv/zenuml
* develop:
  submit built docs
  update Font Awesome Version
  Clarify FontAwesome support
2023-04-27 10:36:16 +05:30
Sidharth Vinod
33c81d557e Merge pull request #4347 from josh-bouganim-avant/patch-1
Clarify FontAwesome support
2023-04-26 11:07:17 +05:30
Sidharth Vinod
91f1ef9c42 Back to JS with jsdoc types 2023-04-26 11:00:35 +05:30
Sidharth Vinod
eba3a7bdcc Add unsupported text 2023-04-26 10:55:37 +05:30
Sidharth Vinod
5bbce45c56 Reduce changes in test 2023-04-26 10:51:54 +05:30
Sidharth Vinod
395a794758 Fix deps 2023-04-26 10:37:03 +05:30
Sidharth Vinod
1f2af83a0c Fix lockfile 2023-04-26 10:35:24 +05:30
Sidharth Vinod
4d3e5e42e1 Use mdast-util-from-markdown instead of simple-markdown 2023-04-26 10:30:13 +05:30
Sidharth Vinod
9b912c4a59 handleMarkdown JS -> TS 2023-04-26 10:11:19 +05:30
Daniel Compton
c6fbabc70e Indent subgraph sections
The two subgraph paragraphs below "Subgraphs" should be
indented below it.
2023-04-26 09:39:17 +12:00
Josh Bouganim
41969c434f submit built docs 2023-04-25 20:35:45 +00:00
Sidharth Vinod
8cd48bf405 Add docs 2023-04-26 00:31:00 +05:30
Sidharth Vinod
8b18fd93f4 Add test 2023-04-26 00:20:00 +05:30
Sidharth Vinod
ec62c2bf5b Merge branch 'develop' into sidv/zenuml
* develop: (33 commits)
  Update version
  Fix classParser
  Check for conflict when linting jison
  Update class grammar test
  fix Class diagram grammar
  Skip sourcemap
  Bump version
  Update deps
  Fix unit tests
  Update vite
  Fix applitools cypress
  Update packages/mermaid/package.json
  chore(deps): update dependency typescript to v5
  fix typedoc
  fix(deps): update all minor dependencies
  chore(deps): update pnpm to v8
  chore(deps): update fregante/setup-git-user action to v2
  fix(deps): update all minor dependencies
  chore(deps): update dependency start-server-and-test to v2
  chore(deps): update dependency rimraf to v5
  ...
2023-04-26 00:15:52 +05:30
Sidharth Vinod
b9e7ba023f Update ZenUML 2023-04-26 00:12:39 +05:30
Josh Bouganim
284d032d26 update Font Awesome Version 2023-04-25 11:06:43 -07:00
Josh Bouganim
9859491381 Clarify FontAwesome support 2023-04-25 11:01:09 -07:00
Kazuki Tsunemi
95d8e3a5df Merge branch 'develop' into feature/class-namespace 2023-04-25 16:40:42 +09:00
Sidharth Vinod
56ec1ab52c Merge pull request #4338 from mermaid-js/sidv/fixClassGrammar
fix ClassGrammar
2023-04-24 20:43:48 +05:30
Sidharth Vinod
597a162249 Update version 2023-04-24 00:35:50 +05:30
Sidharth Vinod
24f5a15f20 Fix classParser 2023-04-24 00:34:41 +05:30
Sidharth Vinod
d125d22488 Check for conflict when linting jison 2023-04-24 00:15:51 +05:30
Sidharth Vinod
d09151e870 Update class grammar test 2023-04-24 00:15:30 +05:30
Sidharth Vinod
60db22886a fix Class diagram grammar 2023-04-24 00:15:07 +05:30
Sidharth Vinod
23bed7e653 Skip sourcemap 2023-04-23 23:40:24 +05:30
Sidharth Vinod
07dcb8cc44 Bump version 2023-04-23 23:38:34 +05:30
Sidharth Vinod
ba632ff65b Merge pull request #4303 from mermaid-js/MultipleUpdatesToClassDiagram
Multiple updates to class diagram
2023-04-23 23:37:24 +05:30
Sidharth Vinod
d79f946cbc Merge branch 'develop' into MultipleUpdatesToClassDiagram
* develop:
  Update deps
  Fix unit tests
2023-04-23 23:22:32 +05:30
Sidharth Vinod
b0c58a9764 Update deps 2023-04-23 23:15:26 +05:30
Sidharth Vinod
94991520ea Fix unit tests 2023-04-23 23:15:05 +05:30
Sidharth Vinod
05e7a6bd4b Merge branch 'develop' into MultipleUpdatesToClassDiagram
* develop: (30 commits)
  Update vite
  Fix applitools cypress
  Update packages/mermaid/package.json
  chore(deps): update dependency typescript to v5
  fix typedoc
  fix(deps): update all minor dependencies
  chore(deps): update pnpm to v8
  chore(deps): update fregante/setup-git-user action to v2
  fix(deps): update all minor dependencies
  chore(deps): update dependency start-server-and-test to v2
  chore(deps): update dependency rimraf to v5
  chore(deps): update dependency eslint-plugin-unicorn to v46
  chore(deps): update actions/deploy-pages action to v2
  chore(deps): update dependency eslint-plugin-jsdoc to v43
  Split docs into build and deploy
  fix(deps): update dependency dompurify to v3
  chore(deps): update dependency concurrently to v8
  Split renovate groups
  Upgrade vitepress
  chore(deps): update pnpm to v7.30.5
  ...
2023-04-23 22:50:40 +05:30
Sidharth Vinod
9298f631f9 Merge pull request #4296 from Will-Low/patch-2
Updating documentation on notes for classes within class diagrams
2023-04-23 22:48:15 +05:30
Sidharth Vinod
04305bdddc Merge pull request #4281 from mermaid-js/sidv/addUMD
Add UMD build Back
2023-04-23 22:40:01 +05:30
Sidharth Vinod
f018ca34da Merge pull request #4335 from mermaid-js/sidv/fixApplitools
Sidv/fix applitools
2023-04-23 22:35:48 +05:30
Sidharth Vinod
bbe3909627 Update vite 2023-04-23 22:34:19 +05:30
Sidharth Vinod
642397b36c Fix applitools cypress 2023-04-23 15:59:27 +05:30
Sidharth Vinod
562514964e Update packages/mermaid/package.json
Co-authored-by: Alois Klink <alois@aloisklink.com>
2023-04-23 15:49:20 +05:30
Sidharth Vinod
125be13df4 Merge branch 'develop' into sidv/addUMD
* develop: (69 commits)
  chore(deps): update dependency typescript to v5
  fix typedoc
  fix(deps): update all minor dependencies
  chore(deps): update pnpm to v8
  chore(deps): update fregante/setup-git-user action to v2
  fix(deps): update all minor dependencies
  chore(deps): update dependency start-server-and-test to v2
  chore(deps): update dependency rimraf to v5
  chore(deps): update dependency eslint-plugin-unicorn to v46
  chore(deps): update actions/deploy-pages action to v2
  chore(deps): update dependency eslint-plugin-jsdoc to v43
  Split docs into build and deploy
  fix(deps): update dependency dompurify to v3
  chore(deps): update dependency concurrently to v8
  Split renovate groups
  Upgrade vitepress
  chore(deps): update pnpm to v7.30.5
  pie diagram mermaid module import fix
  Update docs
  docs(flowchart): wrap br tag by codeblock
  ...
2023-04-23 15:31:17 +05:30
Sidharth Vinod
f3f7460706 Merge pull request #4328 from mermaid-js/renovate/typescript-5.x
chore(deps): update dependency typescript to v5
2023-04-23 13:09:44 +05:30
renovate[bot]
9e58f7bd99 chore(deps): update dependency typescript to v5 2023-04-22 20:51:24 +00:00
Sidharth Vinod
5110967bcd Merge pull request #4321 from mermaid-js/renovate/all-minor
fix(deps): update all minor dependencies (minor)
2023-04-23 02:20:12 +05:30
Sidharth Vinod
5c6773a47c Merge branch 'renovate/all-minor' of https://github.com/mermaid-js/mermaid into renovate/all-minor
* 'renovate/all-minor' of https://github.com/mermaid-js/mermaid:
  fix(deps): update all minor dependencies
  chore(deps): update pnpm to v8
  chore(deps): update fregante/setup-git-user action to v2
2023-04-23 02:04:28 +05:30
Sidharth Vinod
5634c6ca1a fix typedoc 2023-04-23 02:03:28 +05:30
renovate[bot]
1c17f4c770 fix(deps): update all minor dependencies 2023-04-22 20:30:38 +00:00
Sidharth Vinod
f17a325632 Merge pull request #4329 from mermaid-js/renovate/fregante-setup-git-user-2.x
chore(deps): update fregante/setup-git-user action to v2
2023-04-23 01:58:02 +05:30
Sidharth Vinod
9f2d14f676 Merge pull request #4330 from mermaid-js/renovate/pnpm-8.x
chore(deps): update pnpm to v8
2023-04-23 01:57:39 +05:30
renovate[bot]
bed9e8daab chore(deps): update pnpm to v8 2023-04-22 20:04:11 +00:00
renovate[bot]
4a258a0f2c chore(deps): update fregante/setup-git-user action to v2 2023-04-22 20:02:23 +00:00
renovate[bot]
e4bc3e2269 fix(deps): update all minor dependencies 2023-04-22 20:01:25 +00:00
Sidharth Vinod
a470407f02 Merge pull request #4327 from mermaid-js/renovate/start-server-and-test-2.x
chore(deps): update dependency start-server-and-test to v2
2023-04-23 01:30:16 +05:30
renovate[bot]
e6d11b9443 chore(deps): update dependency start-server-and-test to v2 2023-04-22 19:26:13 +00:00
Sidharth Vinod
c624cbb910 Merge pull request #4325 from mermaid-js/renovate/eslint-plugin-unicorn-46.x
chore(deps): update dependency eslint-plugin-unicorn to v46
2023-04-23 00:51:33 +05:30
Sidharth Vinod
b428c06bed Merge pull request #4326 from mermaid-js/renovate/rimraf-5.x
chore(deps): update dependency rimraf to v5
2023-04-23 00:51:08 +05:30
Sidharth Vinod
9cbc3d6fb9 Merge pull request #4322 from mermaid-js/renovate/actions-deploy-pages-2.x
chore(deps): update actions/deploy-pages action to v2
2023-04-23 00:50:58 +05:30
Sidharth Vinod
12ed81855a Add zenuml 2023-04-23 00:34:59 +05:30
renovate[bot]
f597f15f82 chore(deps): update dependency rimraf to v5 2023-04-22 18:53:56 +00:00
renovate[bot]
909c063a67 chore(deps): update dependency eslint-plugin-unicorn to v46 2023-04-22 18:51:50 +00:00
renovate[bot]
f93bac9dd4 chore(deps): update actions/deploy-pages action to v2 2023-04-22 18:49:44 +00:00
renovate[bot]
8cb3318d94 chore(deps): update dependency eslint-plugin-jsdoc to v43 2023-04-22 18:46:44 +00:00
Sidharth Vinod
cb1e8220a4 Merge pull request #4331 from mermaid-js/renovate/dompurify-3.x
fix(deps): update dependency dompurify to v3
2023-04-22 23:59:53 +05:30
Sidharth Vinod
49bb87e14a Split docs into build and deploy 2023-04-22 23:59:33 +05:30
renovate[bot]
ddde451915 fix(deps): update dependency dompurify to v3 2023-04-22 08:28:31 +00:00
Sidharth Vinod
40d2682b14 Merge pull request #4323 from mermaid-js/renovate/concurrently-8.x
chore(deps): update dependency concurrently to v8
2023-04-22 13:53:05 +05:30
renovate[bot]
93eb72248a chore(deps): update dependency concurrently to v8 2023-04-20 04:15:28 +00:00
Sidharth Vinod
6883a92672 Split renovate groups 2023-04-20 09:40:58 +05:30
Sidharth Vinod
2fe0a1360f Upgrade vitepress 2023-04-20 09:35:28 +05:30
Sidharth Vinod
8e0f947d6c Merge pull request #4304 from mermaid-js/renovate/patch-all-minor-patch
chore(deps): update pnpm to v7.30.5
2023-04-19 16:29:40 +05:30
renovate[bot]
411f868f22 chore(deps): update pnpm to v7.30.5 2023-04-19 07:00:59 +00:00
Sidharth Vinod
39f9277a73 Merge pull request #4316 from agentraghav/agentraghav-pie-chart-demos-fix
pie diagram mermaid module import fix
2023-04-19 12:25:59 +05:30
raghvendra
ff3104ad9c pie diagram mermaid module import fix 2023-04-19 11:25:32 +05:30
huynhicode
be69f494b7 Update docs 2023-04-18 19:43:30 +00:00
Steph
fd6d1941b7 Docs: Flowchart - minor verbiage update
Minor verbiage update to Flowchart doc
2023-04-18 12:39:35 -07:00
sidharthv96
8dfad241c3 Update docs 2023-04-18 19:00:47 +00:00
Sidharth Vinod
44f6d11537 Merge pull request #4310 from Bogay/fix/escape-br-tag-in-flowchart-doc
docs(flowchart): wrap br tag by codeblock
2023-04-19 00:27:31 +05:30
Sidharth Vinod
698951c059 Merge pull request #4309 from dix/fix_doc_obsidian_link
fix(doc): Link to Obsidian doc/integration
2023-04-19 00:26:46 +05:30
bogay
b3959299bc docs(flowchart): wrap br tag by codeblock
so that it can render `<br>` text on doc correctly.
2023-04-18 18:51:52 +08:00
dix
1d4fc5051e fix(doc): Link to Obsidian doc/integration 2023-04-18 11:37:39 +02:00
Knut Sveidqvist
6ccdc2bd01 Fix for async handling flowchart-elk 2023-04-17 19:33:51 +02:00
Will-Low
28155b0e0a Removing redundant code block 2023-04-17 10:24:06 -07:00
Will-Low
47edb2c0bb Merge branch 'mermaid-js:develop' into patch-2 2023-04-17 07:30:18 -07:00
Justin Greywolf
642bc1a739 update tests for package visibility 2023-04-17 07:24:27 -07:00
Justin Greywolf
5b0eb702e5 Merge branch 'develop' into MultipleUpdatesToClassDiagram 2023-04-17 06:51:51 -07:00
Justin Greywolf
62870597d6 Fixed failing tests 2023-04-17 06:51:08 -07:00
Sidharth Vinod
01de155e3c Merge pull request #4278 from lishid/patch-2
Fix git graph css bracket leak
2023-04-17 17:29:27 +05:30
Sidharth Vinod
0485999636 Merge pull request #4299 from eitsupi/patch-1
docs(integrations): list quarto
2023-04-17 17:26:53 +05:30
Sidharth Vinod
f638082ab4 Merge pull request #4297 from bish0polis/develop
Update bug_report.yml
2023-04-17 17:26:18 +05:30
Justin Greywolf
59a85a7dfd Multiple Fixes to classes 2023-04-16 19:42:51 -07:00
Kazuki Tsunemi
204baa4586 Merge branch 'develop' into feature/class-namespace 2023-04-17 11:27:10 +09:00
eitsupi
432e8d6535 docs: reflect source changes 2023-04-15 17:01:51 +09:00
eitsupi
8c4fb6c753 docs(integrations): list quarto 2023-04-15 16:49:32 +09:00
Justin Greywolf
ac63788a9c organized and fixed tests 2023-04-14 10:13:21 -07:00
Alois Klink
32538b5b03 Merge branch 'develop' into lishid/patch-2
The E2E tests are failing, but will probably be fixed by commit
9bb0cef8 (fix: wait for image rendering in nodes, 2023-03-30)
on the `develop` branch.
2023-04-14 02:09:22 +01:00
Bishop Clark
8aa51cf3e7 Update bug_report.yml
correct adjective order
2023-04-13 16:59:13 -07:00
Will-Low
e3ca003127 Rebuilding docs 2023-04-13 09:59:11 -07:00
Will-Low
19363965ad Updating documentation on notes for classes
I was confused by the documentation on notes for a specific class. Updated the wording slightly and added an example for clarity.
2023-04-13 09:08:48 -07:00
Sidharth Vinod
32d553a28f Merge pull request #4213 from remcohaszing/fix-node16-module-resolution
Support node16 module resolution
2023-04-13 21:03:27 +05:30
Remco Haszing
e84c5ec4c9 Fix broken tests 2023-04-13 15:13:52 +02:00
Remco Haszing
aa5c1a5f78 Merge branch 'develop' into fix-node16-module-resolution 2023-04-13 14:58:17 +02:00
Sidharth Vinod
d9ebb0d492 Merge pull request #4295 from aloisklink/test/test-styles
Fix and test a bunch of invalid CSS issues
2023-04-13 18:08:11 +05:30
Sidharth Vinod
634d6602b9 Merge pull request #4272 from slab/develop
Add Slab to the list of integrations
2023-04-13 18:05:24 +05:30
Sidharth Vinod
ea6f9c2d59 Merge pull request #4286 from legonigel/4195_arrow_end_size
Fix #4195 start and end arrow have different sizes
2023-04-13 15:05:56 +05:30
Sidharth Vinod
dda2c25d52 Merge pull request #4294 from onayiga/Documentation-edits
Update index.md
2023-04-13 15:04:28 +05:30
Zihua Li
d13b58bec8 Merge branch 'mermaid-js:develop' into develop 2023-04-13 16:00:01 +08:00
Alois Klink
b4164b6ab5 test: test that styles and themes return valid CSS
Test that `src/diagrams/*/styles.ts` module returns a valid
CSS stylesheet that can be parsed via [stylis][1] and then
becomes a valid CSS that [csstree-validator][2] validates.

We test this for every diagram and for every theme, because
many of the invalid CSS bugs are caused by missing theme vars.

There are some CSS errors that I couldn't easily fix, so I've written
the tests to ignore the following CSS errors:
  - 'Unknown property `rx`' (Valid in SVG2 draft and in some browsers)
  - 'Unknown property `ry`' (Valid in SVG2 draft and in some browsers)
  - 'Unknown property `dy`'
    - This doesn't seem to be valid CSS in any SVG version, but maybe
      some browsers support it 🤷 I feel like we should probably change
      this though.

[1]: https://github.com/thysultan/stylis
[2]: https://github.com/csstree/validator
2023-04-13 08:27:32 +01:00
Alois Klink
aee18ca018 fix: fix scaleLabelColor in theme forest/neutral
The `scaleLabelColor` variable in `theme-forest` and `theme-neutral`
was set to `"calculated"`, as it defaults to `this.labelTextColor`
**before** `this.labelTextColor` was set.

Moving the `this.labelTextColor` assignments before `scaleLabelColor`
is calculated fixes this.

Fixes mindmap and timeline invalid CSS in theme forest and neutral.
2023-04-13 07:32:18 +01:00
Alois Klink
cd976871f0 fix: define gitBranchLabel* in theme forest/dark
Define `gitBranchLabel[0-7]` in `theme-dark` and `theme-forest` to fix
invalid CSS for gitgraphs.

The values have been copied from [`theme-default`][1]).

[1]: 727bf30824/packages/mermaid/src/themes/theme-default.js (L296-L303)
2023-04-13 07:32:18 +01:00
Alois Klink
4f9c4548bf fix: define excludeBkgColor for theme-dark
Define `excludeBkgColor` for `theme-dark` to fix invalid CSS
for gantt diagrams.

All the other themes defined this to '#eeeeee', but I thought that
was a bit too bright in a dark theme, so instead I set it to
`darken(this.sectionBkgColor, 10);`.
2023-04-13 07:32:18 +01:00
Alois Klink
720408e143 fix: define border2 for theme-base
`border2` is a theme variable used by the CSS for flowcharts and
user-journey.

I've defined this to default to `tertiaryBorderColor` in theme-base,
as other themes tend to set `border2` to the same value as
`clusterBorder`, which in theme-base is `tertiaryBorderColor`.
2023-04-13 07:32:18 +01:00
Alois Klink
54f827d850 fix: define arrowheadColor for theme-base
Define `arrowheadColor` as `invert(this.background)` in
`theme-base.js`, as it's currently `undefined`, which causes CSS
issues when using `theme-base`.

I've picked `invert(this.background)` so that it matches
the default value of `lineColor`.
2023-04-13 07:32:18 +01:00
Alois Klink
7566b5620e fix: fix requirementBorderSize theme variable
Currently, `requirementBorderSize` defaults to `primaryBorderColor`,
which is a color, not a valid SVG `stroke-width`.

Instead, I've made it default to `1`.
2023-04-13 07:32:18 +01:00
Alois Klink
9cb7a4a3f5 fix: fix invalid CSS fill-opacity value
Fix an invalid value for the CSS `fill-opacity` value.

Percentage values for `fill-opacity` are only supported in the SVG 2.0
draft, so according to [MDN][1]:

> it is not widely supported yet, […] as a consequence, it is best
> practices [sic] to set opacity with a value in the range `[0-1]`.

[1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity
2023-04-13 07:32:18 +01:00
Alois Klink
616d370a51 fix: fix personBorder/Bkg C4 diagram theme vars
The current `personBorder`/`personBkg` theme variables for C4 diagrams
are set to the string `'calculated'`.

However, despite being `'calculated'`, they never seem to change to
anything else, and so become invalid CSS variables.

I've instead changed these to just default to base theme vars,
as that's what they do in [`these-base.js`][1].

[1]: 727bf30824/packages/mermaid/src/themes/theme-base.js (L106-L107)
2023-04-13 07:32:18 +01:00
Alois Klink
83d7d6c48f fix: fix invalid CSS for class diagram
`.divider` had a `stroke` property of `1` that was invalid.

This looks like a typo from PR
https://github.com/mermaid-js/mermaid/pull/1567,
as the `src/theme/class.scss` file's `.divider` section correctly
shows `stroke-width: 1;`.

Fixes: https://github.com/mermaid-js/mermaid/pull/1567
2023-04-13 07:32:18 +01:00
onayiga
1c98621cf4 Update index.md
Minor grammatical and editorial changes; Updated Mermaid API section to make use of active voice for enhanced readability and comprehension.
2023-04-12 23:12:16 -04:00
Justin Greywolf
727bf30824 Merge pull request #4268 from Valentine14th/bug/4023-image-rendering
fix: image rendering in nodes
2023-04-10 10:09:40 -07:00
legonigel
aa3c0023f4 Fix #4195 start and end arrow have different sizes
In #3938, it appears that the marker sizes for pointEnd was
unintentionally changed. This reverts the change in marker size.

It is also possible that the intention was to change the viewBox size
for both start and end, but I doubt this since it makes the arrows
significantly smaller than other markers.
2023-04-09 20:56:00 -07:00
Sidharth Vinod
f08778d0c7 Merge pull request #4285 from emersonbottero/dayjs-esm
fix: really import esm version of dayjs
2023-04-09 11:19:42 +05:30
Emerson Bottero
37eb100bb2 chore: add files to imports 2023-04-08 23:50:10 -03:00
Laura Valentine Tscharner
9bb0cef82b fix: wait for image rendering in nodes 2023-04-08 16:28:58 +01:00
Emerson Bottero
4643bb1c00 fix: really import esm version of dayjs 2023-04-07 23:38:05 -03:00
Knut Sveidqvist
d132d26246 Merge branch 'master' into develop 2023-04-06 08:33:18 +02:00
Sidharth Vinod
24c9506935 fix version 2023-04-05 22:07:46 +05:30
Sidharth Vinod
ca8ce8201c Merge branch 'develop' into sidv/addUMD
* develop: (81 commits)
  revert pnpm changes
  doc update
  auto generated from pnpm run
  auto generated from pnpm run
  linting
  added example of Bar chart
  Update docs
  Adding rendering tests and unit tests
  Syntax for markdown strings is a single backtick.
  updated labels in the chart
  Update docs
  updated example data smaller
  Bar chart
  fix: Remove comment line completely
  fix: trimStart to text
  test: add space before init
  fix uncaughexception in tests
  fix(#4256): Keep error diagram on screen
  fix(#4137): Cleanup comments before parsing
  Update docs
  ...
2023-04-05 22:04:53 +05:30
Sidharth Vinod
777a781052 Merge pull request #4261 from karistom/develop
Bar chart (using gantt chart)
2023-04-05 16:37:06 +05:30
Sidharth Vinod
d1e369e68d revert pnpm changes 2023-04-05 16:32:48 +05:30
chriskim-au1
3b861ab91f doc update 2023-04-05 13:11:22 +10:00
Ch K
721208e981 auto generated from pnpm run 2023-04-05 11:31:44 +10:00
Ch K
ee455c1edb auto generated from pnpm run 2023-04-05 11:26:28 +10:00
Ch K
43137fbdb2 Merge branch 'mermaid-js:develop' into develop 2023-04-05 10:12:12 +10:00
Ch K
7ac84fb9af linting 2023-04-05 09:18:11 +10:00
Ch K
efc4062721 added example of Bar chart 2023-04-05 09:07:01 +10:00
Lishid
5693f63603 Fix git graph css bracket leak 2023-04-04 11:22:19 -04:00
Knut Sveidqvist
8e6d16e601 Update docs 2023-04-04 15:53:53 +02:00
knsv
e96c8306d1 Update docs 2023-04-04 13:46:55 +00:00
Knut Sveidqvist
756fc06c5d 2w is anough, 4 is just too much 2023-04-04 15:43:33 +02:00
Knut Sveidqvist
80df10067d Adding Mermaid Strings to news 2023-04-04 15:39:23 +02:00
Knut Sveidqvist
e7c237dcf3 Merge branch 'release/10.1.0' 2023-04-04 15:19:15 +02:00
Knut Sveidqvist
75adb8ae90 Updated package.json 2023-04-04 14:38:09 +02:00
Knut Sveidqvist
fc1962c795 Version set 10.1.0 and fix for label centering 2023-04-04 14:36:05 +02:00
Knut Sveidqvist
1a56a18f9b Fixing issues with centering of labels for subgraphs and handling of special characters in html strings 2023-04-04 12:49:14 +02:00
Knut Sveidqvist
1841346ff6 Fixing issues in mindmaps and class diagram notes after tests 2023-04-04 10:45:39 +02:00
Knut Sveidqvist
e8799ad515 Merge remote-tracking branch 'origin/release/10.1.0' into release/10.1.0 2023-04-04 08:29:54 +02:00
Knut Sveidqvist
2b9872d656 Some styling fixes for markdown strings 2023-04-04 08:29:15 +02:00
Knut Sveidqvist
9ffd4d2344 Merge pull request #4254 from mermaid-js/add-latest-news-section
Docs: add Latest News section
2023-04-04 08:27:11 +02:00
Steph
815f4cab73 add blog post 2023-04-03 10:48:59 -07:00
Zihua Li
bc573ef0bb Add Slab to the list of integrations 2023-04-03 23:17:29 +08:00
Knut Sveidqvist
5d536b9973 Adding documentation for markdown strings 2023-04-03 14:41:13 +02:00
Knut Sveidqvist
6807c48f9a Merge pull request #4271 from mermaid-js/4220-string-synax-and-features
4220 string synax and features
2023-04-03 12:36:09 +02:00
knsv
c777f9193d Update docs 2023-04-03 10:35:19 +00:00
Knut Sveidqvist
917a54f3cd Merge branch 'develop' into 4220-string-synax-and-features 2023-04-03 12:31:56 +02:00
Knut Sveidqvist
471c842a58 Adding rendering tests and unit tests 2023-04-03 12:12:51 +02:00
Knut Sveidqvist
99f65813a1 Syntax for markdown strings is a single backtick. 2023-04-03 10:43:15 +02:00
Remco Haszing
da7725f38e Merge branch 'develop' into fix-node16-module-resolution 2023-04-01 12:05:19 +02:00
Sidharth Vinod
7e610d13dc Merge pull request #4207 from aloisklink/test/4198-fix-gantt-today-marker-tests
Fix broken Gantt  `todayMarker` tests
2023-03-31 18:23:06 +05:30
Ch K
64baf2d365 updated labels in the chart 2023-03-31 18:01:28 +11:00
knsv
f9c0f1d46f Update docs 2023-03-31 06:46:34 +00:00
Knut Sveidqvist
3823ecafb1 Merge pull request #4238 from JeremyFunk/feature/1618_repeating_tasks
Implement repeating tasks
2023-03-31 08:43:13 +02:00
Knut Sveidqvist
057c9e4b81 Merge branch 'develop' into feature/1618_repeating_tasks 2023-03-31 08:42:10 +02:00
Ch K
e6db9e8fc3 updated example data smaller 2023-03-31 17:36:50 +11:00
Knut Sveidqvist
c4e4efd4b8 Merge pull request #4258 from mermaid-js/sidv/fix/4256
fix(#4256): Keep error diagram on screen
2023-03-31 08:34:53 +02:00
Knut Sveidqvist
da066553bd Merge pull request #4257 from mermaid-js/sidv/fix/4137
fix(#4137): Cleanup comments before parsing
2023-03-31 08:32:55 +02:00
Ch K
a58d014a13 Bar chart 2023-03-31 17:00:53 +11:00
Sidharth Vinod
006da82470 fix: Remove comment line completely 2023-03-31 00:35:56 +05:30
Sidharth Vinod
1945a62990 fix: trimStart to text 2023-03-31 00:25:33 +05:30
Sidharth Vinod
d16894daf4 test: add space before init 2023-03-31 00:18:53 +05:30
Sidharth Vinod
4d933f6b72 Merge pull request #4253 from remcohaszing/export-mermaid-type
Define and export the Mermaid type
2023-03-30 23:56:48 +05:30
Justin Greywolf
e357bbee42 Refactor to consolidate shared svgDraw components 2023-03-30 11:04:19 -07:00
Sidharth Vinod
7739302ee8 fix uncaughexception in tests 2023-03-30 23:28:41 +05:30
Sidharth Vinod
46ab6f46f2 fix(#4256): Keep error diagram on screen 2023-03-30 23:09:46 +05:30
Sidharth Vinod
48d267c6dc fix(#4137): Cleanup comments before parsing 2023-03-30 22:08:50 +05:30
Jeremy Funk
15af3ea585 Update docs 2023-03-29 23:53:12 +02:00
Steph
35366f79ac add announcements page content 2023-03-29 14:48:09 -07:00
Steph
4c0980629c add blog page content 2023-03-29 14:46:19 -07:00
Steph
8bd2c0f272 create announcements and blog pages 2023-03-29 14:27:04 -07:00
Steph
2896865163 add latest news section 2023-03-29 14:23:44 -07:00
Sidharth Vinod
a49cdabd6c Add Slack invite link 2023-03-29 21:50:15 +05:30
Remco Haszing
2dd6329872 Define and export the Mermaid type
This represents the type of the default export. This is useful when it’s
being passed around or declared as a global.
2023-03-29 16:55:58 +02:00
Knut Sveidqvist
507a518a91 Bugfix for port selection when using diamonds in elk layout of flowcharts 2023-03-29 16:17:59 +02:00
Knut Sveidqvist
4caf7d7c7b Adding support for markdown string in flowchart-elk 2023-03-29 16:01:08 +02:00
Knut Sveidqvist
89193d7360 Simple markdown in lock file 2023-03-29 09:35:42 +02:00
Knut Sveidqvist
89eec225ce Merge branch 'develop' into 4220-string-synax-and-features 2023-03-29 09:34:49 +02:00
Knut Sveidqvist
cbc2df1ff6 Merge branch 'develop' into feature/1618_repeating_tasks 2023-03-29 09:23:18 +02:00
Knut Sveidqvist
e4a2c74b1b Merge pull request #4247 from kshitijsaksena/bug/4137_fix_comment_bug
Updated render to remove comments from text
2023-03-28 16:26:54 +02:00
Knut Sveidqvist
63160293c7 Updating support for the new type of strings for flowcharts-v2 2023-03-28 15:28:52 +02:00
Knut Sveidqvist
9c0cb3f320 Merge pull request #4249 from aloisklink/build/remove-use-inline-specifiers-lockfile-format-from-npmrc
Remove inline-specifiers pnpm option from `.npmrc` file to avoid merge conflicts
2023-03-27 16:27:30 +02:00
Knut Sveidqvist
fbeb016398 test commit 2023-03-27 14:43:59 +02:00
Alois Klink
093f1697e1 build: remove inline-specifiers pnpm option
Remove the `use-inline-specifiers-lockfile-format=true` pnpm option
from our `.npmrc` file.

This was added in
[PNPM version v7.7.0](https://github.com/pnpm/pnpm/releases/tag/v7.7.0)
and should make our `pnpm-lock.yaml` file much nicer,
but unfortunately, renovate doesn't seem to support it (unsure why?).

This means that whenever we do a `pnpm install` locally, the lock-file
gets changed, and whenever renovate makes a PR, it changes the
lock-file back. This causes a lot of unnecassary merge conflicts.
2023-03-25 21:16:45 +00:00
Alois Klink
f56e0bd530 Merge pull request #4246 from piradata/patch-1
Fix hexagon node flowchart code example in docs
2023-03-25 21:09:57 +00:00
PIRADATA
022e6670d0 docs: fix hexagon node flowchart code example
Use `mermaid-example` instead of `mmd` so that Mermaid formats
the code properly.
2023-03-25 20:13:04 +00:00
Kshitij
e3760d1709 Fixed regex bug 2023-03-25 20:13:30 +05:30
Kshitij
0475591fb6 Updated render to remove comments from text 2023-03-25 15:46:52 +05:30
Jeremy Funk
ba1c5dc6c7 Change to using display mode yaml 2023-03-25 01:56:50 +01:00
Jeremy Funk
2f8c571a5c Fix unit test 2023-03-24 00:37:25 +01:00
Jeremy Funk
a70b3a881d Add comment 2023-03-24 00:22:52 +01:00
Jeremy Funk
950f560d81 Refactor 2023-03-24 00:20:36 +01:00
Jeremy Funk
fd9680a050 Fix bug 2023-03-24 00:18:52 +01:00
Jeremy Funk
2d815e9626 Add documentation 2023-03-24 00:09:06 +01:00
Jeremy Funk
8c0550b2b7 Code refactoring, add e2e test 2023-03-23 23:45:59 +01:00
Jeremy Funk
f054609e02 Add test, fix typo 2023-03-23 22:58:46 +01:00
Jeremy Funk
45c0c5fee0 Bugfix 2023-03-23 22:54:58 +01:00
Jeremy Funk
a535fe1679 Bugfixes, refactor, add compact 2023-03-23 22:38:04 +01:00
Alois Klink
e4d2118d4b Merge pull request #4231 from mermaid-js/renovate/patch-all-minor-patch
chore(deps): update pnpm to v7.30.1
2023-03-23 20:04:30 +00:00
Alois Klink
1184fce148 Merge pull request #4237 from xuanxu/patch-1
Fix typos in timeline docs
2023-03-23 20:00:39 +00:00
Alois Klink
a79f118323 Merge pull request #4230 from vorburger/patch-1
docs: Remove repeated phrase
2023-03-23 19:58:11 +00:00
Juanjo Bazán
6cba2ea02d docs: fix typos in timeline.md 2023-03-23 19:46:17 +00:00
Michael Vorburger ⛑️
3add711c55 docs: Remove repeated phrase 2023-03-23 19:42:33 +00:00
renovate[bot]
1481a8ccb1 chore(deps): update pnpm to v7.30.1 2023-03-23 19:04:24 +00:00
Jeremy Funk
b3b7108d59 Implement basic repeating tasks 2023-03-22 23:15:54 +01:00
Knut Sveidqvist
fd9ad95346 #4220 Handling paragraphs and html labels with classes in mindmaps. 2023-03-22 18:41:31 +01:00
Knut Sveidqvist
a1c50b8079 #4220 Parsing the text as markdown and rendering accordingly 2023-03-20 14:15:26 +01:00
Remco Haszing
4515c58d42 Merge branch 'develop' into fix-node16-module-resolution 2023-03-20 12:24:29 +01:00
Remco Haszing
0dc6e0a0d9 Update cypress mermaid imports 2023-03-20 12:21:22 +01:00
renovate[bot]
8b37ceffe1 chore(deps): update pnpm to v7.30.0 2023-03-20 04:21:23 +00:00
Remco Haszing
b719fa9b18 Fix Cypress tests 2023-03-17 20:53:13 +01:00
Remco Haszing
f3bebf25ea Merge branch 'develop' into fix-node16-module-resolution 2023-03-17 20:52:50 +01:00
Alois Klink
7647ae317a Merge pull request #4228 from remcohaszing/update-types-lodash-es
Update @types/lodash-es
2023-03-17 18:52:30 +00:00
Remco Haszing
8c69ecd5ac Update @types/lodash-es
This adds support for the TypeScript `"moduleResolution": "node16"`.
2023-03-17 12:26:41 +01:00
Kazuki Tsunemi
b725b69fda Add package of class diagrams to doc 2023-03-17 14:47:32 +09:00
Kazuki Tsunemi
b51b2c7b04 Add namespace sample to README 2023-03-17 14:21:31 +09:00
Knut Sveidqvist
dc98fe6a3b Merge pull request #4226 from mermaid-js/updates-homepage
Updates to the Homepage
2023-03-16 16:28:27 +01:00
Steph
b56c8a2a7a fix favicon resolution 2023-03-16 08:13:10 -07:00
Steph
d18dff65e1 add hover effect to mc icon and update cspell 2023-03-16 08:12:53 -07:00
Steph
2dc71377dc add team member 2023-03-16 08:12:42 -07:00
Steph
89b9868870 update cards 2023-03-16 08:11:29 -07:00
Steph
b232f20169 add mermaid chart logo and link to navbar 2023-03-16 08:11:03 -07:00
sidharthv96
2dd906d809 Update docs 2023-03-15 07:50:54 +00:00
Sidharth Vinod
fb70091046 Merge pull request #4221 from Whoeza/patch-1
typo fix
2023-03-15 13:17:34 +05:30
Kazuki Tsunemi
434961b44a Implement rendering logic 2023-03-15 13:26:51 +09:00
Kazuki Tsunemi
75502d076e Implement database for namespace data 2023-03-15 12:43:21 +09:00
Kazuki Tsunemi
4017bb3c49 Implement namespace parser 2023-03-15 12:18:52 +09:00
Kazuki Tsunemi
c1df62638d class body grammer apply to class stetement only 2023-03-15 12:05:57 +09:00
Chuck
ddd245de71 typo fix 2023-03-14 20:35:39 +01:00
Knut Sveidqvist
853d9b7f98 #4220 Create text utility functions handling new lines and applying them on mindmap 2023-03-14 13:52:20 +01:00
renovate[bot]
f3a9f81bfb fix(deps): update all non-major dependencies 2023-03-13 09:45:30 +00:00
renovate[bot]
4b462d717c chore(deps): update node.js to v18.15.0 2023-03-13 04:42:20 +00:00
Remco Haszing
fc80ba66d2 Fix import extensions 2023-03-11 15:27:16 +01:00
Remco Haszing
fd013286f6 Fix vue import error 2023-03-11 15:07:12 +01:00
Remco Haszing
b7d31adda4 Support node16 module resolution
The `node16` module resolution requires imports to use the `.js` file
extension in type definitions.

`@rollup/plugin-typescript` is needed to make this work with the Vite
setup used by Mermaid.

The module option for Mermaid internally is set to `nodenext`. This is
needed to support `.json` imports. Note that setting `module` to
`node16` or `nodenext` implies a matching `moduleResolution` value.
2023-03-11 14:54:21 +01:00
sidharthv96
273a9e7ad6 Update docs 2023-03-10 19:53:13 +00:00
Sidharth Vinod
f75bd397f8 Merge pull request #4209 from RobertWeinmeister/doc/dokuwiki_plugin
Updated DokuWiki plugin for Mermaid integration
2023-03-11 01:20:06 +05:30
Sidharth Vinod
f70d52510a Merge pull request #4210 from andrew-clarkson/patch-1
v smol fixes while reading thru docs
2023-03-11 01:18:56 +05:30
Sidharth Vinod
f0c24d9ec5 Merge pull request #4211 from andrew-clarkson/patch-2
Remove duplication in "A hexagon node"
2023-03-11 01:18:04 +05:30
Andrew Clarkson
708633f639 Remove duplication in "A hexagon node" 2023-03-10 13:25:14 -05:00
Andrew Clarkson
2e174bb3b6 v smol fixes while reading thru docs 2023-03-10 13:12:21 -05:00
Robert Weinmeister
160fe0f971 Updated DokuWiki plugin for Mermaid integration
The plugin Mermaid for DokuWiki replaces the no longer supported plugin flowcharts.
2023-03-10 10:05:59 +01:00
Alois Klink
58d4ba0d8f test(e2e): fix gantt todayMarker tests
The gantt diagram that were supposed to test whether
`todayMarker off` works wasn't working properly, because
`todayMarker on` wasn't working (i.e. the test never failed).

I've fixed this issue, and added a test that checks whether
`todayMarker on` works.

Fixes: https://github.com/mermaid-js/mermaid/issues/4198
2023-03-09 19:18:22 +00:00
Sidharth Vinod
155e729722 Merge pull request #4197 from mre/update-ignored-links
Clean up list of ignored links
2023-03-09 02:34:04 +05:30
Matthias
a17463307b Clean up list of ignored links
The removed links work again.
2023-03-08 21:30:12 +01:00
Sidharth Vinod
4e4f2fcfc5 Merge branch 'master' into develop
* master:
  Updated import of cytoscape for consistent behavior
  v9.4.3
  fix: dayjs import extension
  9.4.2
  Fix mindmap demo
  9.4.2-rc.2
  chore: Rename diagram-definitions with specific names
  Use cytoscape esm
  Revert "chore: Defer elk loading"
  Revert "Split cytoscape"
  test(gantt): test daylight savings in ganttdb
  refactor(deps): replace `moment` with `dayjs`
  fix(E2E): Add cors package
  fix Server
  Fix lockfile
  Remove Readme
2023-03-08 00:13:54 +05:30
Sidharth Vinod
759ab0c0f9 Merge branch 'release/9.4.3'
* release/9.4.3:
  Updated import of cytoscape for consistent behavior
  v9.4.3
  fix: dayjs import extension
2023-03-08 00:13:27 +05:30
Knut Sveidqvist
1a7b8d3897 Updated import of cytoscape for consistent behavior 2023-03-07 23:30:44 +05:30
Sidharth Vinod
f5e7abb71f v9.4.3 2023-03-07 23:29:22 +05:30
Sidharth Vinod
1412bb4e94 fix: dayjs import extension 2023-03-07 22:40:50 +05:30
Sidharth Vinod
328f3968d1 Merge branch 'release/9.4.2'
* release/9.4.2:
  9.4.2
  Fix mindmap demo
  9.4.2-rc.2
  chore: Rename diagram-definitions with specific names
  Use cytoscape esm
  Revert "chore: Defer elk loading"
  Revert "Split cytoscape"
  test(gantt): test daylight savings in ganttdb
  refactor(deps): replace `moment` with `dayjs`
  fix(E2E): Add cors package
  fix Server
  Fix lockfile
  Remove Readme
2023-03-07 21:33:23 +05:30
Sidharth Vinod
c965e4c456 9.4.2 2023-03-07 21:20:32 +05:30
Sidharth Vinod
86aa7ab91e Fix mindmap demo 2023-03-07 18:09:33 +05:30
Sidharth Vinod
141d38b4e7 Merge pull request #4181 from ischanx/fix-getbbox-cache
fix(squence): getBBox() returns zero
2023-03-07 11:16:42 +05:30
Sidharth Vinod
98af37f09f Merge pull request #4183 from mermaid-js/sidv/fix/1066
fix(#1066): Return true if parse is success.
2023-03-07 11:16:25 +05:30
Sidharth Vinod
a57e392ed4 Merge pull request #4187 from Pr0dt0s/feature/4156_expose_detectType
Expose detectType function
2023-03-07 09:40:50 +05:30
Sidharth Vinod
993a19e15b Merge branch 'develop' into sidv/fix/1066
* develop:
  ci(e2e): skip caching in actions/setup-node
  chore: add default entry to exports
  Fix: add require entry in package.json
2023-03-07 09:39:10 +05:30
Sidharth Vinod
533830172c Add UMD back 2023-03-07 09:38:51 +05:30
Sidharth Vinod
7bea44e752 Merge pull request #4194 from mermaid-js/chore/skip-setup-node-caching-in-e2e-ci
CI(e2e): Skip caching in `actions/setup-node`, as `cypress-io/github-action` already caches for us
2023-03-07 08:34:06 +05:30
Alois Klink
f0a73696f5 ci(e2e): skip caching in actions/setup-node
Skip caching `pnpm` in `actions/setup-node`,
because the `cypress-io/github-action` natively supports caching `pnpm`,
as of [cypress-io/github-action@v4.2.0][1].

[1]: https://github.com/cypress-io/github-action/releases/tag/v4.2.0
2023-03-06 22:57:22 +00:00
Pedro Reyes
878c9f1d9d Add documentation for exposed detectType function 2023-03-06 19:32:34 -03:00
Pedro Reyes
8ebd550e0b Merge branch 'mermaid-js:develop' into feature/4156_expose_detectType 2023-03-06 19:29:59 -03:00
Sidharth Vinod
6b5221e465 Merge pull request #4164 from lceconi/patch-1
Fix: add require entry in package.json
2023-03-06 18:00:37 +05:30
Laura Ceconi
8f0cb695e7 chore: add default entry to exports 2023-03-06 12:15:22 +01:00
Sidharth Vinod
1913aad03f Merge branch 'develop' into sidv/fix/1066
* develop:
  fix(deps): update all non-major dependencies
  chore(deps): update all non-major dependencies
  Update Diagram.ts
  Update Diagram.ts
  feat: added internal label
  feat: improve documentation
  make clearer
  fix: invalid url and generate docs
  Update integrations.md to include Mermaid Flow
  feat: expose the diagram api
  fixup! fixup! Move pie outerStrokeWidth to theme variables, update docs
  fixup! Move pie outerStrokeWidth to theme variables, update docs
  Move pie outerStrokeWidth to theme variables, update docs
  fixup! fixup! feat(pie): adding outer border, text position options
  fixup! feat(pie): adding outer border, text position options
  Update packages/mermaid/src/diagrams/pie/pieRenderer.js
  feat(pie): adding outer border, text position options
2023-03-06 14:04:00 +05:30
Sidharth Vinod
b80da0daa1 Merge pull request #4174 from ted-marozzi/feature/4172_expose_diagram_api
feat: expose the diagram api
2023-03-06 14:00:02 +05:30
Sidharth Vinod
c2035c3709 Merge pull request #4186 from ted-marozzi/docs/make_docs_contributing_clearer
docs: make contributing to docs a bit clearer
2023-03-06 13:55:47 +05:30
Sidharth Vinod
d77be9546d Merge pull request #4190 from mermaid-js/renovate/patch-all-minor-patch
fix(deps): update all non-major dependencies (patch)
2023-03-06 13:54:57 +05:30
renovate[bot]
e9d49e6b98 fix(deps): update all non-major dependencies 2023-03-06 06:25:39 +00:00
renovate[bot]
6c2c28940b chore(deps): update all non-major dependencies 2023-03-06 06:22:18 +00:00
Ted Marozzi
72c94b6e6e Update Diagram.ts 2023-03-06 10:19:06 +11:00
Ted Marozzi
44d806e7f5 Update Diagram.ts 2023-03-06 10:17:43 +11:00
Alois Klink
727c56dbb1 Merge pull request #4184 from ted-marozzi/patch-1
Update integrations.md to include Mermaid Flow Visual Editor
2023-03-05 23:12:50 +00:00
Pedro Reyes
526e8fa1ad Expose detectType function 2023-03-05 15:55:54 -03:00
Ted Marozzi
969088187c feat: added internal label 2023-03-06 05:28:34 +11:00
Ted Marozzi
649e6820cc feat: improve documentation 2023-03-06 05:18:33 +11:00
Ted Marozzi
8027a0c55d make clearer 2023-03-06 04:55:59 +11:00
Ted Marozzi
d65d4fc39f fix: invalid url and generate docs 2023-03-06 04:44:47 +11:00
sidharthv96
f7f6cc73f5 Update docs 2023-03-05 05:52:51 +00:00
Sidharth Vinod
55ebfadb32 Update packages/mermaid/src/mermaidAPI.ts
Co-authored-by: Alois Klink <alois@aloisklink.com>
2023-03-05 11:19:40 +05:30
Ted Marozzi
c5a5a22b72 Update integrations.md to include Mermaid Flow
the interative visual mermaid editor!
2023-03-05 14:33:46 +11:00
Sidharth Vinod
ad52d7d823 Merge pull request #4145 from Billiam/feature/move-pie-labels
Pie: Adding outer border, text position options
2023-03-05 00:33:15 +05:30
Sidharth Vinod
b9576b4bbe Merge branch 'develop' into sidv/fix/1066
* develop:
2023-03-05 00:29:52 +05:30
Sidharth Vinod
f57fed0eb4 Merge branch 'master' into develop
* master:
  v10.0.2
  fix: dayjs import extension
  Setting version to 10.0.1
  #4168 Adding the correct offset for the edges
  Updated import of cytoscape for consistent behavior
  Use cytoscape esm
  Revert "chore: Defer elk loading"
  Revert "Split cytoscape"
  fix: Class with members and styles
2023-03-05 00:29:35 +05:30
Sidharth Vinod
4e344df204 Merge branch 'develop' into sidv/fix/1066
* develop:
  Update bug_report.yml
2023-03-05 00:25:20 +05:30
Sidharth Vinod
43762c4d7f fix(#1066): Return true if parse is success. 2023-03-05 00:22:02 +05:30
ischanx
4d1d1c36de fix(squence): getBBox() returns zero 2023-03-04 00:06:03 +08:00
Sidharth Vinod
e603840395 Update bug_report.yml 2023-03-03 11:55:18 +05:30
Knut Sveidqvist
c7bcd74d56 Merge branch 'release/10.0.2' 2023-03-02 13:47:19 +01:00
Ted Marozzi
51c6462f1d feat: expose the diagram api 2023-03-02 19:17:14 +11:00
Billiam
8810b378b3 fixup! fixup! Move pie outerStrokeWidth to theme variables, update docs 2023-02-28 13:48:50 -06:00
Billiam
c3064f396c fixup! Move pie outerStrokeWidth to theme variables, update docs 2023-02-28 13:44:09 -06:00
Billiam
82f5b4ca39 Move pie outerStrokeWidth to theme variables, update docs 2023-02-28 13:27:09 -06:00
Laura Ceconi
73ce499863 Fix: add require entry in package.json 2023-02-28 18:53:03 +01:00
Sidharth Vinod
1ecf15669a 9.4.2-rc.2 2023-02-28 21:51:31 +05:30
Sidharth Vinod
d24ddca03f chore: Rename diagram-definitions with specific names 2023-02-28 21:49:49 +05:30
Sidharth Vinod
a7847038a5 Use cytoscape esm 2023-02-28 21:45:07 +05:30
Sidharth Vinod
b6db75fe3e Revert "chore: Defer elk loading"
This reverts commit 037504785c.
2023-02-28 21:44:55 +05:30
Sidharth Vinod
2a838e645c Revert "Split cytoscape"
This reverts commit f81f9f7c95.
2023-02-28 21:44:48 +05:30
Alois Klink
61bf7c577c test(gantt): test daylight savings in ganttdb
Add a quick test that ensures `ganttDb` correctly adds `1d` (1 day),
even on days with 25 hours.

This test only runs if the test PC has the TZ='America/Los_Angeles'
set (California has daylight savings).

I've added a test to the GitHub Actions `test.yml` action too for this.
It should only add about 5 seconds to each test, so it isn't too bad.
2023-02-28 19:54:58 +05:30
Alois Klink
704506835f refactor(deps): replace moment with dayjs
Replace Mermaid's dependency on `moment` with `dayjs`.

[Moment is now in maintenance mode][1], and they don't recommend
using it.

[Dayjs][2] has almost exactly the same API as moment, and is still
curently being maintained. Unlike moment, dayjs objects are immutable,
which makes our life much easier, but we need to do
`a = a.add(1, "day")` instead of just `a.add(1, "day")`.

We can't use `dayjs.duration`, because unlike `moment.duration`,
[dayjs durations always degrade to ms][3].
This causes issues with daylight savings, since it assumes that each
day is 24 hours, when some days have 23/25 hours with daylight savings.
(it also assumes that each month is 30 days).

However, `dayjs.add(1, "d");` correctly adds 1 days, even when that
day is only 23 hours long, so we can use that instead.

[1]: https://momentjs.com/docs/#/-project-status/
[2]: https://day.js.org/
[3]: https://day.js.org/docs/en/durations/durations

Co-authored-by: Alois Klink <alois@aloisklink.com>
2023-02-28 19:54:27 +05:30
Billiam
3bed70a0c5 fixup! fixup! feat(pie): adding outer border, text position options 2023-02-25 15:47:38 -06:00
Billiam
b079fb4710 fixup! feat(pie): adding outer border, text position options 2023-02-25 15:43:16 -06:00
Billiam
a2855931d2 Update packages/mermaid/src/diagrams/pie/pieRenderer.js
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-02-24 22:21:51 -06:00
Billiam
6e4e529af2 feat(pie): adding outer border, text position options 2023-02-24 18:56:29 -06:00
Sidharth Vinod
00a14ee811 WIP: Contributors 2023-02-24 23:03:51 +05:30
Sidharth Vinod
d688f1fe94 fix lockfile 2023-02-24 21:16:09 +05:30
Sidharth Vinod
8c2dbafdb5 Merge branch 'develop' into sidv/contributors
* develop: (309 commits)
  Update docs
  fix Lint
  Update CHANGELOG.md
  Update CHANGELOG.md
  fix: fix exports
  Doc (typo): remove duplicate "be"
  Fix readme link
  Regenerate mermaid docs
  Add deepdwn to cspell
  Add Deepdwn to native integrations list
  docs: Fix changelog
  docs: v10 breaking changes
  Remove `null` from diagrams before render
  fix docs diagram
  Updated version
  Minor cleanup to trigger build.
  Fix spellings
  Wrap option working in test case
  Fix typos
  Minor cleanup
  ...
2023-02-24 21:14:55 +05:30
Sidharth Vinod
067b6adc20 fix(E2E): Add cors package 2023-02-20 21:23:06 +05:30
Sidharth Vinod
a8162634cd fix Server 2023-02-20 21:18:54 +05:30
Sidharth Vinod
6ded32880d Fix lockfile 2023-02-20 18:24:24 +05:30
Sidharth Vinod
03419c691c Remove Readme 2023-02-19 14:13:47 +05:30
Sidharth Vinod
1495ae623a WIP Adding contributors page from vitest 2022-12-21 10:54:23 +05:30
352 changed files with 16870 additions and 8842 deletions

View File

@@ -4,4 +4,5 @@ docs/Setup.md
cypress.config.js
cypress/plugins/index.js
coverage
*.json
*.json
node_modules

View File

@@ -50,19 +50,11 @@ body:
attributes:
label: Setup
description: |-
Please fill out the below info.
Note that you only need to fill out one and not both sections.
Please fill out the info below.
Note that you only need to fill out the relevant section
value: |-
**Desktop**
- OS and Version: [Windows, Linux, Mac, ...]
- Mermaid version:
- Browser and Version: [Chrome, Edge, Firefox]
**Smartphone**
- Device: [Samsung, iPhone, ...]
- OS and Version: [Android, iOS, ...]
- Browser and Version: [Chrome, Safari, ...]
- type: textarea
attributes:
label: Additional Context

View File

@@ -3,6 +3,7 @@ description: Suggest a new Diagram Type to add to Mermaid.
labels:
- 'Status: Triage'
- 'Type: Enhancement'
- 'Type: New Diagram'
body:
- type: markdown
@@ -17,6 +18,14 @@ body:
- Use a clear and concise title
- Fill out the text fields with as much detail as possible.
- Never be shy to give us screenshots and/or code samples. It will help!
## Example issues
Refer to the discussions here to get an idea of how the diagram syntax is created.
- https://github.com/mermaid-js/mermaid/issues/4269
- https://github.com/mermaid-js/mermaid/issues/4282
- type: textarea
attributes:
label: Proposal
@@ -35,8 +44,17 @@ body:
description: If applicable, add screenshots to show possible examples of how the diagram may look like.
- type: textarea
attributes:
label: Code Sample
label: Syntax
description: |-
If applicable, add a code sample for how to implement this new diagram.
The text will automatically be rendered as JavaScript code.
render: javascript
If possible, include a syntax which could be used to write the diagram.
Try to add one or two examples of valid use-cases here.
- type: dropdown
id: implementation
attributes:
label: Implementation
description: |-
Would you like to implement this yourself, or is it a proposal for the community?
If there is no corresponding PR from your side after 30 days, the diagram will be open for everyone to implement.
options:
- I will try and implement it myself.
- This is a proposal which I'd love to see built into mermaid by the wonderful community.

29
.github/workflows/build-docs.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Build Vitepress docs
on:
pull_request:
permissions:
contents: read
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: 18
- name: Install Packages
run: pnpm install --frozen-lockfile
- name: Run Build
run: pnpm --filter mermaid run docs:build:vitepress

View File

@@ -38,15 +38,8 @@ jobs:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}
- name: Install Packages
run: |
pnpm install --frozen-lockfile
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress
- if: ${{ env.USE_APPLI }}
name: Notify applitools of new batch
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
@@ -54,19 +47,22 @@ jobs:
env:
# e.g. mermaid-js/mermaid/my-branch
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
- name: Run E2E Tests
run: pnpm run e2e
- name: Cypress run
uses: cypress-io/github-action@v4
id: cypress
with:
start: pnpm run dev
wait-on: 'http://localhost:9000'
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress
# Mermaid applitools.config.js uses this to pick batch name.
APPLI_BRANCH: ${{ github.ref_name }}
APPLITOOLS_BATCH_ID: ${{ github.sha }}
# e.g. mermaid-js/mermaid/my-branch
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'

View File

@@ -21,11 +21,7 @@ jobs:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
# Need to skip setup if Cypress run is skipped, otherwise an error
# is thrown since the pnpm cache step fails
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
with:
cache: pnpm
node-version: ${{ matrix.node-version }}
# Install NPM dependencies, cache them correctly

View File

@@ -14,6 +14,7 @@ on:
pull_request:
branches:
- master
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 8 * * *'
@@ -35,9 +36,16 @@ jobs:
restore-keys: cache-lychee-
- name: Link Checker
uses: lycheeverse/lychee-action@v1.5.4
uses: lycheeverse/lychee-action@v1.8.0
with:
args: --verbose --no-progress --cache --max-cache-age 1d packages/mermaid/src/docs/**/*.md README.md README.zh-CN.md
args: >-
--verbose
--no-progress
--cache
--max-cache-age 1d
packages/mermaid/src/docs/**/*.md
README.md
README.zh-CN.md
fail: true
jobSummary: true
env:

View File

@@ -42,7 +42,7 @@ jobs:
if ! pnpm run lint; then
# print a nice error message on lint failure
ERROR_MESSAGE='Running `pnpm run lint` failed.'
ERROR_MESSAGE+=' Running `pnpm run lint:fix` may fix this issue. '
ERROR_MESSAGE+=' Running `pnpm -w run lint:fix` may fix this issue. '
ERROR_MESSAGE+=" If this error doesn't occur on your local machine,"
ERROR_MESSAGE+=' make sure your packages are up-to-date by running `pnpm install`.'
ERROR_MESSAGE+=' You may also need to delete your prettier cache by running'

View File

@@ -5,10 +5,6 @@ on:
push:
branches:
- master
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
@@ -53,7 +49,6 @@ jobs:
# Deployment job
deploy:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
environment:
name: github-pages
runs-on: ubuntu-latest
@@ -61,4 +56,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: fregante/setup-git-user@v1
- uses: fregante/setup-git-user@v2
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

3
.gitignore vendored
View File

@@ -36,3 +36,6 @@ tsconfig.tsbuildinfo
knsv*.html
local*.html
stats/
**/user-avatars/*
**/contributor-names.json

View File

@@ -1,5 +1,5 @@
export default {
'!(docs/**/*)*.{ts,js,json,html,md,mts}': [
'!(docs/**/*)*.{ts,js,html,md,mts}': [
'eslint --cache --cache-strategy content --fix',
// don't cache prettier yet, since we use `prettier-plugin-jsdoc`,
// and prettier doesn't invalidate cache on plugin updates"

View File

@@ -4,16 +4,8 @@
# Network error: Forbidden
https://codepen.io
# Network error: The certificate was not trusted
https://mkdocs.org/
https://osawards.com/javascript/#nominees
https://osawards.com/javascript/2019
# Timeout error, maybe Twitter has anti-bot defenses against GitHub's CI servers?
https://twitter.com/mermaidjs_
# Don't check files that are generated during the build via `pnpm docs:code`
packages/mermaid/src/docs/config/setup/*
# Network error: 502, since few days
https://bundlephobia.com/

1
.npmrc
View File

@@ -1,3 +1,2 @@
auto-install-peers=true
strict-peer-dependencies=false
use-inline-specifiers-lockfile-format=true

View File

@@ -4,4 +4,5 @@ cypress/platform/xss3.html
coverage
# Autogenerated by PNPM
pnpm-lock.yaml
stats
stats
packages/mermaid/src/docs/.vitepress/components.d.ts

View File

@@ -3,6 +3,7 @@ import { resolve } from 'path';
import { fileURLToPath } from 'url';
import jisonPlugin from './jisonPlugin.js';
import { readFileSync } from 'fs';
import typescript from '@rollup/plugin-typescript';
import { visualizer } from 'rollup-plugin-visualizer';
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';
@@ -10,6 +11,7 @@ const visualize = process.argv.includes('--visualize');
const watch = process.argv.includes('--watch');
const mermaidOnly = process.argv.includes('--mermaid');
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const sourcemap = false;
type OutputOptions = Exclude<
Exclude<InlineConfig['build'], undefined>['rollupOptions'],
@@ -42,6 +44,11 @@ const packageOptions = {
packageName: 'mermaid-example-diagram',
file: 'detector.ts',
},
'mermaid-zenuml': {
name: 'mermaid-zenuml',
packageName: 'mermaid-zenuml',
file: 'detector.ts',
},
};
interface BuildOptions {
@@ -59,9 +66,15 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
{
name,
format: 'esm',
sourcemap: true,
sourcemap,
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
},
{
name,
format: 'umd',
sourcemap,
entryFileNames: `${name}${minify ? '.min' : ''}.js`,
},
];
if (core) {
@@ -78,7 +91,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
{
name,
format: 'esm',
sourcemap: true,
sourcemap,
entryFileNames: `${name}.core.mjs`,
},
];
@@ -102,9 +115,14 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
},
},
resolve: {
extensions: ['.jison', '.js', '.ts', '.json'],
extensions: [],
},
plugins: [jisonPlugin(), ...visualizerOptions(packageName, core)],
plugins: [
jisonPlugin(),
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
typescript({ compilerOptions: { declaration: false } }),
...visualizerOptions(packageName, core),
],
};
if (watch && config.build) {
@@ -133,6 +151,7 @@ if (watch) {
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
if (!mermaidOnly) {
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
}
} else if (visualize) {
await build(getBuildConfig({ minify: false, core: true, entryName: 'mermaid' }));

View File

@@ -10,11 +10,12 @@ async function createServer() {
configFile: './vite.config.ts',
mode: 'production',
server: { middlewareMode: true },
appType: 'custom', // don't include Vite's default HTML handling middlewares
appType: 'custom', // don't include Vite's default HTML handling middleware
});
app.use(cors());
app.use(express.static('./packages/mermaid/dist'));
app.use(express.static('./packages/mermaid-zenuml/dist'));
app.use(express.static('./packages/mermaid-example-diagram/dist'));
app.use(vite.middlewares);
app.use(express.static('demos'));

View File

@@ -55,6 +55,8 @@ The documentation is written in **Markdown**. For more information about Markdow
The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.
After editing files in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory, be sure to run `pnpm install` and `pnpm run --filter mermaid docs:build` locally to build the `/docs` directory.
```mermaid
flowchart LR
classDef default fill:#fff,color:black,stroke:black

View File

@@ -165,6 +165,13 @@ class Class10 {
int id
size()
}
namespace Namespace01 {
class Class11
class Class12 {
int id
size()
}
}
```
```mermaid
@@ -184,6 +191,13 @@ class Class10 {
int id
size()
}
namespace Namespace01 {
class Class11
class Class12 {
int id
size()
}
}
```
### State diagram [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkEFvgzAMhf8K8nEqpYSNthx22Xbcqcexg0sCiZQQlDhIFeK_L8A6TfXp6fOz9ewJGssFVOAJSbwr7ByadGR1n8T6evpO0vQ1uZDSekOrXGFsPqJPO6q-2-imH8f_0TeHXm50lfelsAMjnEHFY6xpMdRAUhhRQxUlFy0GTTXU_RytYeAx-AdXZB1ULWovdoCB7OXWN1CRC-Ju-r3uz6UtchGHJqDbsPygU57iysb2reoWHpyOWBINvsqypb3vFMlw3TfWZF5xiY7keC6zkpUnZIUojwW-FAVvrvn51LLnvOXHQ84Q5nn-AVtLcwk">live editor</a>]
@@ -226,6 +240,44 @@ pie
### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]
### Bar chart (using gantt chart) [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaid.live/edit#pako:eNptkU1vhCAQhv8KIenNugiI4rkf6bmXpvEyFVxJFDYyNt1u9r8X63Z7WQ9m5pknLzieaBeMpQ3dg0dsPUkPOhwteXZIXmJcbCT3xMAxkuh8Z8kIEclyMIB209fqKcwTICFvG4IvFy_oLrZ-g9F26ILfQgvNFN94VaRXQ1iWqpumZBcu1J8p1E1TXDx59eQNr5LyEqjJn6hv5QnGNlxevZJmdLLpy5xJSzut45biYCfb0iaVxvawjNjS1p-TCguG16PvaIPzYjO67e3BwX6GiTY9jPFKH43DMF_hGMDY1J4oHg-_f8hFTJFd8L3br3yZx4QHxENsdrt1nO8dDstH3oVpF50ZYMbhU6ud4qoGLqyqBJRCmO6j0HXPZdGbihUc6Pmc0QP49xD-b5X69ZQv2gjO81IwzWqhC1lKrjJ6pA3nVS7SMiVjrKirWlYp5fs3osgrWeo00lorLWvOzz8JVbXm">live editor</a>]
```
gantt
title Git Issues - days since last update
dateFormat X
axisFormat %s
section Issue19062
71 : 0, 71
section Issue19401
36 : 0, 36
section Issue193
34 : 0, 34
section Issue7441
9 : 0, 9
section Issue1300
5 : 0, 5
```
```mermaid
gantt
title Git Issues - days since last update
dateFormat X
axisFormat %s
section Issue19062
71 : 0, 71
section Issue19401
36 : 0, 36
section Issue193
34 : 0, 34
section Issue7441
9 : 0, 9
section Issue1300
5 : 0, 5
```
### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]
```

View File

@@ -1,5 +1,5 @@
// @ts-nocheck TODO: Fix TS
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3';
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3.js';
export const select = function () {
return new MockedD3();

View File

@@ -5,11 +5,14 @@
"acyclicer",
"adamiecki",
"alois",
"aloisklink",
"antiscript",
"antlr",
"appli",
"applitools",
"asciidoctor",
"ashish",
"ashishjain",
"astah",
"bbox",
"bilkent",
@@ -23,6 +26,7 @@
"classdef",
"codedoc",
"colour",
"commitlint",
"cpettitt",
"customizability",
"cuzon",
@@ -47,30 +51,43 @@
"graphviz",
"grav",
"greywolf",
"huynh",
"huynhicode",
"inkdrop",
"jaoude",
"jgreywolf",
"jison",
"jiti",
"kaufmann",
"khroma",
"klemm",
"klink",
"knsv",
"knut",
"knutsveidqvist",
"laganeckas",
"linetype",
"lintstagedrc",
"logmsg",
"lucida",
"markdownish",
"matthieu",
"matthieumorel",
"mdast",
"mdbook",
"mermaidjs",
"mermerd",
"mindaugas",
"mindmap",
"mindmaps",
"mitigations",
"mkdocs",
"mmorel",
"mult",
"nextra",
"orlandoni",
"pathe",
"pbrolin",
"phpbb",
"plantuml",
"playfair",
@@ -82,6 +99,7 @@
"rect",
"rects",
"redmine",
"rehype",
"roledescription",
"sandboxed",
"setupgraphviewbox",
@@ -89,7 +107,12 @@
"sidharth",
"sidharthv",
"sphinxcontrib",
"startx",
"starty",
"statediagram",
"steph",
"stopx",
"stopy",
"stylis",
"substate",
"sveidqvist",
@@ -99,16 +122,22 @@
"textlength",
"treemap",
"ts-nocheck",
"tsdoc",
"tuleap",
"tylerlong",
"ugge",
"unist",
"unocss",
"valign",
"verdana",
"viewports",
"vinod",
"visio",
"vitepress",
"vueuse",
"xlink",
"yash"
"yash",
"zenuml"
],
"patterns": [
{ "name": "Markdown links", "pattern": "\\((.*)\\)", "description": "" },
@@ -148,6 +177,7 @@
],
"ignorePaths": [
"packages/mermaid/src/docs/CHANGELOG.md",
"packages/mermaid/src/docs/.vitepress/redirect.ts"
"packages/mermaid/src/docs/.vitepress/redirect.ts",
"packages/mermaid/src/docs/.vitepress/contributor-names.json"
]
}

View File

@@ -60,7 +60,7 @@ export const renderGraph = (graphStr, options, api) => {
openURLAndVerifyRendering(url, options);
};
const openURLAndVerifyRendering = (url, options, validation = undefined) => {
export const openURLAndVerifyRendering = (url, options, validation = undefined) => {
const useAppli = Cypress.env('useAppli');
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');

View File

@@ -1,4 +1,4 @@
import { renderGraph } from '../../helpers/util';
import { renderGraph } from '../../helpers/util.js';
describe('Configuration', () => {
describe('arrowMarkerAbsolute', () => {
it('should handle default value false of arrowMarkerAbsolute', () => {

View File

@@ -1,4 +1,4 @@
import { urlSnapshotTest } from '../../helpers/util';
import { urlSnapshotTest } from '../../helpers/util.js';
describe('mermaid', () => {
describe('registerDiagram', () => {

View File

@@ -1,4 +1,4 @@
import { urlSnapshotTest } from '../../helpers/util';
import { urlSnapshotTest, openURLAndVerifyRendering } from '../../helpers/util.js';
describe('CSS injections', () => {
it('should not allow CSS injections outside of the diagram', () => {
@@ -13,4 +13,11 @@ describe('CSS injections', () => {
flowchart: { htmlLabels: false },
});
});
it('should not allow manipulating styletags using arrowheads', () => {
openURLAndVerifyRendering('http://localhost:9000/xss23-css.html', {
logLevel: 1,
arrowMarkerAbsolute: false,
flowchart: { htmlLabels: true },
});
});
});

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest } from '../../helpers/util';
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Class diagram V2', () => {
it('0: should render a simple class diagram', () => {
imgSnapshotTest(
@@ -548,4 +548,18 @@ class C13["With Città foreign language"]
`
);
});
it('should add classes namespaces', function () {
imgSnapshotTest(
`
classDiagram
namespace Namespace1 {
class C1
class C2
}
C1 --> C2
class C3
class C4
`
);
});
});

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Class diagram', () => {
it('1: should render a simple class diagram', () => {
@@ -286,7 +286,7 @@ describe('Class diagram', () => {
cy.get('svg');
});
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
it('15: should render a simple class diagram with css classes applied to multiple classes', () => {
imgSnapshotTest(
`
classDiagram

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest } from '../../helpers/util';
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Current diagram', () => {
it('should render a state with states in it', () => {

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest } from '../../helpers/util';
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Flowchart', () => {
it('34: testing the label width in percy', () => {

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Entity Relationship Diagram', () => {
it('should render a simple ER diagram', () => {
@@ -10,7 +10,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render an ER diagram with a recursive relationship', () => {
@@ -23,7 +22,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render an ER diagram with multiple relationships between the same two entities', () => {
@@ -35,7 +33,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render a cyclical ER diagram', () => {
@@ -48,7 +45,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render a not-so-simple ER diagram', () => {
@@ -66,7 +62,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render multiple ER diagrams', () => {
@@ -85,7 +80,6 @@ describe('Entity Relationship Diagram', () => {
],
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render an ER diagram with blank or empty labels', () => {
@@ -98,7 +92,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render an ER diagrams when useMaxWidth is true (default)', () => {
@@ -151,7 +144,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ er: { useMaxWidth: false } }
);
cy.get('svg');
});
it('should render entities with and without attributes', () => {
@@ -164,7 +156,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities with generic and array attributes', () => {
@@ -179,7 +170,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities with length in attributes type', () => {
@@ -193,7 +183,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities and attributes with big and small entity names', () => {
@@ -209,7 +198,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities with keys', () => {
@@ -228,7 +216,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities with comments', () => {
@@ -247,7 +234,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities with keys and comments', () => {
@@ -267,7 +253,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('should render entities with aliases', () => {
@@ -285,7 +270,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});
it('1433: should render a simple ER diagram with a title', () => {

View File

@@ -0,0 +1,45 @@
import { imgSnapshotTest } from '../../helpers/util';
describe('Error Diagrams', () => {
beforeEach(() => {
cy.on('uncaught:exception', (err) => {
expect(err.message).to.include('Parse error');
// return false to prevent the error from
// failing this test
return false;
});
});
it('should render a simple ER diagram', () => {
imgSnapshotTest(
`
error
`,
{ logLevel: 1 }
);
});
it('should render error diagram for actual errors', () => {
imgSnapshotTest(
`
flowchart TD
A[Christmas] --|Get money| B(Go shopping)
`,
{ logLevel: 1 }
);
});
it('should render error for wrong ER diagram', () => {
imgSnapshotTest(
`
erDiagram
ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
MONGODB-CLUSTERS ||..|{
ATLAS-TEAMS ||..|{
`,
{ logLevel: 1 }
);
});
});

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe.skip('Flowchart ELK', () => {
it('1-elk: should render a simple flowchart', () => {
@@ -684,4 +684,163 @@ A --> B
{ titleTopMargin: 0 }
);
});
it('elk: should include classes on the edges', () => {
renderGraph(
`flowchart-elk TD
A --> B --> C --> D
`,
{}
);
cy.get('svg').should((svg) => {
const edges = svg.querySelectorAll('.edges > path');
edges.forEach((edge) => {
expect(edge).to.have.class('flowchart-link');
});
});
});
describe('Markdown strings flowchart-elk (#4220)', () => {
describe('html labels', () => {
it('With styling and classes', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart-elk LR
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
id1(Start)-->id2(Stop)
style id1 fill:#f9f,stroke:#333,stroke-width:4px
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
classDef someclass fill:#f96
`,
{ titleTopMargin: 0 }
);
});
it('With formatting in a node', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart-elk LR
a{"\`The **cat** in the hat\`"} -- 1o --> b
a -- 2o --> c
a -- 3o --> d
g --2i--> a
d --1i--> a
h --3i -->a
b --> d(The dog in the hog)
c --> d
`,
{ titleTopMargin: 0 }
);
});
it('New line in node and formatted edge label', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart-elk LR
b("\`The dog in **the** hog.(1)
NL\`") --"\`1o **bold**\`"--> c
`,
{ titleTopMargin: 0 }
);
});
it('Wrapping long text with a new line', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart-elk LR
b(\`The dog in **the** hog.(1).. a a a a *very long text* about it
Word!
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`) --> c
`,
{ titleTopMargin: 0 }
);
});
it('Sub graphs and markdown strings', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart-elk LR
subgraph "One"
a("\`The **cat**
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
end
subgraph "\`**Two**\`"
c("\`The **cat**
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
end
`,
{ titleTopMargin: 0 }
);
});
});
describe('svg text labels', () => {
it('With styling and classes', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart-elk LR
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
id1(Start)-->id2(Stop)
style id1 fill:#f9f,stroke:#333,stroke-width:4px
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
classDef someclass fill:#f96
`,
{ titleTopMargin: 0 }
);
});
it('With formatting in a node', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart-elk LR
a{"\`The **cat** in the hat\`"} -- 1o --> b
a -- 2o --> c
a -- 3o --> d
g --2i--> a
d --1i--> a
h --3i -->a
b --> d(The dog in the hog)
c --> d
`,
{ titleTopMargin: 0 }
);
});
it('New line in node and formatted edge label', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart-elk LR
b("\`The dog in **the** hog.(1)
NL\`") --"\`1o **bold**\`"--> c
`,
{ titleTopMargin: 0 }
);
});
it('Wrapping long text with a new line', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart-elk LR
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
Word!
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
`,
{ titleTopMargin: 0 }
);
});
it('Sub graphs and markdown strings', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart-elk LR
subgraph "One"
a("\`The **cat**
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
end
subgraph "\`**Two**\`"
c("\`The **cat**
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
end
`,
{ titleTopMargin: 0 }
);
});
});
});
});

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Flowchart v2', () => {
it('1: should render a simple flowchart', () => {
@@ -685,4 +685,159 @@ A ~~~ B
{ titleTopMargin: 0 }
);
});
it('4023: Should render html labels with images and-or text correctly', () => {
imgSnapshotTest(
`flowchart TD
B[<img src='https://mermaid.js.org/mermaid-logo.svg'>]
B-->C[<img src="https://mermaid.js.org/mermaid-logo.svg"> more text <img src='https://mermaid.js.org/mermaid-logo.svg'>]
B-->D(<img src='https://mermaid.js.org/mermaid-logo.svg'> some text)
B-->E(plain)`,
{}
);
});
describe('Markdown strings flowchart (#4220)', () => {
describe('html labels', () => {
it('With styling and classes', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
id1(Start)-->id2(Stop)
style id1 fill:#f9f,stroke:#333,stroke-width:4px
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
classDef someclass fill:#f96
`,
{ titleTopMargin: 0 }
);
});
it('With formatting in a node', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
a{"\`The **cat** in the hat\`"} -- 1o --> b
a -- 2o --> c
a -- 3o --> d
g --2i--> a
d --1i--> a
h --3i -->a
b --> d(The dog in the hog)
c --> d
`,
{ titleTopMargin: 0 }
);
});
it('New line in node and formatted edge label', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
b("\`The dog in **the** hog.(1)
NL\`") --"\`1o **bold**\`"--> c
`,
{ titleTopMargin: 0 }
);
});
it('Wrapping long text with a new line', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
Word!
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
`,
{ titleTopMargin: 0 }
);
});
it('Sub graphs and markdown strings', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
subgraph "One"
a("\`The **cat**
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
end
subgraph "\`**Two**\`"
c("\`The **cat**
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
end
`,
{ titleTopMargin: 0 }
);
});
});
describe('svg text labels', () => {
it('With styling and classes', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
id1(Start)-->id2(Stop)
style id1 fill:#f9f,stroke:#333,stroke-width:4px
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
classDef someclass fill:#f96
`,
{ titleTopMargin: 0 }
);
});
it('With formatting in a node', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
a{"\`The **cat** in the hat\`"} -- 1o --> b
a -- 2o --> c
a -- 3o --> d
g --2i--> a
d --1i--> a
h --3i -->a
b --> d(The dog in the hog)
c --> d
`,
{ titleTopMargin: 0 }
);
});
it('New line in node and formatted edge label', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
b("\`The dog in **the** hog.(1)
NL\`") --"\`1o **bold**\`"--> c
`,
{ titleTopMargin: 0 }
);
});
it('Wrapping long text with a new line', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
Word!
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
`,
{ titleTopMargin: 0 }
);
});
it('Sub graphs and markdown strings', () => {
imgSnapshotTest(
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
subgraph "One"
a("\`The **cat**
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
end
subgraph "\`**Two**\`"
c("\`The **cat**
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
end
`,
{ titleTopMargin: 0 }
);
});
});
});
});

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Graph', () => {
it('1: should render a simple flowchart no htmlLabels', () => {

View File

@@ -133,6 +133,24 @@ describe('Gantt diagram', () => {
);
});
it('should default to showing today marker', () => {
// This test only works if the environment thinks today is 1010-10-10
imgSnapshotTest(
`
gantt
title Show today marker (vertical line should be visible)
dateFormat YYYY-MM-DD
axisFormat %d
%% Should default to being on
%% todayMarker on
section Section1
Yesterday: 1010-10-09, 1d
Today: 1010-10-10, 1d
`,
{}
);
});
it('should hide today marker', () => {
imgSnapshotTest(
`
@@ -142,7 +160,8 @@ describe('Gantt diagram', () => {
axisFormat %d
todayMarker off
section Section1
Today: 1, -1h
Yesterday: 1010-10-09, 1d
Today: 1010-10-10, 1d
`,
{}
);
@@ -157,7 +176,8 @@ describe('Gantt diagram', () => {
axisFormat %d
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
section Section1
Today: 1, -1h
Yesterday: 1010-10-09, 1d
Today: 1010-10-10, 1d
`,
{}
);
@@ -435,4 +455,39 @@ describe('Gantt diagram', () => {
{ gantt: { topAxis: true } }
);
});
it('should render when compact is true', () => {
imgSnapshotTest(
`
---
displayMode: compact
---
gantt
title GANTT compact
dateFormat HH:mm:ss
axisFormat %Hh%M
section DB Clean
Clean: 12:00:00, 10m
Clean: 12:30:00, 12m
Clean: 13:00:00, 8m
Clean: 13:30:00, 9m
Clean: 14:00:00, 13m
Clean: 14:30:00, 10m
Clean: 15:00:00, 11m
section Sessions
A: 12:00:00, 63m
B: 12:30:00, 12m
C: 13:05:00, 12m
D: 13:06:00, 33m
E: 13:15:00, 55m
F: 13:20:00, 12m
G: 13:32:00, 18m
H: 13:50:00, 20m
I: 14:10:00, 10m
`,
{}
);
});
});

View File

@@ -52,6 +52,17 @@ root[A root with a long text that wraps to keep the node size in check]
);
});
it('a root with wrapping text and long words that exceed width', () => {
imgSnapshotTest(
`mindmap
root[A few smaller words but then averylongsetofcharacterswithoutwhitespacetoseparate that we expect to wrapontonextlinesandnotexceedwidthparameters]
`,
{},
undefined,
shouldHaveRoot
);
});
it('a root with an icon', () => {
imgSnapshotTest(
`mindmap
@@ -223,5 +234,18 @@ mindmap
shouldHaveRoot
);
});
describe('Markdown strings mindmaps (#4220)', () => {
it('Formatted label with linebreak and a wrapping label and emojis', () => {
imgSnapshotTest(
`mindmap
id1[\`**Start** with
a second line 😎\`]
id2[\`The dog in **the** hog... a *very long text* about it
Word!\`]
`,
{ titleTopMargin: 0 }
);
});
});
/* The end */
});

View File

@@ -75,4 +75,15 @@ describe('Pie Chart', () => {
expect(svg).to.not.have.attr('style');
});
});
it('should render a pie diagram when textPosition is set', () => {
imgSnapshotTest(
`
pie
"Dogs": 50
"Cats": 25
`,
{ logLevel: 1, pie: { textPosition: 0.9 } }
);
cy.get('svg');
});
});

View File

@@ -0,0 +1,163 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Quadrant Chart', () => {
it('should render if only chart type is provided', () => {
imgSnapshotTest(
`
quadrantChart
`,
{}
);
cy.get('svg');
});
it('should render a complete quadrant chart', () => {
imgSnapshotTest(
`
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
`,
{}
);
cy.get('svg');
});
it('should render without points', () => {
imgSnapshotTest(
`
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
`,
{}
);
cy.get('svg');
});
it('should able to render y-axix on right side', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"yAxisPosition": "right"}}}%%
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
`,
{}
);
cy.get('svg');
});
it('should able to render x-axix on bottom', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"xAxisPosition": "bottom"}}}%%
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
`,
{}
);
cy.get('svg');
});
it('should able to render x-axix on bottom and y-axis on right', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"xAxisPosition": "bottom", "yAxisPosition": "right"}}}%%
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
`,
{}
);
cy.get('svg');
});
it('should render without title', () => {
imgSnapshotTest(
`
quadrantChart
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
`,
{}
);
cy.get('svg');
});
it('should use all the config', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"chartWidth": 600, "chartHeight": 600, "titlePadding": 20, "titleFontSize": 10, "quadrantPadding": 20, "quadrantTextTopPadding": 40, "quadrantLabelFontSize": 20, "quadrantInternalBorderStrokeWidth": 3, "quadrantExternalBorderStrokeWidth": 5, "xAxisLabelPadding": 20, "xAxisLabelFontSize": 20, "yAxisLabelPadding": 20, "yAxisLabelFontSize": 20, "pointTextPadding": 20, "pointLabelFontSize": 20, "pointRadius": 10 }}}%%
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
`,
{}
);
cy.get('svg');
});
it('should use all the theme variable', () => {
imgSnapshotTest(
`
%%{init: {"themeVariables": {"quadrant1Fill": "#b4dcff","quadrant2Fill": "#fef0ff", "quadrant3Fill": "#fffaf0", "quadrant4Fill": "#f0fff2", "quadrant1TextFill": "#ff0000", "quadrant2TextFill": "#2d00df", "quadrant3TextFill": "#00ffda", "quadrant4TextFill": "#e68300", "quadrantPointFill": "#0149ff", "quadrantPointTextFill": "#dc00ff", "quadrantXAxisTextFill": "#ffb500", "quadrantYAxisTextFill": "#fae604", "quadrantInternalBorderStrokeFill": "#3636f2", "quadrantExternalBorderStrokeFill": "#ff1010", "quadrantTitleFill": "#00ea19"} }}%%
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
`,
{}
);
cy.get('svg');
});
});

View File

@@ -1,6 +1,6 @@
/// <reference types="Cypress" />
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
context('Sequence diagram', () => {
it('should render a sequence diagram with boxes', () => {
@@ -88,6 +88,16 @@ context('Sequence diagram', () => {
{}
);
});
it('should handle empty lines', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>John: Hello John<br/>
John-->>Alice: Great<br/><br/>day!
`,
{}
);
});
it('should handle line breaks and wrap annotations', () => {
imgSnapshotTest(
`
@@ -123,6 +133,29 @@ context('Sequence diagram', () => {
}
);
});
it('should render a sequence diagram with par_over', () => {
imgSnapshotTest(
`
sequenceDiagram
participant Alice
participant Bob
participant John
par_over Section title
Alice ->> Bob: Message 1<br>Second line
Bob ->> John: Message 2
end
par_over Two line<br>section title
Note over Alice: Alice note
Note over Bob: Bob note<br>Second line
Note over John: John note
end
par_over Mixed section
Alice ->> Bob: Message 1
Note left of Bob: Alice/Bob Note
end
`
);
});
context('font settings', () => {
it('should render different note fonts when configured', () => {
imgSnapshotTest(

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('State diagram', () => {
it('v2 should render a simple info', () => {
@@ -530,7 +530,7 @@ stateDiagram-v2
[*] --> A
A --> B: test({ foo#colon; 'far' })
B --> [*]
classDef badBadEvent fill:#f00,color:white,font-weight:bold
classDef badBadEvent fill:#f00,color:white,font-weight:bold
class B badBadEvent
`,
{ logLevel: 0, fontFamily: 'courier' }
@@ -543,14 +543,14 @@ stateDiagram-v2
classDef notMoving fill:white
classDef movement font-style:italic;
classDef badBadEvent fill:#f00,color:white,font-weight:bold
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
class Still notMoving
class Moving, Crash movement
class Crash badBadEvent

View File

@@ -1,4 +1,4 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('State diagram', () => {
it('should render a simple state diagrams', () => {

View File

@@ -0,0 +1,19 @@
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Zen UML', () => {
it('Basic Zen UML diagram', () => {
imgSnapshotTest(
`
zenuml
A.method() {
if(x) {
B.method() {
selfCall() { return X }
}
}
}
`,
{}
);
});
});

View File

@@ -188,7 +188,7 @@ mindmap
//import mindmap from '../../packages/mermaid-mindmap/src/detector';
// import example from '../../packages/mermaid-example-diagram/src/detector';
// import timeline from '../../packages/mermaid-timeline/src/detector';
import mermaid from '../../packages/mermaid/src/mermaid';
import mermaid from './mermaid.esm.mjs';
// await mermaid.registerExternalDiagrams([]);
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);

View File

@@ -1,4 +1,5 @@
import mermaid from '../../packages/mermaid/src/mermaid';
// TODO: this file should be testing the ./mermaid.core.mjs file, as that's the file listed in the package.json file that users will use
import mermaid from './mermaid.esm.mjs';
let code = `flowchart LR
Power_Supply --> Transmitter_A

View File

@@ -11,9 +11,9 @@ example-diagram
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
<!-- <script type="module" src="./external-diagrams-mindmap.mjs" /> -->
<script type="module">
import exampleDiagram from '../../packages/mermaid-example-diagram/src/detector';
import exampleDiagram from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
// import example from '../../packages/mermaid-example-diagram/src/detector';
import mermaid from '../../packages/mermaid/src/mermaid';
import mermaid from './mermaid.esm.mjs';
await mermaid.registerExternalDiagrams([exampleDiagram]);
await mermaid.initialize({ logLevel: 0 });

View File

@@ -30,7 +30,7 @@
</pre>
<script type="module">
import mermaid from '../../packages/mermaid/src/mermaid';
import mermaid from './mermaid.esm.mjs';
mermaid.initialize({
theme: 'forest',

View File

@@ -42,368 +42,86 @@
</style>
</head>
<body>
<pre class="mermaid2" style="width: 50%">
flowchart LR
subgraph one
direction LR
A[myClass1] --> B[default]
subgraph two
direction BT
C[myClass2] --> D[default]
end
end
<pre class="mermaid" style="width: 50%">
%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
b("`The dog in **the** hog.(1).. a a a a *very long text* about it
Word!
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words.`") --apa--> c
</pre
>
<pre class="mermaid" style="width: 50%">
classDiagram-v2
classA -- classB : Inheritance
classA -- classC : link
classC -- classD : link
classB -- classD
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart LR
classDef aPID stroke:#4e4403,fill:#fdde29,color:#4e4403,rx:5px,ry:5px;
classDef crm stroke:#333333,fill:#DCDCDC,color:#333333,rx:5px,ry:5px;
classDef type stroke:#502604,fill:#FAB565,color:#502604,rx:20px,ry:20px;;
O0("Joe")
class O0 aPID;
O1("Person")
class O1 crm;
O0 -- has type -->O1["Person"]
O2("aat:300411314")
class O2 type;
click O2 function "Sorry the newline html tags are not being processed correctly<br/> So all of this appears on the <br/> same line."
O0 -- has type -->O2["Bug"]
click O0 function "Lots of great info about Joe<br>Lots of great info about Joe<br>burt<br>fred";
<pre class="mermaid" style="width: 50%">
sequenceDiagram
Alice->>Bob: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
loop Loopy
Bob->>Alice: Pasten
end
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart TD
subgraph test
direction TB
subgraph test2
direction LR
F --> D
end
subgraph test3
direction TB
G --> H
end
end
<pre class="mermaid" style="width: 50%">
%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
b("`The dog in **the** hog.(1)
NL`") --"`1o **bold**`"--> c[new strings svg labels]
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart TD
release-branch[Create Release Branch]:::relClass
develop-branch[Update Develop Branch]:::relClass
github-release-draft[GitHub Release Draft]:::relClass
trigger-pipeline[Trigger Jenkins pipeline]:::fixClass
github-release[GitHub Release]:::postClass
build-ready --> release-branch
build-ready --> develop-branch
release-branch --> jenkins-release-build
jenkins-release-build --> github-release-draft
jenkins-release-build --> install-release
install-release --> verify-release
jenkins-release-build --> announce
github-release-draft --> github-release
verify-release --> verify-check
verify-check -- Yes --> github-release
verify-check -- No --> release-fix
release-fix --> release-branch-pr
verify-check -- No --> delete-artifacts
release-branch-pr --> trigger-pipeline
delete-artifacts --> trigger-pipeline
trigger-pipeline --> jenkins-release-build
<pre class="mermaid" style="width: 50%">
%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
b("`The dog in **the** hog.(1)
NL`") --"`1o **bold**`"--> c[new strings html labels]
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart LR
a["<strong>Haiya</strong>"]===>b
<pre class="mermaid" style="width: 50%">
%%{init: {"flowchart": {"htmlLabels": true}} }%%
flowchart LR
b("The dog in the hog.(1)\nNL") --"1o bold"--> c[old strings svg labels]
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart TD
A --> B
A --> C
B --> C
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart TD
A([stadium shape test])
A -->|Get money| B([Go shopping])
B --> C([Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?])
C -->|One| D([Laptop])
C -->|Two| E([iPhone])
C -->|Three| F([Car<br/>wroom wroom])
click A "index.html#link-clicked" "link test"
click B testClick "click test"
classDef someclass fill:#f96;
class A someclass;
class C someclass;
</pre>
<pre class="mermaid2" style="width: 50%">
sequenceDiagram
title: My Sequence Diagram Title
accTitle: My Acc Sequence Diagram
accDescr: My Sequence Diagram Description
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
</pre>
<pre class="mermaid2" style="width: 50%">
graph TD
A -->|000| B
B -->|111| C
linkStyle 1 stroke:#ff3,stroke-width:4px,color:red;
</pre>
<pre class="mermaid2" style="width: 100%">
journey
accTitle: My User Journey Diagram
accDescr: My User Journey Diagram Description
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</pre>
<pre class="mermaid2" style="width: 100%">
info
</pre>
<pre class="mermaid2" style="width: 100%">
requirementDiagram
accTitle: My req Diagram
accDescr: My req Diagram Description
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
functionalRequirement test_req2 {
id: 1.1
text: the second test text.
risk: low
verifymethod: inspection
}
performanceRequirement test_req3 {
id: 1.2
text: the third test text.
risk: medium
verifymethod: demonstration
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_req <- copies - test_entity2
</pre>
<pre class="mermaid2" style="width: 100%">
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes weekends
%% (`excludes` accepts specific dates in YYYY-MM-DD format, days of the week ("sunday") or "weekends", but not the word "weekdays".)
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
Functionality added :milestone, 2014-01-25, 0d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</pre>
<pre class="mermaid2" style="width: 100%">
stateDiagram
state Active {
Idle
}
Inactive --> Idle: ACT
Active --> Active: LOG
</pre>
<pre class="mermaid2" style="width: 100%">
flowchart TB
accTitle: My flowchart
accDescr: My flowchart Description
subgraph One
a1-->a2-->a3
end
</pre>
<pre class="mermaid2" style="width: 100%">
sequenceDiagram
A ->> B: 1
rect rgb(204, 0, 102)
break yes
rect rgb(0, 204, 204)
C ->> C: 0
end
end
end
B ->> A: Return
</pre>
<pre class="mermaid2" style="width: 100%">
classDiagram
accTitle: My class diagram
accDescr: My class diagram Description
Class01 <|-- AveryLongClass : Cool
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
int id
size()
}
</pre>
<pre class="mermaid2" style="width: 100%">
%%{init: {'config': {'wrap': true }}}%%
sequenceDiagram
participant A as Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
A->>Bob: Hola
Bob-->A: Pasten !
</pre>
<pre class="mermaid2" style="width: 100%">
gitGraph
commit id: "ZERO"
branch develop
commit id:"A"
checkout main
commit id:"ONE"
checkout develop
commit id:"B"
branch featureA
commit id:"FIX"
commit id: "FIX-2"
checkout main
commit id:"TWO"
cherry-pick id:"A"
commit id:"THREE"
cherry-pick id:"FIX"
checkout develop
commit id:"C"
merge featureA
</pre>
<pre class="mermaid2" style="width: 100%">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
</pre>
<pre class="mermaid2" style="width: 100%">
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</pre>
<pre class="mermaid2" style="width: 100%">
erDiagram
CAR ||--o{ NAMED-DRIVER : allows
CAR {
string registrationNumber
string make
string model
}
PERSON ||--o{ NAMED-DRIVER : is
PERSON {
string firstName
string lastName
int age
}
</pre>
<!-- <script src="./mermaid.js"></script> -->
<script src="./mermaid.js"></script>
<script>
<script type="module">
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
// import example from '../../packages/mermaid-example-diagram/src/mermaid-example-diagram.core.mjs';
import mermaid from './mermaid.esm.mjs';
// await mermaid.registerExternalDiagrams([example]);
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
maxTextSize: 900000,
// theme: 'forest',
startOnLoad: true,
securityLevel: 'loose',
logLevel: 0,
fontFamily: 'courier',
flowchart: {
// curve: 'curveLinear',
useMaxWidth: true,
htmlLabels: false,
fontFamily: 'courier',
// defaultRenderer: 'elk',
useMaxWidth: false,
// htmlLabels: false,
htmlLabels: true,
},
lazyLoadedDiagrams: ['./mermaid-mindmap-detector.js'],
// htmlLabels: false,
gantt: {
useMaxWidth: false,
},
sequence: {
wrap: true,
},
useMaxWidth: false,
});
function callback() {
alert('It worked');
}
function clickByFlow(elemName) {
const div = document.createElement('div');
div.className = 'created-by-click';
div.style = 'padding: 20px; background: green; color: white;';
div.innerText = 'Clicked By Flow';
document.getElementsByTagName('body')[0].appendChild(div);
}
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
};
// mermaid.test1('first_slow', 1200).then((r) => console.info(r));
// mermaid.test1('second_fast', 200).then((r) => console.info(r));
// mermaid.test1('third_fast', 200).then((r) => console.info(r));
// mermaid.test1('forth_slow', 1200).then((r) => console.info(r));
</script>
</body>
</html>

View File

@@ -29,9 +29,9 @@
}
.mermaid svg {
/* font-size: 18px !important; */
background-color: #eee;
background-image: radial-gradient(#fff 1%, transparent 11%),
radial-gradient(#fff 1%, transparent 11%);
background-color: #efefef;
background-image: radial-gradient(#fff 51%, transparent 91%),
radial-gradient(#fff 51%, transparent 91%);
background-size: 20px 20px;
background-position: 0 0, 10px 10px;
background-repeat: repeat;
@@ -51,29 +51,103 @@
font-family: monospace;
font-size: 72px;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<pre id="diagram" class="mermaid">
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
graph BT
a{The cat in the hat} -- 1o --> b
a -- 2o --> c
a -- 3o --> d
g --2i--> a
d --1i--> a
h --3i -->a
b --> d(The dog in the hog)
c --> d
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*] </pre
>
<pre id="diagram" class="mermaid2">
flowchart RL
subgraph "`one`"
a1 -- l1 --> a2
a1 -- l2 --> a2
end
</pre>
<pre id="diagram" class="mermaid">
flowchart RL
subgraph "`one`"
a1 -- l1 --> a2
a1 -- l2 --> a2
end
</pre>
<pre id="diagram" class="mermaid2">
flowchart-elk TB
a --> b
a --> c
b --> d
c --> d
flowchart
id["`A root with a long text that wraps to keep the node size in check. A root with a long text that wraps to keep the node size in check`"]</pre
>
<pre id="diagram" class="mermaid2">
flowchart LR
A[A text that needs to be wrapped wraps to another line]
B[A text that needs to be<br/>wrapped wraps to another line]
C["`A text that needs to be wrapped to another line`"]</pre>
<pre id="diagram" class="mermaid2">
flowchart LR
C["`A text
that needs
to be wrapped
in another
way`"]
</pre
>
<pre id="diagram" class="mermaid">
classDiagram-v2
note "I love this diagram!\nDo you love it?"
</pre>
<pre id="diagram" class="mermaid">
stateDiagram-v2
State1: The state with a note with minus - and plus + in it
note left of State1
Important information! You can write
notes with . and in them.
end note </pre
>
<pre id="diagram" class="mermaid2">
mindmap
root
Child3(A node with an icon and with a long text that wraps to keep the node size in check)
</pre
>
<pre id="diagram" class="mermaid2">
%%{init: {"theme": "forest"} }%%
mindmap
id1[**Start2**<br/>end]
id2[**Start2**<br />end]
%% Another comment
id3[**Start2**<br>end] %% Comment
id4[**Start2**<br >end<br >the very end]
</pre>
<pre id="diagram" class="mermaid2">
mindmap
id1["`**Start2**
second line 😎 with long text that is wrapping to the next line`"]
id2["`Child **with bold** text`"]
id3["`Children of which some
is using *italic type of* text`"]
id4[Child]
id5["`Child
Row
and another
`"]
</pre>
<pre id="diagram" class="mermaid2">
mindmap
id1("`**Root**`"]
id2["`A formatted text... with **bold** and *italics*`"]
id3[Regular labels works as usual]
id4["`Emojis and unicode works too: 🤓
शान्तिः سلام 和平 `"]
</pre>
<pre id="diagram" class="mermaid">
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
flowchart TB
%% I could not figure out how to use double quotes in labels in Mermaid
@@ -89,7 +163,7 @@ flowchart TB
rom --> core2
end
subgraph amd[AMD Latte GPU]
subgraph amd["`**AMD** Latte GPU`"]
mem[Memory & I/O Bridge]
dram[DRAM Controller]
edram[32 MB EDRAM MEM1]
@@ -128,6 +202,62 @@ flowchart TB
rtc{{rtc}}
</pre
>
<pre id="diagram" class="mermaid2">
%%{init: {"flowchart": {"defaultRenderer": "elk", "htmlLabels": false}} }%%
flowchart TB
%% I could not figure out how to use double quotes in labels in Mermaid
subgraph ibm[IBM Espresso CPU]
core0[IBM PowerPC Broadway Core 0]
core1[IBM PowerPC Broadway Core 1]
core2[IBM PowerPC Broadway Core 2]
rom[16 KB ROM]
core0 --- core2
rom --> core2
end
subgraph amd["`**AMD** Latte GPU`"]
mem[Memory & I/O Bridge]
dram[DRAM Controller]
edram[32 MB EDRAM MEM1]
rom[512 B SEEPROM]
sata[SATA IF]
exi[EXI]
subgraph gx[GX]
sram[3 MB 1T-SRAM]
end
radeon[AMD Radeon R7xx GX2]
mem --- gx
mem --- radeon
rom --- mem
mem --- sata
mem --- exi
dram --- sata
dram --- exi
end
ddr3[2 GB DDR3 RAM MEM2]
mem --- ddr3
dram --- ddr3
edram --- ddr3
core1 --- mem
exi --- rtc
rtc{{rtc}}
</pre
>
<br />
<pre id="diagram" class="mermaid2">
flowchart TB
@@ -263,21 +393,23 @@ mindmap
<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([example]);
// import example from '../../packages/mermaid-example-diagram/src/mermaid-example-diagram.core.mjs';
import mermaid from './mermaid.esm.mjs';
// await mermaid.registerExternalDiagrams([example]);
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'forest',
// theme: 'forest',
startOnLoad: true,
logLevel: 5,
logLevel: 0,
flowchart: {
// defaultRenderer: 'elk',
useMaxWidth: false,
// htmlLabels: false,
htmlLabels: true,
},
// htmlLabels: false,
gantt: {
useMaxWidth: false,
},

View File

@@ -40,7 +40,7 @@
<script type="module">
// import mermaid from './mermaid.esm.mjs';
import mermaid from '../../packages/mermaid/src/mermaid';
import mermaid from '../../packages/mermaid/dist/mermaid.esm.mjs';
// import mermaidMindmap from './mermaid-mindmap.esm.mjs';
// import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';

View File

@@ -1,5 +1,6 @@
import mermaid2 from '../../packages/mermaid/src/mermaid';
import externalExample from '../../packages/mermaid-example-diagram/src/detector';
import mermaid2 from './mermaid.esm.mjs';
import externalExample from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
import zenUml from '../../packages/mermaid-zenuml/dist/mermaid-zenuml.core.mjs';
function b64ToUtf8(str) {
return decodeURIComponent(escape(window.atob(str)));
@@ -44,10 +45,9 @@ const contentLoaded = async function () {
document.getElementsByTagName('body')[0].appendChild(div);
}
await mermaid2.registerExternalDiagrams([externalExample]);
await mermaid2.registerExternalDiagrams([externalExample, zenUml]);
mermaid2.initialize(graphObj.mermaid);
await mermaid2.run();
markRendered();
}
};
@@ -123,7 +123,6 @@ const contentLoadedApi = async function () {
bindFunctions(div);
}
}
markRendered();
};
if (typeof document !== 'undefined') {
@@ -135,10 +134,10 @@ if (typeof document !== 'undefined') {
function () {
if (this.location.href.match('xss.html')) {
this.console.log('Using api');
void contentLoadedApi();
void contentLoadedApi().finally(markRendered);
} else {
this.console.log('Not using api');
void contentLoaded();
void contentLoaded().finally(markRendered);
}
},
false

View File

@@ -0,0 +1,85 @@
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<style>
body {
/* background: rgb(221, 208, 208); */
/* background:#333; */
font-family: 'Arial';
/* font-size: 18px !important; */
}
h1 {
color: grey;
}
.mermaid2 {
display: none;
}
.mermaid svg {
/* font-size: 18px !important; */
}
.malware {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 150px;
background: red;
color: black;
display: flex;
display: flex;
justify-content: center;
align-items: center;
font-family: monospace;
font-size: 72px;
}
</style>
</head>
<body>
<div>Security check</div>
<div class="flex">
<div id="diagram" class="mermaid"></div>
<div id="graph-div"></div>
<div id="res" class=""></div>
</div>
<script type="module">
import mermaid from './mermaid.esm.mjs';
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'base',
startOnLoad: false,
flowcharts: { htmlLabels: true },
});
function callback() {
alert('It worked');
}
function xssAttack() {
const div = document.createElement('div');
div.id = 'the-malware';
div.className = 'malware';
div.innerHTML = 'XSS Succeeded';
document.getElementsByTagName('body')[0].appendChild(div);
throw new Error('XSS Succeeded');
}
let diagram = `graph TD
A[["a marker-end=#quot;url(<s title='#<style>*{background:red}</style>'>b"]]
`;
const el = document.querySelector('#graph-div');
console.log(diagram);
const { svg } = await mermaid.render('graph-div', diagram);
document.querySelector('#res').innerHTML = svg;
window.rendered = true;
</script>
</body>
</html>

38
demos/error.html Normal file
View File

@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Error | Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
</head>
<body>
<pre class="mermaid">
erDiagram
ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
</pre>
<pre class="mermaid">
erDiagram
ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
MONGODB-CLUSTERS ||..|{
ATLAS-TEAMS ||..|{
</pre>
<hr />
<pre class="mermaid">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
</pre>
<pre class="mermaid">
flowchart TD
A[Christmas] --|Get money| B(Go shopping)
</pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
</script>
</body>
</html>

View File

@@ -78,7 +78,7 @@
axisFormat %d/%m
todayMarker off
section Section1
Today: 1, -01:00, 5min
Today: 1, 08-08-09-01:00, 5min
</pre>
<hr />
@@ -89,7 +89,7 @@
axisFormat %d/%m
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
section Section1
Today: 1, -01:00, 5min
Today: 1, 08-08-09-01:00, 5min
</pre>
<hr />
@@ -166,6 +166,37 @@
</pre>
<hr />
<pre class="mermaid">
---
displayMode: compact
---
gantt
title GANTT compact
dateFormat HH:mm:ss
axisFormat %Hh%M
section DB Clean
Clean: 12:00:00, 10m
Clean: 12:30:00, 12m
Clean: 13:00:00, 8m
Clean: 13:30:00, 9m
Clean: 14:00:00, 13m
Clean: 14:30:00, 10m
Clean: 15:00:00, 11m
section Sessions
A: 12:00:00, 63m
B: 12:30:00, 12m
C: 13:05:00, 12m
D: 13:06:00, 33m
E: 13:15:00, 55m
F: 13:20:00, 12m
G: 13:32:00, 18m
H: 13:50:00, 20m
I: 14:10:00, 10m
</pre>
<hr />
<script>
function ganttTestClick(a, b, c) {
console.log('a:', a);

View File

@@ -54,6 +54,9 @@
<li>
<h2><a href="./pie.html">Pie</a></h2>
</li>
<li>
<h2><a href="./quadrantchart.html">Quadrant charts</a></h2>
</li>
<li>
<h2><a href="./requirements.html">Requirements</a></h2>
</li>
@@ -63,6 +66,9 @@
<li>
<h2><a href="./state.html">State</a></h2>
</li>
<li>
<h2><a href="./zenuml.html">ZenUML</a></h2>
</li>
</ul>
</body>
</html>

View File

@@ -81,7 +81,6 @@
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
await mermaid.registerExternalDiagrams([mermaidMindmap]);
mermaid.initialize({
theme: 'base',
startOnLoad: true,

View File

@@ -26,6 +26,7 @@
<hr />
<pre class="mermaid">
%%{init: {"pie": {"textPosition": 0.9}, "themeVariables": {"pieOuterStrokeWidth": "5px"}} }%%
pie
title Key elements in Product X
accTitle: Key elements in Product X
@@ -37,7 +38,7 @@
</pre>
<script type="module">
import mermaid from '../packages/mermaid/src/mermaid';
import mermaid from './mermaid.esm.mjs';
mermaid.initialize({
theme: 'forest',
// themeCSS: '.node rect { fill: red; }',

55
demos/quadrantchart.html Normal file
View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
<style>
div.mermaid {
/* font-family: 'trebuchet ms', verdana, arial; */
font-family: 'Courier New', Courier, monospace !important;
}
</style>
</head>
<body>
<h1>Quadrant chart demos</h1>
<pre class="mermaid">
%%{init: {"quadrantChart": {"quadrantPadding": 10}, "theme": "forest", "themeVariables": {"quadrant1TextFill": "blue"}} }%%
quadrantChart
x-axis Urgent --> Not Urgent
y-axis Not Important --> important
quadrant-1 Plan
quadrant-2 Do
quadrant-3 Deligate
quadrant-4 Delete
</pre>
<pre class="mermaid">
%%{init: {"quadrantChart": {"chartWidth": 600, "chartHeight": 600} } }%%
quadrantChart
title Analytics and Business Intelligence Platforms
x-axis "Completeness of Vision ❤" -->
y-axis Ability to Execute
quadrant-1 Leaders
quadrant-2 Challengers
quadrant-3 Niche
quadrant-4 Visionaries
Microsoft: [0.75, 0.75]
Salesforce: [0.55, 0.60]
IBM: [0.51, 0.40]
Incorta: [0.20, 0.30]
</pre>
<hr />
<script type="module">
import mermaid from './mermaid.esm.mjs';
mermaid.initialize({
theme: 'default',
logLevel: 3,
securityLevel: 'loose',
});
</script>
</body>
</html>

View File

@@ -144,6 +144,26 @@
>
<hr />
<pre class="mermaid">
sequenceDiagram
participant Alice
participant Bob
participant John
par_over Section title
Alice ->> Bob: Message 1<br>Second line
Bob ->> John: Message 2
end
par_over Two line<br>section title
Note over Alice: Alice note
Note over Bob: Bob note<br>Second line
Note over John: John note
end
par_over Mixed section
Alice ->> Bob: Message 1
Note left of Bob: Alice/Bob Note
end
</pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
mermaid.initialize({

53
demos/zenuml.html Normal file
View File

@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Mermaid Zenuml Test Page</title>
</head>
<body>
<h1>Zenuml demos</h1>
<pre class="mermaid">
zenuml
title Sync Messages (Design Pattern: Adapter)
@Starter(Client)
Adapter.interfaceMethod() {
translateParameter(parameter)
result = Implementation.implementationMethod()
translateResult()
return translatedResult
}
</pre>
<pre class="mermaid">
zenuml
title Async Messages (SPA Authentication)
// ```
// GET https://${account.namespace}/authorize/?
// response_type=token
// &client_id=${account.clientId}
// &redirect_url=YOUR_CALLBACK_URL
// &state=VALUE_THAT_SURVIVES_REDIRECTS
// &scope=openid
// ```
Browser->Auth0: 1. initiate the authentication
Auth0->"Identity Provider": 2. OAuth2 / SAML, etc
"Identity Provider"->"Identity Provider": 3. user gets authenticated
Auth0->Browser: 4. redirect to ${YOUR_CALLBACK_URL}/#id_token=e68...
Browser->Auth0: 5. validate id_token and get user profile
Browser->"Your API": 6. call API sending JWT in Authorization header
"Your API"->"Your API": 7. validate token
</pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import zenuml from './mermaid-zenuml.esm.mjs';
await mermaid.registerExternalDiagrams([zenuml]);
mermaid.initialize({
logLevel: 3,
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
# Tutorials
This is list of publicly available Tutorials for using Mermaid.JS . This is intended as a basic introduction for the use of the Live Editor for generating diagrams, and deploying Mermaid.JS through HTML.
This is a list of publicly available Tutorials for using Mermaid.JS and is intended as a basic introduction for the use of the Live Editor for generating diagrams, and deploying Mermaid.JS through HTML.
**Note that these tutorials might display an older interface, but the usage of the live-editor will largely be the same.**

View File

@@ -16,4 +16,4 @@
#### Defined in
[mermaidAPI.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L70)
[mermaidAPI.ts:77](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L77)

View File

@@ -39,7 +39,7 @@ bindFunctions?.(div); // To call bindFunctions only if it's present.
#### Defined in
[mermaidAPI.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L91)
[mermaidAPI.ts:98](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L98)
---
@@ -51,4 +51,4 @@ The svg code for the rendered graph.
#### Defined in
[mermaidAPI.ts:81](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L81)
[mermaidAPI.ts:88](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L88)

View File

@@ -14,7 +14,7 @@
#### Defined in
[defaultConfig.ts:2084](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L2084)
[defaultConfig.ts:2293](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L2293)
---

View File

@@ -25,13 +25,13 @@ Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi)
#### Defined in
[mermaidAPI.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L75)
[mermaidAPI.ts:82](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L82)
## Variables
### mermaidAPI
`Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `void` ; `parse`: (`text`: `string`, `parseOptions?`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md)) => `Promise`<`boolean` | `void`> ; `parseDirective`: (`p`: `any`, `statement`: `string`, `context`: `string`, `type`: `string`) => `void` ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](../interfaces/mermaidAPI.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }>
`Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getDiagramFromText`: (`text`: `string`) => `Promise`<`Diagram`> ; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `void` ; `parse`: (`text`: `string`, `parseOptions?`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md)) => `Promise`<`boolean`> ; `parseDirective`: (`p`: `any`, `statement`: `string`, `context`: `string`, `type`: `string`) => `void` ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](../interfaces/mermaidAPI.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }>
## mermaidAPI configuration defaults
@@ -88,6 +88,7 @@ const config = {
numberSectionStyles: 4,
axisFormat: '%Y-%m-%d',
topAxis: false,
displayMode: '',
},
};
mermaid.initialize(config);
@@ -95,7 +96,7 @@ mermaid.initialize(config);
#### Defined in
[mermaidAPI.ts:662](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L662)
[mermaidAPI.ts:670](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L670)
## Functions
@@ -126,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:309](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L309)
---
@@ -152,7 +153,7 @@ the cleaned up svgCode
#### Defined in
[mermaidAPI.ts:259](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L259)
[mermaidAPI.ts:257](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L257)
---
@@ -178,7 +179,7 @@ the string with all the user styles
#### Defined in
[mermaidAPI.ts:188](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L188)
[mermaidAPI.ts:186](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L186)
---
@@ -201,7 +202,7 @@ the string with all the user styles
#### Defined in
[mermaidAPI.ts:236](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L236)
[mermaidAPI.ts:234](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L234)
---
@@ -228,7 +229,7 @@ with an enclosing block that has each of the cssClasses followed by !important;
#### Defined in
[mermaidAPI.ts:172](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L172)
[mermaidAPI.ts:170](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L170)
---
@@ -248,7 +249,7 @@ with an enclosing block that has each of the cssClasses followed by !important;
#### Defined in
[mermaidAPI.ts:152](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L152)
[mermaidAPI.ts:156](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L156)
---
@@ -268,7 +269,7 @@ with an enclosing block that has each of the cssClasses followed by !important;
#### Defined in
[mermaidAPI.ts:123](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L123)
[mermaidAPI.ts:127](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L127)
---
@@ -294,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:288](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L288)
---
@@ -319,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:359](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L359)

View File

@@ -261,6 +261,34 @@ The theming engine will only recognize hex colors and not color names. So, the v
| activationBkgColor | secondaryColor | Activation Background Color |
| sequenceNumberColor | calculated from lineColor | Sequence Number Color |
## Pie Diagram Variables
| Variable | Default value | Description |
| ------------------- | ------------------------------ | ------------------------------------------ |
| pie1 | primaryColor | Fill for 1st section in pie diagram |
| pie2 | secondaryColor | Fill for 2nd section in pie diagram |
| pie3 | calculated from tertiary | Fill for 3rd section in pie diagram |
| pie4 | calculated from primaryColor | Fill for 4th section in pie diagram |
| pie5 | calculated from secondaryColor | Fill for 5th section in pie diagram |
| pie6 | calculated from tertiaryColor | Fill for 6th section in pie diagram |
| pie7 | calculated from primaryColor | Fill for 7th section in pie diagram |
| pie8 | calculated from primaryColor | Fill for 8th section in pie diagram |
| pie9 | calculated from primaryColor | Fill for 9th section in pie diagram |
| pie10 | calculated from primaryColor | Fill for 10th section in pie diagram |
| pie11 | calculated from primaryColor | Fill for 11th section in pie diagram |
| pie12 | calculated from primaryColor | Fill for 12th section in pie diagram |
| pieTitleTextSize | 25px | Title text size |
| pieTitleTextColor | taskTextDarkColor | Title text color |
| pieSectionTextSize | 17px | Text size of individual section labels |
| pieSectionTextColor | textColor | Text color of individual section labels |
| pieLegendTextSize | 17px | Text size of labels in diagram legend |
| pieLegendTextColor | taskTextDarkColor | Text color of labels in diagram legend |
| pieStrokeColor | black | Border color of individual pie sections |
| pieStrokeWidth | 2px | Border width of individual pie sections |
| pieOuterStrokeWidth | 2px | Border width of pie diagram's outer circle |
| pieOuterStrokeColor | black | Border color of pie diagram's outer circle |
| pieOpacity | 0.7 | Opacity of individual pie sections |
## State Colors
| Variable | Default value | Description |

View File

@@ -112,10 +112,10 @@ A `securityLevel` configuration has to first be cleared. `securityLevel` sets th
Values:
- **strict**: (**default**) tags in text are encoded, click functionality is disabled
- **loose**: tags in text are allowed, click functionality is enabled
- **antiscript**: html tags in text are allowed, (only script element is removed), click functionality is enabled
- **sandbox**: With this security level all rendering takes place in a sandboxed iframe. This prevent any JavaScript running in the context. This may hinder interactive functionality of the diagram like scripts, popups in sequence diagram or links to other tabs/targets etc.
- **strict**: (**default**) HTML tags in the text are encoded and click functionality is disabled.
- **antiscript**: HTML tags in text are allowed (only script elements are removed) and click functionality is enabled.
- **loose**: HTML tags in text are allowed and click functionality is enabled.
- **sandbox**: With this security level, all rendering takes place in a sandboxed iframe. This prevent any JavaScript from running in the context. This may hinder interactive functionality of the diagram, like scripts, popups in the sequence diagram, links to other tabs or targets, etc.
> **Note**
> This changes the default behaviour of mermaid so that after upgrade to 8.2, unless the `securityLevel` is not changed, tags in flowcharts are encoded as tags and clicking is disabled.
@@ -247,6 +247,23 @@ The example below show an outline of how this could be used. The example just lo
</script>
```
To determine the type of diagram present in a given text, you can utilize the `mermaid.detectType` function, as demonstrated in the example below.
```html
<script type="module">
import mermaid from './mermaid.esm.mjs';
const graphDefinition = `sequenceDiagram
Pumbaa->>Timon:I ate like a pig.
Timon->>Pumbaa:Pumbaa, you ARE a pig.`;
try {
const type = mermaid.detectType(graphDefinition);
console.log(type); // 'sequence'
} catch (error) {
// UnknownDiagramError
}
</script>
```
### Binding events
Sometimes the generated graph also has defined interactions like tooltip and click events. When using the API one must
@@ -331,10 +348,10 @@ mermaid.parseError = function (err, hash) {
displayErrorInGui(err);
};
const textFieldUpdated = function () {
const textFieldUpdated = async function () {
const textStr = getTextFromFormField('code');
if (mermaid.parse(textStr)) {
if (await mermaid.parse(textStr)) {
reRender(textStr);
}
};

View File

@@ -16,16 +16,19 @@ They also serve as proof of concept, for the variety of things that can be built
- [Using code blocks](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) (**Native support**)
- [GitHub action: Compile mermaid to image](https://github.com/neenjaw/compile-mermaid-markdown-action)
- [svg-generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator)
- [GitHub Writer](https://github.com/ckeditor/github-writer)
- [GitLab](https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts) (**Native support**)
- [Gitea](https://gitea.io) (**Native support**)
- [Azure Devops](https://docs.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops#add-mermaid-diagrams-to-a-wiki-page) (**Native support**)
- [Tuleap](https://docs.tuleap.org/user-guide/writing-in-tuleap.html#graphs) (**Native support**)
- [Mermaid Flow Visual Editor](https://www.mermaidflow.app) (**Native support**)
- [Deepdwn](https://billiam.itch.io/deepdwn) (**Native support**)
- [Joplin](https://joplinapp.org) (**Native support**)
- [Slab](https://slab.com) (**Native support**)
- [Swimm](https://swimm.io) (**Native support**)
- [Notion](https://notion.so) (**Native support**)
- [Observable](https://observablehq.com/@observablehq/mermaid) (**Native support**)
- [Obsidian](https://help.obsidian.md/How+to/Format+your+notes#Diagram) (**Native support**)
- [Obsidian](https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax#Diagram) (**Native support**)
- [GitBook](https://gitbook.com)
- [Mermaid Plugin](https://github.com/JozoVilcek/gitbook-plugin-mermaid)
- [Markdown with Mermaid CLI](https://github.com/miao1007/gitbook-plugin-mermaid-cli)
@@ -56,6 +59,8 @@ They also serve as proof of concept, for the variety of things that can be built
- [hexo-filter-mermaid-diagrams](https://github.com/webappdevelp/hexo-filter-mermaid-diagrams)
- [hexo-tag-mermaid](https://github.com/JameChou/hexo-tag-mermaid)
- [hexo-mermaid-diagrams](https://github.com/mslxl/hexo-mermaid-diagrams)
- [Nextra](https://nextra.site/)
- [Mermaid](https://nextra.site/docs/guide/mermaid)
## CMS
@@ -88,7 +93,7 @@ They also serve as proof of concept, for the variety of things that can be built
- [FosWiki](https://foswiki.org)
- [Mermaid Plugin](https://foswiki.org/Extensions/MermaidPlugin)
- [DokuWiki](https://dokuwiki.org)
- [Flowcharts](https://www.dokuwiki.org/plugin:flowcharts?s[]=mermaid)
- [Mermaid Plugin](https://www.dokuwiki.org/plugin:mermaid)
- [ComboStrap](https://combostrap.com/mermaid)
- [TiddlyWiki](https://tiddlywiki.com/)
- [mermaid-tw5: full js library](https://github.com/efurlanm/mermaid-tw5)
@@ -140,16 +145,22 @@ They also serve as proof of concept, for the variety of things that can be built
- [Named block =Diagram](https://github.com/zag/podlite/tree/main/packages/podlite-diagrams)
- [GNU Nano](https://www.nano-editor.org/)
- [Nano Mermaid](https://github.com/Yash-Singh1/nano-mermaid)
- [CKEditor](https://github.com/ckeditor/ckeditor5)
- [CKEditor 5 Mermaid plugin](https://github.com/ckeditor/ckeditor5-mermaid)
## Document Generation
- [Sphinx](https://www.sphinx-doc.org/en/master/)
- [sphinxcontrib-mermaid](https://github.com/mgaitan/sphinxcontrib-mermaid)
- [remark.js](https://remark.js.org/)
- [remark-mermaid](https://github.com/temando/remark-mermaid)
- [remark](https://remark.js.org/)
- [remark-mermaidjs](https://github.com/remcohaszing/remark-mermaidjs)
- [rehype](https://github.com/rehypejs/rehype)
- [rehype-mermaidjs](https://github.com/remcohaszing/rehype-mermaidjs)
- [Gatsby](https://www.gatsbyjs.com/)
- [gatsby-remark-mermaid](https://github.com/remcohaszing/gatsby-remark-mermaid)
- [jSDoc](https://jsdoc.app/)
- [jsdoc-mermaid](https://github.com/Jellyvision/jsdoc-mermaid)
- [MkDocs](https://mkdocs.org)
- [MkDocs](https://www.mkdocs.org)
- [mkdocs-mermaid2-plugin](https://github.com/fralau/mkdocs-mermaid2-plugin)
- [mkdocs-material](https://github.com/squidfunk/mkdocs-material), check the [docs](https://squidfunk.github.io/mkdocs-material/reference/diagrams/)
- [Type Doc](https://typedoc.org/)
@@ -159,6 +170,7 @@ They also serve as proof of concept, for the variety of things that can be built
- [codedoc-mermaid-plugin](https://www.npmjs.com/package/codedoc-mermaid-plugin)
- [mdbook](https://rust-lang.github.io/mdBook/index.html)
- [mdbook-mermaid](https://github.com/badboy/mdbook-mermaid)
- [Quarto](https://quarto.org/)
## Browser Extensions
@@ -186,6 +198,7 @@ They also serve as proof of concept, for the variety of things that can be built
- [bisheng-plugin-mermaid](https://github.com/yct21/bisheng-plugin-mermaid)
- [Reveal CK](https://github.com/jedcn/reveal-ck)
- [reveal-ck-mermaid-plugin](https://github.com/tmtm/reveal-ck-mermaid-plugin)
- [mermaid-isomorphic](https://github.com/remcohaszing/mermaid-isomorphic)
- [mermaid-server: Generate diagrams using a HTTP request](https://github.com/TomWright/mermaid-server)
- [ExDoc](https://github.com/elixir-lang/ex_doc)
- [Rendering Mermaid graphs](https://github.com/elixir-lang/ex_doc#rendering-mermaid-graphs)

View File

@@ -235,6 +235,42 @@ journey
Sit down: 5: Me
```
### [Quadrant Chart](../syntax/quadrantChart.md)
```mermaid-example
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
```
```mermaid
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
```
## Installation
**In depth guides and examples can be found at [Getting Started](./n00b-gettingStarted.md) and [Usage](../config/usage.md).**
@@ -263,7 +299,7 @@ To Deploy Mermaid:
### [Mermaid API](../config/setup/README.md):
**To deploy mermaid without a bundler, one can insert a `script` tag with an absolute address and a `mermaid.initialize` call into the HTML like so:**
**To deploy mermaid without a bundler, insert a `script` tag with an absolute address and a `mermaid.initialize` call into the HTML using the following example:**
```html
<script type="module">
@@ -272,9 +308,9 @@ To Deploy Mermaid:
</script>
```
**Doing so will command the mermaid parser to look for the `<div>` or `<pre>` tags with `class="mermaid"`. From these tags mermaid will try to read the diagram/chart definitions and render them into SVG charts.**
**Doing so commands the mermaid parser to look for the `<div>` or `<pre>` tags with `class="mermaid"`. From these tags, mermaid tries read the diagram/chart definitions and render them into SVG charts.**
**Examples can be found at** [Other examples](../syntax/examples.md)
**Examples can be found in** [Other examples](../syntax/examples.md)
## Sibling projects

View File

@@ -0,0 +1,13 @@
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/news/announcements.md](../../packages/mermaid/src/docs/news/announcements.md).
# Announcements
## [Bad documentation is bad for developers](https://www.mermaidchart.com/blog/posts/bad-documentation-is-bad-for-developers)
26 April 2023 · 11 mins
Documentation tends to be bad because companies and projects dont fully realize the costs of bad documentation.

43
docs/news/blog.md Normal file
View File

@@ -0,0 +1,43 @@
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/news/blog.md](../../packages/mermaid/src/docs/news/blog.md).
# Blog
## [Bad documentation is bad for developers](https://www.mermaidchart.com/blog/posts/bad-documentation-is-bad-for-developers)
26 April 2023 · 11 mins
Documentation tends to be bad because companies and projects dont fully realize the costs of bad documentation.
## [Automatic text wrapping in flowcharts is here!](https://www.mermaidchart.com/blog/posts/automatic-text-wrapping-in-flowcharts-is-here/)
3 April 2023 · 3 mins
Markdown Strings reduce the hassle # Starting from v10.
## [Mermaid Chart officially launched with sharable diagram links and presentation mode](https://www.mermaidchart.com/blog/posts/mermaid-chart-officially-launched-with-sharable-diagram-links-and-presentation-mode/)
27 March 2023 · 2 mins
Exciting news for all Mermaid OSS fans: Mermaid Chart has officially launched with Mermaid Chart!
## [If you're not excited about ChatGPT, then you're not being creative](https://www.mermaidchart.com/blog/posts/if-youre-not-excited-about-chatgpt-then-youre-not-being-creative-enough/)
8 March 2023 · 9 mins
The hype around AI in general and ChatGPT, in particular, is so intense that its very understandable to assume the hype train is driving straight toward the trough of disillusionment.
## [Flow charts are O(n)2 complex, so don't go over 100 connections](https://www.mermaidchart.com/blog/posts/flow-charts-are-on2-complex-so-dont-go-over-100-connections/)
1 March 2023 · 12 mins
Flowchart design is a game of balance: Read about the importance of dialling in the right level of detail and how to manage complexity in large flowcharts.
## [Busting the myth that developers can't write](https://www.mermaidchart.com/blog/posts/busting-the-myth-that-developers-cant-write/)
10 February 2023 · 10 mins
Busting the myth that developers cant write # Its an annoying stereotype that developers dont know how to write, speak, and otherwise communicate.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -128,7 +128,7 @@ classDiagram
Vehicle <|-- Car
```
Naming convention: a class name should be composed only of alphanumeric characters (including unicode), and underscores.
Naming convention: a class name should be composed only of alphanumeric characters (including unicode), underscores, and dashes (-).
### Class labels
@@ -283,12 +283,12 @@ To describe the visibility (or encapsulation) of an attribute or method/function
- `#` Protected
- `~` Package/Internal
> _note_ you can also include additional _classifiers_ to a method definition by adding the following notation to the _end_ of the method, i.e.: after the `()`:
> _note_ you can also include additional _classifiers_ to a method definition by adding the following notation to the _end_ of the method, i.e.: after the `()` or after the return type:
>
> - `*` Abstract e.g.: `someAbstractMethod()*`
> - `$` Static e.g.: `someStaticMethod()$`
> - `*` Abstract e.g.: `someAbstractMethod()*` or `someAbstractMethod() int*`
> - `$` Static e.g.: `someStaticMethod()$` or `someStaticMethod() String$`
> _note_ you can also include additional _classifiers_ to a field definition by adding the following notation to the end of its name:
> _note_ you can also include additional _classifiers_ to a field definition by adding the following notation to the very end:
>
> - `$` Static e.g.: `String someField$`
@@ -421,6 +421,34 @@ And `Link` can be one of:
| -- | Solid |
| .. | Dashed |
## Define Namespace
A namespace groups classes.
Code:
```mermaid-example
classDiagram
namespace BaseShapes {
class Triangle
class Rectangle {
double width
double height
}
}
```
```mermaid
classDiagram
namespace BaseShapes {
class Triangle
class Rectangle {
double width
double height
}
}
```
## Cardinality / Multiplicity on relations
Multiplicity or cardinality in class diagrams indicates the number of instances of one class that can be linked to an instance of the other class. For example, each company will have one or more employees (not zero), and each employee currently works for zero or one companies.
@@ -604,10 +632,26 @@ You would define these actions on a separate line after all classes have been de
## Notes
It is possible to add notes on diagram using `note "line1\nline2"` or note for class using `note for class "line1\nline2"`
It is possible to add notes on the diagram using `note "line1\nline2"`. A note can be added for a specific class using `note for <CLASS NAME> "line1\nline2"`.
### Examples
```mermaid-example
classDiagram
note "This is a general note"
note for MyClass "This is a note for a class"
class MyClass{
}
```
```mermaid
classDiagram
note "This is a general note"
note for MyClass "This is a note for a class"
class MyClass{
}
```
_URL Link:_
```mermaid-example

View File

@@ -6,11 +6,10 @@
# Flowcharts - Basic Syntax
All Flowcharts are composed of **nodes**, the geometric shapes and **edges**, the arrows or lines. The mermaid code defines the way that these **nodes** and **edges** are made and interact.
Flowcharts are composed of **nodes** (geometric shapes) and **edges** (arrows or lines). The Mermaid code defines how nodes and edges are made and accommodates different arrow types, multi-directional arrows, and any linking to and from subgraphs.
It can also accommodate different arrow types, multi directional arrows, and linking to and from subgraphs.
> **Important note**: Do not type the word "end" as a Flowchart node. Capitalize all or any one the letters to keep the flowchart from breaking, i.e, "End" or "END". Or you can apply this [workaround](https://github.com/mermaid-js/mermaid/issues/1444#issuecomment-639528897).
> **Warning**
> If you are using the word "end" in a Flowchart node, capitalize the entire word or any of the letters (e.g., "End" or "END"), or apply this [workaround](https://github.com/mermaid-js/mermaid/issues/1444#issuecomment-639528897). Typing "end" in all lowercase letters will break the Flowchart.
### A node (default)
@@ -55,7 +54,45 @@ flowchart LR
id1[This is the text in the box]
```
## Graph
#### Unicode text
Use `"` to enclose the unicode text.
```mermaid-example
flowchart LR
id["This ❤ Unicode"]
```
```mermaid
flowchart LR
id["This ❤ Unicode"]
```
#### Markdown formatting
Use double quotes and backticks "\` text \`" to enclose the markdown text.
```mermaid-example
%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
markdown["`This **is** _Markdown_`"]
newLines["`Line1
Line 2
Line 3`"]
markdown --> newLines
```
```mermaid
%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
markdown["`This **is** _Markdown_`"]
newLines["`Line1
Line 2
Line 3`"]
markdown --> newLines
```
### Direction
This statement declares the direction of the Flowchart.
@@ -83,15 +120,13 @@ flowchart LR
Start --> Stop
```
## Flowchart Orientation
Possible FlowChart orientations are:
- TB - top to bottom
- TD - top-down/ same as top to bottom
- BT - bottom to top
- RL - right to left
- LR - left to right
- TB - Top to bottom
- TD - Top-down/ same as top to bottom
- BT - Bottom to top
- RL - Right to left
- LR - Left to right
## Node shapes
@@ -183,20 +218,6 @@ flowchart LR
### A hexagon node
Code:
```mermaid-example
flowchart LR
id1{{This is the text in the box}}
```
```mermaid
flowchart LR
id1{{This is the text in the box}}
```
Render:
```mermaid-example
flowchart LR
id1{{This is the text in the box}}
@@ -648,7 +669,7 @@ flowchart TB
end
```
## flowcharts
### flowcharts
With the graphtype flowchart it is also possible to set edges to and from subgraphs as in the flowchart below.
@@ -686,7 +707,7 @@ flowchart TB
two --> c2
```
## Direction in subgraphs
### Direction in subgraphs
With the graphtype flowcharts you can use the direction statement to set the direction which the subgraph will render like in this example.
@@ -724,6 +745,44 @@ flowchart LR
B1 --> B2
```
## Markdown Strings
The "Markdown Strings" feature enhances flowcharts and mind maps by offering a more versatile string type, which supports text formatting options such as bold and italics, and automatically wraps text within labels.
```mermaid-example
%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
subgraph "One"
a("`The **cat**
in the hat`") -- "edge label" --> b{{"`The **dog** in the hog`"}}
end
subgraph "`**Two**`"
c("`The **cat**
in the hat`") -- "`Bold **edge label**`" --> d("The dog in the hog")
end
```
```mermaid
%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
subgraph "One"
a("`The **cat**
in the hat`") -- "edge label" --> b{{"`The **dog** in the hog`"}}
end
subgraph "`**Two**`"
c("`The **cat**
in the hat`") -- "`Bold **edge label**`" --> d("The dog in the hog")
end
```
Formatting:
- For bold text, use double asterisks (`**`) before and after the text.
- For italics, use single asterisks (`*`) before and after the text.
- With traditional strings, you needed to add `<br>` tags for text to wrap in nodes. However, markdown strings automatically wrap text when it becomes too long and allows you to start a new line by simply using a newline character instead of a `<br>` tag.
This feature is applicable to node labels, edge labels, and subgraph labels.
## Interaction
It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab. **Note**: This functionality is disabled when using `securityLevel='strict'` and enabled when using `securityLevel='loose'`.
@@ -979,7 +1038,7 @@ flowchart TD
B-->E(A fa:fa-camera-retro perhaps?)
```
?> Mermaid is now only compatible with Font Awesome versions 4 and 5. Check that you are using the correct version of Font Awesome.
Mermaid is compatible with Font Awesome up to verion 5, Free icons only. Check that the icons you use are from the [supported set of icons](https://fontawesome.com/v5/search?o=r&m=free).
## Graph declarations with spaces between vertices and link and without semicolon

View File

@@ -257,9 +257,41 @@ The pattern is:
More info in: <https://github.com/d3/d3-time#interval_every>
## Output in compact mode
The compact mode allows you to display multiple tasks in the same row. Compact mode can be enabled for a gantt chart by setting the display mode of the graph via preceeding YAML settings.
```mermaid-example
---
displayMode: compact
---
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :a2, 2014-01-20, 25d
Another one :a3, 2014-02-10, 20d
```
```mermaid
---
displayMode: compact
---
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :a2, 2014-01-20, 25d
Another one :a3, 2014-02-10, 20d
```
## Comments
Comments can be entered within a gantt chart, which will be ignored by the parser. Comments need to be on their own line and must be prefaced with `%%` (double percent signs). Any text after the start of the comment to the next newline will be treated as a comment, including any diagram syntax
Comments can be entered within a gantt chart, which will be ignored by the parser. Comments need to be on their own line and must be prefaced with `%%` (double percent signs). Any text after the start of the comment to the next newline will be treated as a comment, including any diagram syntax.
```mermaid-example
gantt
@@ -432,3 +464,41 @@ Beginner's tip—a full example using interactive links in an html context:
</script>
</body>
```
## Examples
### Bar chart (using gantt chart)
```mermaid-example
gantt
title Git Issues - days since last update
dateFormat X
axisFormat %s
section Issue19062
71 : 0, 71
section Issue19401
36 : 0, 36
section Issue193
34 : 0, 34
section Issue7441
9 : 0, 9
section Issue1300
5 : 0, 5
```
```mermaid
gantt
title Git Issues - days since last update
dateFormat X
axisFormat %s
section Issue19062
71 : 0, 71
section Issue19401
36 : 0, 36
section Issue193
34 : 0, 34
section Issue7441
9 : 0, 9
section Issue1300
5 : 0, 5
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

View File

@@ -182,7 +182,7 @@ More shapes will be added, beginning with the shapes available in flowcharts.
## Icons
As with flowcharts you can add icons to your nodes but with an updated syntax. The styling for the font based icons are added during the integration so that they are available for the web page. _This is not something a diagram author can do but has to be done with the site administrator or the integrator_. Once the icon fonts are in place you add them to the mind map nodes using the `::icon()` syntax. You place the classes for the icon within the parenthesis like in the following example where icons for material design and fontawesome 4 are displayed. The intention is that this approach should be used for all diagrams supporting icons. **Experimental feature:** This wider scope is also the reason Mindmaps are experimental as this syntax and approach could change.
As with flowcharts you can add icons to your nodes but with an updated syntax. The styling for the font based icons are added during the integration so that they are available for the web page. _This is not something a diagram author can do but has to be done with the site administrator or the integrator_. Once the icon fonts are in place you add them to the mind map nodes using the `::icon()` syntax. You place the classes for the icon within the parenthesis like in the following example where icons for material design and [Font Awesome 5](https://fontawesome.com/v5/search?o=r&m=free) are displayed. The intention is that this approach should be used for all diagrams supporting icons. **Experimental feature:** This wider scope is also the reason Mindmaps are experimental as this syntax and approach could change.
```mermaid-example
mindmap
@@ -224,7 +224,7 @@ mindmap
C
```
_These classes needs top be supplied by the site administrator._
_These classes need to be supplied by the site administrator._
## Unclear indentation
@@ -254,6 +254,34 @@ Root
C
```
## Markdown Strings
The "Markdown Strings" feature enhances mind maps by offering a more versatile string type, which supports text formatting options such as bold and italics, and automatically wraps text within labels.
```mermaid-example
mindmap
id1["`**Root** with
a second line
Unicode works too: 🤓`"]
id2["`The dog in **the** hog... a *very long text* that wraps to a new line`"]
id3[Regular labels still works]
```
```mermaid
mindmap
id1["`**Root** with
a second line
Unicode works too: 🤓`"]
id2["`The dog in **the** hog... a *very long text* that wraps to a new line`"]
id3[Regular labels still works]
```
Formatting:
- For bold text, use double asterisks \*\* before and after the text.
- For italics, use single asterisks \* before and after the text.
- With traditional strings, you needed to add <br> tags for text to wrap in nodes. However, markdown strings automatically wrap text when it becomes too long and allows you to start a new line by simply using a newline character instead of a <br> tag.
## Integrating with your library/website.
Mindmap uses the experimental lazy loading & async rendering features which could change in the future. From version 9.4.0 this diagram is included in mermaid but use lazy loading in order to keep the size of mermaid down. This is important in order to be able to add additional diagrams going forward.

View File

@@ -48,6 +48,7 @@ Drawing a pie chart is really simple in mermaid.
## Example
```mermaid-example
%%{init: {"pie": {"textPosition": 0.5}, "themeVariables": {"pieOuterStrokeWidth": "5px"}} }%%
pie showData
title Key elements in Product X
"Calcium" : 42.96
@@ -57,6 +58,7 @@ pie showData
```
```mermaid
%%{init: {"pie": {"textPosition": 0.5}, "themeVariables": {"pieOuterStrokeWidth": "5px"}} }%%
pie showData
title Key elements in Product X
"Calcium" : 42.96
@@ -64,3 +66,11 @@ pie showData
"Magnesium" : 10.01
"Iron" : 5
```
## Configuration
Possible pie diagram configuration parameters:
| Parameter | Description | Default value |
| -------------- | ------------------------------------------------------------------------------------------------------------ | ------------- |
| `textPosition` | The axial position of the pie slice labels, from 0.0 at the center to 1.0 at the outside edge of the circle. | `0.75` |

View File

@@ -0,0 +1,168 @@
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/quadrantChart.md](../../packages/mermaid/src/docs/syntax/quadrantChart.md).
# Quadrant Chart
> A quadrant chart is a visual representation of data that is divided into four quadrants. It is used to plot data points on a two-dimensional grid, with one variable represented on the x-axis and another variable represented on the y-axis. The quadrants are determined by dividing the chart into four equal parts based on a set of criteria that is specific to the data being analyzed. Quadrant charts are often used to identify patterns and trends in data, and to prioritize actions based on the position of data points within the chart. They are commonly used in business, marketing, and risk management, among other fields.
## Example
```mermaid-example
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
```
```mermaid
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
```
## Syntax
> **Note**
> If there is no points available in the chart both **axis** text and **quadrant** will be rendered in the center of the respective quadrant.
> If there are points **x-axis** labels will rendered from left of the respective quadrant also they will be displayed in bottom of the chart, and **y-axis** lables will be rendered in bottom of the respective quadrant, the quadrant text will render at top of the respective quadrant.
> **Note**
> For points x and y value min value is 0 and max value is 1.
### Title
The title is a short description of the chart and it will always render on top of the chart.
#### Example
quadrantChart
title This is a sample example
### x-axis
The x-axis determine what text would be displayed in the x-axis. In x-axis there is two part **left** and **right** you can pass **both** or you can pass only **left**. The statement should start with `x-axis` then the `left axis text` followed by the delimiter `-->` then `right axis text`.
#### Example
1. `x-axis <text> --> <text>` both the left and right axis text will be rendered.
2. `x-axis <text>` only the left axis text will be rendered.
### y-axis
The y-axis determine what text would be displayed in the y-axis. In y-axis there is two part **top** and **bottom** you can pass **both** or you can pass only **bottom**. The statement should start with `y-axis` then the `bottom axis text` followed by the delimiter `-->` then `top axis text`.
#### Example
1. `y-axis <text> --> <text>` both the bottom and top axis text will be rendered.
2. `y-axis <text>` only the bottom axis text will be rendered.
### Quadrants text
The `quadrant-[1,2,3,4]` determine what text would be displayed inside the quadrants.
#### Example
1. `quadrant-1 <text>` determine what text will be rendered inside the top right quadrant.
2. `quadrant-2 <text>` determine what text will be rendered inside the top left quadrant.
3. `quadrant-3 <text>` determine what text will be rendered inside the bottom left quadrant.
4. `quadrant-4 <text>` determine what text will be rendered inside the bottom right quadrant.
### Points
Points are used to plot a circle inside the quadrantChart. The syntax is `<text>: [x, y]` here x and y value is in the range 0 - 1.
#### Example
1. `Point 1: [0.75, 0.80]` here the Point 1 will be drawn in the top right quadrant.
2. `Point 2: [0.35, 0.24]` here the Point 2 will be drawn in the bottom left quadrant.
## Chart Configurations
| Parameter | Description | Default value |
| --------------------------------- | ------------------------------------------------------------------------------------------------- | :-----------: |
| chartWidth | Width of the chart | 500 |
| chartHeight | Height of the chart | 500 |
| titlePadding | Top and Bottom padding of the title | 10 |
| titleFontSize | Title font size | 20 |
| quadrantPadding | Padding outside all the quadrants | 5 |
| quadrantTextTopPadding | Quadrant text top padding when text is drawn on top ( not data points are there) | 5 |
| quadrantLabelFontSize | Quadrant text font size | 16 |
| quadrantInternalBorderStrokeWidth | Border stroke width inside the quadrants | 1 |
| quadrantExternalBorderStrokeWidth | Quadrant external border stroke width | 2 |
| xAxisLabelPadding | Top and bottom padding of x-axis text | 5 |
| xAxisLabelFontSize | X-axis texts font size | 16 |
| xAxisPosition | Position of x-axis (top , bottom) if there are points the x-axis will alway be rendered in bottom | 'top' |
| yAxisLabelPadding | Left and Right padding of y-axis text | 5 |
| yAxisLabelFontSize | Y-axis texts font size | 16 |
| yAxisPosition | Position of y-axis (left , right) | 'left' |
| pointTextPadding | Padding between point and the below text | 5 |
| pointLabelFontSize | Point text font size | 12 |
| pointRadius | Radius of the point to be drawn | 5 |
## Chart Theme Variables
| Parameter | Description |
| -------------------------------- | --------------------------------------- |
| quadrant1Fill | Fill color of the top right quadrant |
| quadrant2Fill | Fill color of the top left quadrant |
| quadrant3Fill | Fill color of the bottom left quadrant |
| quadrant4Fill | Fill color of the bottom right quadrant |
| quadrant1TextFill | Text color of the top right quadrant |
| quadrant2TextFill | Text color of the top left quadrant |
| quadrant3TextFill | Text color of the bottom left quadrant |
| quadrant4TextFill | Text color of the bottom right quadrant |
| quadrantPointFill | Points fill color |
| quadrantPointTextFill | Points text color |
| quadrantXAxisTextFill | X-axis text color |
| quadrantYAxisTextFill | Y-axis text color |
| quadrantInternalBorderStrokeFill | Quadrants inner border color |
| quadrantExternalBorderStrokeFill | Quadrants outer border color |
| quadrantTitleFill | Title color |
## Example on config and theme
```mermaid-example
%%{init: {"quadrantChart": {"chartWidth": 400, "chartHeight": 400}, "themeVariables": {"quadrant1TextFill": "#ff0000"} }}%%
quadrantChart
x-axis Urgent --> Not Urgent
y-axis Not Important --> "Important ❤"
quadrant-1 Plan
quadrant-2 Do
quadrant-3 Deligate
quadrant-4 Delete
```
```mermaid
%%{init: {"quadrantChart": {"chartWidth": 400, "chartHeight": 400}, "themeVariables": {"quadrant1TextFill": "#ff0000"} }}%%
quadrantChart
x-axis Urgent --> Not Urgent
y-axis Not Important --> "Important ❤"
quadrant-1 Plan
quadrant-2 Do
quadrant-3 Deligate
quadrant-4 Delete
```

View File

@@ -8,7 +8,7 @@
> Timeline: This is an experimental diagram for now. The syntax and properties can change in future releases. The syntax is stable except for the icon integration which is the experimental part.
"A timeline is a type of diagram used to illustrate a chronology of events, dates, or periods of time. It is usually presented graphically to indicate the passing of time, and it is usually organized chronologically. A basic timeline presents a list of events in chronological order, usually using dates as markers. A timeline can also be used to show the relationship between events, such as the relationship between the events of a person's life. A timeline can also be used to show the relationship between events, such as the relationship between the events of a person's life." Wikipedia
"A timeline is a type of diagram used to illustrate a chronology of events, dates, or periods of time. It is usually presented graphically to indicate the passing of time, and it is usually organized chronologically. A basic timeline presents a list of events in chronological order, usually using dates as markers. A timeline can also be used to show the relationship between events, such as the relationship between the events of a person's life." Wikipedia
### An example of a timeline.
@@ -213,7 +213,7 @@ However, if there is no section defined, then we have two possibilities:
```
Note that this is no, section defined, and each time period and its corresponding events will have its own color scheme.
Note that there are no sections defined, and each time period and its corresponding events will have its own color scheme.
2. Disable the multiColor option using the `disableMultiColor` option. This will make all time periods and events follow the same color scheme.
@@ -257,7 +257,7 @@ let us look at same example, where we have disabled the multiColor option.
### Customizing Color scheme
You can customize the color scheme using the `cScale0` to `cScale11` theme variables. Mermaid allows you to set unique colors for up-to 12, where `cScale0` variable will drive the value of the first section or time-period, `cScale1` will drive the value of the second section and so on.
You can customize the color scheme using the `cScale0` to `cScale11` theme variables. Mermaid allows you to set unique colors for up-to 12 sections, where `cScale0` variable will drive the value of the first section or time-period, `cScale1` will drive the value of the second section and so on.
In case you have more than 12 sections, the color scheme will start to repeat.
NOTE: Default values for these theme variables are picked from the selected theme. If you want to override the default values, you can use the `initialize` call to add your custom theme variable values.

472
docs/syntax/zenuml.md Normal file
View File

@@ -0,0 +1,472 @@
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/zenuml.md](../../packages/mermaid/src/docs/syntax/zenuml.md).
# ZenUML
> A Sequence diagram is an interaction diagram that shows how processes operate with one another and in what order.
Mermaid can render sequence diagrams with [ZenUML](https://zenuml.com). Note that ZenUML uses a different
syntax than the original Sequence Diagram in mermaid.
```mermaid-example
zenuml
title Demo
Alice->John: Hello John, how are you?
John->Alice: Great!
Alice->John: See you later!
```
```mermaid
zenuml
title Demo
Alice->John: Hello John, how are you?
John->Alice: Great!
Alice->John: See you later!
```
## Syntax
### Participants
The participants can be defined implicitly as in the first example on this page. The participants or actors are
rendered in order of appearance in the diagram source text. Sometimes you might want to show the participants in a
different order than how they appear in the first message. It is possible to specify the actor's order of
appearance by doing the following:
```mermaid-example
zenuml
title Declare participant (optional)
Bob
Alice
Alice->Bob: Hi Bob
Bob->Alice: Hi Alice
```
```mermaid
zenuml
title Declare participant (optional)
Bob
Alice
Alice->Bob: Hi Bob
Bob->Alice: Hi Alice
```
### Annotators
If you specifically want to use symbols instead of just rectangles with text you can do so by using the annotator syntax to declare participants as per below.
```mermaid-example
zenuml
title Annotators
@Actor Alice
@Database Bob
Alice->Bob: Hi Bob
Bob->Alice: Hi Alice
```
```mermaid
zenuml
title Annotators
@Actor Alice
@Database Bob
Alice->Bob: Hi Bob
Bob->Alice: Hi Alice
```
Here are the available annotators:
![img.png](img/zenuml-participant-annotators.png)
### Aliases
The participants can have a convenient identifier and a descriptive label.
```mermaid-example
zenuml
title Aliases
A as Alice
J as John
A->J: Hello John, how are you?
J->A: Great!
```
```mermaid
zenuml
title Aliases
A as Alice
J as John
A->J: Hello John, how are you?
J->A: Great!
```
## Messages
Messages can be one of:
1. Sync message
2. Async message
3. Creation message
4. Reply message
### Sync message
You can think of a sync (blocking) method in a programming language.
```mermaid-example
zenuml
title Sync message
A.SyncMessage
A.SyncMessage(with, parameters) {
B.nestedSyncMessage()
}
```
```mermaid
zenuml
title Sync message
A.SyncMessage
A.SyncMessage(with, parameters) {
B.nestedSyncMessage()
}
```
### Async message
You can think of an async (non-blocking) method in a programming language.
Fire an event and forget about it.
```mermaid-example
zenuml
title Async message
Alice->Bob: How are you?
```
```mermaid
zenuml
title Async message
Alice->Bob: How are you?
```
### Creation message
We use `new` keyword to create an object.
```mermaid-example
zenuml
new A1
new A2(with, parameters)
```
```mermaid
zenuml
new A1
new A2(with, parameters)
```
### Reply message
There are three ways to express a reply message:
```mermaid-example
zenuml
// 1. assign a variable from a sync message.
a = A.SyncMessage()
// 1.1. optionally give the variable a type
SomeType a = A.SyncMessage()
// 2. use return keyword
A.SyncMessage() {
return result
}
// 3. use @return or @reply annotator on an async message
@return
A->B: result
```
```mermaid
zenuml
// 1. assign a variable from a sync message.
a = A.SyncMessage()
// 1.1. optionally give the variable a type
SomeType a = A.SyncMessage()
// 2. use return keyword
A.SyncMessage() {
return result
}
// 3. use @return or @reply annotator on an async message
@return
A->B: result
```
The third way `@return` is rarely used, but it is useful when you want to return to one level up.
```mermaid-example
zenuml
title Reply message
Client->A.method() {
B.method() {
if(condition) {
return x1
// return early
@return
A->Client: x11
}
}
return x2
}
```
```mermaid
zenuml
title Reply message
Client->A.method() {
B.method() {
if(condition) {
return x1
// return early
@return
A->Client: x11
}
}
return x2
}
```
## Nesting
Sync messages and Creation messages are naturally nestable with `{}`.
```mermaid-example
zenuml
A.method() {
B.nested_sync_method()
B->C: nested async message
}
```
```mermaid
zenuml
A.method() {
B.nested_sync_method()
B->C: nested async message
}
```
## Comments
It is possible to add comments to a sequence diagram with `// comment` syntax.
Comments will be rendered above the messages or fragments. Comments on other places
are ignored. Markdown is supported.
See the example below:
```mermaid-example
zenuml
// a comment on a participant will not be rendered
BookService
// a comment on a message.
// **Markdown** is supported.
BookService.getBook()
```
```mermaid
zenuml
// a comment on a participant will not be rendered
BookService
// a comment on a message.
// **Markdown** is supported.
BookService.getBook()
```
## Loops
It is possible to express loops in a ZenUML diagram. This is done by any of the
following notations:
1. while
2. for
3. forEach, foreach
4. loop
```zenuml
while(condition) {
...statements...
}
```
See the example below:
```mermaid-example
zenuml
Alice->John: Hello John, how are you?
while(true) {
John->Alice: Great!
}
```
```mermaid
zenuml
Alice->John: Hello John, how are you?
while(true) {
John->Alice: Great!
}
```
## Alt
It is possible to express alternative paths in a sequence diagram. This is done by the notation
```zenuml
if(condition1) {
...statements...
} else if(condition2) {
...statements...
} else {
...statements...
}
```
See the example below:
```mermaid-example
zenuml
Alice->Bob: Hello Bob, how are you?
if(is_sick) {
Bob->Alice: Not so good :(
} else {
Bob->Alice: Feeling fresh like a daisy
}
```
```mermaid
zenuml
Alice->Bob: Hello Bob, how are you?
if(is_sick) {
Bob->Alice: Not so good :(
} else {
Bob->Alice: Feeling fresh like a daisy
}
```
## Opt
It is possible to render an `opt` fragment. This is done by the notation
```zenuml
opt {
...statements...
}
```
See the example below:
```mermaid-example
zenuml
Alice->Bob: Hello Bob, how are you?
Bob->Alice: Not so good :(
opt {
Bob->Alice: Thanks for asking
}
```
```mermaid
zenuml
Alice->Bob: Hello Bob, how are you?
Bob->Alice: Not so good :(
opt {
Bob->Alice: Thanks for asking
}
```
## Parallel
It is possible to show actions that are happening in parallel.
This is done by the notation
```zenuml
par {
statement1
statement2
statement3
}
```
See the example below:
```mermaid-example
zenuml
par {
Alice->Bob: Hello guys!
Alice->John: Hello guys!
}
```
```mermaid
zenuml
par {
Alice->Bob: Hello guys!
Alice->John: Hello guys!
}
```
## Try/Catch/Finally (Break)
It is possible to indicate a stop of the sequence within the flow (usually used to model exceptions).
This is done by the notation
try {
...statements...
} catch {
...statements...
} finally {
...statements...
}
See the example below:
```mermaid-example
zenuml
try {
Consumer->API: Book something
API->BookingService: Start booking process
} catch {
API->Consumer: show failure
} finally {
API->BookingService: rollback status
}
```
```mermaid
zenuml
try {
Consumer->API: Book something
API->BookingService: Start booking process
} catch {
API->Consumer: show failure
} finally {
API->BookingService: rollback status
}
```
## Integrating with your library/website.
Zenuml uses the experimental lazy loading & async rendering features which could change in the future.
You can use this method to add mermaid including the zenuml diagram to a web page:
```html
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
import zenuml from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-zenuml@0.1.0/dist/mermaid-zenuml.esm.min.mjs';
await mermaid.registerExternalDiagrams([zenuml]);
</script>
```

View File

@@ -1,10 +1,10 @@
{
"name": "mermaid-monorepo",
"private": true,
"version": "10.0.2",
"version": "10.2.3",
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"type": "module",
"packageManager": "pnpm@7.27.0",
"packageManager": "pnpm@8.5.1",
"keywords": [
"diagram",
"markdown",
@@ -18,7 +18,7 @@
"build:vite": "ts-node-esm --transpileOnly .vite/build.ts",
"build:mermaid": "pnpm build:vite --mermaid",
"build:viz": "pnpm build:mermaid --visualize",
"build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-example-diagram/tsconfig.json --emitDeclarationOnly",
"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",
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"",
@@ -26,6 +26,7 @@
"lint": "eslint --cache --cache-strategy content --ignore-path .gitignore . && pnpm lint:jison && prettier --cache --check .",
"lint:fix": "eslint --cache --cache-strategy content --fix --ignore-path .gitignore . && prettier --write . && ts-node-esm scripts/fixCSpell.ts",
"lint:jison": "ts-node-esm ./scripts/jison/lint.mts",
"contributors": "ts-node-esm scripts/updateContributors.ts",
"cypress": "cypress run",
"cypress:open": "cypress open",
"e2e": "start-server-and-test dev http://localhost:9000/ cypress",
@@ -54,64 +55,65 @@
]
},
"devDependencies": {
"@applitools/eyes-cypress": "^3.27.6",
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@cspell/eslint-plugin": "^6.14.2",
"@applitools/eyes-cypress": "^3.32.0",
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.6.1",
"@cspell/eslint-plugin": "^6.31.1",
"@rollup/plugin-typescript": "^11.1.0",
"@types/cors": "^2.8.13",
"@types/eslint": "^8.4.10",
"@types/eslint": "^8.37.0",
"@types/express": "^4.17.17",
"@types/js-yaml": "^4.0.5",
"@types/jsdom": "^21.0.0",
"@types/lodash": "^4.14.188",
"@types/mdast": "^3.0.10",
"@types/node": "^18.11.9",
"@types/prettier": "^2.7.1",
"@types/jsdom": "^21.1.1",
"@types/lodash": "^4.14.194",
"@types/mdast": "^3.0.11",
"@types/node": "^18.16.0",
"@types/prettier": "^2.7.2",
"@types/rollup-plugin-visualizer": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"@vitest/coverage-c8": "^0.28.4",
"@vitest/spy": "^0.28.4",
"@vitest/ui": "^0.28.4",
"concurrently": "^7.5.0",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/spy": "^0.31.0",
"@vitest/ui": "^0.31.0",
"concurrently": "^8.0.1",
"cors": "^2.8.5",
"coveralls": "^3.1.1",
"cypress": "^12.0.0",
"cypress": "^12.10.0",
"cypress-image-snapshot": "^4.0.1",
"esbuild": "^0.17.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-cypress": "^2.12.1",
"esbuild": "^0.17.18",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-cypress": "^2.13.2",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jsdoc": "^43.0.7",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-tsdoc": "^0.2.17",
"eslint-plugin-unicorn": "^45.0.0",
"eslint-plugin-unicorn": "^46.0.0",
"express": "^4.18.2",
"globby": "^13.1.2",
"husky": "^8.0.2",
"jest": "^29.3.1",
"globby": "^13.1.4",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jison": "^0.4.18",
"js-yaml": "^4.1.0",
"jsdom": "^21.0.0",
"lint-staged": "^13.0.3",
"jsdom": "^21.1.1",
"lint-staged": "^13.2.1",
"path-browserify": "^1.0.1",
"pnpm": "^7.15.0",
"prettier": "^2.7.1",
"pnpm": "^8.3.1",
"prettier": "^2.8.8",
"prettier-plugin-jsdoc": "^0.4.2",
"rimraf": "^4.0.0",
"rollup-plugin-visualizer": "^5.8.3",
"start-server-and-test": "^1.15.4",
"rimraf": "^5.0.0",
"rollup-plugin-visualizer": "^5.9.0",
"start-server-and-test": "^2.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"vite": "^4.1.1",
"vitest": "^0.28.5"
"typescript": "^5.0.4",
"vite": "^4.3.1",
"vitest": "^0.31.0"
},
"volta": {
"node": "18.14.0"
"node": "18.16.0"
}
}

View File

@@ -48,8 +48,8 @@
},
"devDependencies": {
"@types/cytoscape": "^3.19.9",
"concurrently": "^7.5.0",
"rimraf": "^4.0.0",
"concurrently": "^8.0.0",
"rimraf": "^5.0.0",
"mermaid": "workspace:*"
},
"resolutions": {

View File

@@ -1,9 +1,9 @@
// @ts-ignore: TODO Fix ts errors
import parser from './parser/exampleDiagram';
import * as db from './exampleDiagramDb';
import renderer from './exampleDiagramRenderer';
import styles from './styles';
import { injectUtils } from './mermaidUtils';
import parser from './parser/exampleDiagram.jison';
import * as db from './exampleDiagramDb.js';
import renderer from './exampleDiagramRenderer.js';
import styles from './styles.js';
import { injectUtils } from './mermaidUtils.js';
export const diagram = {
db,

View File

@@ -1,6 +1,6 @@
import { parser } from './parser/exampleDiagram';
import * as db from './exampleDiagramDb';
import { injectUtils } from './mermaidUtils';
import { parser } from './parser/exampleDiagram.jison';
import * as db from './exampleDiagramDb.js';
import { injectUtils } from './mermaidUtils.js';
// Todo fix utils functions for tests
import {
log,
@@ -8,7 +8,7 @@ import {
getConfig,
sanitizeText,
setupGraphViewBox,
} from '../../mermaid/src/diagram-api/diagramAPI';
} from '../../mermaid/src/diagram-api/diagramAPI.js';
injectUtils(log, setLogLevel, getConfig, sanitizeText, setupGraphViewBox);

View File

@@ -1,5 +1,5 @@
/** Created by knut on 15-01-14. */
import { log } from './mermaidUtils';
import { log } from './mermaidUtils.js';
var message = '';
var info = false;

View File

@@ -1,6 +1,6 @@
/** Created by knut on 14-12-11. */
import { select } from 'd3';
import { log, getConfig, setupGraphViewbox } from './mermaidUtils';
import { log, getConfig, setupGraphViewbox } from './mermaidUtils.js';
/**
* Draws a an info picture in the tag with id: id based on the graph definition in text.

View File

@@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"module": "esnext",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"

View File

@@ -0,0 +1 @@
../mermaid/src/docs/syntax/zenuml.md

View File

@@ -0,0 +1,47 @@
{
"name": "@mermaid-js/mermaid-zenuml",
"version": "0.1.0",
"description": "MermaidJS plugin for ZenUML integration",
"module": "dist/mermaid-zenuml.core.mjs",
"types": "dist/detector.d.ts",
"type": "module",
"exports": {
".": {
"import": "./dist/mermaid-zenuml.core.mjs",
"types": "./dist/detector.d.ts"
},
"./*": "./*"
},
"keywords": [
"diagram",
"markdown",
"zenuml",
"mermaid"
],
"scripts": {
"prepublishOnly": "pnpm -w run build"
},
"repository": {
"type": "git",
"url": "https://github.com/mermaid-js/mermaid",
"directory": "packages/mermaid-zenuml"
},
"contributors": [
"Peng Xiao (https://github.com/MrCoder)",
"Sidharth Vinod (https://sidharth.dev)",
"Dong Cai (https://github.com/dontry)"
],
"license": "MIT",
"dependencies": {
"@zenuml/core": "^3.0.0"
},
"devDependencies": {
"mermaid": "workspace:^"
},
"peerDependencies": {
"mermaid": "workspace:>=10.0.0"
},
"files": [
"dist"
]
}

View File

@@ -0,0 +1,21 @@
import type { ExternalDiagramDefinition } from 'mermaid';
const id = 'zenuml';
const regexp = /^\s*zenuml/;
const detector = (txt: string) => {
return txt.match(regexp) !== null;
};
const loader = async () => {
const { diagram } = await import('./zenuml-definition.js');
return { id, diagram };
};
const plugin: ExternalDiagramDefinition = {
id,
detector,
loader,
};
export default plugin;

View File

@@ -0,0 +1,58 @@
import type { MermaidConfig } from 'mermaid';
const warning = (s: string) => {
// Todo remove debug code
// eslint-disable-next-line no-console
console.error('Log function was called before initialization', s);
};
export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
export const LEVELS: Record<LogLevel, number> = {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4,
fatal: 5,
};
export const log: Record<keyof typeof LEVELS, typeof console.log> = {
trace: warning,
debug: warning,
info: warning,
warn: warning,
error: warning,
fatal: warning,
};
export let setLogLevel: (level: keyof typeof LEVELS | number | string) => void;
export let getConfig: () => MermaidConfig;
export let sanitizeText: (str: string) => string;
// eslint-disable @typescript-eslint/no-explicit-any
export let setupGraphViewbox: (
graph: any,
svgElem: any,
padding: any,
useMaxWidth: boolean
) => void;
export const injectUtils = (
_log: Record<keyof typeof LEVELS, typeof console.log>,
_setLogLevel: any,
_getConfig: any,
_sanitizeText: any,
_setupGraphViewbox: any
) => {
_log.info('Mermaid utils injected');
log.trace = _log.trace;
log.debug = _log.debug;
log.info = _log.info;
log.warn = _log.warn;
log.error = _log.error;
log.fatal = _log.fatal;
setLogLevel = _setLogLevel;
getConfig = _getConfig;
sanitizeText = _sanitizeText;
setupGraphViewbox = _setupGraphViewbox;
};

View File

@@ -0,0 +1,12 @@
/**
* ZenUML manage parsing internally. It uses Antlr4 to parse the DSL.
* The parser is defined in https://github.com/ZenUml/vue-sequence/blob/main/src/parser/index.js
*
* This is a dummy parser that satisfies the mermaid API logic.
*/
export default {
parser: { yy: {} },
parse: () => {
// no op
},
};

View File

@@ -0,0 +1,17 @@
import { injectUtils } from './mermaidUtils.js';
import parser from './parser.js';
import renderer from './zenumlRenderer.js';
export const diagram = {
db: {
clear: () => {
// no-op
},
},
renderer,
parser,
styles: () => {
// no-op
},
injectUtils,
};

View File

@@ -0,0 +1,68 @@
import { getConfig, log } from './mermaidUtils.js';
import ZenUml from '@zenuml/core';
const regexp = /^\s*zenuml/;
// Create a Zen UML container outside the svg first for rendering, otherwise the Zen UML diagram cannot be rendered properly
function createTemporaryZenumlContainer(id: string) {
const container = document.createElement('div');
container.id = `container-${id}`;
container.style.display = 'flex';
container.innerHTML = `<div id="zenUMLApp-${id}"></div>`;
const app = container.querySelector(`#zenUMLApp-${id}`) as HTMLElement;
return { container, app };
}
// Create a foreignObject to wrap the Zen UML container in the svg
function createForeignObject(id: string) {
const foreignObject = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject');
foreignObject.setAttribute('x', '0');
foreignObject.setAttribute('y', '0');
foreignObject.setAttribute('width', '100%');
foreignObject.setAttribute('height', '100%');
const { container, app } = createTemporaryZenumlContainer(id);
foreignObject.appendChild(container);
return { foreignObject, container, app };
}
/**
* Draws a Zen UML in the tag with id: id based on the graph definition in text.
*
* @param text - The text of the diagram
* @param id - The id of the diagram which will be used as a DOM element id¨
*/
export const draw = async function (text: string, id: string) {
log.info('draw with Zen UML renderer', ZenUml);
text = text.replace(regexp, '');
const { securityLevel } = getConfig();
// Handle root and Document for when rendering in sandbox mode
let sandboxElement: HTMLIFrameElement | null = null;
if (securityLevel === 'sandbox') {
sandboxElement = document.getElementById('i' + id) as HTMLIFrameElement;
}
const root = securityLevel === 'sandbox' ? sandboxElement?.contentWindow?.document : document;
const svgContainer = root?.querySelector(`svg#${id}`);
if (!root || !svgContainer) {
log.error('Cannot find root or svgContainer');
return;
}
const { foreignObject, container, app } = createForeignObject(id);
svgContainer.appendChild(foreignObject);
// @ts-expect-error @zenuml/core@3.0.0 exports the wrong type for ZenUml
const zenuml = new ZenUml(app);
// default is a theme name. More themes to be added and will be configurable in the future
await zenuml.render(text, 'theme-mermaid');
const { width, height } = window.getComputedStyle(container);
log.debug('zenuml diagram size', width, height);
svgContainer.setAttribute('style', `width: ${width}; height: ${height};`);
};
export default {
draw,
};

View File

@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["./src/**/*.ts"],
"typeRoots": ["./src/types"]
}

View File

@@ -1,3 +1,6 @@
src/vitepress
src/docs/config/setup
README.*
README.*
src/docs/public/user-avatars/
src/docs/.vitepress/cache
src/docs/.vitepress/components.d.ts

View File

@@ -1,6 +1,6 @@
{
"name": "mermaid",
"version": "10.0.2",
"version": "10.2.3",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"type": "module",
"module": "./dist/mermaid.core.mjs",
@@ -8,7 +8,8 @@
"exports": {
".": {
"types": "./dist/mermaid.d.ts",
"import": "./dist/mermaid.core.mjs"
"import": "./dist/mermaid.core.mjs",
"default": "./dist/mermaid.core.mjs"
},
"./*": "./*"
},
@@ -27,8 +28,8 @@
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts",
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify",
"docs:pre:vitepress": "rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress",
"docs:build:vitepress": "pnpm docs:pre:vitepress && vitepress build src/vitepress && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"vitepress dev src/vitepress\" \"ts-node-esm src/docs.mts --watch --vitepress\"",
"docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm --filter ./ install --no-frozen-lockfile --ignore-scripts && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./ src/vitepress dev\" \"ts-node-esm src/docs.mts --watch --vitepress\"",
"docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
"docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"",
"release": "pnpm build",
@@ -51,19 +52,20 @@
]
},
"dependencies": {
"@braintree/sanitize-url": "^6.0.0",
"@braintree/sanitize-url": "^6.0.2",
"cytoscape": "^3.23.0",
"cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-fcose": "^2.1.0",
"d3": "^7.4.0",
"dagre-d3-es": "7.0.9",
"dagre-d3-es": "7.0.10",
"dayjs": "^1.11.7",
"dompurify": "2.4.3",
"dompurify": "3.0.3",
"elkjs": "^0.8.2",
"khroma": "^2.0.0",
"lodash-es": "^4.17.21",
"mdast-util-from-markdown": "^1.3.0",
"non-layered-tidy-tree-layout": "^2.0.2",
"stylis": "^4.1.2",
"stylis": "^4.1.3",
"ts-dedent": "^2.2.0",
"uuid": "^9.0.0",
"web-worker": "^1.2.0"
@@ -71,42 +73,46 @@
"devDependencies": {
"@types/cytoscape": "^3.19.9",
"@types/d3": "^7.4.0",
"@types/dompurify": "^2.4.0",
"@types/jsdom": "^21.0.0",
"@types/lodash-es": "^4.17.6",
"@types/dompurify": "^3.0.2",
"@types/jsdom": "^21.1.1",
"@types/lodash-es": "^4.17.7",
"@types/micromatch": "^4.0.2",
"@types/prettier": "^2.7.1",
"@types/prettier": "^2.7.2",
"@types/stylis": "^4.0.2",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"chokidar": "^3.5.3",
"concurrently": "^7.5.0",
"concurrently": "^8.0.1",
"coveralls": "^3.1.1",
"cpy-cli": "^4.2.0",
"cspell": "^6.14.3",
"globby": "^13.1.2",
"cspell": "^6.31.1",
"csstree-validator": "^3.0.0",
"globby": "^13.1.4",
"jison": "^0.4.18",
"js-base64": "^3.7.2",
"jsdom": "^21.0.0",
"js-base64": "^3.7.5",
"jsdom": "^21.1.1",
"micromatch": "^4.0.5",
"path-browserify": "^1.0.1",
"prettier": "^2.7.1",
"prettier": "^2.8.8",
"remark": "^14.0.2",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^3.0.1",
"rimraf": "^4.0.0",
"start-server-and-test": "^1.14.0",
"typedoc": "^0.23.18",
"typedoc-plugin-markdown": "^3.13.6",
"typescript": "^4.8.4",
"rimraf": "^5.0.0",
"start-server-and-test": "^2.0.0",
"typedoc": "^0.24.5",
"typedoc-plugin-markdown": "^3.15.2",
"typescript": "^5.0.4",
"unist-util-flatmap": "^1.0.0",
"vitepress": "^1.0.0-alpha.46",
"vitepress-plugin-search": "^1.0.4-alpha.19"
"vitepress": "^1.0.0-alpha.72",
"vitepress-plugin-search": "^1.0.4-alpha.20"
},
"files": [
"dist",
"dist/",
"README.md"
],
"sideEffects": false
"sideEffects": false,
"publishConfig": {
"access": "public"
}
}

View File

@@ -1,12 +1,18 @@
import * as configApi from './config';
import { log } from './logger';
import { getDiagram, registerDiagram } from './diagram-api/diagramAPI';
import { detectType, getDiagramLoader } from './diagram-api/detectType';
import { extractFrontMatter } from './diagram-api/frontmatter';
import { UnknownDiagramError } from './errors';
import { DetailedError } from './utils';
import * as configApi from './config.js';
import { log } from './logger.js';
import { getDiagram, registerDiagram } from './diagram-api/diagramAPI.js';
import { detectType, getDiagramLoader } from './diagram-api/detectType.js';
import { extractFrontMatter } from './diagram-api/frontmatter.js';
import { UnknownDiagramError } from './errors.js';
import { DetailedError } from './utils.js';
import { cleanupComments } from './diagram-api/comments.js';
export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
/**
* An object representing a parsed mermaid diagram definition.
* @privateRemarks This is exported as part of the public mermaidAPI.
*/
export class Diagram {
type = 'graph';
parser;
@@ -38,7 +44,10 @@ export class Diagram {
// Similarly, we can't do this in getDiagramFromText() because some code
// calls diagram.db.clear(), which would reset anything set by
// extractFrontMatter().
this.parser.parse = (text: string) => originalParse(extractFrontMatter(text, this.db));
this.parser.parse = (text: string) =>
originalParse(cleanupComments(extractFrontMatter(text, this.db)));
this.parser.parser.yy = this.db;
if (diagram.init) {
diagram.init(cnf);
@@ -68,6 +77,15 @@ export class Diagram {
}
}
/**
* Parse the text asynchronously and generate a Diagram object asynchronously.
* **Warning:** This function may be changed in the future.
* @alpha
* @param text - The mermaid diagram definition.
* @returns A the Promise of a Diagram object.
* @throws {@link UnknownDiagramError} if the diagram type can not be found.
* @privateRemarks This is exported as part of the public mermaidAPI.
*/
export const getDiagramFromText = async (text: string): Promise<Diagram> => {
const type = detectType(text, configApi.getConfig());
try {

View File

@@ -3,9 +3,9 @@
*
* We can't easily use `vi.spyOn(mermaidAPI, "function")` since the object is frozen with `Object.freeze()`.
*/
import * as configApi from '../config';
import * as configApi from '../config.js';
import { vi } from 'vitest';
import { mermaidAPI as mAPI } from '../mermaidAPI';
import { mermaidAPI as mAPI } from '../mermaidAPI.js';
// original version cannot be modified since it was frozen with `Object.freeze()`
export const mermaidAPI = {

Some files were not shown because too many files have changed in this diff Show More