Compare commits

..

569 Commits

Author SHA1 Message Date
Knut Sveidqvist
820603e475 MC-2620 Cleanup 2025-02-11 11:04:55 +01:00
Knut Sveidqvist
4636305783 Using intersect function 2025-02-11 10:36:00 +01:00
Knut Sveidqvist
2247bc583f Fix for generateRoundedPath 2025-02-11 10:04:26 +01:00
Knut Sveidqvist
fa51a37d8c Merge in latest 2025-02-10 15:29:31 +01:00
Knut Sveidqvist
e6e88cef15 WIP Merge in latest 2025-02-10 14:44:54 +01:00
Knut Sveidqvist
2e47e17d28 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2025-01-31 15:17:59 +01:00
Knut Sveidqvist
79218398ee Fix for lifelines color in default theme 2025-01-31 15:15:55 +01:00
Ashish Jain
01010465dd Merge pull request #34 from Mermaid-Chart/mc-2642-fix-for-class-diagram-markers
Mc 2642 fix for class diagram markers
2025-01-30 12:06:58 +01:00
Knut Sveidqvist
c3b78a37a6 MC-2642 Removing code that makes class diagram arrows go wrong 2025-01-29 16:54:44 +01:00
Ashish Jain
7e9a29f486 MC-2572 fix for class diagram broken edges 2025-01-29 12:03:29 +01:00
Ashish Jain
5d1c619ca5 Update alana version to 11.4.1-b.11 2025-01-28 13:16:40 +01:00
Ashish Jain
23c00bf7ca Merge pull request #33 from Mermaid-Chart/redux-dark-theme-update
updated redux-dark theme
2025-01-28 13:09:18 +01:00
omkarht
b3a2794f1f updated redux-dark theme 2025-01-28 17:17:27 +05:30
Ashish Jain
7513d0e39a Merge pull request #31 from Mermaid-Chart/set-default-font-family-to-arial
Set default font family to "Arial" for all themes
2025-01-28 12:39:35 +01:00
Saurabh Gore
571bbab859 Added "Recursive Variable" font for redux theme 2025-01-28 16:58:50 +05:30
Ashish Jain
88b28e8fc3 Merge pull request #32 from Mermaid-Chart/shape-theme-styling-issue-fix
fixed issues of  border radius and styling, label padding
2025-01-28 11:08:59 +01:00
Ashish Jain
579d1ee33c Merge from upstream mermaid OS develop 2025-01-28 10:56:26 +01:00
Saurabh Gore
13e3d7293e Remove "trebuchet ms", verdana from font family 2025-01-28 12:32:50 +05:30
omkarht
db2295db24 fixed issues of padding and border radius and border styling 2025-01-27 20:10:50 +05:30
Saurabh Gore
aa28880be7 Set default font family to arial for all themes 2025-01-27 19:24:29 +05:30
Ashish Jain
463d42b86d Merge pull request #30 from Mermaid-Chart/mc-2560-dotted-lines-neo
MC-2560 Reviving dotted lines for flowcharts
2025-01-24 15:59:47 +01:00
Knut Sveidqvist
ba0b945821 MC-2560 Reviving dotted lines for flowcharts 2025-01-24 15:49:11 +01:00
Ashish Jain
bf39ae7369 Merge pull request #29 from Mermaid-Chart/redux-theme
Updated html-label alignment for shapes
2025-01-24 15:17:45 +01:00
Ashish Jain
4911b63e44 Merge from upstream mermaid OS develop 2025-01-24 15:15:55 +01:00
omkarht
d52e3d1931 updated html-label alignment for shapes 2025-01-24 17:55:02 +05:30
Ashish Jain
0d308fdffe Merge from upstream mermaid OS develop 2025-01-24 12:47:42 +01:00
Ashish Jain
fb19255f10 Merge pull request #28 from Mermaid-Chart/animations-for-neo-look
#MC-2558 Handling animations for look neo
2025-01-24 12:26:05 +01:00
Ashish Jain
2ef6760cbc Increase size limit of diagrams 2025-01-24 12:18:49 +01:00
Ashish Jain
2f525434fd Merge pull request #27 from Mermaid-Chart/redux-theme
Resolved the issue for shapes  where the drop-shadow was being applied to themes other than Redux.
2025-01-24 12:14:49 +01:00
Knut Sveidqvist
49bdd11011 #MC-2558 Handling animations for look neo 2025-01-24 11:44:05 +01:00
omkarht
f785b47b1d Resolved the issue where the drop-shadow was being applied to themes other than Redux. 2025-01-24 15:20:38 +05:30
Ashish Jain
f7772b440d Merge pull request #25 from Mermaid-Chart/redux-theme
Redux theme
2025-01-23 14:41:45 +01:00
Ashish Jain
5bee403c33 Merge pull request #26 from Mermaid-Chart/2542-astar-exposing-intersection
MC-2542 exposing calcIntersect for use in A* Path finding
2025-01-23 14:32:40 +01:00
Knut Sveidqvist
d7535a9e4d MC-2542 Exposing calcIntersect function 2025-01-23 12:03:54 +01:00
Ashish Jain
fd8f95b628 Fix for default curve on flowchart edge 2025-01-23 11:36:06 +01:00
omkarht
78c63d3dc1 minor adjustment for double circle shape for drop-shadow 2025-01-23 15:17:34 +05:30
omkarht
9c89d3401a Merge branch 'neo-new-shapes' of https://github.com/Mermaid-Chart/alana-mermaid into redux-theme 2025-01-23 14:58:48 +05:30
omkarht
7fbc873fd0 updated drop shadow styling for small shapes 2025-01-23 12:27:47 +05:30
Ashish Jain
1089ec0963 Update alana version to 11.4.1-b.7 2025-01-22 23:56:34 +01:00
Ashish Jain
7df125ab59 Merge from upstream mermaid OS develop 2025-01-22 23:42:47 +01:00
omkarht
7425430b80 updated Label and Stroke color for redux theme 2025-01-22 19:30:12 +05:30
omkarht
2674bb80ab minor adjustment of padding for some shapes 2025-01-22 18:57:25 +05:30
omkarht
d4441e0200 updated padding for set of shapes [Left Curly Brace , Right Curly Brace, Curly Braces ] 2025-01-21 20:25:38 +05:30
omkarht
8bc898ddf1 shapes updated for drop shadow syling in redux theme 2025-01-21 20:01:37 +05:30
omkarht
7afd7a9729 Third Set of shapes updated for drop shadow syling in redux theme 2025-01-21 19:06:04 +05:30
omkarht
fa4d93483a Second Set of shapes updated for drop shadow syling in redux theme 2025-01-21 18:32:01 +05:30
omkarht
7d11a9578a First Set of shapes updated for drop shadow syling in redux theme 2025-01-21 16:08:11 +05:30
omkarht
5b6c5412cd Draft of fifth set of shapes [Lined Process, Delay, Multiprocess, Stored Data, Internal storage] 2025-01-17 13:06:53 +05:30
omkarht
51756edefc Draft of fourth set of shapes [ Document, Tagged Document, Paper Tape, Lined Document, Multiple Documents] 2025-01-16 21:21:31 +05:30
omkarht
4e685b74a7 Draft of third set of shapes [Divided Process, Manual Input,Subprocess, Horizontal Cylinder, Loop Limit] 2025-01-16 17:04:54 +05:30
Knut Sveidqvist
259af0fb77 Tmp removal of edge id handling 2025-01-16 11:08:15 +01:00
omkarht
6e3c37c98b Draft of second set of shapes [Card, Cylinder, Reversed Trapezoid, Odd, Tagged Rect] 2025-01-15 20:49:53 +05:30
Ashish Jain
9114f65dbe Update alana version to 11.4.1-b.4 2025-01-15 13:50:13 +01:00
Ashish Jain
6d73220348 Merge branch 'develop' of github.com:mermaid-js/mermaid into neo-new-shapes 2025-01-15 13:46:01 +01:00
Ashish Jain
e07fd6d98c Update alana version to 11.4.1-b.3 2025-01-15 13:09:21 +01:00
Ashish Jain
e6d45da81e Merge from upstream mermaid OS develop 2025-01-15 12:58:13 +01:00
Knut Sveidqvist
619a1df26e Updated to handle arrow heads differently between noe/classic 2025-01-10 11:44:14 +01:00
Knut Sveidqvist
7491c78c8c Tuning 2024-12-20 15:57:58 +01:00
Knut Sveidqvist
f0fdf91379 Adjustment for point 2024-12-20 15:36:16 +01:00
Knut Sveidqvist
0bf4aa3e82 Fix for arrow point 2024-12-20 15:28:08 +01:00
Knut Sveidqvist
9bf2bda539 Fix for arrow cross 2024-12-20 15:13:52 +01:00
Knut Sveidqvist
35aa869adc Draft of first set of shapes 2024-12-20 12:38:49 +01:00
Knut Sveidqvist
bf20e0615a Redux themes 2024-12-20 11:07:53 +01:00
Knut Sveidqvist
2352b422db #2028 Adding legacy code 2024-12-19 16:12:44 +01:00
Knut Sveidqvist
48a0d41a81 WIP 2024-12-13 10:15:00 +01:00
Knut Sveidqvist
e75260ac07 Initial skeleton setup 2024-12-13 09:12:39 +01:00
Knut Sveidqvist
b5ef6d2e23 Placement draft 2024-12-09 09:29:45 +01:00
Knut Sveidqvist
8277579259 #6097 Handling hourglass and lightningBolt 2024-12-03 10:49:43 +01:00
Knut Sveidqvist
8336d1cf2d #6097 Next shapes, learn-right and card 2024-12-03 10:23:02 +01:00
Knut Sveidqvist
3c93e4640a #6097 Next batch of shapes 2024-11-30 13:42:50 +01:00
Knut Sveidqvist
0c28593ea5 #6097 Implemented calcIntersect for the first round of shapes 2024-11-30 10:54:18 +01:00
Knut Sveidqvist
33d8b1a78d #6097 Added scaffolding for the new function in all shapes 2024-11-30 09:49:54 +01:00
Knut Sveidqvist
1e3ea13323 Fix for when last point is on the intersection 2024-11-29 09:07:47 +01:00
Knut Sveidqvist
4c8c48cde9 Generic solution for intersection of shapes with elk 2024-11-28 14:31:54 +01:00
Ashish Jain
38250af678 Merge from upstream mermaid to sync elk 0.1.7 2024-11-27 18:26:24 +01:00
Knut Sveidqvist
c8e50276e8 Added changeset 2024-11-27 15:54:05 +01:00
Knut Sveidqvist
1e6419a63f #6088 Updated offset calculations 2024-11-27 15:52:24 +01:00
Ashish Jain
de08b8244f Merge from upstream mermaid to sync 11.4.1 2024-11-27 12:25:04 +01:00
pbrolin47
41fdfd4c5c Merge pull request #21 from Mermaid-Chart/fix/classBox-neo-default
Fix invisible divider lines on classBox when using neo-default
2024-11-26 10:30:57 +01:00
yari-dewalt
81c2f0f7a9 Add 'neo-line' class to divider lines when appropriate 2024-11-22 08:29:52 -08:00
Ashish Jain
fee2ad565d chore: update alana version to 11.4.0-b.3 2024-11-21 14:49:58 +01:00
pbrolin47
725e25ad88 Merge pull request #20 from Mermaid-Chart/yari/classBox-neofication
"classBox" Shape Neofication and Resize Support
2024-11-21 11:01:44 +01:00
Ashish Jain
cb03af5214 Merge pull request #19 from Mermaid-Chart/fix-edge-flickring-on-delete-node
edge flickring fix while deleting nodes
2024-11-20 13:12:12 +01:00
Feroz Mujawar
4a812a964d fix scenario where two nodes have multiple edges 2024-11-19 12:10:02 +05:30
yari-dewalt
c4d06cd4fd Fix methodsAreaPlacement 2024-11-15 09:40:49 -08:00
Feroz Mujawar
ae2c533aca edge flickring fix while deleting nodes 2024-11-15 17:56:41 +05:30
yari-dewalt
1598ac713f Update testing html files 2024-11-14 10:35:03 -08:00
yari-dewalt
45d8a815dc Make node compatible with neo look and resizing 2024-11-14 10:33:24 -08:00
yari-dewalt
82b421696b Add support for positions 2024-11-14 10:32:44 -08:00
Ashish Jain
e98ab130cc Merge pull request #13 from Mermaid-Chart/fix-node-resize-intersection
fix intersection required object read from db while resizing node
2024-11-11 10:51:53 +01:00
Feroz Mujawar
ddeab2f705 lint fix 2024-11-11 14:34:54 +05:30
Feroz Mujawar
b08cd5dbba Merge branch 'neo-new-shapes' of https://github.com/Mermaid-Chart/alana-mermaid into fix-node-resize-intersection 2024-11-08 20:21:25 +05:30
Ashish Jain
e842cf582b Merge pull request #18 from Mermaid-Chart/MC-2265/fix-failing-e2e-shapes-test
MC-2265: Fix all failing E2E tests in Mermaid Alana
2024-11-08 15:28:03 +01:00
Alois Klink
6db6beca4b Merge pull request #16 from Mermaid-Chart/alana-11.4.0-megre
Merge mermaid 11.4.0 (develop) to neo-new-shapes in Alana
2024-11-08 14:04:38 +00:00
Alois Klink
35fea81209 Merge remote-tracking branch 'origin/alana-11.4.0-megre'; commit '1388662132cc829f9820c2e9970ae04e2dd90588' into MC-2265/fix-failing-e2e-shapes-test
Merges https://github.com/mermaid-js/mermaid/pull/6038 into
Mermaid Alana, fixing the broken E2E test.

See: https://github.com/mermaid-js/mermaid/pull/6038
See: https://mermaidchart.atlassian.net/browse/MC-2265
2024-11-08 22:29:56 +09:00
Ashish Jain
13d4a238d4 Merge pull request #15 from Mermaid-Chart/ci/disable-argos-in-ci
ci: disable Argos in CI
2024-11-07 14:14:45 +01:00
Alois Klink
c7171fa7b1 test(e2e): fix state diagram useMaxWidth tests
These tests assume that we're using `look: classic, theme: default`,
otherwise the widths are off.

However, since
3dc66a64c (MC-1730 Making neo the default theme, 2024-08-06),
`neo` is now the default look and theme in Alana Mermaid.

Fixes: 3dc66a64c7
2024-11-07 22:13:21 +09:00
Ashish Jain
861599245d Merge from upstream mermaid os 11.4.0 develop 2024-11-07 13:58:42 +01:00
Alois Klink
f550f17dc0 ci: disable Argos in CI
Argos only works in open-source repos, it doesn't work for this private
repo.
2024-11-07 21:49:01 +09:00
Alois Klink
191cd27b2b Merge pull request #14 from Mermaid-Chart/merge-fix/make-parse-error-on-invalid-shape
Merge https://github.com/mermaid-js/mermaid/pull/6002
2024-11-07 12:40:51 +00:00
Ashish Jain
4ad85974c6 Merge pull request #11 from Mermaid-Chart/merge-refactor/improving-rendering-shape-types
Merge https://github.com/mermaid-js/mermaid/pull/5974
2024-11-07 13:34:51 +01:00
Alois Klink
91ed9bb9c2 Merge commit '848be3d1297b833c4e8b2e25fabafec4d7c4db02' into merge-fix/make-parse-error-on-invalid-shape
Pulls PR https://github.com/mermaid-js/mermaid/pull/6002 into Alana.

Fixes a semantic merge conflict in
- `docs/config/setup/interfaces/mermaid.LayoutData.md`

See: https://github.com/mermaid-js/mermaid/pull/6002
2024-10-30 22:31:31 +09:00
Feroz Mujawar
18fd67300f fix intersection required object read from db while resizing node 2024-10-29 14:23:37 +05:30
Alois Klink
93239b5f34 Merge commit 'f8746bee0454b01378726d04f9c65bbc3974eb3a' into merge-refactor/improving-rendering-shape-types
See https://github.com/mermaid-js/mermaid/pull/5974

Conflicts:
	docs/config/setup/interfaces/mermaid.RenderResult.md
	packages/mermaid/src/rendering-util/rendering-elements/shapes/util.ts
2024-10-28 21:03:19 +09:00
Ashish Jain
807820f199 Update alana version to v11.3.0-b.4 2024-10-23 10:47:08 +02:00
Knut Sveidqvist
030aeb8c88 Merge pull request #12 from Mermaid-Chart/subgraph-NaN-fix
fix NaN error while adding subgraph
2024-10-22 16:58:18 +02:00
Feroz Mujawar
0d1212e463 fix NaN error while adding subgraph 2024-10-22 19:42:27 +05:30
Alois Klink
92d706f677 Merge commit '16a5fc05d65165f02966eb7f33154f136394a534' into merge-refactor/improving-rendering-shape-types
See https://github.com/mermaid-js/mermaid/pull/5974

There were a lot of merge conflicts!

Conflicts:
	packages/mermaid/src/rendering-util/rendering-elements/shapes/bowTieRect.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/card.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/crossedCircle.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/cylinder.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/drawRect.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/filledCircle.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/flippedTriangle.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/hourglass.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/iconRounded.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/iconSquare.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/imageSquare.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/lightningBolt.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/linedCylinder.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/roundedRect.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/shadedProcess.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/stateStart.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/taggedRect.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/triangle.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/util.ts
	packages/mermaid/src/rendering-util/rendering-elements/shapes/windowPane.ts
2024-10-18 02:49:26 +09:00
Ashish Jain
44e7e68e0b Update alana version to v11.3.0-b.3 2024-10-17 10:57:28 +02:00
Knut Sveidqvist
7d59a624d7 Updating fontsize to 14px 2024-10-16 18:25:27 +02:00
Ashish Jain
e2dc9e557c Update alana version to v11.3.0-b.2 2024-10-16 14:54:25 +02:00
Knut Sveidqvist
c7adb37a1f Fix for points to rearrange function for issue when using dagre 2024-10-16 13:52:06 +02:00
Ashish Jain
3b5ca1c638 Updated alana version to v11.3.0-b.1 2024-10-10 14:47:01 +02:00
omkarht
ff9fffef90 fixed resizing issue for iconCircle shape 2024-10-10 17:04:37 +05:30
saurabhg772244
71d6ded224 Fix path highlight for neo icons 2024-10-10 10:23:06 +05:30
Alois Klink
5ecd12de1c Merge pull request #10 from Mermaid-Chart/export-calcIntersections-and-calcNodeIntersections
Export `calcIntersections, calcNodeIntersections`
2024-10-09 22:25:58 +09:00
Alois Klink
ee4991f3e7 docs: regenerate docs 2024-10-09 21:55:04 +09:00
Ashish Jain
1028ca2ffc Merge branch 'develop' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-10-09 13:24:46 +02:00
saurabhg772244
edce46b305 Merge branch 'neo-new-shapes' of mermaid.github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-10-09 16:51:50 +05:30
saurabhg772244
2509511135 Fixed neo look for color icons 2024-10-09 16:50:46 +05:30
Alois Klink
c76a513417 Merge branch 'neo-new-shapes' into export-calcIntersections-and-calcNodeIntersections 2024-10-09 19:31:52 +09:00
Sidharth Vinod
3968010d6b skip ts build in alana 2024-10-09 15:51:37 +05:30
Sidharth Vinod
122a44024c fix: change package json import path 2024-10-09 15:44:57 +05:30
Ashish Jain
654c00f88c Update alana version 2024-10-09 11:47:47 +02:00
Ashish Jain
c5acf870de Fix broken unit test 2024-10-09 11:34:14 +02:00
Ashish Jain
c73f8d0990 Merge from upstream mermaid os develop 2024-10-09 11:19:40 +02:00
omkarht
aa91874d9e resolved edge intersection calculation issue for square and rounded form of icon shape 2024-10-08 19:51:28 +05:30
omkarht
42fe55e2bc updated iconCircle shape 2024-10-07 11:53:24 +05:30
omkarht
3bcbad7fa1 upated iconRounded shape 2024-10-07 11:52:08 +05:30
Alois Klink
32ff6ec50f Export calcIntersections, calcNodeIntersections
Support doing:

```js
import { calcIntersections, calcNodeIntersections } from '@mermaid-chart/mermaid';
```

This means we can eventually stop doing `window.calcIntersections` and
`window.calcNodeIntersections`.
2024-10-04 19:57:35 +09:00
Ashish Jain
0198f0e798 Update alana version 2024-10-03 15:42:48 +02:00
Knut Sveidqvist
9aded56538 Updating image and diamond dimension handling 2024-10-03 15:32:07 +02:00
Knut Sveidqvist
b52b54086e Fixed sizing of diamond shape 2024-10-03 07:59:55 +02:00
Ashish Jain
31c01b1795 fix for label positioning for brace-l & brace-r shapes 2024-10-02 21:33:44 +02:00
Ashish Jain
90b200ed2e Merge commit 2024-10-02 21:22:58 +02:00
Ashish Jain
971a166073 fix for label positioning for brances shape 2024-10-02 21:22:01 +02:00
Knut Sveidqvist
4e25bf5db9 Adding handling of self-loops into update position 2024-10-02 21:06:01 +02:00
Ashish Jain
962fcb8ba8 fix for label positioning divided rect 2024-10-02 20:59:21 +02:00
Knut Sveidqvist
b3f2ba8bb8 Fix for intersecrtion calculations for start shape sm-circ 2024-10-02 20:36:10 +02:00
Ashish Jain
bda37516b8 fix for label positioning triangle and flipped triangle 2024-10-02 19:43:54 +02:00
Ashish Jain
0aebb941e9 Updated alana version 2024-10-02 14:45:35 +02:00
Knut Sveidqvist
36df0e340e Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-10-02 14:37:03 +02:00
Ashish Jain
1d8c4fd279 merge from upstream 2024-10-02 14:36:41 +02:00
Knut Sveidqvist
c1377f9075 Adjusted fixed height settings odd 2024-10-02 14:36:19 +02:00
Ashish Jain
c6fd62ab7d fix for min size for flag 2024-10-02 14:07:45 +02:00
Ashish Jain
2abdece0f2 fix for min size for tagged rect 2024-10-02 13:34:28 +02:00
Knut Sveidqvist
ed1427ed31 Adjusted fixed height settings tag-doc 2024-10-02 13:22:38 +02:00
Knut Sveidqvist
36f1dc8541 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-10-02 09:47:22 +02:00
Knut Sveidqvist
7a7d161a61 Fix for tag-doc 2024-10-02 09:46:58 +02:00
Ashish Jain
a2d64a82c5 fix for min size for more shapes 2024-10-02 09:45:55 +02:00
Ashish Jain
f1674b8b04 fix for min size for more shapes 2024-10-01 23:45:32 +02:00
Ashish Jain
eb346e1c51 fix for min size for several shapes 2024-10-01 21:35:30 +02:00
Ashish Jain
d2dfb639c8 fix for min size for several shapes 2024-10-01 18:52:26 +02:00
Alois Klink
5363e9545e Merge 'aloisklink:fix/5904-ban-dompurify-3.1.7' into neo-new-shapes
This prevents DOMPurify 3.1.7 from being installed.
2024-10-02 00:27:19 +09:00
omkarht
42fd9836f0 updated curly-brace shapes 2024-10-01 18:56:29 +05:30
Knut Sveidqvist
bda3bfd2a7 test html file 2024-10-01 14:50:20 +02:00
Knut Sveidqvist
834fa07991 Updated shapes using the set width/height 2024-10-01 14:18:40 +02:00
Knut Sveidqvist
491aa7d9ff Mermaid version v11.2.0-b.12 2024-09-30 15:04:25 +02:00
Knut Sveidqvist
6cf07067e2 Default size for circle 2024-09-30 14:57:14 +02:00
Knut Sveidqvist
d0881534c1 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-30 14:54:40 +02:00
Knut Sveidqvist
f10d148097 Adjusted min values 2024-09-30 14:53:33 +02:00
Per Brolin
f5545d094f Set a smaller default size for stateStart and stateEnd 2024-09-30 13:16:44 +02:00
Per Brolin
c36bdf12a0 Merge branch 'perb-fix-circles-resize' into neo-new-shapes 2024-09-30 10:58:54 +02:00
Per Brolin
92f67af6af Merge branch 'neo-new-shapes' into perb-fix-circles-resize 2024-09-30 10:56:08 +02:00
Per Brolin
d175e9a403 Fixed default size if not provided in height/width 2024-09-30 10:48:15 +02:00
Per Brolin
2ce57e4cf4 Fix default size if width/height not provided 2024-09-30 10:45:52 +02:00
Per Brolin
a7a9185222 Fix default size if not provided 2024-09-30 10:44:01 +02:00
Per Brolin
edc2ac7fea Fixed double circle 2024-09-30 10:35:13 +02:00
Per Brolin
221d59cbfc Fix problem with circle 2024-09-30 10:26:00 +02:00
Knut Sveidqvist
e8472c3647 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-30 10:16:38 +02:00
Knut Sveidqvist
414f666417 Better handling of subgraphs without positions 2024-09-30 10:11:38 +02:00
Per Brolin
5ad1a6082b Merge branch 'neo-new-shapes' into perb-fix-circles-resize 2024-09-29 22:45:46 +02:00
Per Brolin
32d7f470dc fix remaining rendering of circles 2024-09-29 22:40:08 +02:00
Ashish Jain
9b269ecf3b fix for trapezoidal pentagon 2024-09-29 20:42:01 +02:00
Per Brolin
8fa8fd6abd WIP. Updated size-testet 2024-09-29 20:36:36 +02:00
omkarht
9957d3101f updated multiWaveEdgedRectangle shape 2024-09-28 23:52:00 +05:30
Ashish Jain
22982baf1a fix for flipped triangle 2024-09-28 12:35:44 +02:00
Ashish Jain
d3b51e2282 fix for triangle 2024-09-28 12:35:01 +02:00
Knut Sveidqvist
d9b2220085 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-27 17:36:43 +02:00
Knut Sveidqvist
e2ecb8e180 TaggedWaveEdged Rect 2024-09-27 17:35:44 +02:00
Alois Klink
68ba79259a fix: fix sizing of bow-rect in fixed layout
OMG, I never want to hear 'sagitta', 'ellipse', and 'Elliptic integral'
again. This shape was painful to fix.
2024-09-28 00:20:14 +09:00
Knut Sveidqvist
0f7e14ba70 Update for stadium shape 2024-09-27 16:59:37 +02:00
Knut Sveidqvist
59f28810d5 lin-doc shape fixed 2024-09-27 16:26:44 +02:00
Knut Sveidqvist
00b32d07fe Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-27 16:15:06 +02:00
Knut Sveidqvist
bf57a283d3 Trapezoids and document 2024-09-27 16:14:28 +02:00
Alois Klink
ee2e6a2c2c fix: fix sizing of tag-rect in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
9caa46cfd2 fix: fix sizing of st-rect in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
2566f1cab8 fix: fix sizing of sl-rect in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
aae4e6f048 fix: fix sizing of win-pane in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
b32acb619c fix: fix sizing of div-rect in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
1510939196 fix: fix sizing of lin-rect in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
a8db94fd1a fix: fix sizing of notch-rect in fixed layout 2024-09-27 23:05:40 +09:00
Alois Klink
c72d774519 fix: fix sizing of fr-rect in fixed layout 2024-09-27 23:05:40 +09:00
Ashish Jain
437f2c0be2 fix for half-rounded-rectangle 2024-09-27 16:03:13 +02:00
omkarht
82e8eb97cc updated waveRectangle shape 2024-09-27 19:20:29 +05:30
Ashish Jain
c7a2023661 fix for curved trapezoid 2024-09-27 14:43:34 +02:00
Ashish Jain
0b0c0fc1f1 lin cyl 2024-09-27 14:13:54 +02:00
Ashish Jain
ba51f4ab38 fix cylr & h-cyl 2024-09-27 13:55:22 +02:00
Knut Sveidqvist
c3838305b3 Lean-left 2024-09-27 13:44:44 +02:00
Knut Sveidqvist
5b7dfbad94 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-27 13:41:12 +02:00
Knut Sveidqvist
b47168b064 Lean-right and question 2024-09-27 13:40:32 +02:00
saurabhg772244
2c0d48eef5 updated shapes 2024-09-27 17:07:53 +05:30
Knut Sveidqvist
1ef4c42bcf Updating odd shape 2024-09-27 11:59:05 +02:00
saurabhg772244
9da6321c4b updated lightning bolt shape 2024-09-27 15:25:19 +05:30
Ashish Jain
b99e080337 suport dynamic resizing of rect shape 2024-09-27 10:24:29 +02:00
saurabhg772244
7a9ec739d9 fixed lightning bolt shape 2024-09-27 12:17:31 +05:30
Knut Sveidqvist
390025c085 Fix for sizing of Stadium 2024-09-26 19:55:32 +02:00
Knut Sveidqvist
e4abc39572 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-26 19:51:21 +02:00
Knut Sveidqvist
b0abb44928 Fix for width calculations in Rect 2024-09-26 19:41:35 +02:00
Knut Sveidqvist
0afd83a0c3 Adding size-tester for checking size calculations with fixed sizes 2024-09-26 18:26:49 +02:00
Alois Klink
0a355968c4 fix(types): improve mermaid.parse types
It looks like
8873ffca1 (chore: Overload parse type to be more specific., 2023-12-08)
got overwritten in the merge from Mermaid v11.
2024-09-27 01:07:34 +09:00
Knut Sveidqvist
2a05b479ae Removing wrap 2024-09-26 16:21:28 +02:00
Knut Sveidqvist
9e3bd1fb19 Fix for text sizing calculations ans possibly insertion of a bug 2024-09-26 15:33:02 +02:00
Knut Sveidqvist
0ba4265bc3 Handle fixed size for hexagon 2024-09-26 13:20:44 +02:00
Knut Sveidqvist
a94ad012c4 Fix for resizing of circle 2024-09-26 13:13:37 +02:00
Ashish Jain
bcfc5e0ce4 update version to v11.2.0-b.8 2024-09-24 15:13:43 +02:00
Ashish Jain
210cd35422 Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-24 15:11:43 +02:00
Ashish Jain
2aaf1b9619 update version to v11.2.0-b.7 2024-09-24 11:13:10 +02:00
Ashish Jain
e63f533f3c Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-24 11:12:00 +02:00
saurabhg772244
3a3ea06413 fixed hover highlight for crossed circle multiRect and multiWavedEgeRect 2024-09-24 14:18:51 +05:30
saurabhg772244
5a1640ee34 updated neo look for shaded process and divided process 2024-09-24 13:46:25 +05:30
saurabhg772244
633328c9da fixed padding in neo look for icon square and rounded 2024-09-24 11:53:55 +05:30
Ashish Jain
51aba30620 update version to v11.2.0-b.6 2024-09-23 18:01:28 +02:00
Ashish Jain
f720f2cb13 Merge from Upstream new-shapes branch 2024-09-23 17:52:40 +02:00
saurabhg772244
02a03e3d60 fixed multirect for shadow 2024-09-23 19:54:11 +05:30
Knut Sveidqvist
97dec4e4cb Decreasing drop shadow for neo-dark 2024-09-23 15:10:42 +02:00
Knut Sveidqvist
bb755c6e99 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-23 15:00:06 +02:00
Knut Sveidqvist
65d47dea24 Fix for issues with comment shapes in neo-dark 2024-09-23 14:57:18 +02:00
saurabhg772244
6934c3eb5a Updated padding for neo look 2024-09-23 17:08:17 +05:30
saurabhg772244
4d2ffc46d0 updated padding for curley brace shape 2024-09-23 16:46:44 +05:30
saurabhg772244
2f2fc1b4f1 updated window pane for new look 2024-09-23 15:48:46 +05:30
Knut Sveidqvist
7dcd2758b2 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-23 10:23:54 +02:00
Knut Sveidqvist
1a974eeb39 Fix for state diagram curve 2024-09-23 10:19:55 +02:00
Ashish Jain
7272e7297c update version to v11.2.0-b.5 2024-09-23 10:05:07 +02:00
Ashish Jain
c94c3d7c86 Merge from Upstream new-shapes branch 2024-09-23 09:43:33 +02:00
Knut Sveidqvist
3fc723003c Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-20 15:10:43 +02:00
Knut Sveidqvist
6d64c75121 Fix for image 2024-09-20 15:09:29 +02:00
Ashish Jain
62bcfefa7c update version to v11.2.0-b.4 2024-09-20 13:59:00 +02:00
Ashish Jain
401590c010 Merge from Upstream new-shapes branch 2024-09-20 12:31:07 +02:00
saurabhg772244
b301138d93 neoify icon shape 2024-09-20 15:45:17 +05:30
Ashish Jain
cf53340672 fix lint issue 2024-09-20 11:07:33 +02:00
Ashish Jain
a07b61fdf1 Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-20 10:59:25 +02:00
Knut Sveidqvist
e67894fbb3 Adding config for chose edge type and adding debug option for curves. Mermaid version 11.2.0-b.3 2024-09-19 14:54:58 +02:00
Knut Sveidqvist
fa638da9fc Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-19 14:28:38 +02:00
Knut Sveidqvist
b9ae52e1c2 Configurable debugging of edge points 2024-09-19 14:28:33 +02:00
Knut Sveidqvist
5348e74475 Handling of rounded paths 2024-09-19 14:01:17 +02:00
Ashish Jain
aa41c67266 Merge from upstream new-shapes branch 2024-09-19 13:28:34 +02:00
Knut Sveidqvist
6184510439 Mermaid version 11.2.0-a.10 2024-09-18 13:49:50 +02:00
Sidharth Vinod
faed69c86e chore: Bump versions 2024-09-17 21:35:26 +05:30
Sidharth Vinod
16a75de518 Merge branch 'knsv/new-shapes' into neo-new-shapes
* knsv/new-shapes:
  chore: changeset
  [autofix.ci] apply automated fixes
  test: fix gantt.spec.js type error
  test: await on `expect().resolves/rejects`
  build(types): disable preserveSymlinks in tsconfig
2024-09-17 21:02:04 +05:30
Ashish Jain
a23132e1f2 Merge from upstream new-shapes branch 2024-09-17 09:57:30 +02:00
Ashish Jain
2bc6ac4a76 fix prettier lint error 2024-09-17 08:41:34 +02:00
Ashish Jain
776cb92e3e fix unit test 2024-09-17 08:39:18 +02:00
Ashish Jain
2a7c3dc436 fix lint error for unused variables 2024-09-17 00:02:00 +02:00
Ashish Jain
032a8cbbee Merge pull request #8 from Mermaid-Chart/sidv/configReturn
fix: Change return type from parse
2024-09-16 23:43:28 +02:00
Ashish Jain
3d767cbc06 Merge branch 'neo-new-shapes' into sidv/configReturn 2024-09-16 23:37:14 +02:00
Knut Sveidqvist
eee669f1ee New mermaid version 11.1.0-b.12 2024-09-16 15:41:34 +02:00
Knut Sveidqvist
d85889c200 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-16 15:38:29 +02:00
Knut Sveidqvist
ff3418c520 Adding intersection calculation for new nodes 2024-09-16 15:38:05 +02:00
Sidharth Vinod
7b0b548d05 Merge branch 'neo-new-shapes' into sidv/configReturn
* neo-new-shapes:
  update type check for getTypeFromVertex
  [autofix.ci] apply automated fixes
  fixed build error
  Updated readme for renderOptions parameter and renamed to use kabab case
  Updated icon shape for background colour and icon colour
  Moving case check to parsing
  Adding case check
  Updated shape aliases
  Updated type
  Throwing error for invalid shape
  Updated insertNode to pass optional config
  Fix for amp and adjusted tests
  WIP
  Removing the ending @ sign in the shape data
2024-09-16 18:35:08 +05:30
Ashish Jain
48791aac13 Merge from upstream newShapes branch 2024-09-16 14:59:46 +02:00
Sidharth Vinod
c8381d0fca fix: ParseResult type 2024-09-16 15:59:03 +05:30
Sidharth Vinod
2bb1a2c4f2 Merge branch 'neo-new-shapes' into sidv/configReturn
* neo-new-shapes:
  Mermaid version b.10
  Fix for issue with incorrect calculations of which edge a line intersects with
2024-09-16 14:46:46 +05:30
Knut Sveidqvist
3730f1afbb Mermaid version b.10 2024-09-16 10:04:10 +02:00
Sidharth Vinod
e0c2b832a9 Bump version 2024-09-13 23:18:20 +05:30
Sidharth Vinod
4cbb0004be fix: Remove changes to parse 2024-09-13 20:54:59 +05:30
Sidharth Vinod
19e79fda73 feat: Add title to parseResult 2024-09-13 19:49:24 +05:30
Knut Sveidqvist
05989d06fa Fix for issue with incorrect calculations of which edge a line intersects with 2024-09-13 08:37:07 +02:00
Sidharth Vinod
71889fd135 chore: Remove type from ParseResult 2024-09-13 12:00:05 +05:30
Sidharth Vinod
eca19efa32 Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/mermaid into sidv/configReturn
* 'knsv/new-shapes' of https://github.com/mermaid-js/mermaid:
2024-09-12 15:47:20 +05:30
Sidharth Vinod
4841b7d3d9 Merge branch 'develop' of https://github.com/mermaid-js/mermaid into sidv/configReturn
* 'develop' of https://github.com/mermaid-js/mermaid:
  #5787 Fix for issue with labels in firefox
2024-09-12 15:41:31 +05:30
Sidharth Vinod
dd01f3d52c revert import changes 2024-09-12 15:33:03 +05:30
Sidharth Vinod
dc642fb5bc Build docs 2024-09-12 15:23:11 +05:30
Sidharth Vinod
ef428dc555 Merge branch 'neo-new-shapes' of https://github.com/Mermaid-Chart/alana-mermaid into sidv/configReturn
* 'neo-new-shapes' of https://github.com/Mermaid-Chart/alana-mermaid: (45 commits)
  updated styles, testcases and fixed html labels for image shape
  MC-1733 Reset layout
  updated ImageSqaure shape
  updated styles
  updated pos changes
  fixed html labels for icon shape
  updated test cases
  Added rounded icon shape
  Updated circle icon
  updated image shape
  Updated labels for shapes
  updated icon square and icon
  MC-1733 Reset layout
  Updated logic for vertex label
  Updated test cases
  Update .changeset/rude-meals-invite.md
  changesets
  added neo-fication and shape-resize for linedCylinder shape
  added neo-fication for curvedTrapezoid shape
  Version Packages
  ...
2024-09-12 15:19:21 +05:30
Ashish Jain
d964893a5d Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-12 10:48:18 +02:00
Ashish Jain
7ef296a9cf Merge from upstream newShapes branch 2024-09-11 14:41:52 +02:00
Knut Sveidqvist
acd66a5eb4 MC-1733 Reset layout 2024-09-11 13:57:32 +02:00
Sidharth Vinod
db6242590e Fix result type 2024-09-10 18:41:59 +05:30
Knut Sveidqvist
1efc794056 Merge branch 'neo-new-shapes' of github.com:Mermaid-Chart/alana-mermaid into neo-new-shapes 2024-09-10 13:43:38 +02:00
Knut Sveidqvist
d1395d05e2 MC-1733 Reset layout 2024-09-10 13:39:13 +02:00
Sidharth Vinod
888f668f5e chore: Fix imports 2024-09-10 17:08:29 +05:30
Sidharth Vinod
d0caa2b3e0 test: Fix parse tests 2024-09-10 17:08:15 +05:30
Ashish Jain
900c8a4209 Replace with relative path 2024-09-10 13:19:32 +02:00
Sidharth Vinod
5ab955b6b3 fix: Change return type from parse 2024-09-10 14:18:34 +05:30
omkarht
fd8542080d added neo-fication and shape-resize for linedCylinder shape 2024-09-09 19:10:03 +05:30
omkarht
040a989c3d added neo-fication for curvedTrapezoid shape 2024-09-09 18:54:43 +05:30
Sidharth Vinod
638be1992d Merge remote-tracking branch 'upstream/develop' into neo-new-shapes
* upstream/develop: (27 commits)
  [autofix.ci] apply automated fixes
  fix: Return type, make config non optional
  [autofix.ci] apply automated fixes
  Create red-beans-cross.md
  chore(deps): update dependency eslint-plugin-jsdoc to v50
  remove tsconfig compiler option paths
  linting
  replace mermaid/dist with relative paths
  chore: add git command and set safe dir
  chore: Fix check
  feat: Preview release
  feat: Return parsed config from `mermaid.parse`
  Version Packages
  Adding changeset
  Cleanup of test-file
  Updated cypress test for self-loops
  Fix for issues with self loops
  docs: Fix SMW link
  add blog post - architecture diagrams
  more , linting
  ...
2024-09-09 18:30:31 +05:30
Ashish Jain
13b96ad6c0 Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-06 14:59:14 +02:00
Ashish Jain
f9d5128c91 Merge from upsteam, updated to version v11.1.0-b6 2024-09-05 13:42:04 +02:00
Ashish Jain
35f2e4f5fa Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-05 13:40:07 +02:00
Ashish Jain
2244c1fa87 Merge from upsteam, updated to version v11.1.0-b5 2024-09-05 12:04:41 +02:00
Per Brolin
791b442089 fix-architecture-styling 2024-09-05 12:02:21 +02:00
Ashish Jain
e180ad0666 Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-09-05 12:01:39 +02:00
Ashish Jain
1b67997da2 Merge from upsteam, updated to version v11.1.0-b4 2024-09-05 10:58:04 +02:00
Per Brolin
c18ee0381c Merge branch 'pebr-fix-arch-neo-reboot' into neo-new-shapes 2024-09-04 16:56:44 +02:00
Per Brolin
8d91622235 MC-2029: Fix styling for neo-dark 2024-09-04 16:24:19 +02:00
Per Brolin
19f98c1c72 MC-2029: Corrected dashed border 2024-09-04 16:17:01 +02:00
Per Brolin
afe32f2f8c MC-2029: Updated lockfile 2024-09-04 16:10:01 +02:00
Per Brolin
b214f30e96 MC-2029: Added styling 2024-09-04 16:08:47 +02:00
Per Brolin
415eb26335 MC-2029: Added demo page with architecture neo 2024-09-04 15:54:39 +02:00
Ashish Jain
8fd57abc81 Fix support for fixed layout for flowchart 2024-09-04 13:38:10 +02:00
omkarht
165a4f6825 updated trapezoidalPentagon shape 2024-09-04 13:58:45 +05:30
omkarht
1e7a5a4408 updated taggedWaveEdgedRectangle shape 2024-09-04 13:17:31 +05:30
omkarht
acb569193b updated waveEdgedRectangle shape 2024-09-04 11:53:42 +05:30
saurabhg772244
1b6d627bd3 updated styles for shapes 2024-09-03 18:29:42 +05:30
omkarht
ea987171b2 implemented neo-fication and shape resize for waveRectangle, taggedWaveEdgedRectangle, multiWaveEdgedRectangle shapes 2024-09-03 18:01:15 +05:30
Ashish Jain
b84617c915 Updated versions 2024-09-03 12:26:52 +02:00
Ashish Jain
0e2753814a merge commit 2024-09-03 11:57:12 +02:00
Ashish Jain
11bb1a4a17 Merge from upstream 2024-09-03 11:55:46 +02:00
omkarht
46aba3dfe9 implemented neo-fication and shape resize for flippedTriangle, taggedRect, triangle waveEdgedRectangle shapes 2024-09-03 15:21:57 +05:30
omkarht
0764dca3ce implemented neo-fication for bowTieRect shape 2024-09-03 13:33:09 +05:30
omkarht
83493f26b7 implemented neo-fication for multiRect, slopedRect, waveEdgedRectangle shapes 2024-09-02 21:00:12 +05:30
Knut Sveidqvist
5673dd7ebc Mermaid version 11.0.2-b.9 2024-09-02 11:51:03 +02:00
Knut Sveidqvist
fabecc4abd Incorrect mermaid version, was already published by someone else 2024-09-02 11:50:13 +02:00
Knut Sveidqvist
7603a51302 MC-1801 Fix for issue with markers using fixed layout 2024-09-02 11:46:32 +02:00
Knut Sveidqvist
dedf2d25e3 MC-1801 Fix for link id issue and intersection calculations 2024-08-29 11:58:30 +02:00
Ashish Jain
b011b628ad Updated package versions 2024-08-29 10:00:08 +02:00
Ashish Jain
db3541047a Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-08-28 14:36:44 +02:00
Ashish Jain
bd5a9cc21e Merge from Upstream 2024-08-28 14:33:13 +02:00
Knut Sveidqvist
62f887b3c3 Alana version 11.0.2-b.5, Updated calcIntersections allowing mouse coordinates 2024-08-28 11:45:20 +02:00
Knut Sveidqvist
9c2d7b1dad Fix for fixed position 2024-08-27 16:11:16 +02:00
Ashish Jain
fd47e4eb2f fix fixed layout 2024-08-27 15:54:31 +02:00
Ashish Jain
327ea728ac fix fixed layout 2024-08-27 15:30:37 +02:00
Ashish Jain
96974c9007 updated version 2024-08-27 15:14:27 +02:00
Ashish Jain
c00707165f fix lint & typescript issues 2024-08-27 15:13:39 +02:00
Ashish Jain
dc2ecc9f19 fix mermiad version placeholder 2024-08-27 15:12:49 +02:00
Ashish Jain
41b8a1e6f4 Merge from Upstream & fix version 2024-08-27 14:41:03 +02:00
Ashish Jain
d421cfb1fd Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into neo-new-shapes 2024-08-27 14:22:19 +02:00
Ashish Jain
ba978e86ae Merge from Upstream 2024-08-27 14:21:46 +02:00
Knut Sveidqvist
1483e9245e Merge remote-tracking branch 'os_repo/knsv/new-shapes' into neo-new-shapes 2024-08-26 12:17:37 +02:00
Ashish Jain
6a53d87742 Merge from upstream new-shapes branch 2024-08-21 17:24:47 +02:00
Ashish Jain
a7b771a622 Merge from upstream new-shapes branch 2024-08-21 16:27:55 +02:00
Knut Sveidqvist
c6acf84e43 Mermaid version 11.0.0-b.74, handling of default positions in subgraphs for fixed layout 2024-08-20 13:35:40 +02:00
Knut Sveidqvist
e9b91485f4 Updated intersection calculations , Mermaid version 11.0.0-b.73 2024-08-15 18:26:23 +02:00
Knut Sveidqvist
a0a03b932d Updated intersection calculations , Mermaid version 11.0.0-b.73 2024-08-15 18:25:24 +02:00
Knut Sveidqvist
9acf55069c Mermaid version 11.0.0-b.67, handling of fixed layout without defined positions 2024-08-15 14:11:02 +02:00
Ashish Jain
4878cb9356 Export types & version upgrade 2024-08-15 12:46:48 +02:00
Ashish Jain
b6725eae94 Export types & version upgrade 2024-08-15 12:08:02 +02:00
Knut Sveidqvist
2415e8652a Updated intersection calculations , Mermaid version 11.0.0-b.64 2024-08-15 12:05:59 +02:00
Knut Sveidqvist
941a1723d8 Mermaid version 11.0.0-b.63 2024-08-14 14:05:57 +02:00
Knut Sveidqvist
43b038547e Merge remote-tracking branch 'os_repo/develop' into alanaV11 2024-08-13 14:08:55 +02:00
Ashish Jain
8a22615dbf Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-08-09 15:47:22 +02:00
Ashish Jain
947b59d392 merge from upstream mermaid 2024-08-09 15:18:41 +02:00
Ashish Jain
58694ecd29 merge from upstream mermaid 2024-08-09 15:17:25 +02:00
Knut Sveidqvist
8e3cb5fb1b Fix for fixed layout, mermaid v11.0.0-b.61 2024-08-08 09:49:16 +02:00
Knut Sveidqvist
534cf32231 Removing console.logs 2024-08-06 15:14:34 +02:00
Knut Sveidqvist
41484b2272 MC-1730 Fix for subroutine shape 2024-08-06 15:03:19 +02:00
Knut Sveidqvist
992095d0f8 Mermaid version 11.0.0-b.58 2024-08-06 14:29:52 +02:00
Knut Sveidqvist
3321f6472f Adding subroutine fill 2024-08-06 14:29:33 +02:00
Ashish Jain
2ee94eb9ae updated package version 2024-08-06 12:02:31 +02:00
Ashish Jain
2114e3e0fc fix NaN values in viewBox for sequence diagram 2024-08-06 10:55:30 +02:00
Knut Sveidqvist
87011c6ab4 MC-1730 Better elk publish 2024-08-06 10:33:33 +02:00
Knut Sveidqvist
3dc66a64c7 MC-1730 Making neo the default theme 2024-08-06 10:27:06 +02:00
Alois Klink
64cc767dd5 fix: add mc mermaid theme to types 2024-08-05 23:08:59 +09:00
Knut Sveidqvist
04a704c068 MC-1730 Fix for id handling in elk 2024-08-05 16:02:50 +02:00
Ashish Jain
cef45c023f fix edge id for elk 2024-08-05 15:48:53 +02:00
Knut Sveidqvist
61100d81b1 Updated version of elk renderer 0.0.15 2024-08-05 13:12:29 +02:00
Knut Sveidqvist
29a9c16ab6 Updated mermaid version to 11.0.0-b.55 2024-08-05 13:11:28 +02:00
Knut Sveidqvist
ba20d6c627 #5237 Fix for issue with edge routing for elk layout 2024-08-05 13:09:13 +02:00
Knut Sveidqvist
ca7ddbfe8a MC-1730 Fixed border-color for statediagram notes 2024-08-05 11:04:25 +02:00
Knut Sveidqvist
c33aa50916 Mermaid version 11.0.0-b.54 2024-08-02 18:01:19 +02:00
Steph
b153203338 Merge branch 'alanaV11' of https://github.com/Mermaid-Chart/alana-mermaid into alanaV11 2024-08-02 08:23:41 -07:00
Steph
f834dba3ff update gradient colors for neo-dark 2024-08-02 08:21:58 -07:00
Knut Sveidqvist
640c502346 MC-1730 Fix for flowchart arrows without arrowheads 2024-08-02 17:16:40 +02:00
Knut Sveidqvist
34ecbba275 Mermaid version 11.0.0-b.53 with neo colors for gantt chart 2024-08-02 12:18:28 +02:00
Knut Sveidqvist
930a33d351 Updated version 11.0.0-b.52 2024-08-02 12:11:12 +02:00
Knut Sveidqvist
fda930ec64 Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-08-02 11:48:14 +02:00
Knut Sveidqvist
f93e331be5 Updating the color scales for the neo theme 2024-08-02 11:47:57 +02:00
Ashish Jain
7396c485db fix for parser module for pie 2024-08-02 11:21:38 +02:00
Knut Sveidqvist
85e7af566e Mermaid v11.0.0-b.50 2024-08-01 16:12:11 +02:00
Knut Sveidqvist
36c90cf90e #5237 Fix for issue with styling rectWithTitle 2024-08-01 16:09:32 +02:00
Knut Sveidqvist
6346e29f6a 5237 Fix for edges to diamond shapes and new mermaid version 2024-07-31 15:07:28 +02:00
Knut Sveidqvist
04b31b8672 MC-1730 Adding mc theme 2024-07-22 12:52:22 +02:00
Knut Sveidqvist
2eddee90e0 MC-1730 Adding mc theme 2024-07-22 12:52:16 +02:00
Knut Sveidqvist
63f9043d40 Mermaid version 11.0.0-b.46 2024-07-22 11:06:31 +02:00
Knut Sveidqvist
e019a60bdd MC-1730 Adding neo and neo-dark to valid themes 2024-07-22 11:03:09 +02:00
Knut Sveidqvist
0a4ace5128 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-22 11:01:51 +02:00
Knut Sveidqvist
7156735394 MC-1730 Fix for failing unit-test 2024-07-22 10:12:03 +02:00
Ashish Jain
64a5c11318 Fix broken unit test 2024-07-19 15:40:20 +02:00
Ashish Jain
05abfd132b lint fixes 2024-07-19 14:55:51 +02:00
Knut Sveidqvist
31370ed240 Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-07-19 14:30:01 +02:00
Knut Sveidqvist
e6722bc7f6 MC-1730 Lint fixes 2024-07-19 14:29:52 +02:00
Ashish Jain
3f0e18cb94 fix lint issue 2024-07-19 14:27:00 +02:00
Knut Sveidqvist
cc0dcd68f8 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-19 14:15:08 +02:00
Ashish Jain
9a2865c64a Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-07-15 11:50:37 +02:00
Ashish Jain
2c25197d65 MC-1730 Fix flowchart subgraph id isue 2024-07-10 15:29:26 +02:00
Ashish Jain
2d6a5ade9d MC-1730 Updated version 2024-07-10 14:53:11 +02:00
Ashish Jain
7ad9b84319 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-07-10 14:45:02 +02:00
Ashish Jain
ff0322a5dd MC-1730 Updated version 2024-07-10 11:28:26 +02:00
Ashish Jain
9aa01d8a39 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-07-10 11:27:21 +02:00
Ashish Jain
04ad2ae3dd MC-1730 Fix for data-et as cluster 2024-07-08 16:07:59 +02:00
Ashish Jain
d7497c179e MC-1730 Fix for data-et as cluster 2024-07-08 14:52:07 +02:00
Ashish Jain
df7de0e796 MC-1730 Merge from mermaid v11 2024-07-08 14:10:59 +02:00
Ashish Jain
55d4e83732 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-07-04 22:12:00 +02:00
Ashish Jain
9e01da0d04 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-07-04 21:45:32 +02:00
Knut Sveidqvist
476b7a12d7 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-03 15:47:46 +02:00
Knut Sveidqvist
40063d0982 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-03 14:52:56 +02:00
Knut Sveidqvist
25703ea8c1 Latest merge from mermaid b38 2024-07-03 14:06:54 +02:00
Knut Sveidqvist
87f333b0d5 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-03 14:00:08 +02:00
Knut Sveidqvist
ae046ff4dd Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-02 11:06:36 +02:00
Knut Sveidqvist
5f35f6c37d Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-07-02 10:41:56 +02:00
Knut Sveidqvist
3b7fb45ee6 MC-1799 Reviving the fixed layout 2024-07-01 13:39:11 +02:00
Ashish Jain
0ab49e1e3d Update version 2024-07-01 11:26:30 +02:00
Ashish Jain
442d5077d3 Merge from mermaid 2024-07-01 11:16:19 +02:00
Knut Sveidqvist
834afef2c0 MC-1730 Styling of the subprocess class with neo 2024-06-30 12:24:07 +02:00
Knut Sveidqvist
0b4dbeda8c Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-29 21:23:56 +02:00
Knut Sveidqvist
84fc95d7cf Divider layout fix 2024-06-28 17:50:24 +02:00
Knut Sveidqvist
bbe71f5367 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-28 15:40:46 +02:00
Knut Sveidqvist
9528b5f391 Merge from mermaid 2024-06-28 09:00:33 +02:00
Ashish Jain
23180d35ac MC-1730 Adding data-id, data-node, and data-et attr for dividers. Also, updated version 2024-06-27 16:05:15 +02:00
Ashish Jain
35ae14681e MC-1730 Updated version 2024-06-26 15:50:59 +02:00
Ashish Jain
9bfd6517ac Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-26 15:48:07 +02:00
Knut Sveidqvist
bebc2ba4e9 Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-06-26 09:22:47 +02:00
Knut Sveidqvist
93b4699189 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-26 09:22:13 +02:00
Ashish Jain
5feb3beb8b Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-24 12:10:01 +02:00
Ashish Jain
11c3ef1c8b MC-1730 Updated version 2024-06-24 11:36:38 +02:00
Ashish Jain
f967ee935d Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-24 11:34:41 +02:00
Knut Sveidqvist
20a273a853 Merge branches 'alanaV11' and 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-06-24 11:31:35 +02:00
Knut Sveidqvist
e451f83b08 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-24 11:30:30 +02:00
Ashish Jain
948781cbce MC-1730 Updated version 2024-06-20 15:45:42 +02:00
Ashish Jain
cdf75558b5 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-20 15:43:44 +02:00
Knut Sveidqvist
f8c16f577b New build b.26 2024-06-20 15:31:39 +02:00
Knut Sveidqvist
823035abd8 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-20 15:29:36 +02:00
Ashish Jain
82f1344af6 MC-1730 Updated version 2024-06-20 14:14:32 +02:00
Ashish Jain
ab626fac9e Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-20 14:13:52 +02:00
Ashish Jain
4fa080df9d #5237 Add data-id attr for edge 2024-06-20 13:31:44 +02:00
Ashish Jain
c5186b0df2 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-20 13:30:58 +02:00
Knut Sveidqvist
b9dda2797a Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-06-19 13:56:59 +02:00
Knut Sveidqvist
d898cc6a67 New build numbers 2024-06-19 13:43:28 +02:00
Knut Sveidqvist
01b7074203 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-19 13:38:38 +02:00
Per Brolin
c4685fb0ff Merge branch 'pebr/neo-style' into alanaV11 2024-06-19 11:53:14 +02:00
Per Brolin
96c8e544ec MC-1765: Added specific end-state class 2024-06-19 11:52:28 +02:00
Knut Sveidqvist
c406e6cefe Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-19 10:57:31 +02:00
Per Brolin
31936cf6cb MC-1765: Merge from AlanaV11 to pebr/neo-style 2024-06-19 09:53:06 +02:00
Per Brolin
d6e8419360 MC-1765: Removed curvature from inner rect composite 2024-06-19 09:49:04 +02:00
Knut Sveidqvist
37e43c0be4 Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-06-18 16:02:02 +02:00
Knut Sveidqvist
9510b2e138 MC-1730 Selector for gradients 2024-06-18 16:00:57 +02:00
Knut Sveidqvist
4bd6e3a70c MC-1730 Selector for gradients 2024-06-18 15:58:50 +02:00
Ashish Jain
54a6a996aa Fix database shapes neo look for flowchart 2024-06-18 15:58:09 +02:00
Per Brolin
ba6f2b26a6 Merge branch 'alanaV11' into pebr/neo-style 2024-06-18 15:43:20 +02:00
Per Brolin
9cac8cc472 MC-1765: WIP Added some flow chart shapes 2024-06-18 15:42:29 +02:00
Ashish Jain
416a9fa069 Fix different shapes neo look for flowchart 2024-06-18 15:35:16 +02:00
Ashish Jain
1c1dbe0eb7 Fix different shapes neo look for flowchart 2024-06-18 15:33:28 +02:00
Knut Sveidqvist
0520226b5b Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-06-18 15:11:35 +02:00
Knut Sveidqvist
e7d9e1b223 MC-1730 Putting shadows back 2024-06-18 15:10:47 +02:00
Per Brolin
d5735fd721 Merge branch 'pebr/neo-style' into alanaV11 2024-06-18 15:09:36 +02:00
Per Brolin
1e47c8a70e Merge branch 'alanaV11' into pebr/neo-style 2024-06-18 15:05:46 +02:00
Knut Sveidqvist
838b2ce391 Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-06-18 15:04:10 +02:00
Knut Sveidqvist
9b310df58a MC-1730 Updated gradient settings 2024-06-18 15:00:51 +02:00
Per Brolin
7f8ca0c77e Merge branch 'alanaV11' into pebr/neo-style 2024-06-18 14:59:02 +02:00
Per Brolin
444bad5f20 MC-1765 WIP Added test-grid for states 2024-06-18 14:58:34 +02:00
Ashish Jain
0d630862ee Fix odd (asymmetrical) shape & hexagon shape neo look for flowchart 2024-06-18 14:51:14 +02:00
Knut Sveidqvist
7297b9bc42 MC-1730 Updated gradient settings 2024-06-18 14:42:00 +02:00
Ashish Jain
92e6f52168 Fix double circle shape neo look for flowchart 2024-06-18 14:31:17 +02:00
Ashish Jain
2007cab5ee Fix circle shape neo look for flowchart 2024-06-18 14:16:28 +02:00
Knut Sveidqvist
86d75373ca MC-1730 Neo look for subgraphs 2024-06-18 14:15:53 +02:00
Ashish Jain
41a5f2dacd Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-18 14:07:16 +02:00
Knut Sveidqvist
f431020b6b MC-1730 Cleanup of gradients, adding neo-dark 2024-06-18 14:04:41 +02:00
Ashish Jain
736181bf3d fix neo look for stadium shape in flowchart 2024-06-18 13:59:17 +02:00
Per Brolin
ace39a2154 MC-1765: WIP Test Grid of shapes and themes 2024-06-18 13:30:31 +02:00
Per Brolin
959d8cb606 Merge branch 'pebr/neo-style' into alanaV11 2024-06-18 13:03:08 +02:00
Per Brolin
f96c6462de Merge branch 'alanaV11' into pebr/neo-style 2024-06-18 13:02:22 +02:00
Per Brolin
74ef8b53f1 MC-1765: WIP. Gradiant 2024-06-18 13:00:37 +02:00
Per Brolin
3780659337 MC-1765: WIP Support for Gradient-theme 2024-06-18 12:59:04 +02:00
Knut Sveidqvist
ea87596363 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-18 12:40:09 +02:00
Knut Sveidqvist
caff6662a0 MC-1730 Repplying rectClass efter merge conflict 2024-06-18 11:26:11 +02:00
Knut Sveidqvist
ce7e738843 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-18 11:19:56 +02:00
Per Brolin
9591159901 Corrected end-state for neo 2024-06-17 20:40:48 +02:00
Per Brolin
ced34394bb Updated label padding, and set rx, ry for neo-style class 2024-06-17 20:15:04 +02:00
Per Brolin
1cdafaac80 Merge branch 'alanaV11' into pebr/neo-style 2024-06-17 15:40:02 +02:00
Per Brolin
0fc2f3c85f Corrected minor typo 2024-06-17 15:39:00 +02:00
Knut Sveidqvist
ea0b4f3e95 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-17 14:44:57 +02:00
Per Brolin
8aefe293b0 MC-1765: Merge branch 'alanaV11' into pebr/neo-style 2024-06-17 08:53:17 +02:00
Per Brolin
757f5c395c MC-1765: Added drop-shadow for circles and polygons 2024-06-17 08:47:44 +02:00
Knut Sveidqvist
0a08cfd573 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-14 17:40:42 +02:00
Per Brolin
582035ef9b MC-1765: Added column for classic, default as comparison 2024-06-14 15:29:08 +02:00
Per Brolin
2f6d728123 Added attribute data-look to composite and nested states 2024-06-14 14:45:24 +02:00
Knut Sveidqvist
61b8c9b639 New mermaid version bete-20 2024-06-14 14:24:04 +02:00
Knut Sveidqvist
729cbec78d Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-14 14:18:06 +02:00
Per Brolin
ccdaa6333e Renamed test file and added new file to check neo and themes 2024-06-14 13:49:14 +02:00
Per Brolin
bbb118547e Removed temp override of look 2024-06-14 11:40:58 +02:00
Per Brolin
04159a8427 MC-1765: Removed hard-coded setting of look in render-utils 2024-06-14 11:36:34 +02:00
Knut Sveidqvist
4838023a0b MC-1730 Latest fixes from mermaid 2024-06-13 17:02:49 +02:00
Per Brolin
d70ffe93bb MCC-1765: Added styling of neo class and removed override in drawRect 2024-06-13 13:44:34 +02:00
Per Brolin
10e9a30769 Merge branch 'pebr/neo-style' into alanaV11 2024-06-13 13:34:05 +02:00
Ashish Jain
9d590bc587 updated version 2024-06-13 11:10:37 +02:00
Ashish Jain
69871c94c4 updated version 7 data-node true attr 2024-06-13 11:09:59 +02:00
Per Brolin
2c2b86dc9d Merge branch 'alanaV11' into pebr/neo-style 2024-06-13 10:11:15 +02:00
Per Brolin
8b278d483a MC-1765: Added todo-list to keep track 2024-06-13 10:10:37 +02:00
Knut Sveidqvist
9fbad9c9c1 MC-1730 Applying look to nodes 2024-06-13 10:01:20 +02:00
Per Brolin
2130839770 Merge branch 'alanaV11' into pebr/neo-style 2024-06-13 08:36:34 +02:00
Per Brolin
f22f319599 Fixed so padding of Node labels is working for neo and other theme 2024-06-13 08:35:26 +02:00
Per Brolin
f17d788ac8 Set a less prominent color in nested composite state and added demo page of styling 2024-06-12 14:54:03 +02:00
Ashish Jain
67cf57ae4f added logging for config 2024-06-12 14:45:54 +02:00
Ashish Jain
8ff462f01c Updated version 2024-06-12 14:34:14 +02:00
Ashish Jain
183b83b1ff Adding data-et and data-id for cluster in rendering-util 2024-06-12 14:33:22 +02:00
Knut Sveidqvist
0dd6db67e8 Fix for paddings in square rect 2024-06-12 13:49:37 +02:00
Per Brolin
7ff731163f Added rendering of neo-style in state-refactor 2024-06-12 13:31:01 +02:00
Knut Sveidqvist
7c851bc849 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-12 12:38:29 +02:00
Knut Sveidqvist
2df39e3658 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-12 11:46:46 +02:00
Knut Sveidqvist
29e73ed2dc Verisons 2024-06-12 11:46:32 +02:00
Ashish Jain
32f6c9eefa Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-12 11:37:13 +02:00
Per Brolin
3af2c29d8f Clean-up to avoid code duplication. Corrected neo-optins according to stephs design 2024-06-12 10:38:54 +02:00
Per Brolin
6842b316ec Correccted bug with innen height in composite diags 2024-06-12 08:49:58 +02:00
Per Brolin
979a9b08f9 Merge branch 'alanaV11' into pebr/neo-style 2024-06-11 16:14:34 +02:00
Per Brolin
d3ec33cfe7 Set line-height of label so bbox is height of line 2024-06-11 16:13:55 +02:00
Knut Sveidqvist
80295c3cc2 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-11 15:04:06 +02:00
Knut Sveidqvist
a4777bd44d Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-11 14:48:03 +02:00
Per Brolin
efe8573c06 Merge branch 'pebr/neo-style' into alanaV11 2024-06-11 13:44:41 +02:00
Per Brolin
a9aa8b7f1a Commit prior work by knsv 2024-06-11 13:43:54 +02:00
Knut Sveidqvist
58f5f4a35d Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-11 13:28:47 +02:00
Per Brolin
6dcdec0126 Removed border for neo as UX-design by steph 2024-06-10 15:26:20 +02:00
Per Brolin
4eea7ff5da Corrected options rx,ry for roundedRect when not neo 2024-06-10 14:15:43 +02:00
Per Brolin
15d35387a0 Removed slick 2024-06-10 13:56:21 +02:00
Per Brolin
8b7001b8e3 Removed useRough in favor of node.look 2024-06-10 13:55:08 +02:00
Per Brolin
4fe7e062b5 Removed some hard coding form review 2024-06-10 12:02:15 +02:00
Per Brolin
b41431b378 Merge branch 'alanaV11' into pebr/neo-style 2024-06-10 10:24:43 +02:00
Knut Sveidqvist
1bf4cca3a3 Local package for layout 2024-06-09 19:01:34 +02:00
Knut Sveidqvist
edd4457154 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-09 18:28:31 +02:00
Per Brolin
36de3dca62 Added fix for handling y-alignment of labels of different font-sizes for composite states 2024-06-09 17:33:58 +02:00
Per Brolin
51da34b831 Replaced hard-coded node.look by checking diagram config and cleanup styling a bit 2024-06-07 15:14:26 +02:00
Knut Sveidqvist
59130ca107 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-06-04 16:42:10 +02:00
Per Brolin
544d17db95 WIP:Updated edge-arrow and correct styling pars from figma 2024-06-04 15:11:13 +02:00
Per Brolin
ce6aa48511 WIP: Changed drop-shadow and background of states and composite-states 2024-06-04 12:17:27 +02:00
Per Brolin
03ba130764 Made drop-shadow less prominent and set new arrow-type 2024-06-03 15:42:49 +02:00
Knut Sveidqvist
a36f1d1656 #MC-1733 Support for subgraphs in fixed layout 2024-06-03 15:02:05 +02:00
Ashish Jain
8d1539f2d7 Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-03 14:43:40 +02:00
Ashish Jain
0393e4018b Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-06-03 14:23:37 +02:00
Per Brolin
195ea6405a Merge branch 'alanaV11' into pebr/neo-style 2024-06-03 13:33:26 +02:00
Per Brolin
9fca13ca19 Added first initial styling for neo for state diagrams 2024-06-03 13:10:05 +02:00
Knut Sveidqvist
b9b678a429 #MC-1733 New fixed layout-algorithm for mermaid, nodes and edges 2024-05-31 16:20:24 +02:00
Knut Sveidqvist
648d804d03 Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11 2024-05-31 13:26:10 +02:00
Knut Sveidqvist
344f7a9060 #5237 Bugfixes 2024-05-31 11:29:27 +02:00
Knut Sveidqvist
520e06d2eb #5237 State diagram bugfixes 2024-05-31 10:52:23 +02:00
Knut Sveidqvist
8bb340182c Decorating edges and nodes 2024-05-29 15:58:50 +02:00
Knut Sveidqvist
a62239d9bc Merge branch 'alanaV11' of github.com:Mermaid-Chart/alana-mermaid into alanaV11 2024-05-29 15:56:54 +02:00
Knut Sveidqvist
b390fbe1cb Decorating edges and nodes 2024-05-29 15:56:43 +02:00
Ashish Jain
e416ac1c0b refactor: added look to nodes and edges 2024-05-29 14:27:48 +02:00
Knut Sveidqvist
4538f5b8c6 pnpm-lock fix 2024-05-28 10:39:22 +02:00
Knut Sveidqvist
b2ccec0efa Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-05-28 10:30:04 +02:00
knsv
e52ad8edc2 Update docs 2024-05-24 15:06:03 +00:00
Knut Sveidqvist
be604703aa Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-05-24 17:01:29 +02:00
Knut Sveidqvist
2ba93dd30d Merge branch '5237-unified-layout-common-renderer' of github.com:mermaid-js/mermaid into alanaV11 2024-05-24 17:00:31 +02:00
sidharthv96
a54e1a854b Update docs 2024-05-24 11:09:36 +00:00
Sidharth Vinod
ea56c64c7b Merge branch 'develop' into alana
* develop: (355 commits)
  Create FUNDING.json
  Update pnpm to v9
  Tiny improvements to Diagram Syntax sidebar
  chore(deps): update all patch dependencies
  chore: address @Yokozuna59's code reviews
  refactor: remove non-null assertion operator
  chore: remove unrefSubSchemas
  chore: Build config types before building types
  chore: Ignore `vite.config.ts.timestamp-`
  chore(deps): update all patch dependencies
  Update docs
  chore: Update ordering
  Added to "others" section on integration with Astro
  feat: use standard edge id function for class,flow,state diagram
  feat(utils): create a standard edge id function
  chore: update browsers list
  chore: rm autocompleted import
  trigger e2e again
  feat(state): add from, to in edge
  fix: classrenderer v2 using in op
  ...
2024-05-24 16:33:41 +05:30
Knut Sveidqvist
1089c4029c Merge branch 'master' of github.com:mermaid-js/mermaid into develop 2024-05-24 08:33:22 +02:00
Knut Sveidqvist
bca86cce52 Merge branch 'master' of github.com:mermaid-js/mermaid into develop 2024-05-14 13:09:24 +02:00
Knut Sveidqvist
d14a399801 10.9.0-b.5 2024-03-18 10:41:33 +01:00
Knut Sveidqvist
949a06b00f Adding the missing id prefix 2024-03-18 10:40:57 +01:00
Knut Sveidqvist
0b88e0a8a9 Adding missing id 2024-03-15 15:19:04 +01:00
Knut Sveidqvist
ec4f0120ef Adding missing id 2024-03-14 16:01:46 +01:00
Knut Sveidqvist
51b1216a46 Merge branch 'develop' of github.com:Mermaid-Chart/alana-mermaid into develop 2024-03-14 15:49:29 +01:00
Knut Sveidqvist
f353f3b28c Updated changes for 10.9.0-b.2 2024-03-14 15:49:10 +01:00
knsv
f0f1bec9ce Update docs 2024-03-06 10:14:35 +00:00
Knut Sveidqvist
f5bd82461e MC-1278 version 10.9.0-b.1 2024-03-06 11:10:03 +01:00
Knut Sveidqvist
b5f70cd45e MC-1278 Merging mermaid 10.9 2024-03-06 10:37:53 +01:00
Knut Sveidqvist
c2b640aa86 Updated changes for b.8 2024-03-01 18:03:00 +01:00
Knut Sveidqvist
f5bf2563cf Removing tagging from sequence diagram footer 2024-02-28 17:59:03 +01:00
Knut Sveidqvist
26c7ee15e9 MC-1278 Removing tagging of footer participants 2024-02-28 15:06:53 +01:00
Knut Sveidqvist
8f7fd8329d MC-1278 Adding additional data to messages 2024-02-21 11:34:01 +01:00
knsv
a41488a849 Update docs 2024-02-16 11:15:25 +00:00
Knut Sveidqvist
762daac854 MC-1278 Making adding data-et and data-id to life-lines and actors 2024-02-16 12:10:12 +01:00
Knut Sveidqvist
f1e5bd37ae Merge branch 'release/10.8.0' of github.com:mermaid-js/mermaid into develop 2024-02-02 11:11:46 +01:00
Knut Sveidqvist
ae307831eb Merge from release/10.8.0 2024-02-02 09:55:30 +01:00
Knut Sveidqvist
976a39ea54 Merge branch 'perf/add-dompurify-hooks-once-only' into develop 2024-01-25 18:25:10 +01:00
Alois Klink
0ff611b729 perf: prevent adding multiple DOMPurify hooks
Currently, everytime `removeScript()` is called, the same DOMPurify
hooks are getting added again and again.
2024-01-25 16:48:17 +00:00
Knut Sveidqvist
6c2ded389f Merge branch 'master' of github.com:mermaid-js/mermaid into develop 2024-01-16 10:13:15 +01:00
Knut Sveidqvist
5b3b73ba49 Support for ids on edges 2023-12-08 17:38:49 +01:00
Knut Sveidqvist
ce4318a419 POC Changes 2023-11-13 15:38:03 +01:00
645 changed files with 36895 additions and 28270 deletions

View File

@@ -27,7 +27,6 @@ const MERMAID_CONFIG_DIAGRAM_KEYS = [
'block',
'packet',
'architecture',
'radar',
] as const;
/**

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: architecture diagrams no longer grow to extreme heights due to conflicting alignments

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
Fixes for consistent edge id creation & handling edge cases for animate edge feature

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
Fix for issue #6195 - allowing @ signs inside node labels

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: `mermaidAPI.getDiagramFromText()` now returns a new different db for each class diagram

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: revert state db to resolve getData returning empty nodes and edges

View File

@@ -0,0 +1,8 @@
---
'mermaid': minor
---
Flowchart new syntax for node metadata bugs
- Incorrect label mapping for nodes when using `&`
- Syntax error when `}` with trailing spaces before new line

View File

@@ -0,0 +1,5 @@
---
'@mermaid-js/layout-elk': patch
---
fix: Updated offset calculations for diamond shape when handling intersections

View File

@@ -0,0 +1,5 @@
---
'mermaid': minor
---
Adding support for animation of flowchart edges

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: `mermaidAPI.getDiagramFromText()` now returns a new different db for each flowchart

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: Gantt, Sankey and User Journey diagram are now able to pick font-family from mermaid config.

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
`mermaidAPI.getDiagramFromText()` now returns a new different db for each state diagram

View File

@@ -47,13 +47,13 @@ edgesep
EMPTYSTR
enddate
ERDIAGRAM
eslint
flatmap
forwardable
frontmatter
funs
gantt
GENERICTYPE
getBoundarys
grammr
graphtype
halign
@@ -88,7 +88,6 @@ NODIR
NSTR
outdir
Qcontrolx
QSTR
reinit
rels
reqs

View File

@@ -2,10 +2,8 @@
Ashish Jain
cpettitt
Dong Cai
knsv
Knut Sveidqvist
Nikolay Rozhkov
Peng Xiao
Per Brolin
Sidharth Vinod
subhash-halder
Vinod Sidharth

View File

@@ -26,7 +26,6 @@ dompurify
elkjs
fcose
fontawesome
Fonticons
Forgejo
Foswiki
Gitea
@@ -48,6 +47,7 @@ mdbook
Mermerd
mkdocs
Nextra
NODECOUNT
nodenext
npmjs
pageview
@@ -59,6 +59,7 @@ presetAttributify
pyplot
redmine
rehype
RIGHTDOWN
roughjs
rscratch
shiki
@@ -68,6 +69,7 @@ sphinxcontrib
ssim
stylis
Swimm
topdown
tsbuildinfo
tseslint
Tuleap

View File

@@ -13,10 +13,11 @@ gitgraph
gzipped
handDrawn
kanban
knsv
Knut
marginx
marginy
Markdownish
mermaidchart
mermaidjs
mindmap
mindmaps
@@ -34,6 +35,7 @@ sandboxed
siebling
statediagram
substate
Sveidqvist
unfixable
Viewbox
viewports

View File

@@ -1,5 +1,5 @@
import { build } from 'esbuild';
import { cp, mkdir, readFile, rename, writeFile } from 'node:fs/promises';
import { mkdir, writeFile } from 'node:fs/promises';
import { packageOptions } from '../.build/common.js';
import { generateLangium } from '../.build/generateLangium.js';
import type { MermaidBuildOptions } from './util.js';
@@ -31,27 +31,6 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => {
// mermaid.js
{ ...iifeOptions },
// mermaid.min.js
{ ...iifeOptions, minify: true, metafile: shouldVisualize },
// mermaid.tiny.min.js
{
...iifeOptions,
minify: true,
includeLargeFeatures: false,
metafile: shouldVisualize,
sourcemap: false,
}
);
}
if (entryName === 'mermaid-zenuml') {
const iifeOptions: MermaidBuildOptions = {
...commonOptions,
format: 'iife',
globalName: 'mermaid-zenuml',
};
buildConfigs.push(
// mermaid-zenuml.js
{ ...iifeOptions },
// mermaid-zenuml.min.js
{ ...iifeOptions, minify: true, metafile: shouldVisualize }
);
}
@@ -78,21 +57,6 @@ const handler = (e) => {
process.exit(1);
};
const buildTinyMermaid = async () => {
await mkdir('./packages/tiny/dist', { recursive: true });
await rename(
'./packages/mermaid/dist/mermaid.tiny.min.js',
'./packages/tiny/dist/mermaid.tiny.js'
);
// Copy version from mermaid's package.json to tiny's package.json
const mermaidPkg = JSON.parse(await readFile('./packages/mermaid/package.json', 'utf8'));
const tinyPkg = JSON.parse(await readFile('./packages/tiny/package.json', 'utf8'));
tinyPkg.version = mermaidPkg.version;
await writeFile('./packages/tiny/package.json', JSON.stringify(tinyPkg, null, 2) + '\n');
await cp('./packages/mermaid/CHANGELOG.md', './packages/tiny/CHANGELOG.md');
};
const main = async () => {
await generateLangium();
await mkdir('stats', { recursive: true });
@@ -101,7 +65,6 @@ const main = async () => {
for (const pkg of packageNames) {
await buildPackage(pkg).catch(handler);
}
await buildTinyMermaid();
};
void main();

View File

@@ -14,7 +14,6 @@ export interface MermaidBuildOptions extends BuildOptions {
metafile: boolean;
format: 'esm' | 'iife';
options: PackageOptions;
includeLargeFeatures: boolean;
}
export const defaultOptions: Omit<MermaidBuildOptions, 'entryName' | 'options'> = {
@@ -22,7 +21,6 @@ export const defaultOptions: Omit<MermaidBuildOptions, 'entryName' | 'options'>
metafile: false,
core: false,
format: 'esm',
includeLargeFeatures: true,
} as const;
const buildOptions = (override: BuildOptions): BuildOptions => {
@@ -41,18 +39,12 @@ const buildOptions = (override: BuildOptions): BuildOptions => {
};
};
const getFileName = (
fileName: string,
{ core, format, minify, includeLargeFeatures }: MermaidBuildOptions
) => {
const getFileName = (fileName: string, { core, format, minify }: MermaidBuildOptions) => {
if (core) {
fileName += '.core';
} else if (format === 'esm') {
fileName += '.esm';
}
if (!includeLargeFeatures) {
fileName += '.tiny';
}
if (minify) {
fileName += '.min';
}
@@ -62,27 +54,23 @@ const getFileName = (
export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => {
const {
core,
metafile,
format,
minify,
options: { name, file, packageName },
globalName = 'mermaid',
includeLargeFeatures,
...rest
} = options;
const external: string[] = ['require', 'fs', 'path'];
const outFileName = getFileName(name, options);
const output: BuildOptions = buildOptions({
...rest,
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
entryPoints: {
[outFileName]: `src/${file}`,
},
globalName,
metafile,
minify,
logLevel: 'info',
chunkNames: `chunks/${outFileName}/[name]-[hash]`,
define: {
// This needs to be stringified for esbuild
includeLargeFeatures: `${includeLargeFeatures}`,
'import.meta.vitest': 'undefined',
},
});
@@ -101,12 +89,11 @@ export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => {
if (format === 'iife') {
output.format = 'iife';
output.splitting = false;
const originalGlobalName = output.globalName ?? 'mermaid';
output.globalName = `__esbuild_esm_mermaid_nm[${JSON.stringify(originalGlobalName)}]`;
output.globalName = '__esbuild_esm_mermaid';
// Workaround for removing the .default access in esbuild IIFE.
// https://github.com/mermaid-js/mermaid/pull/4109#discussion_r1292317396
output.footer = {
js: `globalThis[${JSON.stringify(originalGlobalName)}] = globalThis.${output.globalName}.default;`,
js: 'globalThis.mermaid = globalThis.__esbuild_esm_mermaid.default;',
};
output.outExtension = { '.js': '.js' };
} else {

View File

@@ -4,7 +4,7 @@ contact_links:
url: https://github.com/mermaid-js/mermaid/discussions
about: Ask the Community questions or share your own graphs in our discussions.
- name: Discord
url: https://discord.gg/sKeNQX4Wtj
url: https://discord.gg/AgrbSrBer3
about: Join our Community on Discord for Help and a casual chat.
- name: Documentation
url: https://mermaid.js.org

View File

@@ -29,7 +29,7 @@ body:
label: Colors
description: |-
A detailed list of the different colour values to use.
See the [list of currently used variable names](https://mermaid-js.github.io/mermaid/#/theming?id=theme-variables-reference-table)
A list of currently used variable names can be found [here](https://mermaid-js.github.io/mermaid/#/theming?id=theme-variables-reference-table)
placeholder: |-
- background: #f4f4f4
- primaryColor: #fff4dd

13
.github/lychee.toml vendored
View File

@@ -46,17 +46,8 @@ exclude = [
# Drupal 403
"https://(www.)?drupal.org",
# Phbpp 403
"https://(www.)?phpbb.com",
# Swimm returns 404, even though the link is valid
"https://docs.swimm.io",
# Timeout
"https://huehive.co",
"https://foswiki.org",
"https://www.gnu.org",
"https://mermaid-preview.com"
# Swimm returns 404, eventhough the link is valid
"https://docs.swimm.io"
]
# Exclude all private IPs from checking.

2
.github/stale.yml vendored
View File

@@ -15,5 +15,5 @@ markComment: >
If you are still interested in this issue and it is still relevant you can comment to revive it.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue has been automatically closed due to a lack of activity.
This issue has been been automatically closed due to a lack of activity.
This is done to maintain a clean list of issues that the community is interested in developing.

View File

@@ -13,13 +13,13 @@ jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
# uses version from "packageManager" field in package.json
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'

View File

@@ -18,12 +18,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Check for difference in README.md and docs/README.md
run: |

View File

@@ -32,11 +32,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }}
@@ -48,7 +48,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
uses: github/codeql-action/autobuild@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -62,4 +62,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12

View File

@@ -15,6 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: 'Dependency Review'
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4

View File

@@ -32,31 +32,29 @@ jobs:
run: |
echo "::error,title=Not using Applitools::APPLITOOLS_API_KEY is empty, disabling Applitools for this run."
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
# uses version from "packageManager" field in package.json
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.node-version'
- if: ${{ env.USE_APPLI }}
name: Notify applitools of new batch
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
run: curl -L -d '' -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH"
env:
# e.g. mermaid-js/mermaid/my-branch
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
uses: wei/curl@012398a392d02480afa2720780031f8621d5f94c
with:
args: -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH"
- name: Cypress run
uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12
uses: cypress-io/github-action@d79d2d530a66e641eb4a5f227e13bc985c60b964 # v4.2.2
id: cypress
with:
start: pnpm run dev

View File

@@ -11,7 +11,6 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
jobs:
timings:
@@ -20,19 +19,18 @@ jobs:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.node-version'
- name: Install dependencies
uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
with:
runTests: false
- name: Cypress run
uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
id: cypress
with:
install: false
@@ -46,25 +44,10 @@ jobs:
SPLIT: 1
SPLIT_INDEX: 0
SPLIT_FILE: 'cypress/timings.json'
- name: Compare timings
id: compare
run: |
OUTPUT=$(pnpm tsx scripts/compare-timings.ts)
echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY
echo "output<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Commit and create pull request
uses: peter-evans/create-pull-request@889dce9eaba7900ce30494f5e1ac7220b27e5c81
- name: Commit changes
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
add-paths: |
cypress/timings.json
commit-message: 'chore: update E2E timings'
branch: update-timings
title: Update E2E Timings
body: ${{ steps.compare.outputs.output }}
delete-branch: true
sign-commits: true
add: 'cypress/timings.json'
author_name: 'github-actions[bot]'
author_email: '41898282+github-actions[bot]@users.noreply.github.com'
message: 'chore: update E2E timings'

View File

@@ -7,6 +7,9 @@ on:
- master
- release/**
pull_request:
issue_comment:
types:
- created
merge_group:
concurrency: ${{ github.workflow }}-${{ github.ref }}
@@ -28,38 +31,41 @@ env:
) ||
github.event.before
}}
# Check if this is a new comment with '/visual-test'
RUN_VISUAL_TEST: >-
${{ github.repository == 'mermaid-js/mermaid' && (github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/')) }}
${{ github.event_name == 'issue_comment' && github.event.action == 'created' && contains(github.event.comment.body, '/visual-test') && github.event.issue.pull_request != null }}
jobs:
cache:
if: ${{ github.event_name != 'issue_comment' || contains(github.event.comment.body, '/visual-test') }}
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.node-version'
- name: Cache snapshots
id: cache-snapshot
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
save-always: true
path: ./cypress/snapshots
key: ${{ runner.os }}-snapshots-${{ env.targetHash }}
# If a snapshot for a given Hash is not found, we checkout that commit, run the tests and cache the snapshots.
- name: Switch to base branch
if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ env.targetHash }}
- name: Install dependencies
if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true' }}
uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
with:
# just perform install
runTests: false
@@ -82,26 +88,26 @@ jobs:
matrix:
containers: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
# uses version from "packageManager" field in package.json
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.node-version'
# These cached snapshots are downloaded, providing the reference snapshots.
- name: Cache snapshots
id: cache-snapshot
uses: actions/cache/restore@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./cypress/snapshots
key: ${{ runner.os }}-snapshots-${{ env.targetHash }}
- name: Install dependencies
uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
with:
runTests: false
@@ -117,7 +123,7 @@ jobs:
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
id: cypress
with:
install: false
@@ -128,6 +134,8 @@ jobs:
# e.g. if this action was run from a fork
record: ${{ env.RUN_VISUAL_TEST == 'true' && secrets.CYPRESS_RECORD_KEY != '' }}
env:
# Only set Argos environment variables if the visual test comment trigger is present
ARGOS_TOKEN: ${{ env.RUN_VISUAL_TEST == 'true' && secrets.ARGOS_TOKEN || '' }}
ARGOS_PARALLEL: ${{ env.RUN_VISUAL_TEST == 'true' }}
ARGOS_PARALLEL_TOTAL: ${{ env.RUN_VISUAL_TEST == 'true' && strategy.job-total || 1 }}
ARGOS_PARALLEL_INDEX: ${{ env.RUN_VISUAL_TEST == 'true' && matrix.containers || 1 }}
@@ -139,7 +147,7 @@ jobs:
VITEST_COVERAGE: true
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
# Run step only pushes to develop and pull_requests
if: ${{ steps.cypress.conclusion == 'success' && (github.event_name == 'pull_request' || github.ref == 'refs/heads/develop')}}
with:

View File

@@ -29,17 +29,17 @@ jobs:
# lychee only uses the GITHUB_TOKEN to avoid rate-limiting
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Restore lychee cache
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Checker
uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6 # v2.3.0
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # v1.9.3
with:
args: >-
--config .github/lychee.toml

View File

@@ -15,7 +15,7 @@ jobs:
docker-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
@@ -23,13 +23,13 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
# uses version from "packageManager" field in package.json
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'

View File

@@ -22,7 +22,7 @@ jobs:
pull-requests: write # write permission is required to label PRs
steps:
- name: Label PR
uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
with:
config-name: pr-labeler.yml
disable-autolabeler: false

View File

@@ -23,12 +23,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'
@@ -37,7 +37,7 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
- name: Run Build
run: pnpm --filter mermaid run docs:build:vitepress

View File

@@ -9,14 +9,14 @@ jobs:
publish-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'

View File

@@ -26,12 +26,12 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'

View File

@@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'
@@ -36,7 +36,7 @@ jobs:
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
uses: changesets/action@3de3850952bec538fde60aac71731376e57b9b57 # v1.4.8
with:
version: pnpm changeset:version
publish: pnpm changeset:publish

View File

@@ -16,22 +16,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
sarif_file: results.sarif

View File

@@ -9,13 +9,13 @@ jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
# uses version from "packageManager" field in package.json
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: pnpm
node-version-file: '.node-version'
@@ -39,11 +39,12 @@ jobs:
pnpm exec vitest run ./packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts --coverage
- name: Verify out-of-tree build with TypeScript
if: ${{ github.repository == 'mermaid-js/mermaid' }}
run: |
pnpm test:check:tsc
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
# Run step only pushes to develop and pull_requests
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/develop' }}
with:

View File

@@ -8,8 +8,8 @@ jobs:
update-browser-list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- run: npx update-browserslist-db@latest
- name: Commit changes
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
@@ -19,7 +19,7 @@ jobs:
message: 'chore: update browsers list'
push: false
- name: Create Pull Request
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
branch: update-browserslist
title: Update Browserslist

View File

@@ -1,70 +0,0 @@
name: Validate pnpm-lock.yaml
on:
pull_request:
paths:
- 'pnpm-lock.yaml'
- '**/package.json'
- '.github/workflows/validate-lockfile.yml'
jobs:
validate-lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Validate pnpm-lock.yaml entries
id: validate # give this step an ID so we can reference its outputs
run: |
issues=()
# 1) No tarball references
if grep -qF 'tarball:' pnpm-lock.yaml; then
issues+=("• Tarball references found (forbidden)")
fi
# 2) No unwanted vitepress paths
if grep -qF 'packages/mermaid/src/vitepress' pnpm-lock.yaml; then
issues+=("• Disallowed path 'packages/mermaid/src/vitepress' present. Run `rm -rf packages/mermaid/src/vitepress && pnpm install` to regenerate.")
fi
# 3) Lockfile only changes when package.json changes
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} > changed.txt
if grep -q '^pnpm-lock.yaml$' changed.txt && ! grep -q 'package.json' changed.txt; then
issues+=("• pnpm-lock.yaml changed without any package.json modification")
fi
# If any issues, output them and fail
if [ ${#issues[@]} -gt 0 ]; then
# Use the new GITHUB_OUTPUT approach to set a multiline output
{
echo "errors<<EOF"
printf '%s\n' "${issues[@]}"
echo "EOF"
} >> $GITHUB_OUTPUT
exit 1
fi
- name: Comment on PR if validation failed
if: failure()
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
The following issue(s) were detected:
${{ steps.validate.outputs.errors }}
Please address these and push an update.
_Posted automatically by GitHub Actions_

View File

@@ -1 +1 @@
22.14.0
20.12.2

View File

@@ -94,10 +94,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
}),
...visualizerOptions(packageName, core),
],
define: {
// Needs to be string
includeLargeFeatures: 'true',
},
};
if (watch && config.build) {

24
.vscode/launch.json vendored
View File

@@ -12,18 +12,18 @@
"args": ["run", "${relativeFile}"],
"smartStep": true,
"console": "integratedTerminal"
},
{
"name": "Docs generation",
"type": "node",
"request": "launch",
"args": ["scripts/docs.cli.mts"],
// we'll need to change this to --import in Node.JS v20.6.0 and up
"runtimeArgs": ["--loader", "tsx/esm"],
"cwd": "${workspaceRoot}/packages/mermaid",
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart"
}
// {
// "name": "Docs generation",
// "type": "node",
// "request": "launch",
// "args": ["scripts/docs.cli.mts"],
// // we'll need to change this to --import in Node.JS v20.6.0 and up
// "runtimeArgs": ["--loader", "tsx/esm"],
// "cwd": "${workspaceRoot}/packages/mermaid",
// "skipFiles": ["<node_internals>/**", "**/node_modules/**"],
// "smartStep": true,
// "internalConsoleOptions": "openOnSessionStart"
// }
]
}

View File

@@ -256,7 +256,7 @@ mermaid.run({
- Problem showing graph with php on localhost [\#502](https://github.com/knsv/mermaid/issues/502)
- logLevel's option doesnt work at 7.0.0 [\#501](https://github.com/knsv/mermaid/issues/501)
- How do I get the log for a render or parse attempt? [\#500](https://github.com/knsv/mermaid/issues/500)
- Mermaid neutral style to built in latest release [\#499](https://github.com/knsv/mermaid/issues/499)
- Mermaid neutral style style to built in latest release [\#499](https://github.com/knsv/mermaid/issues/499)
- Any plans for adding a typescript definition file? [\#495](https://github.com/knsv/mermaid/issues/495)
- Gantt diagrams too narrow [\#493](https://github.com/knsv/mermaid/issues/493)
- Flowchart edge labels placement [\#490](https://github.com/knsv/mermaid/issues/490)
@@ -833,7 +833,7 @@ mermaid.run({
- Merge pull request \#1 from knsv/master [\#96](https://github.com/knsv/mermaid/pull/96) ([gkchic](https://github.com/gkchic))
- Removed duplicated section in flowchart docs [\#94](https://github.com/knsv/mermaid/pull/94) ([kaime](https://github.com/kaime))
- Grammar changes to sequence page [\#93](https://github.com/knsv/mermaid/pull/93) ([gkchic](https://github.com/gkchic))
- GitHub buttons [\#89](https://github.com/knsv/mermaid/pull/89) ([gkchic](https://github.com/gkchic))
- Github buttons [\#89](https://github.com/knsv/mermaid/pull/89) ([gkchic](https://github.com/gkchic))
- Template change [\#88](https://github.com/knsv/mermaid/pull/88) ([gkchic](https://github.com/gkchic))
## [0.3.1](https://github.com/knsv/mermaid/tree/0.3.1) (2015-01-05)
@@ -1002,4 +1002,4 @@ mermaid.run({
## [0.1.0](https://github.com/knsv/mermaid/tree/0.1.0) (2014-11-16)
\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/GitHub-Changelog-Generator)_
\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_

View File

@@ -1,4 +1,4 @@
FROM node:22.12.0-alpine3.19@sha256:40dc4b415c17b85bea9be05314b4a753f45a4e1716bb31c01182e6c53d51a654
FROM node:20.12.2-alpine3.19@sha256:7a91aa397f2e2dfbfcdad2e2d72599f374e0b0172be1d86eeb73f1d33f36a4b2
USER 0:0

9
Pulling-from-remote.md Normal file
View File

@@ -0,0 +1,9 @@
Pulling from remote repo
```
git remote add os_repo git@github.com:mermaid-js/mermaid.git
git pull os_repo main
git pull os_repo
git pull os_repo master
git pull os_repo 5237-unified-layout-common-renderer
```

View File

@@ -15,7 +15,7 @@ Generate diagrams from markdown-like text.
<a href="https://mermaid.live/"><b>Live Editor!</b></a>
</p>
<p align="center">
<a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/sKeNQX4Wtj" title="Discord invite">🙌 Join Us</a>
<a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/AgrbSrBer3" title="Discord invite">🙌 Join Us</a>
</p>
<p align="center">
<a href="./README.zh-CN.md">简体中文</a>
@@ -33,7 +33,7 @@ Try Live Editor previews of future releases: <a href="https://develop.git.mermai
[![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/sKeNQX4Wtj)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_)
[![Covered by Argos Visual Testing](https://argos-ci.com/badge.svg)](https://argos-ci.com?utm_source=mermaid&utm_campaign=oss)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/mermaid-js/mermaid/badge)](https://securityscorecards.dev/viewer/?uri=github.com/mermaid-js/mermaid)
@@ -44,7 +44,7 @@ Try Live Editor previews of future releases: <a href="https://develop.git.mermai
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
<a href="https://mermaid.js.org/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt='Banner for "The Official Guide to Mermaid.js" book'></a>
<a href="https://mermaid.js.org/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
## Table of content
@@ -95,6 +95,10 @@ In our release process we rely heavily on visual regression tests using [applito
<!-- </Main description> -->
## Mermaid AI Bot
[Mermaid](https://codeparrot.ai/oracle?owner=mermaid-js&repo=mermaid) Bot will help you understand this repository better. You can ask for code examples, installation guide, debugging help and much more.
## Examples
**The following are some examples of the diagrams, charts and graphs that can be made using Mermaid. Click here to jump into the [text syntax](https://mermaid.js.org/intro/syntax-reference.html).**
@@ -253,34 +257,6 @@ 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>]
```
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
commit
```
```mermaid
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
commit
```
### Bar chart (using gantt chart) [<a href="https://mermaid.js.org/syntax/gantt.html">docs</a> - <a href="https://mermaid.live/edit#pako:eNptkU1vhCAQhv8KIenNugiI4rkf6bmXpvEyFVxJFDYyNt1u9r8X63Z7WQ9m5pknLzieaBeMpQ3dg0dsPUkPOhwteXZIXmJcbCT3xMAxkuh8Z8kIEclyMIB209fqKcwTICFvG4IvFy_oLrZ-g9F26ILfQgvNFN94VaRXQ1iWqpumZBcu1J8p1E1TXDx59eQNr5LyEqjJn6hv5QnGNlxevZJmdLLpy5xJSzut45biYCfb0iaVxvawjNjS1p-TCguG16PvaIPzYjO67e3BwX6GiTY9jPFKH43DMF_hGMDY1J4oHg-_f8hFTJFd8L3br3yZx4QHxENsdrt1nO8dDstH3oVpF50ZYMbhU6ud4qoGLqyqBJRCmO6j0HXPZdGbihUc6Pmc0QP49xD-b5X69ZQv2gjO81IwzWqhC1lKrjJ6pA3nVS7SMiVjrKirWlYp5fs3osgrWeo00lorLWvOzz8JVbXm">live editor</a>]
```
@@ -447,7 +423,7 @@ For public sites, it can be precarious to retrieve text from users on the intern
As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing javascript in the code from being executed. This is a great step forward for better security.
_Unfortunately you cannot have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code._
_Unfortunately you can not have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code._
## Reporting vulnerabilities

View File

@@ -15,7 +15,7 @@ Mermaid
<a href="https://mermaid.live/"><b>实时编辑器!</b></a>
</p>
<p align="center">
<a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/sKeNQX4Wtj" title="Discord invite">🙌 加入我们</a>
<a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/AgrbSrBer3" title="Discord invite">🙌 加入我们</a>
</p>
<p align="center">
<a href="./README.md">English</a>
@@ -34,7 +34,7 @@ Mermaid
[![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/sKeNQX4Wtj)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_)
<img src="./img/header.png" alt="" />
@@ -43,13 +43,13 @@ Mermaid
**感谢所有参与进来提交 PR解答疑问的人们! 🙏**
<a href="https://mermaid.js.org/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt='Banner for "The Official Guide to Mermaid.js" book'></a>
<a href="https://mermaid.js.org/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
## 关于 Mermaid
<!-- <Main description> -->
Mermaid 是一个基于 JavaScript 的图表绘制工具,通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。Mermaid 诞生的主要目的是让文档的更新能够及时跟上开发进度。
Mermaid 是一个基于 Javascript 的图表绘制工具,通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。Mermaid 诞生的主要目的是让文档的更新能够及时跟上开发进度。
> Doc-Rot 是 Mermaid 致力于解决的一个难题。

View File

@@ -1,8 +1,8 @@
import eyesPlugin from '@applitools/eyes-cypress';
import { registerArgosTask } from '@argos-ci/cypress/task';
import coverage from '@cypress/code-coverage/task.js';
import coverage from '@cypress/code-coverage/task';
import { defineConfig } from 'cypress';
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin.js';
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';
import cypressSplit from 'cypress-split';
export default eyesPlugin(
@@ -23,10 +23,16 @@ export default eyesPlugin(
});
// copy any needed variables from process.env to config.env
config.env.useAppli = process.env.USE_APPLI ? true : false;
config.env.useArgos = process.env.RUN_VISUAL_TEST === 'true';
// only use Argos on CI in the mermaid-js/mermaid repository
config.env.useArgos =
!!process.env.CI &&
process.env.GITHUB_REPOSITORY === 'mermaid-js/mermaid' &&
!!process.env.ARGOS_TOKEN;
if (config.env.useArgos) {
registerArgosTask(on, config);
registerArgosTask(on, config, {
token: 'fc3a35cf5200db928d65b2047861582d9444032b',
});
} else {
addMatchImageSnapshotPlugin(on, config);
}

View File

@@ -69,9 +69,7 @@ describe('Configuration', () => {
.and('include', 'url(#');
});
});
// This has been broken for a long time, but something about the Cypress environment was
// rewriting the URL to be relative, causing the test to incorrectly pass.
it.skip('should handle arrowMarkerAbsolute explicitly set to "false" as false', () => {
it('should handle arrowMarkerAbsolute explicitly set to "false" as false', () => {
renderGraph(
`graph TD
A[Christmas] -->|Get money| B(Go shopping)
@@ -114,7 +112,7 @@ describe('Configuration', () => {
.first()
.should('have.attr', 'marker-end')
.should('exist')
.and('include', 'url(http\\:\\/\\/localhost');
.and('include', 'url(http://localhost');
});
});
it('should not taint the initial configuration when using multiple directives', () => {

View File

@@ -20,7 +20,7 @@ describe('Interaction', () => {
});
it('Graph: should handle a click on a node with a bound url', () => {
// When there is a URL, `cy.contains()` selects the `a` tag instead of the `span` tag. The .node is a child of `a`, so we have to use `find()` instead of `parent`.
// When there is a URL, cy.contains selects the a tag instead of the span. The .node is a child of a, so we have to use find instead of parent.
cy.contains('URLTest1').find('.node').click();
cy.location().should(({ href }) => {
expect(href).to.eq('http://localhost:9000/empty.html');
@@ -146,7 +146,7 @@ describe('Interaction', () => {
});
});
describe('Interaction - security level other, misspelling', () => {
describe('Interaction - security level other, missspelling', () => {
beforeEach(() => {
cy.visit('http://localhost:9000/click_security_other.html');
});

View File

@@ -19,25 +19,6 @@ describe.skip('architecture diagram', () => {
`
);
});
it('should render a simple architecture diagram with titleAndAccessibilities', () => {
imgSnapshotTest(
`architecture-beta
title Simple Architecture Diagram
accTitle: Accessibility Title
accDescr: Accessibility Description
group api(cloud)[API]
service db(database)[Database] in api
service disk1(disk)[Storage] in api
service disk2(disk)[Storage] in api
service server(server)[Server] in api
db:L -- R:server
disk1:T -- B:server
disk2:T -- B:db
`
);
});
it('should render an architecture diagram with groups within groups', () => {
imgSnapshotTest(
`architecture-beta
@@ -191,7 +172,7 @@ describe.skip('architecture diagram', () => {
);
});
it('should render an architecture diagram with a reasonable height', () => {
it('should render an architecture diagram with a resonable height', () => {
imgSnapshotTest(
`architecture-beta
group federated(cloud)[Federated Environment]

View File

@@ -14,7 +14,7 @@ describe('Block diagram', () => {
);
});
it('BL2: should handle columns statement in sub-blocks', () => {
it('BL2: should handle colums statement in sub-blocks', () => {
imgSnapshotTest(
`block-beta
id1["Hello"]
@@ -30,7 +30,7 @@ describe('Block diagram', () => {
);
});
it('BL3: should align block widths and handle columns statement in sub-blocks', () => {
it('BL3: should align block widths and handle colums statement in sub-blocks', () => {
imgSnapshotTest(
`block-beta
block
@@ -46,7 +46,7 @@ describe('Block diagram', () => {
);
});
it('BL4: should align block widths and handle columns statements in deeper sub-blocks then 1 level', () => {
it('BL4: should align block widths and handle colums statements in deeper sub-blocks then 1 level', () => {
imgSnapshotTest(
`block-beta
columns 1
@@ -66,7 +66,7 @@ describe('Block diagram', () => {
);
});
it('BL5: should align block widths and handle columns statements in deeper sub-blocks then 1 level (alt)', () => {
it('BL5: should align block widths and handle colums statements in deeper sub-blocks then 1 level (alt)', () => {
imgSnapshotTest(
`block-beta
columns 1
@@ -236,7 +236,7 @@ describe('Block diagram', () => {
);
});
it('BL17: width alignment - blocks should be equal in width', () => {
it('BL17: width alignment - blocks shold be equal in width', () => {
imgSnapshotTest(
`block-beta
A("This is the text")

View File

@@ -429,7 +429,7 @@ describe('Class diagram', () => {
classDiagram
class \`This\nTitle\nHas\nMany\nNewlines\` {
+String Also
-String Many
-Stirng Many
#int Members
+And()
-Many()
@@ -443,7 +443,7 @@ describe('Class diagram', () => {
classDiagram
class \`This\nTitle\nHas\nMany\nNewlines\` {
+String Also
-String Many
-Stirng Many
#int Members
+And()
-Many()
@@ -459,7 +459,7 @@ describe('Class diagram', () => {
namespace testingNamespace {
class \`This\nTitle\nHas\nMany\nNewlines\` {
+String Also
-String Many
-Stirng Many
#int Members
+And()
-Many()

View File

@@ -1,652 +0,0 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
const testOptions = [
{ description: '', options: { logLevel: 1 } },
{ description: 'ELK: ', options: { logLevel: 1, layout: 'elk' } },
{ description: 'HD: ', options: { logLevel: 1, look: 'handDrawn' } },
];
describe('Entity Relationship Diagram Unified', () => {
testOptions.forEach(({ description, options }) => {
it(`${description}should render a simple ER diagram`, () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
options
);
});
it(`${description}should render a simple ER diagram without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render an ER diagram with a recursive relationship`, () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||..o{ CUSTOMER : refers
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
options
);
});
it(`${description}should render an ER diagram with multiple relationships between the same two entities`, () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||--|{ ADDRESS : "invoiced at"
CUSTOMER ||--|{ ADDRESS : "receives goods at"
`,
options
);
});
it(`${description}should render a cyclical ER diagram`, () => {
imgSnapshotTest(
`
erDiagram
A ||--|{ B : likes
B ||--|{ C : likes
C ||--|{ A : likes
`,
options
);
});
it(`${description}should render a not-so-simple ER diagram`, () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
`,
options
);
});
it(`${description}should render a not-so-simple ER diagram without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render multiple ER diagrams`, () => {
imgSnapshotTest(
[
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
],
options
);
});
it(`${description}should render an ER diagram with blank or empty labels`, () => {
imgSnapshotTest(
`
erDiagram
BOOK }|..|{ AUTHOR : ""
BOOK }|..|{ GENRE : " "
AUTHOR }|..|{ GENRE : " "
`,
options
);
});
it(`${description}should render entities that have no relationships`, () => {
renderGraph(
`
erDiagram
DEAD_PARROT
HERMIT
RECLUSE
SOCIALITE }o--o{ SOCIALITE : "interacts with"
RECLUSE }o--o{ SOCIALITE : avoids
`,
options
);
});
it(`${description}should render entities with and without attributes`, () => {
renderGraph(
`
erDiagram
BOOK { string title }
AUTHOR }|..|{ BOOK : writes
BOOK { float price }
`,
options
);
});
it(`${description}should render entities with generic and array attributes`, () => {
renderGraph(
`
erDiagram
BOOK {
string title
string[] authors
type~T~ type
}
`,
options
);
});
it(`${description}should render entities with generic and array attributes without htmlLabels`, () => {
renderGraph(
`
erDiagram
BOOK {
string title
string[] authors
type~T~ type
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with length in attributes type`, () => {
renderGraph(
`
erDiagram
CLUSTER {
varchar(99) name
string(255) description
}
`,
options
);
});
it(`${description}should render entities with length in attributes type without htmlLabels`, () => {
renderGraph(
`
erDiagram
CLUSTER {
varchar(99) name
string(255) description
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities and attributes with big and small entity names`, () => {
renderGraph(
`
erDiagram
PRIVATE_FINANCIAL_INSTITUTION {
string name
int turnover
}
PRIVATE_FINANCIAL_INSTITUTION ||..|{ EMPLOYEE : employs
EMPLOYEE { bool officer_of_firm }
`,
options
);
});
it(`${description}should render entities and attributes with big and small entity names without htmlLabels`, () => {
renderGraph(
`
erDiagram
PRIVATE_FINANCIAL_INSTITUTION {
string name
int turnover
}
PRIVATE_FINANCIAL_INSTITUTION ||..|{ EMPLOYEE : employs
EMPLOYEE { bool officer_of_firm }
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with attributes that begin with asterisk`, () => {
imgSnapshotTest(
`
erDiagram
BOOK {
int *id
string name
varchar(99) summary
}
BOOK }o..o{ STORE : soldBy
STORE {
int *id
string name
varchar(50) address
}
`,
options
);
});
it(`${description}should render entities with attributes that begin with asterisk without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
BOOK {
int *id
string name
varchar(99) summary
}
BOOK }o..o{ STORE : soldBy
STORE {
int *id
string name
varchar(50) address
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with keys`, () => {
renderGraph(
`
erDiagram
AUTHOR_WITH_LONG_ENTITY_NAME {
string name PK
}
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
BOOK {
float price
string author FK
string title PK
}
`,
options
);
});
it(`${description}should render entities with keys without htmlLabels`, () => {
renderGraph(
`
erDiagram
AUTHOR_WITH_LONG_ENTITY_NAME {
string name PK
}
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
BOOK {
float price
string author FK
string title PK
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with comments`, () => {
renderGraph(
`
erDiagram
AUTHOR_WITH_LONG_ENTITY_NAME {
string name "comment"
}
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
BOOK {
string author
string title "author comment"
float price "price comment"
}
`,
options
);
});
it(`${description}should render entities with comments without htmlLabels`, () => {
renderGraph(
`
erDiagram
AUTHOR_WITH_LONG_ENTITY_NAME {
string name "comment"
}
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
BOOK {
string author
string title "author comment"
float price "price comment"
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with keys and comments`, () => {
renderGraph(
`
erDiagram
AUTHOR_WITH_LONG_ENTITY_NAME {
string name PK "comment"
}
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
BOOK {
string description
float price "price comment"
string title PK "title comment"
string author FK
}
`,
options
);
});
it(`${description}should render entities with keys and comments without htmlLabels`, () => {
renderGraph(
`
erDiagram
AUTHOR_WITH_LONG_ENTITY_NAME {
string name PK "comment"
}
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
BOOK {
string description
float price "price comment"
string title PK "title comment"
string author FK
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with aliases`, () => {
renderGraph(
`
erDiagram
T1 one or zero to one or more T2 : test
T2 one or many optionally to zero or one T3 : test
T3 zero or more to zero or many T4 : test
T4 many(0) to many(1) T5 : test
T5 many optionally to one T6 : test
T6 only one optionally to only one T1 : test
T4 0+ to 1+ T6 : test
T1 1 to 1 T3 : test
`,
options
);
});
it(`${description}should render a simple ER diagram with a title`, () => {
imgSnapshotTest(
`---
title: simple ER diagram
---
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
options
);
});
it(`${description}should render entities with entity name aliases`, () => {
imgSnapshotTest(
`
erDiagram
p[Person] {
varchar(64) firstName
varchar(64) lastName
}
c["Customer Account"] {
varchar(128) email
}
p ||--o| c : has
`,
options
);
});
it(`${description}should render relationship labels with line breaks`, () => {
imgSnapshotTest(
`
erDiagram
p[Person] {
string firstName
string lastName
}
a["Customer Account"] {
string email
}
b["Customer Account Secondary"] {
string email
}
c["Customer Account Tertiary"] {
string email
}
d["Customer Account Nth"] {
string email
}
p ||--o| a : "has<br />one"
p ||--o| b : "has<br />one<br />two"
p ||--o| c : "has<br />one<br/>two<br />three"
p ||--o| d : "has<br />one<br />two<br/>three<br />...<br/>Nth"
`,
options
);
});
it(`${description}should render an ER diagram with unicode text`, () => {
imgSnapshotTest(
`
erDiagram
_**testẽζØ😀㌕ぼ**_ {
*__List~List~int~~sdfds__* **driversLicense** PK "***The l😀icense #***"
*string(99)~T~~~~~~* firstName "Only __99__ <br>characters are a<br>llowed dsfsdfsdfsdfs"
string last*Name*
string __phone__ UK
int _age_
}
`,
options
);
});
it(`${description}should render an ER diagram with unicode text without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
_**testẽζØ😀㌕ぼ**_ {
*__List~List~int~~sdfds__* **driversLicense** PK "***The l😀icense #***"
*string(99)~T~~~~~~* firstName "Only __99__ <br>characters are a<br>llowed dsfsdfsdfsdfs"
string last*Name*
string __phone__ UK
int _age_
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render an ER diagram with relationships with unicode text`, () => {
imgSnapshotTest(
`
erDiagram
person[😀] {
string *first*Name
string _**last**Name_
}
a["*Customer Account*"] {
**string** ema*i*l
}
person ||--o| a : __hẽ😀__
`,
options
);
});
it(`${description}should render an ER diagram with relationships with unicode text without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
person[😀] {
string *first*Name
string _**last**Name_
}
a["*Customer Account*"] {
**string** ema*i*l
}
person ||--o| a : __hẽ😀__
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render an ER diagram with TB direction`, () => {
imgSnapshotTest(
`
erDiagram
direction TB
CAR ||--|{ NAMED-DRIVER : allows
PERSON ||..o{ NAMED-DRIVER : is
`,
options
);
});
it(`${description}should render an ER diagram with BT direction`, () => {
imgSnapshotTest(
`
erDiagram
direction BT
CAR ||--|{ NAMED-DRIVER : allows
PERSON ||..o{ NAMED-DRIVER : is
`,
options
);
});
it(`${description}should render an ER diagram with LR direction`, () => {
imgSnapshotTest(
`
erDiagram
direction LR
CAR ||--|{ NAMED-DRIVER : allows
PERSON ||..o{ NAMED-DRIVER : is
`,
options
);
});
it(`${description}should render an ER diagram with RL direction`, () => {
imgSnapshotTest(
`
erDiagram
direction RL
CAR ||--|{ NAMED-DRIVER : allows
PERSON ||..o{ NAMED-DRIVER : is
`,
options
);
});
it(`${description}should render entities with styles applied from style statement`, () => {
imgSnapshotTest(
`
erDiagram
c[CUSTOMER]
p[PERSON]
style c,p fill:#f9f,stroke:blue, color:grey, font-size:24px,font-weight:bold
`,
options
);
});
it(`${description}should render entities with styles applied from style statement without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
c[CUSTOMER]
p[PERSON]
style c,p fill:#f9f,stroke:blue, color:grey, font-size:24px,font-weight:bold
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with styles applied from class statement`, () => {
imgSnapshotTest(
`
erDiagram
c[CUSTOMER]
p[PERSON]:::blue
classDef bold font-size:24px, font-weight: bold
classDef blue stroke:lightblue, color: #0000FF
class c,p bold
`,
options
);
});
it(`${description}should render entities with styles applied from class statement without htmlLabels`, () => {
imgSnapshotTest(
`
erDiagram
c[CUSTOMER]
p[PERSON]:::blue
classDef bold font-size:24px, font-weight: bold
classDef blue stroke:lightblue, color: #0000FF
class c,p bold
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render entities with styles applied from the default class and other styles`, () => {
imgSnapshotTest(
`
erDiagram
c[CUSTOMER]
p[PERSON]:::blue
classDef blue stroke:lightblue, color: #0000FF
classDef default fill:pink
style c color:green
`,
{ ...options }
);
});
});
});

View File

@@ -109,8 +109,8 @@ describe('Entity Relationship Diagram', () => {
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
// use within because the absolute value can be slightly different depending on the environment ±6%
expect(maxWidthValue).to.be.within(140 * 0.96, 140 * 1.06);
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(maxWidthValue).to.be.within(140 * 0.95, 140 * 1.05);
});
});
@@ -125,8 +125,8 @@ describe('Entity Relationship Diagram', () => {
);
cy.get('svg').should((svg) => {
const width = parseFloat(svg.attr('width'));
// use within because the absolute value can be slightly different depending on the environment ±6%
expect(width).to.be.within(140 * 0.96, 140 * 1.06);
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(width).to.be.within(140 * 0.95, 140 * 1.05);
// expect(svg).to.have.attr('height', '465');
expect(svg).to.not.have.attr('style');
});

View File

@@ -208,13 +208,13 @@ describe('Flowchart ELK', () => {
`flowchart-elk TB
internet
nat
router
routeur
lb1
lb2
compute1
compute2
subgraph project
router
routeur
nat
subgraph subnet1
compute1
@@ -225,8 +225,8 @@ describe('Flowchart ELK', () => {
lb2
end
end
internet --> router
router --> subnet1 & subnet2
internet --> routeur
routeur --> subnet1 & subnet2
subnet1 & subnet2 --> nat --> internet
`,
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
@@ -443,7 +443,7 @@ flowchart-elk TD
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
);
});
it('63-elk: title on subgraphs should be themeable', () => {
it('63-elk: title on subgraphs should be themable', () => {
imgSnapshotTest(
`
%%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%%

View File

@@ -1,28 +0,0 @@
import { imgSnapshotTest } from '../../helpers/util.ts';
const themes = ['default', 'forest', 'dark', 'base', 'neutral'];
describe('when rendering flowchart with icons', () => {
for (const theme of themes) {
it(`should render icons from fontawesome library on theme ${theme}`, () => {
imgSnapshotTest(
`flowchart TD
A("fab:fa-twitter Twitter") --> B("fab:fa-facebook Facebook")
B --> C("fa:fa-coffee Coffee")
C --> D("fa:fa-car Car")
D --> E("fab:fa-github GitHub")
`,
{ theme }
);
});
it(`should render registered icons on theme ${theme}`, () => {
imgSnapshotTest(
`flowchart TD
A("fa:fa-bell Bell")
`,
{ theme }
);
});
}
});

View File

@@ -99,7 +99,7 @@ describe('Flowchart v2', () => {
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
expect(maxWidthValue).to.be.within(440 * 0.95, 440 * 1.05);
expect(maxWidthValue).to.be.within(417 * 0.95, 417 * 1.05);
});
});
it('8: should render a flowchart when useMaxWidth is false', () => {
@@ -118,7 +118,7 @@ describe('Flowchart v2', () => {
const width = parseFloat(svg.attr('width'));
// use within because the absolute value can be slightly different depending on the environment ±5%
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
expect(width).to.be.within(440 * 0.95, 440 * 1.05);
expect(width).to.be.within(417 * 0.95, 417 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
@@ -198,13 +198,13 @@ describe('Flowchart v2', () => {
`flowchart TB
internet
nat
router
routeur
lb1
lb2
compute1
compute2
subgraph project
router
routeur
nat
subgraph subnet1
compute1
@@ -215,8 +215,8 @@ describe('Flowchart v2', () => {
lb2
end
end
internet --> router
router --> subnet1 & subnet2
internet --> routeur
routeur --> subnet1 & subnet2
subnet1 & subnet2 --> nat --> internet
`,
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
@@ -433,7 +433,7 @@ flowchart TD
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
);
});
it('63: title on subgraphs should be themeable', () => {
it('63: title on subgraphs should be themable', () => {
imgSnapshotTest(
`
%%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%%
@@ -699,7 +699,7 @@ A --> B
{ flowchart: { titleTopMargin: 10 } }
);
});
it('3192: It should be possible to render flowcharts with invisible edges', () => {
it('3192: It should be possieble to render flowcharts with invisible edges', () => {
imgSnapshotTest(
`---
title: Simple flowchart with invisible edges
@@ -1076,11 +1076,11 @@ end
);
});
});
describe('New @ syntax for node metadata edge cases', () => {
describe('New @ sytax for node metadata edge cases', () => {
it('should be possible to use @ syntax to add labels on multi nodes', () => {
imgSnapshotTest(
`flowchart TB
n2["label for n2"] & n4@{ label: "label for n4"} & n5@{ label: "label for n5"}
n2["label for n2"] & n4@{ label: "labe for n4"} & n5@{ label: "labe for n5"}
`,
{}
);
@@ -1088,7 +1088,7 @@ end
it('should be possible to use @ syntax to add labels with trail spaces and &', () => {
imgSnapshotTest(
`flowchart TB
n2["label for n2"] & n4@{ label: "label for n4"} & n5@{ label: "label for n5"}
n2["label for n2"] & n4@{ label: "labe for n4"} & n5@{ label: "labe for n5"}
`,
{}
);
@@ -1097,8 +1097,8 @@ end
imgSnapshotTest(
`flowchart TB
n2["label for n2"]
n4@{ label: "label for n4"}
n5@{ label: "label for n5"}
n4@{ label: "labe for n4"}
n5@{ label: "labe for n5"}
`,
{}
);

View File

@@ -895,7 +895,7 @@ graph TD
imgSnapshotTest(
`
graph TD
classDef default fill:#a34,stroke:#000,stroke-width:4px,color:#fff
classDef default fill:#a34,stroke:#000,stroke-width:4px,color:#fff
hello --> default
`,
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
@@ -917,60 +917,4 @@ graph TD
}
);
});
it('#6369: edge color should affect arrow head', () => {
imgSnapshotTest(
`
flowchart LR
A --> B
A --> C
C --> D
linkStyle 0 stroke:#D50000
linkStyle 2 stroke:#D50000
`,
{
flowchart: { htmlLabels: true },
securityLevel: 'loose',
}
);
});
it('68: should honor subgraph direction when inheritDir is false', () => {
imgSnapshotTest(
`
%%{init: {"flowchart": { "inheritDir": false }}}%%
flowchart TB
direction LR
subgraph A
direction TB
a --> b
end
subgraph B
c --> d
end
`,
{
fontFamily: 'courier',
}
);
});
it('69: should inherit global direction when inheritDir is true', () => {
imgSnapshotTest(
`
%%{init: {"flowchart": { "inheritDir": true }}}%%
flowchart TB
direction LR
subgraph A
direction TB
a --> b
end
subgraph B
c --> d
end
`,
{
fontFamily: 'courier',
}
);
});
});

View File

@@ -117,7 +117,7 @@ describe('Gantt diagram', () => {
{}
);
});
it('should FAIL rendering a gantt chart for issue #1060 with invalid date', () => {
it('should FAIL redering a gantt chart for issue #1060 with invalid date', () => {
imgSnapshotTest(
`
gantt
@@ -358,23 +358,6 @@ describe('Gantt diagram', () => {
);
});
it('should render a gantt diagram with a vert tag', () => {
imgSnapshotTest(
`
gantt
title A Gantt Diagram
dateFormat ss
axisFormat %Ss
section Section
A task : a1, 00, 6s
Milestone : vert, 01,
section Another
Task in sec : 06, 3s
another task : 3s
`
);
});
it('should render a gantt diagram with tick is 2 milliseconds', () => {
imgSnapshotTest(
`
@@ -590,7 +573,7 @@ describe('Gantt diagram', () => {
`
);
});
it('should render a gantt diagram excluding friday and saturday', () => {
it('should render a gantt diagram exculding friday and saturday', () => {
imgSnapshotTest(
`gantt
title A Gantt Diagram
@@ -601,7 +584,7 @@ describe('Gantt diagram', () => {
A task :a1, 2024-02-28, 10d`
);
});
it('should render a gantt diagram excluding saturday and sunday', () => {
it('should render a gantt diagram exculding saturday and sunday', () => {
imgSnapshotTest(
`gantt
title A Gantt Diagram
@@ -688,7 +671,7 @@ describe('Gantt diagram', () => {
title Gantt Digram
dateFormat YYYY-MM-DD
section Section
;A task with a semicolon :a1, 2014-01-01, 30d
;A task with a semiclon :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d

View File

@@ -11,7 +11,7 @@ describe('Git Graph diagram', () => {
{}
);
});
it('2: should render a simple gitgraph with commit on main branch with id', () => {
it('2: should render a simple gitgraph with commit on main branch with Id', () => {
imgSnapshotTest(
`gitGraph
commit id: "One"
@@ -253,7 +253,7 @@ describe('Git Graph diagram', () => {
`
gitGraph
checkout main
%% Make sure to manually set the id of all commits, for consistent visual tests
%% Make sure to manually set the ID of all commits, for consistent visual tests
commit id: "1-abcdefg"
checkout main
branch branch1
@@ -343,7 +343,7 @@ gitGraph
{}
);
});
it('16: should render a simple gitgraph with commit on main branch with id | Vertical Branch', () => {
it('16: should render a simple gitgraph with commit on main branch with Id | Vertical Branch', () => {
imgSnapshotTest(
`gitGraph TB:
commit id: "One"
@@ -585,7 +585,7 @@ gitGraph
`
gitGraph TB:
checkout main
%% Make sure to manually set the id of all commits, for consistent visual tests
%% Make sure to manually set the ID of all commits, for consistent visual tests
commit id: "1-abcdefg"
checkout main
branch branch1
@@ -1024,7 +1024,7 @@ gitGraph TB:
{}
);
});
it('51: should render a simple gitgraph with commit on main branch with id | Vertical Branch - Bottom-to-top', () => {
it('51: should render a simple gitgraph with commit on main branch with Id | Vertical Branch - Bottom-to-top', () => {
imgSnapshotTest(
`gitGraph BT:
commit id: "One"
@@ -1266,7 +1266,7 @@ gitGraph TB:
`
gitGraph BT:
checkout main
%% Make sure to manually set the id of all commits, for consistent visual tests
%% Make sure to manually set the ID of all commits, for consistent visual tests
commit id: "1-abcdefg"
checkout main
branch branch1
@@ -1491,7 +1491,7 @@ gitGraph TB:
`
gitGraph
switch main
%% Make sure to manually set the id of all commits, for consistent visual tests
%% Make sure to manually set the ID of all commits, for consistent visual tests
commit id: "1-abcdefg"
switch main
branch branch1

View File

@@ -63,199 +63,4 @@ section Checkout from website
{ journey: { useMaxWidth: false } }
);
});
it('should initialize with a left margin of 150px for user journeys', () => {
renderGraph(
`
---
config:
journey:
maxLabelWidth: 320
---
journey
title User Journey Example
section Onboarding
Sign Up: 5:
Browse Features: 3:
Use Core Functionality: 4:
section Engagement
Browse Features: 3
Use Core Functionality: 4
`,
{ journey: { useMaxWidth: true } }
);
let diagramStartX;
cy.contains('foreignobject', 'Sign Up').then(($diagram) => {
diagramStartX = parseFloat($diagram.attr('x'));
expect(diagramStartX).to.be.closeTo(150, 2);
});
});
it('should maintain sufficient space between legend and diagram when legend labels are longer', () => {
renderGraph(
`journey
title Web hook life cycle
section Darkoob
Make preBuilt:5: Darkoob user
register slug : 5: Darkoob userf deliberately increasing the size of this label to check if distance between legend and diagram is maintained
Map slug to a Prebuilt Job:5: Darkoob user
section External Service
set Darkoob slug as hook for an Event : 5 : admin Exjjjnjjjj qwerty
listen to the events : 5 : External Service
call darkoob endpoint : 5 : External Service
section Darkoob
check for inputs : 5 : DarkoobAPI
run the prebuilt job : 5 : DarkoobAPI
`,
{ journey: { useMaxWidth: true } }
);
let LabelEndX, diagramStartX;
// Get right edge of the legend
cy.contains('tspan', 'Darkoob userf').then((textBox) => {
const bbox = textBox[0].getBBox();
LabelEndX = bbox.x + bbox.width;
});
// Get left edge of the diagram
cy.contains('foreignobject', 'Make preBuilt').then((rect) => {
diagramStartX = parseFloat(rect.attr('x'));
});
// Assert right edge of the diagram is greater than or equal to the right edge of the label
cy.then(() => {
expect(diagramStartX).to.be.gte(LabelEndX);
});
});
it('should wrap a single long word with hyphenation', () => {
renderGraph(
`
---
config:
journey:
maxLabelWidth: 100
---
journey
title Long Word Test
section Test
VeryLongWord: 5: Supercalifragilisticexpialidocious
`,
{ journey: { useMaxWidth: true } }
);
// Verify that the line ends with a hyphen, indicating proper hyphenation for words exceeding maxLabelWidth.
cy.get('tspan').then((tspans) => {
const hasHyphen = [...tspans].some((t) => t.textContent.trim().endsWith('-'));
return expect(hasHyphen).to.be.true;
});
});
it('should wrap text on whitespace without adding hyphens', () => {
renderGraph(
`
---
config:
journey:
maxLabelWidth: 200
---
journey
title Whitespace Test
section Test
TextWithSpaces: 5: Gustavo Fring is played by Giancarlo Esposito and is a character in Breaking Bad.
`,
{ journey: { useMaxWidth: true } }
);
// Verify that none of the text spans end with a hyphen.
cy.get('tspan').each(($el) => {
const text = $el.text();
expect(text.trim()).not.to.match(/-$/);
});
});
it('should wrap long labels into multiple lines, keep them under max width, and maintain margins', () => {
renderGraph(
`
---
config:
journey:
maxLabelWidth: 320
---
journey
title User Journey Example
section Onboarding
Sign Up: 5: This is a long label that will be split into multiple lines to test the wrapping functionality
Browse Features: 3: This is another long label that will be split into multiple lines to test the wrapping functionality
Use Core Functionality: 4: This is yet another long label that will be split into multiple lines to test the wrapping functionality
section Engagement
Browse Features: 3
Use Core Functionality: 4
`,
{ journey: { useMaxWidth: true } }
);
let diagramStartX, maxLineWidth;
// Get the diagram's left edge x-coordinate
cy.contains('foreignobject', 'Sign Up')
.then(($diagram) => {
diagramStartX = parseFloat($diagram.attr('x'));
})
.then(() => {
cy.get('text.legend').then(($lines) => {
// Check that there are multiple lines
expect($lines.length).to.be.equal(9);
// Check that all lines are under the maxLabelWidth
$lines.each((index, el) => {
const bbox = el.getBBox();
expect(bbox.width).to.be.lte(320);
maxLineWidth = Math.max(maxLineWidth || 0, bbox.width);
});
/** The expected margin between the diagram and the legend is 150px, as defined by
* conf.leftMargin in user-journey-config.js
*/
expect(diagramStartX - maxLineWidth).to.be.closeTo(150, 2);
});
});
});
it('should correctly render the user journey diagram title with the specified styling', () => {
renderGraph(
`---
config:
journey:
titleColor: "#2900A5"
titleFontFamily: "Times New Roman"
titleFontSize: "5rem"
---
journey
title User Journey Example
section Onboarding
Sign Up: 5: John, Shahir
Complete Profile: 4: John
section Engagement
Browse Features: 3: John
Use Core Functionality: 4: John
section Retention
Revisit Application: 5: John
Invite Friends: 3: John
size: 2rem
`
);
cy.get('text').contains('User Journey Example').as('title');
cy.get('@title').then(($title) => {
expect($title).to.have.attr('fill', '#2900A5');
expect($title).to.have.attr('font-family', 'Times New Roman');
expect($title).to.have.attr('font-size', '5rem');
});
});
});

View File

@@ -62,7 +62,7 @@ describe('Kanban diagram', () => {
{}
);
});
it('6: should handle assignments', () => {
it('6: should handle assigments', () => {
imgSnapshotTest(
`kanban
id1[Todo]
@@ -118,7 +118,7 @@ kanban
docs[Create Documentation]
docs[Create Blog about the new diagram]
id7[In progress]
id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes. And some more just for the extra flare.]
id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
id8[Design grammar]@{ assigned: 'knsv' }
id9[Ready for deploy]
id10[Ready for test]

View File

@@ -146,7 +146,7 @@ root
shouldHaveRoot
);
});
it('text should wrap with icon', () => {
it('text shouhld wrap with icon', () => {
imgSnapshotTest(
`mindmap
root

View File

@@ -64,7 +64,7 @@ describe('pie chart', () => {
});
});
it('should render a pie diagram when textPosition is set', () => {
it('should render a pie diagram when textPosition is setted', () => {
imgSnapshotTest(
`pie
"Dogs": 50

View File

@@ -45,7 +45,7 @@ describe('Quadrant Chart', () => {
{}
);
});
it('should able to render y-axis on right side', () => {
it('should able to render y-axix on right side', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"yAxisPosition": "right"}}}%%
@@ -61,7 +61,7 @@ describe('Quadrant Chart', () => {
{}
);
});
it('should able to render x-axis on bottom', () => {
it('should able to render x-axix on bottom', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"xAxisPosition": "bottom"}}}%%
@@ -77,7 +77,7 @@ describe('Quadrant Chart', () => {
{}
);
});
it('should able to render x-axis on bottom and y-axis on right', () => {
it('should able to render x-axix on bottom and y-axis on right', () => {
imgSnapshotTest(
`
%%{init: {"quadrantChart": {"xAxisPosition": "bottom", "yAxisPosition": "right"}}}%%

View File

@@ -1,79 +0,0 @@
import { imgSnapshotTest } from '../../helpers/util';
describe('radar structure', () => {
it('should render a simple radar diagram', () => {
imgSnapshotTest(
`radar-beta
title Best Radar Ever
axis A, B, C
curve c1{1, 2, 3}
`
);
});
it('should render a radar diagram with multiple curves', () => {
imgSnapshotTest(
`radar-beta
title Best Radar Ever
axis A, B, C
curve c1{1, 2, 3}
curve c2{2, 3, 1}
`
);
});
it('should render a complex radar diagram', () => {
imgSnapshotTest(
`radar-beta
title My favorite ninjas
axis Agility, Speed, Strength
axis Stam["Stamina"] , Intel["Intelligence"]
curve Ninja1["Naruto Uzumaki"]{
Agility 2, Speed 2,
Strength 3, Stam 5,
Intel 0
}
curve Ninja2["Sasuke"]{2, 3, 4, 1, 5}
curve Ninja3 {3, 2, 1, 5, 4}
showLegend true
ticks 3
max 8
min 0
graticule polygon
`
);
cy.get('svg').should((svg) => {
expect(svg).to.have.length(1);
});
});
it('should render radar diagram with config override', () => {
imgSnapshotTest(
`radar-beta
title Best Radar Ever
axis A,B,C
curve mycurve{1,2,3}`,
{ radar: { marginTop: 100, axisScaleFactor: 0.5 } }
);
});
it('should parse radar diagram with theme override', () => {
imgSnapshotTest(
`radar-beta
axis A,B,C
curve mycurve{1,2,3}`,
{ theme: 'base', themeVariables: { fontSize: 80, cScale0: '#FF0000' } }
);
});
it('should handle radar diagram with radar style override', () => {
imgSnapshotTest(
`radar-beta
axis A,B,C
curve mycurve{1,2,3}`,
{ theme: 'base', themeVariables: { radar: { axisColor: '#FF0000' } } }
);
});
});

View File

@@ -1,703 +0,0 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
const testOptions = [
{ description: '', options: { logLevel: 1 } },
{ description: 'ELK: ', options: { logLevel: 1, layout: 'elk' } },
{ description: 'HD: ', options: { logLevel: 1, look: 'handDrawn' } },
];
describe('Requirement Diagram Unified', () => {
testOptions.forEach(({ description, options }) => {
it(`${description}should render a simple Requirement diagram`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
it(`${description}should render a simple Requirement diagram without htmlLabels`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render a not-so-simple Requirement diagram`, () => {
imgSnapshotTest(
`
requirementDiagram
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
}
interfaceRequirement test_req4 {
id: 1.2.1
text: the fourth test text.
risk: medium
verifymethod: analysis
}
physicalRequirement test_req5 {
id: 1.2.2
text: the fifth test text.
risk: medium
verifymethod: analysis
}
designConstraint test_req6 {
id: 1.2.3
text: the sixth test text.
risk: medium
verifymethod: analysis
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
element test_entity3 {
type: "test suite"
docRef: github.com/all_the_tests
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_req3 - contains -> test_req4
test_req4 - derives -> test_req5
test_req5 - refines -> test_req6
test_entity3 - verifies -> test_req5
test_req <- copies - test_entity2
`,
options
);
});
it(`${description}should render a not-so-simple Requirement diagram without htmlLabels`, () => {
imgSnapshotTest(
`
requirementDiagram
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
}
interfaceRequirement test_req4 {
id: 1.2.1
text: the fourth test text.
risk: medium
verifymethod: analysis
}
physicalRequirement test_req5 {
id: 1.2.2
text: the fifth test text.
risk: medium
verifymethod: analysis
}
designConstraint test_req6 {
id: 1.2.3
text: the sixth test text.
risk: medium
verifymethod: analysis
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
element test_entity3 {
type: "test suite"
docRef: github.com/all_the_tests
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_req3 - contains -> test_req4
test_req4 - derives -> test_req5
test_req5 - refines -> test_req6
test_entity3 - verifies -> test_req5
test_req <- copies - test_entity2
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render multiple Requirement diagrams`, () => {
imgSnapshotTest(
[
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
],
options
);
});
it(`${description}should render a Requirement diagram with empty information`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
}
element test_entity {
}
`,
options
);
});
it(`${description}should render requirements and elements with and without information`, () => {
renderGraph(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
}
`,
options
);
});
it(`${description}should render requirements and elements with long and short text`, () => {
renderGraph(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text that is long and takes up a lot of space.
risk: high
verifymethod: test
}
element test_entity_name_that_is_extra_long {
}
`,
options
);
});
it(`${description}should render requirements and elements with long and short text without htmlLabels`, () => {
renderGraph(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text that is long and takes up a lot of space.
risk: high
verifymethod: test
}
element test_entity_name_that_is_extra_long {
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render requirements and elements with quoted text for spaces`, () => {
renderGraph(
`
requirementDiagram
requirement "test req name with spaces" {
id: 1
text: the test text that is long and takes up a lot of space.
risk: high
verifymethod: test
}
element "test entity name that is extra long with spaces" {
}
`,
options
);
});
it(`${description}should render requirements and elements with markdown text`, () => {
renderGraph(
`
requirementDiagram
requirement "__my bolded name__" {
id: 1
text: "**Bolded text** _italicized text_"
risk: high
verifymethod: test
}
element "*my italicized name*" {
type: "**Bolded type** _italicized type_"
docref: "*Italicized* __Bolded__"
}
`,
options
);
});
it(`${description}should render requirements and elements with markdown text without htmlLabels`, () => {
renderGraph(
`
requirementDiagram
requirement "__my bolded name__" {
id: 1
text: "**Bolded text** _italicized text_"
risk: high
verifymethod: test
}
element "*my italicized name*" {
type: "**Bolded type** _italicized type_"
docref: "*Italicized* __Bolded__"
}
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render a simple Requirement diagram with a title`, () => {
imgSnapshotTest(
`---
title: simple Requirement diagram
---
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
it(`${description}should render a Requirement diagram with TB direction`, () => {
imgSnapshotTest(
`
requirementDiagram
direction TB
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
it(`${description}should render a Requirement diagram with BT direction`, () => {
imgSnapshotTest(
`
requirementDiagram
direction BT
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
it(`${description}should render a Requirement diagram with LR direction`, () => {
imgSnapshotTest(
`
requirementDiagram
direction LR
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
it(`${description}should render a Requirement diagram with RL direction`, () => {
imgSnapshotTest(
`
requirementDiagram
direction RL
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
it(`${description}should render requirements and elements with styles applied from style statement`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
style test_req,test_entity fill:#f9f,stroke:blue, color:grey, font-weight:bold
`,
options
);
});
it(`${description}should render requirements and elements with styles applied from style statement without htmlLabels`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
style test_req,test_entity fill:#f9f,stroke:blue, color:grey, font-weight:bold
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render requirements and elements with styles applied from class statement`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
classDef bold font-weight: bold
classDef blue stroke:lightblue, color: #0000FF
class test_entity bold
class test_req blue, bold
`,
options
);
});
it(`${description}should render requirements and elements with styles applied from class statement without htmlLabels`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
classDef bold font-weight: bold
classDef blue stroke:lightblue, color: #0000FF
class test_entity bold
class test_req blue, bold
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render requirements and elements with styles applied from classes with shorthand syntax`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req:::blue {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
classDef bold font-weight: bold
classDef blue stroke:lightblue, color: #0000FF
test_entity:::bold
`,
options
);
});
it(`${description}should render requirements and elements with styles applied from classes with shorthand syntax without htmlLabels`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req:::blue {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
classDef bold font-weight: bold
classDef blue stroke:lightblue, color: #0000FF
test_entity:::bold
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render requirements and elements with styles applied from the default class and other styles`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req:::blue {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
classDef blue stroke:lightblue, color:blue
classDef default fill:pink
style test_entity color:green
`,
options
);
});
it(`${description}should render requirements and elements with styles applied from the default class and other styles without htmlLabels`, () => {
imgSnapshotTest(
`
requirementDiagram
requirement test_req:::blue {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
classDef blue stroke:lightblue, color:blue
classDef default fill:pink
style test_entity color:green
`,
{ ...options, htmlLabels: false }
);
});
it(`${description}should render a Requirement diagram with a theme`, () => {
imgSnapshotTest(
`
---
theme: forest
---
requirementDiagram
requirement test_req:::blue {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
`,
options
);
});
});
});

View File

@@ -138,8 +138,8 @@ describe('State diagram', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1: This a single line description
State2: This a multi line description
State1: This a a single line description
State2: This a a multi line description
State2: here comes the multi part
[*] --> State1
State1 --> State2
@@ -345,7 +345,7 @@ stateDiagram
}
);
});
it('v2 width of compound state should grow with title if title is wider', () => {
it('v2 width of compond state should grow with title if title is wider', () => {
imgSnapshotTest(
`
stateDiagram-v2
@@ -402,8 +402,8 @@ stateDiagram-v2
`
stateDiagram-v2
MyState
note left of MyState : I am a lefty
note right of MyState : I am a righty
note left of MyState : I am a leftie
note right of MyState : I am a rightie
`,
{
logLevel: 0,
@@ -460,7 +460,7 @@ stateDiagram-v2
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: true } }
{ state: { useMaxWidth: true }, look: 'classic' }
);
cy.get('svg').should((svg) => {
expect(svg).to.have.attr('width', '100%');
@@ -482,7 +482,7 @@ stateDiagram-v2
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: false } }
{ state: { useMaxWidth: false }, look: 'classic' }
);
cy.get('svg').should((svg) => {
// const height = parseFloat(svg.attr('height'));
@@ -552,7 +552,7 @@ style AState fill:#636,border:1px solid red,color:white;
{ logLevel: 0, fontFamily: 'courier' }
);
});
it(' should let styles take precedence over classes', () => {
it(' should let styles take preceedence over classes', () => {
imgSnapshotTest(
`
stateDiagram-v2
@@ -565,7 +565,7 @@ style AState fill:#636,border:1px solid red,color:white;
{ logLevel: 0, fontFamily: 'courier' }
);
});
it(' should allow styles to take effect in subgraphs', () => {
it(' should allow styles to take effect in stubgraphs', () => {
imgSnapshotTest(
`
stateDiagram

View File

@@ -129,8 +129,8 @@ describe('State diagram', () => {
imgSnapshotTest(
`
stateDiagram
State1: This a single line description
State2: This a multi line description
State1: This a a single line description
State2: This a a multi line description
State2: here comes the multi part
[*] --> State1
State1 --> State2
@@ -338,7 +338,7 @@ describe('State diagram', () => {
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: true } }
{ state: { useMaxWidth: true }, look: 'classic', theme: 'default' }
);
cy.get('svg').should((svg) => {
expect(svg).to.have.attr('width', '100%');
@@ -361,7 +361,7 @@ describe('State diagram', () => {
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: false } }
{ state: { useMaxWidth: false }, look: 'classic', theme: 'default' }
);
cy.get('svg').should((svg) => {
// const height = parseFloat(svg.attr('height'));

View File

@@ -7,7 +7,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
`,
{}
@@ -35,7 +35,7 @@ describe('Timeline diagram', () => {
section Stone Age
7600 BC : Britain's oldest known house was built in Orkney, Scotland
6000 BC : Sea levels rise and Britain becomes an island.<br> The people who live here are hunter-gatherers.
section Bronze Age
section Broze Age
2300 BC : People arrive from Europe and settle in Britain. <br>They bring farming and metalworking.
: New styles of pottery and ways of burying the dead appear.
2200 BC : The last major building works are completed at Stonehenge.<br> People now bury their dead in stone circles.
@@ -51,7 +51,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
`,
{}
@@ -68,7 +68,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -84,7 +84,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -101,7 +101,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -118,7 +118,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -135,7 +135,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -152,7 +152,7 @@ describe('Timeline diagram', () => {
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -161,68 +161,4 @@ describe('Timeline diagram', () => {
{}
);
});
it('11: should render timeline with many stacked events and proper timeline line length', () => {
imgSnapshotTest(
`timeline
title Medical Device Lifecycle
section Pre-Development
Quality Management System : Regulatory Compliance : Risk Management
section Development
Management Responsibility : Planning Activities : Human Resources
Resource Management : Management Reviews : Infrastructure
section Post-Development
Product Realization Activities : Planning Activities : Customer-related Processes
Post-Production Activities : Feedback : Complaints : Adverse Events
: Research and Development : Purchasing Activities
: Production Activities : Installation Activities
: Servicing Activities : Post-Market Surveillance
`,
{}
);
});
it('12: should render timeline with proper vertical line lengths for all columns', () => {
imgSnapshotTest(
`---
config:
theme: base
themeVariables:
fontFamily: Fira Sans
fontSize: 17px
cScale0: '#b3cde0'
cScale1: '#f49090'
cScale2: '#85d5b8'
---
timeline
title Medical Device Lifecycle
section Planning
Quality Management System (4): Regulatory Compliance (4.1.1)
: Risk Management (4.1.2)
Management Resposibility (5): Planning Activities (5.4)
: Management Reviews (5.6)
Resource Management (6): Human Resources (6.2)
: Infrastructure (6.3)
section Realization
Research and Development (7.3): RnD Planning (7.3.2)
: Inputs (7.3.3)
: Outputs (7.3.4)
: Review (7.3.5)
: Verification (7.3.6)
: Validation (7.3.7)
Purchasing (7.4): Purchasing Process (7.4.1)
: Purchasing Information (7.4.2)
Production (7.5): Production Activities (7.5.1)
: Production Feedback (8.2.1)
Installation (7.5.3): Installation Activities (7.5.3)
Servicing (7.5.4): Servicing Activities (7.5.4)
section Post-Production
Post-Market Activities (8): Feedback (8.2.1)
: Complaints (8.2.2)
: Adverse Events (8.2.3)
`,
{}
);
});
});

View File

@@ -1,382 +0,0 @@
import { imgSnapshotTest } from '../../helpers/util.ts';
describe('Treemap Diagram', () => {
it('1: should render a basic treemap', () => {
imgSnapshotTest(
`treemap-beta
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
`,
{}
);
});
it('2: should render a hierarchical treemap', () => {
imgSnapshotTest(
`treemap-beta
"Products"
"Electronics"
"Phones": 50
"Computers": 30
"Accessories": 20
"Clothing"
"Men's"
"Shirts": 10
"Pants": 15
"Women's"
"Dresses": 20
"Skirts": 10
`,
{}
);
});
it('3: should render a treemap with styling using classDef', () => {
imgSnapshotTest(
`treemap-beta
"Section 1"
"Leaf 1.1": 12
"Section 1.2":::class1
"Leaf 1.2.1": 12
"Section 2"
"Leaf 2.1": 20:::class1
"Leaf 2.2": 25
"Leaf 2.3": 12
classDef class1 fill:red,color:blue,stroke:#FFD600;
`,
{}
);
});
it('4: should handle long text that wraps', () => {
imgSnapshotTest(
`treemap-beta
"Main Category"
"This is a very long item name that should wrap to the next line when rendered in the treemap diagram": 50
"Short item": 20
`,
{}
);
});
it('5: should render with a forest theme', () => {
imgSnapshotTest(
`---
config:
theme: forest
---
treemap-beta
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
`,
{}
);
});
it('6: should handle multiple levels of nesting', () => {
imgSnapshotTest(
`treemap-beta
"Level 1"
"Level 2A"
"Level 3A": 10
"Level 3B": 15
"Level 2B"
"Level 3C": 20
"Level 3D"
"Level 4A": 5
"Level 4B": 5
`,
{}
);
});
it('7: should handle classDef with multiple styles', () => {
imgSnapshotTest(
`treemap-beta
"Main"
"A": 20
"B":::important
"B1": 10
"B2": 15
"C": 5:::secondary
classDef important fill:#f96,stroke:#333,stroke-width:2px;
classDef secondary fill:#6cf,stroke:#333,stroke-dasharray:5 5;
`,
{}
);
});
it('8: should handle dollar value formatting with thousands separator', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: "$0,0"
---
treemap
"Budget"
"Operations"
"Salaries": 700000
"Equipment": 200000
"Supplies": 100000
"Marketing"
"Advertising": 400000
"Events": 100000
`,
{}
);
});
it('8a: should handle percentage formatting', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: ".1%"
---
treemap-beta
"Market Share"
"Company A": 0.35
"Company B": 0.25
"Company C": 0.15
"Others": 0.25
`,
{}
);
});
it('8b: should handle decimal formatting', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: ".2f"
---
treemap-beta
"Metrics"
"Conversion Rate": 0.0567
"Bounce Rate": 0.6723
"Click-through Rate": 0.1289
"Engagement": 0.4521
`,
{}
);
});
it('8c: should handle dollar sign with decimal places', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: "$.2f"
---
treemap-beta
"Product Prices"
"Basic": 19.99
"Standard": 49.99
"Premium": 99.99
"Enterprise": 199.99
`,
{}
);
});
it('8d: should handle dollar sign with thousands separator and decimal places', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: "$,.2f"
---
treemap-beta
"Revenue"
"Q1": 1250345.75
"Q2": 1645789.25
"Q3": 1845123.50
"Q4": 2145678.75
`,
{}
);
});
it('8e: should handle simple thousands separator', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: ","
---
treemap-beta
"User Counts"
"Active Users": 1250345
"New Signups": 45789
"Churned": 12350
"Converted": 78975
`,
{}
);
});
it('8f: should handle valueFormat set via directive with dollar and thousands separator', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: "$,.0f"
---
treemap-beta
"Sales by Region"
"North": 1234567
"South": 7654321
"East": 4567890
"West": 9876543
`,
{}
);
});
it('8g: should handle scientific notation format', () => {
imgSnapshotTest(
`---
config:
treemap:
valueFormat: ".2e"
---
treemap-beta
"Scientific Values"
"Value 1": 1234567
"Value 2": 0.0000123
"Value 3": 1000000000
`,
{}
);
});
it('9: should handle a complex example with multiple features', () => {
imgSnapshotTest(
`---
config:
theme: dark
treemap:
valueFormat: "$0,0"
---
treemap-beta
"Company Budget"
"Engineering":::engineering
"Frontend": 300000
"Backend": 400000
"DevOps": 200000
"Marketing":::marketing
"Digital": 250000
"Print": 100000
"Events": 150000
"Sales":::sales
"Direct": 500000
"Channel": 300000
classDef engineering fill:#6b9bc3,stroke:#333;
classDef marketing fill:#c36b9b,stroke:#333;
classDef sales fill:#c3a66b,stroke:#333;
`,
{}
);
});
it('10: should render the example from documentation', () => {
imgSnapshotTest(
`
treemap-beta
"Section 1"
"Leaf 1.1": 12
"Section 1.2":::class1
"Leaf 1.2.1": 12
"Section 2"
"Leaf 2.1": 20:::class1
"Leaf 2.2": 25
"Leaf 2.3": 12
classDef class1 fill:red,color:blue,stroke:#FFD600;
`,
{}
);
});
it('11: should handle comments', () => {
imgSnapshotTest(
`
treemap-beta
%% This is a comment
"Category A"
"Item A1": 10
"Item A2": 20
%% Another comment
"Category B"
"Item B1": 15
"Item B2": 25
`,
{}
);
});
/*
it.skip('12: should render a treemap with title', () => {
imgSnapshotTest(
`
treemap-beta
title Treemap with Title
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
`,
{}
);
});
it.skip('13: should render a treemap with accessibility attributes', () => {
imgSnapshotTest(
`
treemap-beta
accTitle: Accessible Treemap Title
accDescr: This is a description of the treemap for accessibility purposes
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
`,
{}
);
});
it.skip('14: should render a treemap with title and accessibility attributes', () => {
imgSnapshotTest(
`
treemap
title Treemap with Title and Accessibility
accTitle: Accessible Treemap Title
accDescr: This is a description of the treemap for accessibility purposes
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
`,
{}
);
});
*/
});

View File

@@ -179,7 +179,6 @@ describe('XY Chart', () => {
axisLineWidth: 5
chartOrientation: horizontal
plotReservedSpacePercent: 60
showDataLabel: true
---
xychart-beta
title "Sales Revenue"
@@ -316,516 +315,4 @@ describe('XY Chart', () => {
);
cy.get('svg');
});
it('should render vertical bar chart with labels', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
`,
{}
);
});
it('should render horizontal bar chart with labels', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
`,
{}
);
});
it('should render vertical bar chart without labels by default', () => {
imgSnapshotTest(
`
xychart-beta
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
`,
{}
);
});
it('should render horizontal bar chart without labels by default', () => {
imgSnapshotTest(
`
---
config:
xyChart:
chartOrientation: horizontal
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
`,
{}
);
});
it('should render multiple bar plots vertically with labels correctly', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Multiple Bar Plots"
x-axis Categories [A, B, C]
y-axis "Values" 0 --> 100
bar [10, 50, 90]
`,
{}
);
});
it('should render multiple bar plots horizontally with labels correctly', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Multiple Bar Plots"
x-axis Categories [A, B, C]
y-axis "Values" 0 --> 100
bar [10, 50, 90]
`,
{}
);
});
it('should render a single bar with label for a vertical xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Single Bar Chart"
x-axis Categories [A]
y-axis "Value" 0 --> 100
bar [75]
`,
{}
);
});
it('should render a single bar with label for a horizontal xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Single Bar Chart"
x-axis Categories [A]
y-axis "Value" 0 --> 100
bar [75]
`,
{}
);
});
it('should render negative and decimal values with correct labels for vertical xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Decimal and Negative Values"
x-axis Categories [A, B, C]
y-axis -10 --> 10
bar [ -2.5, 0.75, 5.1 ]
`,
{}
);
});
it('should render negative and decimal values with correct labels for horizontal xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Decimal and Negative Values"
x-axis Categories [A, B, C]
y-axis -10 --> 10
bar [ -2.5, 0.75, 5.1 ]
`,
{}
);
});
it('should render data labels within each bar in the vertical xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan,b,c]
y-axis "Revenue (in $)" 4000 --> 12000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000, 3000, 2000, 500, 2000, 3000, 11000, 5000, 6000]
`,
{}
);
cy.get('g.bar-plot-0').within(() => {
cy.get('rect').each(($rect, index) => {
// Extract bar properties
const barProps = {
x: parseFloat($rect.attr('x')),
y: parseFloat($rect.attr('y')),
width: parseFloat($rect.attr('width')),
height: parseFloat($rect.attr('height')),
};
// Get the text element corresponding to this bar by index.
cy.get('text')
.eq(index)
.then(($text) => {
const bbox = $text[0].getBBox();
const textProps = {
x: bbox.x,
y: bbox.y,
width: bbox.width,
height: bbox.height,
};
// Verify that the text label is positioned within the boundaries of the bar.
expect(textProps.x).to.be.greaterThan(barProps.x);
expect(textProps.x + textProps.width).to.be.lessThan(barProps.x + barProps.width);
// Check horizontal alignment (within tolerance)
expect(textProps.x + textProps.width / 2).to.be.closeTo(
barProps.x + barProps.width / 2,
5
);
expect(textProps.y).to.be.greaterThan(barProps.y);
expect(textProps.y + textProps.height).to.be.lessThan(barProps.y + barProps.height);
});
});
});
});
it('should render data labels within each bar in the horizontal xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan,b,c]
y-axis "Revenue (in $)" 4000 --> 12000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000, 3000, 2000, 500, 2000, 3000, 11000, 5000, 6000]
`,
{}
);
cy.get('g.bar-plot-0').within(() => {
cy.get('rect').each(($rect, index) => {
// Extract bar properties
const barProps = {
x: parseFloat($rect.attr('x')),
y: parseFloat($rect.attr('y')),
width: parseFloat($rect.attr('width')),
height: parseFloat($rect.attr('height')),
};
// Get the text element corresponding to this bar by index.
cy.get('text')
.eq(index)
.then(($text) => {
const bbox = $text[0].getBBox();
const textProps = {
x: bbox.x,
y: bbox.y,
width: bbox.width,
height: bbox.height,
};
// Verify that the text label is positioned within the boundaries of the bar.
expect(textProps.x).to.be.greaterThan(barProps.x);
expect(textProps.x + textProps.width).to.be.lessThan(barProps.x + barProps.width);
expect(textProps.y).to.be.greaterThan(barProps.y);
expect(textProps.y + textProps.height).to.be.lessThan(barProps.y + barProps.height);
expect(textProps.y + textProps.height / 2).to.be.closeTo(
barProps.y + barProps.height / 2,
5
);
});
});
});
});
it('should render data labels within each bar in the vertical xy-chart with a lot of bars of different sizes', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s]
y-axis "Revenue (in $)" 4000 --> 12000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000, 8000, 10000, 5000, 7600, 4999,11000 ,5000,6000]
`,
{}
);
cy.get('g.bar-plot-0').within(() => {
cy.get('rect').each(($rect, index) => {
// Extract bar properties
const barProps = {
x: parseFloat($rect.attr('x')),
y: parseFloat($rect.attr('y')),
width: parseFloat($rect.attr('width')),
height: parseFloat($rect.attr('height')),
};
// Get the text element corresponding to this bar by index.
cy.get('text')
.eq(index)
.then(($text) => {
const bbox = $text[0].getBBox();
const textProps = {
x: bbox.x,
y: bbox.y,
width: bbox.width,
height: bbox.height,
};
// Verify that the text label is positioned within the boundaries of the bar.
expect(textProps.x).to.be.greaterThan(barProps.x);
expect(textProps.x + textProps.width).to.be.lessThan(barProps.x + barProps.width);
// Check horizontal alignment (within tolerance)
expect(textProps.x + textProps.width / 2).to.be.closeTo(
barProps.x + barProps.width / 2,
5
);
expect(textProps.y).to.be.greaterThan(barProps.y);
expect(textProps.y + textProps.height).to.be.lessThan(barProps.y + barProps.height);
});
});
});
});
it('should render data labels within each bar in the horizontal xy-chart with a lot of bars of different sizes', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s]
y-axis "Revenue (in $)" 4000 --> 12000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000, 8000, 10000, 5000, 7600, 4999,11000 ,5000,6000]
`,
{}
);
cy.get('g.bar-plot-0').within(() => {
cy.get('rect').each(($rect, index) => {
// Extract bar properties
const barProps = {
x: parseFloat($rect.attr('x')),
y: parseFloat($rect.attr('y')),
width: parseFloat($rect.attr('width')),
height: parseFloat($rect.attr('height')),
};
// Get the text element corresponding to this bar by index.
cy.get('text')
.eq(index)
.then(($text) => {
const bbox = $text[0].getBBox();
const textProps = {
x: bbox.x,
y: bbox.y,
width: bbox.width,
height: bbox.height,
};
// Verify that the text label is positioned within the boundaries of the bar.
expect(textProps.x).to.be.greaterThan(barProps.x);
expect(textProps.x + textProps.width).to.be.lessThan(barProps.x + barProps.width);
expect(textProps.y).to.be.greaterThan(barProps.y);
expect(textProps.y + textProps.height).to.be.lessThan(barProps.y + barProps.height);
expect(textProps.y + textProps.height / 2).to.be.closeTo(
barProps.y + barProps.height / 2,
5
);
});
});
});
});
it('should render data labels correctly for a bar in the vertical xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan]
y-axis "Revenue (in $)" 3000 --> 12000
bar [4000]
`,
{}
);
cy.get('g.bar-plot-0').within(() => {
cy.get('rect').each(($rect, index) => {
// Extract bar properties
const barProps = {
x: parseFloat($rect.attr('x')),
y: parseFloat($rect.attr('y')),
width: parseFloat($rect.attr('width')),
height: parseFloat($rect.attr('height')),
};
// Get the text element corresponding to this bar by index.
cy.get('text')
.eq(index)
.then(($text) => {
const bbox = $text[0].getBBox();
const textProps = {
x: bbox.x,
y: bbox.y,
width: bbox.width,
height: bbox.height,
};
// Verify that the text label is positioned within the boundaries of the bar.
expect(textProps.x).to.be.greaterThan(barProps.x);
expect(textProps.x + textProps.width).to.be.lessThan(barProps.x + barProps.width);
// Check horizontal alignment (within tolerance)
expect(textProps.x + textProps.width / 2).to.be.closeTo(
barProps.x + barProps.width / 2,
5
);
expect(textProps.y).to.be.greaterThan(barProps.y);
expect(textProps.y + textProps.height).to.be.lessThan(barProps.y + barProps.height);
});
});
});
});
it('should render data labels correctly for a bar in the horizontal xy-chart', () => {
imgSnapshotTest(
`
---
config:
xyChart:
showDataLabel: true
chartOrientation: horizontal
---
xychart-beta
title "Sales Revenue"
x-axis Months [jan]
y-axis "Revenue (in $)" 3000 --> 12000
bar [4000]
`,
{}
);
cy.get('g.bar-plot-0').within(() => {
cy.get('rect').each(($rect, index) => {
// Extract bar properties
const barProps = {
x: parseFloat($rect.attr('x')),
y: parseFloat($rect.attr('y')),
width: parseFloat($rect.attr('width')),
height: parseFloat($rect.attr('height')),
};
// Get the text element corresponding to this bar by index.
cy.get('text')
.eq(index)
.then(($text) => {
const bbox = $text[0].getBBox();
const textProps = {
x: bbox.x,
y: bbox.y,
width: bbox.width,
height: bbox.height,
};
// Verify that the text label is positioned within the boundaries of the bar.
expect(textProps.x).to.be.greaterThan(barProps.x);
expect(textProps.x + textProps.width).to.be.lessThan(barProps.x + barProps.width);
expect(textProps.y).to.be.greaterThan(barProps.y);
expect(textProps.y + textProps.height).to.be.lessThan(barProps.y + barProps.height);
expect(textProps.y + textProps.height / 2).to.be.closeTo(
barProps.y + barProps.height / 2,
5
);
});
});
});
});
});

221
cypress/platform/ash.html Normal file
View File

@@ -0,0 +1,221 @@
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&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; */
/* 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; */
}
.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;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<pre id="diagram" class="mermaid">
flowchart
node
rounded(rounded)
id1([This is the text in the box])
id2((circle))
id3(((double circle)))
id4>Asymetrical]
id5{This is the text in the box}
id6{{This is the text in the box}}
id7[/This is the text in the box/]
id8[\This is the text in the box\]
A[/Christmas\]
B[\Christmas/]
sub[[subroutine]]
db[(Database)]
</pre
>
<pre id="diagram" class="mermaid">
---
config:
theme: default
look: classic
---
flowchart
node
rounded(rounded)
id1([This is the text in the box])
id2((circle))
id3(((double circle)))
id4>Asymetrical]
id5{This is the text in the box}
id6{{This is the text in the box}}
id7[/This is the text in the box/]
id8[\This is the text in the box\]
B[/Christmas\]
sub[[subroutine]]
db[(Database)]
</pre
>
<pre id="diagram" class="mermaid">
stateDiagram
[*] --> Active
Active --> Inactive
Inactive --> Active
Active --> [*]
</pre>
<pre id="diagram" class="mermaid2">
flowchart
a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
a_a --> c --> d_d --> c_c
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
class a_a apa;
click a_a "http://www.aftonbladet.se" "bookmark"
click c_c callback "new tooltip"
</pre
>
<pre id="diagram2" class="mermaid2">
flowchart LR
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
</pre>
<pre id="diagram3" class="mermaid2">
flowchart LR
A:::foo & B:::bar --> C:::foobar
classDef foo stroke:#f00
classDef bar stroke:#0f0
classDef ash color:red
class C ash
style C stroke:#00f, fill:black
</pre>
<pre id="diagram4" class="mermaid2">
stateDiagram
A:::foo
B:::bar --> C:::foobar
classDef foo stroke:#f00
classDef bar stroke:#0f0
style C stroke:#00f, fill:black, color:white
</pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
console.error('Mermaid error: ', err);
};
window.callback = function () {
alert('A callback was triggered');
};
mermaid.initialize({
theme: 'neo',
look: 'neo',
// handdrawnSeed: 12,
// look: 'handdrawn',
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
// layout: 'dagre',
// layout: 'elk',
// layout: 'fixed',
// htmlLabels: false,
flowchart: { titleTopMargin: 10 },
// fontFamily: 'Caveat',
// fontFamily: 'Kalam',
// fontFamily: 'courier',
fontFamily: 'arial',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
messageFontFamily: 'courier',
},
fontSize: 12,
logLevel: 0,
securityLevel: 'loose',
});
function callback() {
alert('It worked');
}
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
};
</script>
</body>
</html>

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
@@ -30,8 +30,8 @@
.mermaid svg {
/* font-size: 18px !important; */
background-color: #eee;
background-image:
radial-gradient(#fff 1%, transparent 11%), radial-gradient(#fff 1%, transparent 11%);
background-image: radial-gradient(#fff 1%, transparent 11%),
radial-gradient(#fff 1%, transparent 11%);
background-size: 20px 20px;
background-position:
0 0,
@@ -60,7 +60,7 @@
<pre id="diagram" class="mermaid2">
timeline
title My day
section Section with no tasks
section section with no tasks
section Go to work at the dog office
1930 : first step : second step is a long step
: third step
@@ -70,18 +70,18 @@
1960 : India fights poverty, looses war to China and gets nuclear weapons from USA and USSR
1970 : Green Revolution comes to india
section Another section with no tasks
I am a very, very big task
I am not so big task
I am a big big big tasks
I am not so big tasks
</pre>
<pre id="diagram" class="mermaid">
timeline
title MermaidChart 2023 Timeline
section 2023 Q1 <br> Release Personal Tier
Bullet 1 : sub-point 1a : sub-point 1b
Buttet 1 : sub-point 1a : sub-point 1b
: sub-point 1c
Bullet 2 : sub-point 2a : sub-point 2b
section 2023 Q2 <br> Release XYZ Tier
Bullet 3 : sub-point <br> 3a : sub-point 3b
Buttet 3 : sub-point <br> 3a : sub-point 3b
: sub-point 3c
Bullet 4 : sub-point 4a : sub-point 4b
@@ -93,7 +93,7 @@
section Stone Age
7600 BC : Britain's oldest known house was built in Orkney, Scotland
6000 BC : Sea levels rise and Britain becomes an island. The people who live here are hunter-gatherers.
section Bronze Age
section Broze Age
2300 BC : People arrive from Europe and settle in Britain. They bring farming and metalworking.
: New styles of pottery and ways of burying the dead appear.
2200 BC : The last major building works are completed at Stonehenge. People now bury their dead in stone circles.
@@ -106,7 +106,7 @@
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google : Pixar
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008s : Instagram
@@ -122,7 +122,7 @@
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google : Pixar
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008s : Instagram
@@ -139,7 +139,7 @@
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008 : Instagram
@@ -152,7 +152,7 @@
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2005 : Youtube
2006 : Twitter
2007 : Tumblr
2008s : Instagram

View File

@@ -3,7 +3,7 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
@@ -37,7 +37,7 @@
+String owner
+BigDecimal balance
+deposit(amount) bool
+withdrawal(amount) int
+withdrawl(amount) int
}
cssClass "BankAccount" customCss
@@ -56,7 +56,7 @@ classE o-- classF : aggregation
+String owner
+BigDecimal balance
+deposit(amount) bool
+withdrawal(amount) int
+withdrawl(amount) int
}
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~

View File

@@ -77,7 +77,7 @@
document.getElementsByTagName('body')[0].appendChild(div);
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'strict_', logLevel: 1 });
mermaid.initialize({ startOnLoad: true, securityLevel: 'strct', logLevel: 1 });
</script>
</body>
</html>

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
@@ -31,7 +31,7 @@
flowchart BT subgraph S1 sub1 -->sub2 end subgraph S2 sub4 end S1 --> S2 sub1 --> sub4
</div>
<div class="mermaid2" style="width: 50%; height: 200px">
sequenceDiagram Alice->>Bob:Extremely utterly long line of longness which had previously
sequenceDiagram Alice->>Bob:Extremely utterly long line of longness which had preivously
overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short
though
</div>
@@ -61,9 +61,9 @@
#quot;elit#quot;."}}
</div>
<div class="mermaid2" style="width: 50%; height: 50%">
flowchart TB internet nat router lb1 lb2 compute1 compute2 subgraph project router nat
subgraph subnet1 compute1 lb1 end subgraph subnet2 compute2 lb2 end end internet --> router
router --> subnet1 & subnet2 subnet1 & subnet2 --> nat --> internet
flowchart TB internet nat routeur lb1 lb2 compute1 compute2 subgraph project routeur nat
subgraph subnet1 compute1 lb1 end subgraph subnet2 compute2 lb2 end end internet --> routeur
routeur --> subnet1 & subnet2 subnet1 & subnet2 --> nat --> internet
</div>
<div class="mermaid2" style="width: 50%; height: 50%">
flowchart TD subgraph one[One] subgraph sub_one[Sub One] _sub_one end end subgraph two[Two]

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"

View File

@@ -7,7 +7,7 @@
rel="stylesheet"
/>
<style>
svg:not(svg svg) {
svg {
border: 2px solid darkred;
}
.exClass2 > rect,

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"

View File

@@ -3,7 +3,7 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
@@ -38,7 +38,7 @@
+String owner
+BigDecimal balance
+deposit(amount) bool
+withdrawal(amount) int
+withdrawl(amount) int
}
cssClass "BankAccount" customCss
</pre>

View File

@@ -3,7 +3,7 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"

View File

@@ -3,7 +3,7 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
@@ -30,8 +30,8 @@
.mermaid svg {
/* font-size: 18px !important; */
background-color: #efefef;
background-image:
radial-gradient(#fff 51%, transparent 91%), radial-gradient(#fff 51%, transparent 91%);
background-image: radial-gradient(#fff 51%, transparent 91%),
radial-gradient(#fff 51%, transparent 91%);
background-size: 20px 20px;
background-position:
0 0,

View File

@@ -0,0 +1,164 @@
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&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; */
/* 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; */
}
.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;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<pre id="diagram" class="mermaid">
flowchart
A --> B & C
subgraph apa
D --> E
end
</pre
>
<pre id="diagram2" class="mermaid2">
flowchart LR
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
</pre>
<pre id="diagram3" class="mermaid2">
flowchart LR
A:::foo & B:::bar --> C:::foobar
classDef foo stroke:#f00
classDef bar stroke:#0f0
classDef ash color:red
class C ash
style C stroke:#00f, fill:black
</pre>
<pre id="diagram4" class="mermaid2">
stateDiagram
A:::foo
B:::bar --> C:::foobar
classDef foo stroke:#f00
classDef bar stroke:#0f0
style C stroke:#00f, fill:black, color:white
</pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
console.error('Mermaid error: ', err);
};
window.callback = function () {
alert('A callback was triggered');
};
mermaid.initialize({
theme: 'neo-dark',
// handdrawnSeed: 12,
look: 'neo',
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
// layout: 'dagre',
// layout: 'elk',
// layout: 'fixed',
// htmlLabels: false,
flowchart: { titleTopMargin: 10 },
// fontFamily: 'Caveat',
// fontFamily: 'Kalam',
// fontFamily: 'courier',
fontFamily: 'arial',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
messageFontFamily: 'courier',
},
fontSize: 12,
logLevel: 0,
securityLevel: 'loose',
});
function callback() {
alert('It worked');
}
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
};
</script>
</body>
</html>

View File

@@ -0,0 +1,206 @@
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&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; */
/* 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; */
}
.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;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<pre id="diagram" class="mermaid"></pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
console.error('Mermaid error: ', err);
};
mermaid.initialize({
startOnLoad: false,
// look: 'handdrawn',
// layout: 'elk',
fontFamily: 'Kalam',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
messageFontFamily: 'courier',
},
flowchart: {
// curve: 'cardinal',
// edgeDebug: true,
},
logLevel: 0,
});
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
};
let code = `---
config:
state:
curve: line
---
stateDiagram
S:S
T:T
U:U
state Z {
state X {
Y:Ypsilon
}
}
A
S --> T: angrepp
T --> U
T --> V
C
D
E
`;
code = `
flowchart TB
n3["Untitled Node"] --> n5["Untitled Node"] & n6["Untitled Node"] & n7["Untitled Node"] & n8["Untitled Node"] & n9["Untitled Node"]
`;
let positions = {
nodes: {
S: { x: 0, y: 0 },
T: { x: 100, y: 100, width: 100, height: 100 },
U: { x: 250, y: 260 },
V: { x: 300, y: 120 },
Z: { x: 300, y: 10, width: 160, height: 100 },
X: { x: 300, y: 20, width: 80, height: 60 },
Y: { x: 300, y: 30, width: 50, height: 20 },
A: { x: 300, y: 75, width: 20, height: 20 },
},
edges: {
edge0: {
points: [
{ x: 0, y: 0 },
{ x: 50, y: 0 },
{ x: 100, y: 100 },
],
},
edge1: {
// points: [
// { x: 100, y: 100 },
// { x: 200, y: 200 },
// ],
points: [
{ x: 100, y: 100 },
{ x: 150, y: 120 },
{ x: 190.19453144073486, y: 120 },
{ x: 190.19453144073486, y: 152.1556251525879 },
{ x: 250, y: 152.1556251525879 },
{ x: 250, y: 160 },
],
},
edge2: {
points: [
{ x: 100, y: 100 },
{ x: 175, y: 80 },
{ x: 200, y: 120 },
{ x: 300, y: 100 },
],
},
},
};
positions = JSON.parse(
'{"nodes":{"n3":{"x":360.885009765625,"y":7.677405834197998,"width":120.59375,"height":45.00000762939453},"n5":{"x":546.1309814453125,"y":190.24496459960938,"width":120.59375,"height":45},"n6":{"x":694.6719360351562,"y":167.00001525878906,"width":120.59375,"height":45},"n7":{"x":72.29684925079346,"y":167.00001525878906,"width":120.59370994567871,"height":45},"n8":{"x":250.27700805664062,"y":183.1090545654297,"width":120.59375,"height":45},"n9":{"x":393.2580871582031,"y":197.45834350585938,"width":120.59375,"height":45}},"edges":{"L_n3_n5_0":{"points":[{"x":383.71510673157036,"y":30.177409648895264},{"x":383.71510673157036,"y":98.96118712425232},{"x":523.300888350029,"y":98.96118712425232},{"x":523.300888350029,"y":167.74496459960938}],"start":"n3","end":"n5"},"L_n3_n6_1":{"points":[{"x":408.02337350122014,"y":30.177409648895264},{"x":408.02337350122014,"y":87.33871245384216},{"x":647.533580291497,"y":87.33871245384216},{"x":647.533580291497,"y":144.50001525878906}],"start":"n3","end":"n6"},"L_n3_n7_2":{"points":[{"x":320.12974762228504,"y":30.177409648895264},{"x":270.12974762228504,"y":87.33871245384216},{"x":113.05210448440184,"y":87.33871245384216},{"x":113.05210448440184,"y":144.50001525878906}],"start":"n3","end":"n7"},"L_n3_n8_3":{"points":[{"x":346.6989693425486,"y":30.177409648895264},{"x":346.6989693425486,"y":95.39323210716248},{"x":264.4630460745863,"y":95.39323210716248},{"x":264.4630460745863,"y":160.6090545654297}],"start":"n3","end":"n8"},"L_n3_n9_4":{"points":[{"x":364.7230894682698,"y":30.177409648895264},{"x":364.7230894682698,"y":102.56787657737732},{"x":389.42000810627434,"y":102.56787657737732},{"x":389.42000810627434,"y":174.95834350585938}],"start":"n3","end":"n9"}}}'
);
// console.log('positions:', positions);
const { svg } = await mermaid.render('the-id-of-the-svg', code, undefined, positions);
// if (window?.calcIntersections2) {
// const int = await calcIntersections2(
// { id: 'a', shape: 'rect', x: 100, y: 100, width: 100, height: 100 },
// { id: 'a', shape: 'rect', x: 300, y: 100, width: 100, height: 100 }
// );
// console.log('Intersections', int);
// } else {
// console.error('calcIntersections not found');
// }
// console.log(JSON.stringify(positions));
const elem = document.querySelector('#diagram');
elem.innerHTML = svg;
</script>
</body>
</html>

View File

@@ -0,0 +1,272 @@
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Recursive:wght@300..1000&display=swap"
rel="stylesheet"
/>
<style>
.recursive-500 {
font-family: 'Recursive', serif;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
font-variation-settings:
'slnt' 0,
'CASL' 0,
'CRSV' 0.5,
'MONO' 0;
}
body {
/* background: rgb(221, 208, 208); */
/* background: #333; */
/* font-family: 'Arial'; */
font-family: 'Recursive', serif;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
font-variation-settings:
'slnt' 0,
'CASL' 0,
'CRSV' 0.5,
'MONO' 0;
/* color: white; */
/* font-size: 18px !important; */
}
.gridify.tiny {
background-image: linear-gradient(
transparent 11px,
rgba(220, 220, 200, 0.8) 12px,
transparent 12px
),
linear-gradient(90deg, transparent 11px, rgba(220, 220, 200, 0.8) 12px, transparent 12px);
background-size:
100% 12px,
12px 100%;
}
.gridify.dots {
background-image: radial-gradient(
circle at center,
rgba(220, 220, 200, 0.8) 1px,
transparent 1px
);
background-size: 24px 24px;
}
h1 {
color: grey;
}
.mermaid2 {
display: none;
}
.mermaid svg {
font-size: 16px !important;
font-family: 'Recursive', serif;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
font-variation-settings:
'slnt' 0,
'CASL' 0,
'CRSV' 0.5,
'MONO' 0;
}
pre {
width: 100%;
/*box-shadow: 4px 4px 0px 0px #0000000F;*/
}
</style>
</head>
<body class="gridify dots">
<p class="mb-20">Test Diagram</p>
<div class="w-full h-64">
<pre id="diagram4" class="mermaid">
---
config:
theme: neo
layout: dagre
---
flowchart TD
A{"Diamond"} --- n1["Rectangle"] & n2["Rounded"] & n3(["Stadium"])
n1 --x n4["Rounded"]
n2 --o n5["Hexagon"]
n3 --> n6["Parallelogram"]
n5 o--o n7["Trapezoid"]
n4 x--x n8["Lean Right"]
n6 <--> n9(("Circle"))
n8 --> n10["Rose"]
n7 --> n11["Pine"]
n9 --> n12["Peach"]
n2@{ shape: rounded}
n4@{ shape: rounded}
n5@{ shape: hex}
n6@{ shape: lean-l}
n7@{ shape: trap-b}
n8@{ shape: lean-r}
n10:::Rose
n11:::Pine
n12:::Peach
classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
classDef Pine stroke-width:1px, stroke-dasharray:none, stroke:#254336, fill:#27654A, color:#FFFFFF
classDef Peach stroke-width:1px, stroke-dasharray:none, stroke:#FBB35A, fill:#FFEFDB, color:#8F632D
n10 --x End
n11 --x End
n12 --x End
</pre
>
<pre id="diagram4" class="mermaid">
---
config:
look: classic
theme: forest
layout: dagre
---
flowchart TD
A{"Diamond"} --- n1["Rectangle"] & n2["Rounded"] & n3(["Stadium"])
n1 --x n4["Rounded"]
n2 --o n5["Hexagon"]
n3 --> n6["Parallelogram"]
n5 o--o n7["Trapezoid"]
n4 x--x n8["Lean Right"]
n6 <--> n9(("Circle"))
n8 --> n10["Rose"]
n7 --> n11["Pine"]
n9 --> n12["Peach"]
n2@{ shape: rounded}
n4@{ shape: rounded}
n5@{ shape: hex}
n6@{ shape: lean-l}
n7@{ shape: trap-b}
n8@{ shape: lean-r}
n10:::Rose
n11:::Pine
n12:::Peach
classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
classDef Pine stroke-width:1px, stroke-dasharray:none, stroke:#254336, fill:#27654A, color:#FFFFFF
classDef Peach stroke-width:1px, stroke-dasharray:none, stroke:#FBB35A, fill:#FFEFDB, color:#8F632D
n10 --x End
n11 --x End
n12 --x End
</pre
>
</div>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
const staticBellIconPack = {
prefix: 'fa6-regular',
icons: {
bell: {
body: '<path fill="currentColor" d="M224 0c-17.7 0-32 14.3-32 32v19.2C119 66 64 130.6 64 208v25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416h400c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6c-28.3-35.5-43.8-79.6-43.8-125V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32m0 96c61.9 0 112 50.1 112 112v25.4c0 47.9 13.9 94.6 39.7 134.6H72.3c25.8-40 39.7-86.7 39.7-134.6V208c0-61.9 50.1-112 112-112m64 352H160c0 17 6.7 33.3 18.7 45.3S207 512 224 512s33.3-6.7 45.3-18.7S288 465 288 448"/>',
width: 448,
},
},
width: 512,
height: 512,
};
mermaid.registerIconPacks([
{
name: 'logos',
loader: () =>
fetch('https://unpkg.com/@iconify-json/logos@1/icons.json').then((res) => res.json()),
},
{
name: 'fa',
loader: () => staticBellIconPack,
},
]);
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
console.error('Mermaid error: ', err);
};
window.callback = function () {
alert('A callback was triggered');
};
function callback() {
alert('It worked');
}
await mermaid.initialize({
startOnLoad: false,
theme: 'redux',
// theme: 'default',
// theme: 'forest',
// handDrawnSeed: 12,
look: 'neo',
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
// layout: 'dagre',
// layout: 'elk',
// layout: 'fixed',
// htmlLabels: false,
flowchart: { titleTopMargin: 10 },
// fontFamily: 'Caveat',
// fontFamily: 'Kalam',
// fontFamily: 'courier',
fontFamily: 'Recursive',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
messageFontFamily: 'courier',
},
kanban: {
htmlLabels: false,
},
fontSize: 16,
logLevel: 0,
securityLevel: 'loose',
callback,
});
// setTimeout(() => {
mermaid.init(undefined, document.querySelectorAll('.mermaid'));
// }, 1000);
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
};
</script>
</body>
</html>

View File

@@ -0,0 +1,306 @@
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&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; */
/* 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; */
}
.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;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<pre id="diagram" class="mermaid"></pre>
<pre id="diagram2" class="mermaid"></pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
console.error('Mermaid error: ', err);
};
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
};
let code = `
stateDiagram
S:S
T:T
U:U
state Z {
state X {
Y:Ypsilon
}
}
A
S --> T: angrepp
S --> T: angrepp
T --> U
Y --> V
C
D
E
`;
code = `
flowchart TB
c1-->a2
subgraph one
a1-->a2
end
subgraph two
b1-->b2
end
subgraph three
c1-->c2
end
`;
// code = `
// flowchart BT
// A
// subgraph one
// a1 --> a2
// end
// subgraph two
// a3
// end
// `;
// code = `
// flowchart TB
// subgraph one
// a1-->a2
// end`;
// let positions = JSON.parse(
// '{"nodes":{"S":{"x":30.78125,"y":43.5},"Y":{"x":127.94140625,"y":50}},"edges":{}}'
// );
function exctractPositions(svg) {
const positions = { nodes: {}, edges: {} };
// Extract the viewbox paddings - TOSDO: update in collab
const viewBox = svg.getAttribute('viewBox').split(' ');
const viewBoxX = parseFloat(viewBox[0]);
const viewBoxY = parseFloat(viewBox[1]);
// console.log('viewBox:', viewBoxX, viewBoxY);
svg.querySelectorAll('[data-et="node"]').forEach((node) => {
if (node.tagName === 'g') {
// console.log('node:', node);
const id = node.dataset.id;
const bbox = node.getBBox();
const transform = node.getAttribute('transform');
const x = parseFloat(transform.split(',')[0].split('(')[1]);
const y = parseFloat(transform.split(',')[1].split(')')[0]);
// Get the bounding rectangle of the element
const rect = node.getBoundingClientRect();
// Get the absolute position relative to the document
const absoluteX = rect.left + window.pageXOffset + viewBoxX;
const absoluteY = rect.top + window.pageYOffset + viewBoxY;
positions.nodes[id] = {
x: absoluteX + rect.width / 2,
y: absoluteY + rect.height / 2,
width: rect.width,
height: rect.height,
};
}
});
svg.querySelectorAll('[data-et="cluster"]').forEach((node) => {
// console.log('cluster:', node);
if (node.tagName === 'g') {
const id = node.dataset.id;
// console.log('cluster:', node);
const transform = node.getAttribute('transform');
const rect = node.getBoundingClientRect();
// Get the absolute position relative to the document
const absoluteX = rect.left + window.pageXOffset + viewBoxX;
const absoluteY = rect.top + window.pageYOffset + viewBoxY;
positions.nodes[id] = {
x: absoluteX + rect.width / 2,
y: absoluteY + rect.height / 2,
width: rect.width,
height: rect.height,
};
}
});
svg.querySelectorAll('[data-et="edge"]').forEach((edge) => {
// if (node.tagName === 'g') {
const path = edge.getBoundingClientRect();
// Get the absolute position relative to the document
const absoluteX = path.left + window.pageXOffset + viewBoxX;
const absoluteY = path.top + window.pageYOffset + viewBoxY;
console.log(
'absoluteX:',
absoluteX,
'absoluteY:',
absoluteY,
'offset',
window.pageXOffset
);
const id = edge.dataset.id;
const points = JSON.parse(atob(edge.dataset.points));
console.log('edge:', points, absoluteX, absoluteY);
let minX = 10000;
let minY = 10000;
points.forEach((point) => {
if (point.x < minX) {
minX = point.x;
}
if (point.y < minY) {
minY = point.y;
}
});
let dx = absoluteX - minX;
let dy = absoluteY - minY;
if (dx < 1) {
dx = 0;
}
if (dy < 1) {
dy = 0;
}
positions.edges[id] = {
points: points.map((point) => {
console.log('point:', point.y, absoluteY);
return {
x: point.x + dx,
y: point.y + dy,
};
}),
};
// }
});
return positions;
}
const mode = 'reset';
if (mode === 'reset') {
mermaid.initialize({
startOnLoad: false,
layout: 'elk',
fontFamily: 'Kalam',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
messageFontFamily: 'courier',
},
logLevel: 5,
});
const { svg } = await mermaid.render('the-id-of-the-svg', code);
const elem = document.querySelector('#diagram');
elem.innerHTML = svg;
elem.classList.remove('mermaid');
const positions = exctractPositions(elem.firstChild);
// console.log('Positions:', JSON.stringify(positions));
const { svg: svg2 } = await mermaid.render(
'the-id-of-the-svg2',
'---\n config:\n layout: fixed\n---' + code,
undefined,
positions
);
// console.log('svg2', svg2);
const elem2 = document.querySelector('#diagram2');
elem2.innerHTML = svg2;
} else {
mermaid.initialize({
startOnLoad: false,
// look: 'handdrawn',
layout: 'fixed',
fontFamily: 'Kalam',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
messageFontFamily: 'courier',
},
logLevel: 0,
});
const { svg } = await mermaid.render('the-id-of-the-svg', code, undefined, positions);
// console.log(JSON.stringify(positions));
const elem = document.querySelector('#diagram');
elem.innerHTML = svg;
}
</script>
</body>
</html>

View File

@@ -4,7 +4,7 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"

View File

@@ -4,14 +4,14 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
rel="stylesheet"
/>
<link
@@ -32,26 +32,8 @@
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Recursive:wght@300..1000&display=swap"
rel="stylesheet"
/>
<style>
.recursive-mermaid {
font-family: 'Recursive', sans-serif;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
font-variation-settings:
'slnt' 0,
'CASL' 0,
'CRSV' 0.5,
'MONO' 0;
}
body {
/* background: rgb(221, 208, 208); */
/* background: #333; */
@@ -63,9 +45,7 @@
h1 {
color: grey;
}
.mermaid {
border: 1px solid red;
}
.mermaid2 {
display: none;
}
@@ -98,126 +78,86 @@
font-family: monospace;
font-size: 72px;
}
pre {
width: 100%;
}
.class2 {
fill: red;
fill-opacity: 1;
}
/* tspan {
font-size: 6px !important;
} */
/* .flowchart-link {
stroke-dasharray: 4, 4 !important;
animation: flow 1s linear infinite;
animation: dashdraw 4.93282s linear infinite;
stroke-width: 2px !important;
} */
@keyframes dashdraw {
from {
stroke-dashoffset: 0;
}
}
/*stroke-width:2;stroke-dasharray:10.000000,9.865639;stroke-dashoffset:-198.656393;animation: 4.932820s linear infinite;*/
/* stroke-width:2;stroke-dasharray:10.000000,9.865639;stroke-dashoffset:-198.656393;animation: dashdraw 4.932820s linear infinite;*/
</style>
</head>
<body>
<pre id="diagram4" class="mermaid">
treemap
"Section 1"
"Leaf 1.1": 12
"Section 1.2":::class1
"Leaf 1.2.1": 12
"Section 2"
"Leaf 2.1": 20:::class1
"Leaf 2.2": 25
"Leaf 2.3": 12
classDef class1 fill:red,color:blue,stroke:#FFD600;
</pre
>
---
config:
look: classic
theme: forest
layout: dagre
---
flowchart LR
A["A"] --> C
B("B B B B B") --> C[/"C C C C C"/]
C@{ shape: circle }
%%C@{ shape: question }
C@{ shape: stadium }
</pre>
<pre id="diagram4" class="mermaid">
---
config:
look: classic
layout: elk
---
flowchart LR
n1["n1"] --- C
B("Continue") --> C[/"Evaluate"/]
C -- One --> D["Option 1"]
C -- Two --> E["Option 2"]
C -- Three --> F["fa:fa-car Option 3"]
C@{ shape: db }
</pre>
<pre id="diagram4" class="mermaid2">
---
config:
treemap:
valueFormat: '$0,0'
layout: elk
---
treemap
"Budget"
"Operations"
"Salaries": 7000
"Equipment": 2000
"Supplies": 1000
"Marketing"
"Advertising": 4000
"Events": 1000
flowchart LR
%% subgraph s1["Untitled subgraph"]
C{"Evaluate"}
%% end
</pre
>
<pre id="diagram4" class="mermaid">
treemap
title Accessible Treemap Title
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
B --> C
</pre>
<pre id="diagram4" class="mermaid2">
---
config:
look: neo
layout: elk
---
flowchart LR
%% A ==> B
%% A2 --> B2
D --> I((I the Circle))
D --> I
</pre>
<pre id="diagram4" class="mermaid2">
---
config:
layout: elk
---
flowchart LR
AB["apa@apa@"] --> B(("`apa@apa`"))
</pre>
<pre id="diagram4" class="mermaid2">
flowchart
D(("for D"))
</pre>
<pre id="diagram4" class="mermaid2">
flowchart LR
A e1@==> B
e1@{ animate: true}
</pre>
<pre id="diagram4" class="mermaid2">
flowchart LR
A e1@--> B
classDef animate stroke-width:2,stroke-dasharray:10\,8,stroke-dashoffset:-180,animation: edge-animation-frame 6s linear infinite, stroke-linecap: round
class e1 animate
</pre>
<h2>infinite</h2>
<pre id="diagram4" class="mermaid2">
flowchart LR
A e1@--> B
classDef animate stroke-dasharray: 9\,5,stroke-dashoffset: 900,animation: dash 25s linear infinite;
class e1 animate
</pre>
<h2>Mermaid - edge-animation-slow</h2>
<pre id="diagram4" class="mermaid2">
flowchart LR
A e1@--> B
e1@{ animation: fast}
</pre>
<h2>Mermaid - edge-animation-fast</h2>
<pre id="diagram4" class="mermaid2">
flowchart LR
A e1@--> B
classDef animate stroke-dasharray: 1000,stroke-dashoffset: 1000,animation: dash 10s linear;
class e1 edge-animation-fast
</pre>
subgraph S2
subgraph s1["APA"]
D{"Use the editor"}
end
<pre id="diagram4" class="mermaid2">
info </pre
>
D -- Mermaid js --> I(("fa:fa-code Text"))
D --> I
D --> E --> I
end
</pre>
<pre id="diagram4" class="mermaid2">
---
config:
@@ -455,7 +395,7 @@ kanban
[Create Documentation]
docs[Create Blog about the new diagram]
id7[In progress]
id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes. And some more just for the extra flare.]
id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
id9[Ready for deploy]
id8[Design grammar]@{ assigned: 'knsv' }
id10[Ready for test]
@@ -503,13 +443,10 @@ kanban
window.callback = function () {
alert('A callback was triggered');
};
function callback() {
alert('It worked');
}
await mermaid.initialize({
// theme: 'forest',
mermaid.initialize({
// theme: 'base',
// theme: 'default',
// theme: 'forest',
theme: 'forest',
// handDrawnSeed: 12,
// look: 'handDrawn',
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
@@ -517,8 +454,10 @@ kanban
// layout: 'elk',
// layout: 'fixed',
// htmlLabels: false,
flowchart: { titleTopMargin: 10 },
fontFamily: "'Recursive', sans-serif",
flowchart: { titleTopMargin: 10, useMaxWidth: false },
// fontFamily: 'Caveat',
// fontFamily: 'Kalam',
// fontFamily: 'courier',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
@@ -530,9 +469,10 @@ kanban
fontSize: 12,
logLevel: 0,
securityLevel: 'loose',
callback,
});
function callback() {
alert('It worked');
}
mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);

View File

@@ -1,103 +1,173 @@
<!doctype html>
<html lang="en">
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Mindmap Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<style>
div.mermaid {
/* font-family: 'trebuchet ms', verdana, arial; */
font-family: 'Courier New', Courier, monospace !important;
body {
/* background: rgb(221, 208, 208); */
/* background: #333; */
font-family: 'Arial';
/* color: white; */
/* font-size: 18px !important; */
}
h1 {
color: grey;
}
.mermaid2 {
display: none;
}
.mermaid svg {
/* font-size: 18px !important; */
/* 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; */
}
.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;
}
pre {
width: 100%;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<h1>Mindmap diagram demo</h1>
<pre class="mermaid">
mindmap
root
child1((Circle))
grandchild 1
grandchild 2
child2(Round rectangle)
grandchild 3
grandchild 4
child3[Square]
grandchild 5
::icon(mdi mdi-fire)
gc6((grand<br/>child 6))
::icon(mdi mdi-fire)
gc7((grand<br/>grand<br/>child 8))
</pre>
<h2>Mindmap with root wrapping text and a shape</h2>
<pre class="mermaid">
mindmap
root[A root with a long text that wraps to keep the node size in check]
</pre>
<div class="flex gap-4">
<pre id="diagram4" class="mermaid">
---
config:
look: classic
theme: forest
layout: elk
---
flowchart LR
n1["n1"] --> C
n2("n2") --> C
C@{ shape: circle }
</pre
>
<pre id="diagram4" class="mermaid">
---
config:
look: neo
theme: redux
layout: elk
---
flowchart LR
n1["n1"] --> C
n2("n2") --> C
C@{ shape: circle }
</pre
>
<pre id="diagram4" class="mermaid">
---
config:
look: handDrawn
theme: forest
layout: elk
---
flowchart LR
n1["n1"] --> C
n2("n2") --> C
C@{ shape: circle }
</pre
>
</div>
<script type="module">
// import mermaid from './mermaid.esm.mjs';
import mermaid from '../../packages/mermaid/dist/mermaid.esm.mjs';
// import mermaidMindmap from './mermaid-mindmap.esm.mjs';
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
// import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';
// await mermaid.registerExternalDiagrams([mermaidMindmap]);
const staticBellIconPack = {
prefix: 'fa6-regular',
icons: {
bell: {
body: '<path fill="currentColor" d="M224 0c-17.7 0-32 14.3-32 32v19.2C119 66 64 130.6 64 208v25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416h400c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6c-28.3-35.5-43.8-79.6-43.8-125V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32m0 96c61.9 0 112 50.1 112 112v25.4c0 47.9 13.9 94.6 39.7 134.6H72.3c25.8-40 39.7-86.7 39.7-134.6V208c0-61.9 50.1-112 112-112m64 352H160c0 17 6.7 33.3 18.7 45.3S207 512 224 512s33.3-6.7 45.3-18.7S288 465 288 448"/>',
width: 448,
},
},
width: 512,
height: 512,
};
const ALLOWED_TAGS = [
'a',
'b',
'blockquote',
'br',
'dd',
'div',
'dl',
'dt',
'em',
'foreignObject',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'h7',
'h8',
'hr',
'i',
'li',
'ul',
'ol',
'p',
'pre',
'span',
'strike',
'strong',
'table',
'tbody',
'td',
'tfoot',
'th',
'thead',
'tr',
];
mermaid.registerIconPacks([
{
name: 'logos',
loader: () =>
fetch('https://unpkg.com/@iconify-json/logos@1/icons.json').then((res) => res.json()),
},
{
name: 'fa',
loader: () => staticBellIconPack,
},
]);
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
console.error('Mermaid error: ', err);
};
window.callback = function () {
alert('A callback was triggered');
};
mermaid.initialize({
theme: 'base',
startOnLoad: true,
flowchart: { titleTopMargin: 10, useMaxWidth: false },
fontSize: 12,
logLevel: 0,
flowchart: {
useMaxWidth: false,
htmlLabels: true,
},
gantt: {
useMaxWidth: false,
},
useMaxWidth: false,
securityLevel: 'loose',
});
function callback() {
alert('It worked');

View File

@@ -0,0 +1,171 @@
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<style>
body {
font-family: 'Arial';
background-color: #333;
}
h3 {
color: white;
}
</style>
</head>
<body>
<div class="flex w-full">
<div id="diagram-fixed"></div>
<div id="diagram-normal"></div>
</div>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
console.error('Mermaid error: ', err);
};
mermaid.initialize({
startOnLoad: false,
//look: 'handdrawn',
// layout: 'fixed',
theme: 'neo-dark',
//layout: 'elk',
fontFamily: 'Kalam',
logLevel: 1,
});
// let shape = 'rect'; // Done
//let shape = 'rounded'; // Done
//let shape = 'stadium'; // Done
// let shape = 'fr-rect'; // Done
// let shape = 'cyl'; // Done
//let shape = 'circle'; // Done
// let shape = 'odd'; // Done
// let shape = 'diam'; //Done
// let shape = 'hex'; // Done
// let shape = 'lean-r'; // Done
// let shape = 'lean-l'; // Done
// let shape = 'trap-b'; // Done
// let shape = 'trap-t'; // Done
// let shape = 'dbl-circ'; // Done
// let shape = 'text'; // Done
// let shape = 'notch-rect'; // Done
// let shape = 'lin-rect'; // Done
//let shape = 'sm-circ'; // Done
// let shape = 'fr-circ'; //Done
//let shape = 'fork'; // Done
//let shape = 'hourglass'; //Done
// let shape = 'bolt'; //Done
// let shape = 'doc'; // Done
// let shape = 'delay'; // Done
// let shape = 'h-cyl'; // Done
// let shape = 'lin-cyl'; // Done
// let shape = 'curv-trap'; // Done
// let shape = 'div-rect'; // Done
//let shape = 'tri'; // Done
// let shape = 'win-pane'; //Done
// let shape = 'f-circ'; // Done
// let shape = 'lin-doc'; // Done
// let shape = 'notch-pent'; // Done
// let shape = 'flip-tri'; // Done
// let shape = 'sl-rect'; // Done
// let shape = 'cross-circ'; // Done
// let shape = 'bow-rect'; // Done
// let shape = 'st-rect'; // Done
// let shape = 'flag';
// let shape = 'docs';
// let shape = 'brace';
// let shape = 'brace-r';
// let shape = 'braces';
// let shape = 'tag-doc';
let configFixed = `---
config:
layout: fixed
---
`;
let code = `flowchart TB
%% n80["APA ksldj hfaskljdh aklsjdhf klasjdhf klasjhf klsajdh klasjdhf klasjdhf klasjdh klasjhf klasjdh klajsdhfklasjdhf kljadh fklasjdhf klajsdhf lkasdhf klajsdhf klasjdhfklasjdh klasjhf klasdfh klasdfh aklsjfh akjshkasldfh klasdfh klasjh fklsjhf klasdhf kljasdhf klasdhf klj"]
%% n80@{ shape: '${shape}'}
n81@{ label: "Ashish", shape: '${shape}'}
%%n82@{ label: "n82", shape: '${shape}'}
%%n83@{ label: "n83", shape: '${shape}'}
`;
let positions = {
edges: {},
nodes: {
n81: {
x: 0,
y: 10,
width: 107.7,
height: 65,
},
n80: {
x: -400,
y: 10,
width: 1,
height: 1,
},
n82: {
x: 0,
y: 110,
},
n83: {
x: 80,
y: 10,
},
n84: {
x: 1200,
y: 10,
width: 300,
height: 200,
},
},
};
console.log(configFixed + code);
const { svg } = await mermaid.render(
'the-id-of-the-svg-1',
configFixed + code,
undefined,
positions
);
const elem = document.querySelector('#diagram-fixed');
elem.innerHTML = svg;
const { svg: svg2 } = await mermaid.render('the-id-of-the-svg-2', code, undefined, positions);
const elem2 = document.querySelector('#diagram-normal');
elem2.innerHTML = svg2;
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -66,8 +66,11 @@
/* font-size: 18px !important; */
}
.gridify.tiny {
background-image:
linear-gradient(transparent 11px, rgba(220, 220, 200, 0.8) 12px, transparent 12px),
background-image: linear-gradient(
transparent 11px,
rgba(220, 220, 200, 0.8) 12px,
transparent 12px
),
linear-gradient(90deg, transparent 11px, rgba(220, 220, 200, 0.8) 12px, transparent 12px);
background-size:
100% 12px,
@@ -112,41 +115,57 @@
</head>
<body class="gridify dots">
<p class="mb-20">Test Diagram</p>
<div class="w-full h-64">
<pre id="diagram4" class="mermaid" style="background: rgb(255, 255, 255)">
erDiagram
CAR ||--o{ NAMED-DRIVER : allows
CAR ::: Pine {
string registrationNumber PK "Primary Key<br><strong>Unique registration number</strong>"
string make "Car make<br><strong>e.g., Toyota</strong>"
string model "Model of the car<br><strong>e.g., Corolla</strong>"
string[] parts "List of parts<br><strong>Stored as array</strong>"
}
PERSON ||--o{ NAMED-DRIVER : is
PERSON ::: someclass {
string driversLicense PK "The license #<br><strong>Primary Key</strong>"
string(99) firstName "Only 99 characters <br>are allowed <br> <strong>e.g., Smith</strong>"
string lastName "Last name of person<br><strong>e.g., Smith</strong>"
string phone UK "Unique phone number<br><strong>Used for contact</strong>"
int age "Age of the person<br><strong>Must be numeric</strong>"
}
NAMED-DRIVER {
string carRegistrationNumber PK, FK, UK, PK "Foreign key to CAR<br><strong>Also part of PK</strong>"
string driverLicence PK, FK "Foreign key to PERSON<br><strong>Also part of PK</strong>"
}
MANUFACTURER only one to zero or more CAR : makesx
</pre>
<hr />
<pre class="mermaid">
erDiagram
_**testẽζØ😀㌕ぼ**_ {
*__List~List~int~~sdfds__* **driversLicense** PK "***The l😀icense #***"
string last*Name*
string __phone__ UK
*string(99)~T~~~~~~* firstName "Only __99__ <br>characters are a<br>llowed dsfsdfsdfsdfs"
int _age_
}
</pre>
<pre style="display: none">
---
config:
theme: neo
layout: dagre
---
flowchart TD
A{"Cylinder"} --- n1["Rectangle"] & n2["Rounded"] & n3(["Stadium"])
n1 --x n4["Rounded"]
n2 --o n5["Hexagon"]
n3 --> n6["Parallelogram"]
n5 o--o n7["Trapezoid"]
n4 x--x n8["Lean Right"]
n6 <--> n9(("Circle"))
n8 --> n10["Rose"]
n7 --> n11["Pine"]
n9 --> n12["Peach"]
n2@{ shape: rounded}
n4@{ shape: rounded}
n5@{ shape: hex}
n6@{ shape: lean-l}
n7@{ shape: trap-b}
n8@{ shape: lean-r}
n10:::Rose
n11:::Pine
n12:::Peach
classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
classDef Pine stroke-width:1px, stroke-dasharray:none, stroke:#254336, fill:#27654A, color:#FFFFFF
classDef Peach stroke-width:1px, stroke-dasharray:none, stroke:#FBB35A, fill:#FFEFDB, color:#8F632D
n10 --x End
n11 --x End
n12 --x End
</pre
>
<pre id="diagram4" class="mermaid">
---
config:
theme: neo
layout: dagre
---
flowchart TD
n1["Cylinder"]
n1@{ shape: database}
</pre
>
</div>
<script type="module">
@@ -188,14 +207,21 @@
}
await mermaid.initialize({
startOnLoad: false,
theme: 'forest',
look: 'classic',
layout: 'dagre',
theme: 'redux',
// theme: 'default',
// look: 'classic',
// theme: 'forest',
// handDrawnSeed: 12,
look: 'neo',
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
// layout: 'dagre',
// layout: 'elk',
// layout: 'fixed',
// htmlLabels: false,
flowchart: { titleTopMargin: 10 },
// fontFamily: 'Caveat',
// fontFamily: 'Kalam',
// fontFamily: 'courier',
fontFamily: 'Recursive',
sequence: {
actorFontFamily: 'courier',

View File

@@ -4,28 +4,60 @@
<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/6.7.2/css/font-awesome.min.css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
rel="stylesheet"
/>
<style>
body {
/* background: rgb(221, 208, 208); */
/* background:#333; */
/* background: #333; */
font-family: 'Arial';
/* font-size: 18px !important; */
}
h1 {
color: grey;
}
.mermaid2 {
display: none;
}
.mermaid svg {
/* font-size: 18px !important; */
/* 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; */
}
.malware {
position: fixed;
bottom: 0;
@@ -41,34 +73,75 @@
font-family: monospace;
font-size: 72px;
}
/* tspan {
font-size: 6px !important;
} */
</style>
</head>
<body>
<div>Security check</div>
<pre id="diagram" class="mermaid">
flowchart LR
A-->B
</pre
>
<pre id="diagram" class="mermaid2">
mindmap
root
ch1
ch2
</pre
stateDiagram-v2
direction LR
[*] --> Active
state Active {
direction BT
[*] --> Inner
Inner --> NumLockOn : EvNumLockPressed
}
%% Outer --> Inner
</pre
>
<script src="./packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script>
<script src="./packages/mermaid-mindmap/dist/mermaid-example-diagram-detector.js"></script>
<script src="./packages/mermaid/dist/mermaid.esm.mjs"></script>
<script>
<pre id="diagram" class="mermaid">
stateDiagram-v2
[*] --> First
state First {
[*] --> second
second --> [*]
}
</pre>
<pre id="diagram" class="mermaid2">
flowchart LR
A[Start] --Some text--> B(Continue)
B --> C{Evaluate}
C -- One --> D[Option 1]
C -- Two --> E[Option 2]
C -- Three --> F[fa:fa-car Option 3]
</pre>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
mermaid.registerLayoutLoaders(layouts);
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
console.error('Mermaid error: ', err);
};
mermaid.initialize({
startOnLoad: true,
theme: 'neo',
handdrawnSeed: 12,
look: 'neo',
//layout: 'elk',
'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
// layout: 'dagre',
// layout: 'elk',
flowchart: { titleTopMargin: 10 },
// fontFamily: 'Caveat',
//fontFamily: 'Kalam',
fontFamily: 'Arial',
sequence: {
actorFontFamily: 'arial',
noteFontFamily: 'arial',
messageFontFamily: 'arial',
},
fontSize: 10,
logLevel: 0,
basePath: './packages/',
// themeVariables: {relationLabelColor: 'red'}
htmlLabels: true,
});
function callback() {
alert('It worked');
@@ -77,6 +150,10 @@ A-->B
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>

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