mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 17:56:43 +02:00
Compare commits
982 Commits
sidv/useUn
...
sidv/fixFl
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5c63c5ceae | ||
![]() |
6d4a064df2 | ||
![]() |
15dbf22a40 | ||
![]() |
95bba56bd8 | ||
![]() |
45f8fb4a84 | ||
![]() |
302f335704 | ||
![]() |
896a8a23ca | ||
![]() |
9928a15a66 | ||
![]() |
2b388ec6ec | ||
![]() |
3662869ce1 | ||
![]() |
415e73b6f4 | ||
![]() |
609530b246 | ||
![]() |
cae612dfff | ||
![]() |
7cd62bd052 | ||
![]() |
d4a473b88a | ||
![]() |
c73d4939e9 | ||
![]() |
beb3a227d1 | ||
![]() |
66116ef8a0 | ||
![]() |
307aa6f623 | ||
![]() |
08c1071382 | ||
![]() |
186de337b4 | ||
![]() |
8426716886 | ||
![]() |
ecec4d9e4c | ||
![]() |
5b4efbad49 | ||
![]() |
1a6fd69f65 | ||
![]() |
b7795ef12d | ||
![]() |
35e81f3fd4 | ||
![]() |
7e639bec3a | ||
![]() |
9deae27c82 | ||
![]() |
689ffbf5a5 | ||
![]() |
f630fba392 | ||
![]() |
bf346ea155 | ||
![]() |
d6bd59c46e | ||
![]() |
0cc93d38c6 | ||
![]() |
6ff33149e0 | ||
![]() |
638c3691a8 | ||
![]() |
599fb3a728 | ||
![]() |
4b7ed7845b | ||
![]() |
0c449bbd27 | ||
![]() |
8d60ef6d0a | ||
![]() |
6af2438474 | ||
![]() |
56a9625d95 | ||
![]() |
921bbd1a9f | ||
![]() |
750b1d2223 | ||
![]() |
ae14f6a947 | ||
![]() |
daee545e78 | ||
![]() |
ab0eb6c9bf | ||
![]() |
2a5b122d0c | ||
![]() |
3e20a42b3e | ||
![]() |
e2a32e5040 | ||
![]() |
f0b1529727 | ||
![]() |
171d7a04f4 | ||
![]() |
40199e28b8 | ||
![]() |
245c4f8c78 | ||
![]() |
616d445074 | ||
![]() |
cdea0ea829 | ||
![]() |
d0e8074de7 | ||
![]() |
e7b9b5a0a9 | ||
![]() |
f35e0cafdf | ||
![]() |
af13f3430a | ||
![]() |
c78ad7dbac | ||
![]() |
4320fe7839 | ||
![]() |
5b4356bd43 | ||
![]() |
98d9205e6f | ||
![]() |
dfdfa63009 | ||
![]() |
e6a48f8baf | ||
![]() |
372b57d540 | ||
![]() |
a7b75d71e4 | ||
![]() |
64558ffa9c | ||
![]() |
9573f336c3 | ||
![]() |
6ced1673b0 | ||
![]() |
e688138167 | ||
![]() |
b11c511c5c | ||
![]() |
5b3e565b63 | ||
![]() |
8cbe1a9046 | ||
![]() |
4a200473c9 | ||
![]() |
190d79613d | ||
![]() |
bdd3ed41fc | ||
![]() |
ea138ef29f | ||
![]() |
26d0e5cb04 | ||
![]() |
355b471ca0 | ||
![]() |
b651be77f1 | ||
![]() |
a754f7b699 | ||
![]() |
2abb9541b6 | ||
![]() |
d32d935c44 | ||
![]() |
c76cb93f6f | ||
![]() |
779acb1b72 | ||
![]() |
19fab1f6a7 | ||
![]() |
40f517daee | ||
![]() |
88bda42e74 | ||
![]() |
9b6f2ecf42 | ||
![]() |
071f490047 | ||
![]() |
6e657e56a0 | ||
![]() |
dad9e94816 | ||
![]() |
4adc94761d | ||
![]() |
a51e6e06f7 | ||
![]() |
768e0122e2 | ||
![]() |
ac9a79643c | ||
![]() |
9a080bb975 | ||
![]() |
75f9de3d4a | ||
![]() |
81e86bc87c | ||
![]() |
f464212dc0 | ||
![]() |
0ad084182a | ||
![]() |
e2e9d0f1f3 | ||
![]() |
ac488dd800 | ||
![]() |
d00d20fc37 | ||
![]() |
88b94dea66 | ||
![]() |
9896402be6 | ||
![]() |
e9b76bba9b | ||
![]() |
ad09d63f65 | ||
![]() |
af7531d08a | ||
![]() |
eef6745272 | ||
![]() |
0cb6df1ef8 | ||
![]() |
ab627802a8 | ||
![]() |
f20ff4d580 | ||
![]() |
2a6603b33a | ||
![]() |
6115f6976a | ||
![]() |
da1beb36bf | ||
![]() |
d2409dc163 | ||
![]() |
1b40f552b2 | ||
![]() |
5b696a72f8 | ||
![]() |
d148a65967 | ||
![]() |
74ccf6410d | ||
![]() |
7cdb15c526 | ||
![]() |
55092f532f | ||
![]() |
7b6cb4f974 | ||
![]() |
0cd1c5de97 | ||
![]() |
48e5d743b3 | ||
![]() |
98e75959cc | ||
![]() |
0cec854f3b | ||
![]() |
abcae14fa7 | ||
![]() |
641098e602 | ||
![]() |
c2c8024718 | ||
![]() |
5338d90077 | ||
![]() |
180c695f2f | ||
![]() |
ce9bdcc53f | ||
![]() |
38d9ebc5da | ||
![]() |
5fd5de10b5 | ||
![]() |
ca5d78098e | ||
![]() |
cb2bc2a587 | ||
![]() |
6093383d45 | ||
![]() |
bd1343648e | ||
![]() |
3517314390 | ||
![]() |
8d43b87200 | ||
![]() |
9c12c42a26 | ||
![]() |
5bfe32524d | ||
![]() |
bd616e0ef5 | ||
![]() |
9fb25310e8 | ||
![]() |
102b9bc8c3 | ||
![]() |
9cec5ae1c4 | ||
![]() |
ac23787084 | ||
![]() |
ad61f4c6b1 | ||
![]() |
496585b543 | ||
![]() |
9e6168111f | ||
![]() |
f535640c1e | ||
![]() |
acc19db5bb | ||
![]() |
6cce1b20fb | ||
![]() |
a00616863d | ||
![]() |
49c97dad4c | ||
![]() |
e984b34af4 | ||
![]() |
c255d95ae2 | ||
![]() |
27e59e5adc | ||
![]() |
507e24cc72 | ||
![]() |
bb400d53b9 | ||
![]() |
b1590c2211 | ||
![]() |
9eeeb97e15 | ||
![]() |
0ef115f69a | ||
![]() |
6a89ef94f7 | ||
![]() |
97be4983f0 | ||
![]() |
c7affbe33b | ||
![]() |
82eccb70fa | ||
![]() |
78efac2c51 | ||
![]() |
58ec2686da | ||
![]() |
3a5c4a149f | ||
![]() |
c889ef0c30 | ||
![]() |
cce5505662 | ||
![]() |
b925849893 | ||
![]() |
d86d1e7887 | ||
![]() |
132ce2fb4b | ||
![]() |
458ac84749 | ||
![]() |
fa3e800802 | ||
![]() |
f616663f2f | ||
![]() |
b563ddc19d | ||
![]() |
c755e45961 | ||
![]() |
de34a06718 | ||
![]() |
040827d95d | ||
![]() |
a991c32732 | ||
![]() |
c4aebe6d57 | ||
![]() |
0f354ff974 | ||
![]() |
b2a5ddcd85 | ||
![]() |
816800adcd | ||
![]() |
fe9c109837 | ||
![]() |
1253733962 | ||
![]() |
4cbcfa054e | ||
![]() |
9a7dbab5ed | ||
![]() |
6eef09661d | ||
![]() |
10a66030b9 | ||
![]() |
93370a8e11 | ||
![]() |
4e3c2adffc | ||
![]() |
fbd35ae95a | ||
![]() |
75e73a4f03 | ||
![]() |
17c798a1b3 | ||
![]() |
c0b7ba305f | ||
![]() |
bd53e9d449 | ||
![]() |
45139470a3 | ||
![]() |
3677d44a58 | ||
![]() |
272ccded93 | ||
![]() |
b27d018c09 | ||
![]() |
a1fe7222ac | ||
![]() |
1b48c19897 | ||
![]() |
2dc780a766 | ||
![]() |
0b73d40ca1 | ||
![]() |
500efda8d6 | ||
![]() |
8e9d1bfc35 | ||
![]() |
75337287ea | ||
![]() |
b04155178a | ||
![]() |
d7e140a829 | ||
![]() |
25a7164df2 | ||
![]() |
29c8f8c867 | ||
![]() |
a226b073a0 | ||
![]() |
0c18f26dc0 | ||
![]() |
4d0447574a | ||
![]() |
40176f9bef | ||
![]() |
97a34a0cfc | ||
![]() |
d1690a03db | ||
![]() |
d8c67cd2c9 | ||
![]() |
ccc87be462 | ||
![]() |
f8b029de0e | ||
![]() |
8573db5114 | ||
![]() |
c6c3b07c33 | ||
![]() |
7df21c01ec | ||
![]() |
a1e64c2102 | ||
![]() |
7f9ebcf2c6 | ||
![]() |
7e240dac22 | ||
![]() |
06fdb95389 | ||
![]() |
2216bbad25 | ||
![]() |
43819f1bd8 | ||
![]() |
221640aa25 | ||
![]() |
5f1a507820 | ||
![]() |
7fd4814abc | ||
![]() |
61e31b3fe6 | ||
![]() |
e903f06f75 | ||
![]() |
35051f1946 | ||
![]() |
a5e0630e21 | ||
![]() |
bf37956528 | ||
![]() |
725b80831e | ||
![]() |
cb3982de7e | ||
![]() |
b30e9620f4 | ||
![]() |
4c9e35e269 | ||
![]() |
18571052ad | ||
![]() |
0d373f3a6a | ||
![]() |
70a52da393 | ||
![]() |
5c8b739047 | ||
![]() |
3549ffc4ac | ||
![]() |
df1095166e | ||
![]() |
c79be5d829 | ||
![]() |
38efaf93c8 | ||
![]() |
dfa65c5fc8 | ||
![]() |
32928224e5 | ||
![]() |
4456c2a267 | ||
![]() |
9e0410e0d3 | ||
![]() |
cdc68d99fe | ||
![]() |
110cd61c64 | ||
![]() |
baf5e8f6b2 | ||
![]() |
99abd4c31b | ||
![]() |
9238deaf00 | ||
![]() |
a01343bf1b | ||
![]() |
88f9233aa8 | ||
![]() |
33c81d557e | ||
![]() |
91f1ef9c42 | ||
![]() |
eba3a7bdcc | ||
![]() |
5bbce45c56 | ||
![]() |
395a794758 | ||
![]() |
1f2af83a0c | ||
![]() |
4d3e5e42e1 | ||
![]() |
9b912c4a59 | ||
![]() |
c6fbabc70e | ||
![]() |
41969c434f | ||
![]() |
8cd48bf405 | ||
![]() |
8b18fd93f4 | ||
![]() |
ec62c2bf5b | ||
![]() |
b9e7ba023f | ||
![]() |
284d032d26 | ||
![]() |
9859491381 | ||
![]() |
95d8e3a5df | ||
![]() |
56ec1ab52c | ||
![]() |
597a162249 | ||
![]() |
24f5a15f20 | ||
![]() |
d125d22488 | ||
![]() |
d09151e870 | ||
![]() |
60db22886a | ||
![]() |
23bed7e653 | ||
![]() |
07dcb8cc44 | ||
![]() |
ba632ff65b | ||
![]() |
d79f946cbc | ||
![]() |
b0c58a9764 | ||
![]() |
94991520ea | ||
![]() |
05e7a6bd4b | ||
![]() |
9298f631f9 | ||
![]() |
04305bdddc | ||
![]() |
f018ca34da | ||
![]() |
bbe3909627 | ||
![]() |
642397b36c | ||
![]() |
562514964e | ||
![]() |
125be13df4 | ||
![]() |
f3f7460706 | ||
![]() |
9e58f7bd99 | ||
![]() |
5110967bcd | ||
![]() |
5c6773a47c | ||
![]() |
5634c6ca1a | ||
![]() |
1c17f4c770 | ||
![]() |
f17a325632 | ||
![]() |
9f2d14f676 | ||
![]() |
bed9e8daab | ||
![]() |
4a258a0f2c | ||
![]() |
e4bc3e2269 | ||
![]() |
a470407f02 | ||
![]() |
e6d11b9443 | ||
![]() |
c624cbb910 | ||
![]() |
b428c06bed | ||
![]() |
9cbc3d6fb9 | ||
![]() |
12ed81855a | ||
![]() |
f597f15f82 | ||
![]() |
909c063a67 | ||
![]() |
f93bac9dd4 | ||
![]() |
8cb3318d94 | ||
![]() |
cb1e8220a4 | ||
![]() |
49bb87e14a | ||
![]() |
ddde451915 | ||
![]() |
40d2682b14 | ||
![]() |
93eb72248a | ||
![]() |
6883a92672 | ||
![]() |
2fe0a1360f | ||
![]() |
8e0f947d6c | ||
![]() |
411f868f22 | ||
![]() |
39f9277a73 | ||
![]() |
ff3104ad9c | ||
![]() |
be69f494b7 | ||
![]() |
fd6d1941b7 | ||
![]() |
8dfad241c3 | ||
![]() |
44f6d11537 | ||
![]() |
698951c059 | ||
![]() |
b3959299bc | ||
![]() |
1d4fc5051e | ||
![]() |
6ccdc2bd01 | ||
![]() |
28155b0e0a | ||
![]() |
47edb2c0bb | ||
![]() |
642bc1a739 | ||
![]() |
5b0eb702e5 | ||
![]() |
62870597d6 | ||
![]() |
01de155e3c | ||
![]() |
0485999636 | ||
![]() |
f638082ab4 | ||
![]() |
59a85a7dfd | ||
![]() |
204baa4586 | ||
![]() |
432e8d6535 | ||
![]() |
8c4fb6c753 | ||
![]() |
ac63788a9c | ||
![]() |
32538b5b03 | ||
![]() |
8aa51cf3e7 | ||
![]() |
e3ca003127 | ||
![]() |
19363965ad | ||
![]() |
32d553a28f | ||
![]() |
e84c5ec4c9 | ||
![]() |
aa5c1a5f78 | ||
![]() |
d9ebb0d492 | ||
![]() |
634d6602b9 | ||
![]() |
ea6f9c2d59 | ||
![]() |
dda2c25d52 | ||
![]() |
d13b58bec8 | ||
![]() |
b4164b6ab5 | ||
![]() |
aee18ca018 | ||
![]() |
cd976871f0 | ||
![]() |
4f9c4548bf | ||
![]() |
720408e143 | ||
![]() |
54f827d850 | ||
![]() |
7566b5620e | ||
![]() |
9cb7a4a3f5 | ||
![]() |
616d370a51 | ||
![]() |
83d7d6c48f | ||
![]() |
1c98621cf4 | ||
![]() |
727bf30824 | ||
![]() |
aa3c0023f4 | ||
![]() |
f08778d0c7 | ||
![]() |
37eb100bb2 | ||
![]() |
9bb0cef82b | ||
![]() |
4643bb1c00 | ||
![]() |
d132d26246 | ||
![]() |
24c9506935 | ||
![]() |
ca8ce8201c | ||
![]() |
777a781052 | ||
![]() |
d1e369e68d | ||
![]() |
3b861ab91f | ||
![]() |
721208e981 | ||
![]() |
ee455c1edb | ||
![]() |
43137fbdb2 | ||
![]() |
7ac84fb9af | ||
![]() |
efc4062721 | ||
![]() |
5693f63603 | ||
![]() |
8e6d16e601 | ||
![]() |
e96c8306d1 | ||
![]() |
756fc06c5d | ||
![]() |
80df10067d | ||
![]() |
e7c237dcf3 | ||
![]() |
75adb8ae90 | ||
![]() |
fc1962c795 | ||
![]() |
1a56a18f9b | ||
![]() |
1841346ff6 | ||
![]() |
e8799ad515 | ||
![]() |
2b9872d656 | ||
![]() |
9ffd4d2344 | ||
![]() |
815f4cab73 | ||
![]() |
bc573ef0bb | ||
![]() |
5d536b9973 | ||
![]() |
6807c48f9a | ||
![]() |
c777f9193d | ||
![]() |
917a54f3cd | ||
![]() |
471c842a58 | ||
![]() |
99f65813a1 | ||
![]() |
da7725f38e | ||
![]() |
7e610d13dc | ||
![]() |
64baf2d365 | ||
![]() |
f9c0f1d46f | ||
![]() |
3823ecafb1 | ||
![]() |
057c9e4b81 | ||
![]() |
e6db9e8fc3 | ||
![]() |
c4e4efd4b8 | ||
![]() |
da066553bd | ||
![]() |
a58d014a13 | ||
![]() |
006da82470 | ||
![]() |
1945a62990 | ||
![]() |
d16894daf4 | ||
![]() |
4d933f6b72 | ||
![]() |
e357bbee42 | ||
![]() |
7739302ee8 | ||
![]() |
46ab6f46f2 | ||
![]() |
48d267c6dc | ||
![]() |
15af3ea585 | ||
![]() |
35366f79ac | ||
![]() |
4c0980629c | ||
![]() |
8bd2c0f272 | ||
![]() |
2896865163 | ||
![]() |
a49cdabd6c | ||
![]() |
2dd6329872 | ||
![]() |
507a518a91 | ||
![]() |
4caf7d7c7b | ||
![]() |
89193d7360 | ||
![]() |
89eec225ce | ||
![]() |
cbc2df1ff6 | ||
![]() |
e4a2c74b1b | ||
![]() |
63160293c7 | ||
![]() |
9c0cb3f320 | ||
![]() |
fbeb016398 | ||
![]() |
093f1697e1 | ||
![]() |
f56e0bd530 | ||
![]() |
022e6670d0 | ||
![]() |
e3760d1709 | ||
![]() |
0475591fb6 | ||
![]() |
ba1c5dc6c7 | ||
![]() |
2f8c571a5c | ||
![]() |
a70b3a881d | ||
![]() |
950f560d81 | ||
![]() |
fd9680a050 | ||
![]() |
2d815e9626 | ||
![]() |
8c0550b2b7 | ||
![]() |
f054609e02 | ||
![]() |
45c0c5fee0 | ||
![]() |
a535fe1679 | ||
![]() |
e4d2118d4b | ||
![]() |
1184fce148 | ||
![]() |
a79f118323 | ||
![]() |
6cba2ea02d | ||
![]() |
3add711c55 | ||
![]() |
1481a8ccb1 | ||
![]() |
b3b7108d59 | ||
![]() |
fd9ad95346 | ||
![]() |
a1c50b8079 | ||
![]() |
4515c58d42 | ||
![]() |
0dc6e0a0d9 | ||
![]() |
8b37ceffe1 | ||
![]() |
b719fa9b18 | ||
![]() |
f3bebf25ea | ||
![]() |
7647ae317a | ||
![]() |
8c69ecd5ac | ||
![]() |
b725b69fda | ||
![]() |
b51b2c7b04 | ||
![]() |
dc98fe6a3b | ||
![]() |
b56c8a2a7a | ||
![]() |
d18dff65e1 | ||
![]() |
2dc71377dc | ||
![]() |
89b9868870 | ||
![]() |
b232f20169 | ||
![]() |
2dd906d809 | ||
![]() |
fb70091046 | ||
![]() |
434961b44a | ||
![]() |
75502d076e | ||
![]() |
4017bb3c49 | ||
![]() |
c1df62638d | ||
![]() |
ddd245de71 | ||
![]() |
853d9b7f98 | ||
![]() |
f3a9f81bfb | ||
![]() |
4b462d717c | ||
![]() |
fc80ba66d2 | ||
![]() |
fd013286f6 | ||
![]() |
b7d31adda4 | ||
![]() |
273a9e7ad6 | ||
![]() |
f75bd397f8 | ||
![]() |
f70d52510a | ||
![]() |
f0c24d9ec5 | ||
![]() |
708633f639 | ||
![]() |
2e174bb3b6 | ||
![]() |
160fe0f971 | ||
![]() |
58d4ba0d8f | ||
![]() |
155e729722 | ||
![]() |
a17463307b | ||
![]() |
4e4f2fcfc5 | ||
![]() |
759ab0c0f9 | ||
![]() |
1a7b8d3897 | ||
![]() |
f5e7abb71f | ||
![]() |
1412bb4e94 | ||
![]() |
328f3968d1 | ||
![]() |
c965e4c456 | ||
![]() |
86aa7ab91e | ||
![]() |
141d38b4e7 | ||
![]() |
98af37f09f | ||
![]() |
a57e392ed4 | ||
![]() |
993a19e15b | ||
![]() |
533830172c | ||
![]() |
7bea44e752 | ||
![]() |
f0a73696f5 | ||
![]() |
878c9f1d9d | ||
![]() |
8ebd550e0b | ||
![]() |
6b5221e465 | ||
![]() |
8f0cb695e7 | ||
![]() |
1913aad03f | ||
![]() |
b80da0daa1 | ||
![]() |
c2035c3709 | ||
![]() |
d77be9546d | ||
![]() |
e9d49e6b98 | ||
![]() |
6c2c28940b | ||
![]() |
72c94b6e6e | ||
![]() |
44d806e7f5 | ||
![]() |
727c56dbb1 | ||
![]() |
526e8fa1ad | ||
![]() |
969088187c | ||
![]() |
649e6820cc | ||
![]() |
8027a0c55d | ||
![]() |
d65d4fc39f | ||
![]() |
f7f6cc73f5 | ||
![]() |
55ebfadb32 | ||
![]() |
c5a5a22b72 | ||
![]() |
ad52d7d823 | ||
![]() |
b9576b4bbe | ||
![]() |
f57fed0eb4 | ||
![]() |
4e344df204 | ||
![]() |
43762c4d7f | ||
![]() |
4d1d1c36de | ||
![]() |
e603840395 | ||
![]() |
c7bcd74d56 | ||
![]() |
20298d243a | ||
![]() |
51c6462f1d | ||
![]() |
6f3077c856 | ||
![]() |
4a9d96aaba | ||
![]() |
4275aa613c | ||
![]() |
a65fb3b979 | ||
![]() |
c0dba713c5 | ||
![]() |
8810b378b3 | ||
![]() |
c3064f396c | ||
![]() |
82f5b4ca39 | ||
![]() |
73ce499863 | ||
![]() |
1ecf15669a | ||
![]() |
d24ddca03f | ||
![]() |
a7847038a5 | ||
![]() |
b6db75fe3e | ||
![]() |
2a838e645c | ||
![]() |
807e1f303d | ||
![]() |
65f5f9dc45 | ||
![]() |
b8b8c4740a | ||
![]() |
61bf7c577c | ||
![]() |
704506835f | ||
![]() |
f8f7d94d5a | ||
![]() |
114ab87816 | ||
![]() |
4a6056b558 | ||
![]() |
3a56af9633 | ||
![]() |
fda0c8d0a9 | ||
![]() |
b932cd0930 | ||
![]() |
2f06b41f5f | ||
![]() |
1ab3ed1a1a | ||
![]() |
1981f12976 | ||
![]() |
733967f65a | ||
![]() |
56d27d555b | ||
![]() |
7cee8cb6dc | ||
![]() |
c91fa192aa | ||
![]() |
3f93edaaf3 | ||
![]() |
0bed5d717b | ||
![]() |
1b56071eb3 | ||
![]() |
e050a5aaa1 | ||
![]() |
9b2f503dc7 | ||
![]() |
c7bdc6ad92 | ||
![]() |
a5db04b01c | ||
![]() |
06640aba06 | ||
![]() |
3bed70a0c5 | ||
![]() |
b079fb4710 | ||
![]() |
8b5cb75ef7 | ||
![]() |
a2855931d2 | ||
![]() |
50db9dcf8e | ||
![]() |
fa8a887ae1 | ||
![]() |
6e4e529af2 | ||
![]() |
275a54a562 | ||
![]() |
00a14ee811 | ||
![]() |
d688f1fe94 | ||
![]() |
8c2dbafdb5 | ||
![]() |
1bace23cea | ||
![]() |
f62c4831ad | ||
![]() |
7b4ce7c6ea | ||
![]() |
dda0d00fb9 | ||
![]() |
4bf5c9f3d8 | ||
![]() |
0409c5ac27 | ||
![]() |
19e5ccfdda | ||
![]() |
b13707fa7b | ||
![]() |
716a4d2cbc | ||
![]() |
3b2d55efec | ||
![]() |
870550bd7e | ||
![]() |
89f1ea49ba | ||
![]() |
7372d7d6c5 | ||
![]() |
0206ff540a | ||
![]() |
1e5d9ae1f4 | ||
![]() |
378e6b59e6 | ||
![]() |
8910ecb463 | ||
![]() |
ca97210d67 | ||
![]() |
f8abc9c6d5 | ||
![]() |
ef20e0b77a | ||
![]() |
f3b313ec1d | ||
![]() |
8f830a1698 | ||
![]() |
6a6b200a04 | ||
![]() |
15231924cd | ||
![]() |
7d4692f7b2 | ||
![]() |
285a7448ae | ||
![]() |
fd6ce89933 | ||
![]() |
c8e351c2bb | ||
![]() |
a59904cf16 | ||
![]() |
df36968ec8 | ||
![]() |
2ab1e15b86 | ||
![]() |
eca4163363 | ||
![]() |
1ac219282b | ||
![]() |
0df8c149f9 | ||
![]() |
bdf2667389 | ||
![]() |
b868777184 | ||
![]() |
fe2ef5e0c6 | ||
![]() |
ac21fe2d5c | ||
![]() |
6b251de227 | ||
![]() |
bb56492afe | ||
![]() |
2a9e846a49 | ||
![]() |
3b25cd3238 | ||
![]() |
4bc997cb8f | ||
![]() |
555d4f2cdc | ||
![]() |
75633ba125 | ||
![]() |
ec5fa31a11 | ||
![]() |
bfb8a75fca | ||
![]() |
067b6adc20 | ||
![]() |
a8162634cd | ||
![]() |
14c15b221a | ||
![]() |
8743e9e30e | ||
![]() |
22b18a4320 | ||
![]() |
786023ffa6 | ||
![]() |
6ded32880d | ||
![]() |
68cdc759a7 | ||
![]() |
eb04d80df0 | ||
![]() |
b6cac3a431 | ||
![]() |
3a71618a49 | ||
![]() |
dde8330888 | ||
![]() |
38b2cbc3d1 | ||
![]() |
2272af38b9 | ||
![]() |
40b5f868de | ||
![]() |
3e480612c7 | ||
![]() |
4c7306d808 | ||
![]() |
f66b524585 | ||
![]() |
5de5598069 | ||
![]() |
c9c4320f89 | ||
![]() |
543e4de0c8 | ||
![]() |
8174c7ca16 | ||
![]() |
014ab85420 | ||
![]() |
e51817b735 | ||
![]() |
c7d9103ede | ||
![]() |
92cd5ed133 | ||
![]() |
6fb17bb405 | ||
![]() |
638362baea | ||
![]() |
e22171c5bc | ||
![]() |
77207e0452 | ||
![]() |
4a721a2d25 | ||
![]() |
db8a14cdaf | ||
![]() |
1691d48b2e | ||
![]() |
8469e72709 | ||
![]() |
83f3ceb7f5 | ||
![]() |
4ea7294eeb | ||
![]() |
57fd3e586a | ||
![]() |
8363552c3a | ||
![]() |
8c64a90721 | ||
![]() |
6e3d96e16d | ||
![]() |
1684faf632 | ||
![]() |
e6b4e2c084 | ||
![]() |
03419c691c | ||
![]() |
6aa3ea43ae | ||
![]() |
735aceb37a | ||
![]() |
d2927435ab | ||
![]() |
eaa84d2d91 | ||
![]() |
941b959da3 | ||
![]() |
ae36586b58 | ||
![]() |
d22e8d92c6 | ||
![]() |
45adc5fb6b | ||
![]() |
c1aad5975c | ||
![]() |
0c18c0309b | ||
![]() |
631ff8fb9e | ||
![]() |
31629fe93f | ||
![]() |
735faa83e9 | ||
![]() |
2c062d648a | ||
![]() |
ea8128e881 | ||
![]() |
bd98f1477f | ||
![]() |
0f36bbf3e1 | ||
![]() |
3c4a6a19bb | ||
![]() |
e31924eadc | ||
![]() |
bb8bd111f8 | ||
![]() |
fec193ebaf | ||
![]() |
4ed6ec1a4d | ||
![]() |
ccaa99937f | ||
![]() |
17238c0326 | ||
![]() |
ac231949f0 | ||
![]() |
d543bc0411 | ||
![]() |
23ed533fac | ||
![]() |
86cfb1bb60 | ||
![]() |
b10d243995 | ||
![]() |
b22978dfb2 | ||
![]() |
276f042983 | ||
![]() |
71e4f1152b | ||
![]() |
0a923dfe91 | ||
![]() |
743c636441 | ||
![]() |
8c7043ffaf | ||
![]() |
f81f9f7c95 | ||
![]() |
ea7aaa5d56 | ||
![]() |
ec6ef35d21 | ||
![]() |
c815c84e1c | ||
![]() |
b8315cec6c | ||
![]() |
76fdc00b06 | ||
![]() |
83797eef38 | ||
![]() |
0db2657b7b | ||
![]() |
a1a252cc29 | ||
![]() |
533bd7da3c | ||
![]() |
037504785c | ||
![]() |
62f7fb082e | ||
![]() |
b89b90dbb9 | ||
![]() |
e9cc9f4005 | ||
![]() |
8df965bd60 | ||
![]() |
2b3019fb94 | ||
![]() |
31afd7499b | ||
![]() |
25da0c6c8e | ||
![]() |
aad147c219 | ||
![]() |
98bec36f81 | ||
![]() |
97614b8af5 | ||
![]() |
343e48302e | ||
![]() |
aef989fe03 | ||
![]() |
0c38f20281 | ||
![]() |
eed427b4ac | ||
![]() |
027296df68 | ||
![]() |
10e6c92766 | ||
![]() |
e1710fddd9 | ||
![]() |
bcfefefbd4 | ||
![]() |
ef4fbd8bb3 | ||
![]() |
17e317385a | ||
![]() |
102900749e | ||
![]() |
46f2aebabc | ||
![]() |
b9c2f62b47 | ||
![]() |
9d75665460 | ||
![]() |
6fcba87ee8 | ||
![]() |
a956be7bbf | ||
![]() |
e0286be8d2 | ||
![]() |
3e9978a58c | ||
![]() |
fd8fb96ec2 | ||
![]() |
ad6a43cf81 | ||
![]() |
f6d9868e35 | ||
![]() |
94d4ee3a2c | ||
![]() |
004432fae9 | ||
![]() |
08ac41113f | ||
![]() |
e9d2d084fd | ||
![]() |
34c98717d5 | ||
![]() |
f22ce38ada | ||
![]() |
8ba33a994c | ||
![]() |
07764348eb | ||
![]() |
803c8ca45b | ||
![]() |
f791cd2b24 | ||
![]() |
b69b3919bb | ||
![]() |
886d1c15c4 | ||
![]() |
72e8b7fb38 | ||
![]() |
3a89cc7993 | ||
![]() |
bb3a48c91a | ||
![]() |
d45eda1c60 | ||
![]() |
4d12fb0464 | ||
![]() |
08e7bbcc13 | ||
![]() |
f83f09d8b0 | ||
![]() |
c4eb1608b0 | ||
![]() |
74df4a7a68 | ||
![]() |
38a84a7fe0 | ||
![]() |
5e864c3b9b | ||
![]() |
b5a4cc0e17 | ||
![]() |
82f7e1b754 | ||
![]() |
580903051f | ||
![]() |
ce037a84ca | ||
![]() |
7f254e37e9 | ||
![]() |
d562a81019 | ||
![]() |
6a045db83c | ||
![]() |
563896400b | ||
![]() |
73ee9e9a92 | ||
![]() |
923ddc8309 | ||
![]() |
64096b22dc | ||
![]() |
84d563584f | ||
![]() |
ac67794fb2 | ||
![]() |
98b2148352 | ||
![]() |
b3e509b7d4 | ||
![]() |
8d6d90021a | ||
![]() |
71e5a53172 | ||
![]() |
a75cacd4a4 | ||
![]() |
c2ec63d4fd | ||
![]() |
7ecaaaf46f | ||
![]() |
4900647bf0 | ||
![]() |
df10d64989 | ||
![]() |
b9bed14cda | ||
![]() |
cd007cabb5 | ||
![]() |
cb1a20264d | ||
![]() |
7179f1bcba | ||
![]() |
b35e4a8c52 | ||
![]() |
a89cb9f0d6 | ||
![]() |
8b4426aebf | ||
![]() |
003997372e | ||
![]() |
61f33567ae | ||
![]() |
9fb6f1998f | ||
![]() |
19e3624e89 | ||
![]() |
be332cfdef | ||
![]() |
c51f6df82c | ||
![]() |
dc0a46f742 | ||
![]() |
c76728b423 | ||
![]() |
0aa7da261f | ||
![]() |
5e6aac4377 | ||
![]() |
52bd5181f9 | ||
![]() |
49ce5222c9 | ||
![]() |
df1e9c4117 | ||
![]() |
5c14df0aeb | ||
![]() |
8af5c4c341 | ||
![]() |
f7756ccc00 | ||
![]() |
3066a4b43a | ||
![]() |
26e9b1790b | ||
![]() |
c256a6b887 | ||
![]() |
bd1449a0d3 | ||
![]() |
c9833dcd79 | ||
![]() |
6792bb94b7 | ||
![]() |
b36e5d0d3b | ||
![]() |
ead4037963 | ||
![]() |
a28f6bf80c | ||
![]() |
fb6ba231d0 | ||
![]() |
e4491136c3 | ||
![]() |
e7451e7a4e | ||
![]() |
816f2f512e | ||
![]() |
76c3716b2d | ||
![]() |
2f1a521db6 | ||
![]() |
8f4caa4537 | ||
![]() |
b26cdb3e46 | ||
![]() |
de8928b2d9 | ||
![]() |
e5b33087f3 | ||
![]() |
bc56a7d4f1 | ||
![]() |
80903e427c | ||
![]() |
7b67f5783e | ||
![]() |
e8db9b2bd5 | ||
![]() |
023f2354cd | ||
![]() |
5925d8b731 | ||
![]() |
96d5bc7695 | ||
![]() |
7ef71cc04d | ||
![]() |
3cd15cdcf2 | ||
![]() |
e865368649 | ||
![]() |
be818ad57f | ||
![]() |
ca22e85e55 | ||
![]() |
652a42fe1a | ||
![]() |
3aeef7b846 | ||
![]() |
250f1f9687 | ||
![]() |
5b9839cbd0 | ||
![]() |
afe3f593e1 | ||
![]() |
e573be4afd | ||
![]() |
549483d19b | ||
![]() |
8a485c3c88 | ||
![]() |
96dedc7b5e | ||
![]() |
9629c8d8d6 | ||
![]() |
7e8c1b0393 | ||
![]() |
e4bdfee85a | ||
![]() |
c0f9b3c00b | ||
![]() |
fba3f8481e | ||
![]() |
ae7c9475ef | ||
![]() |
d320e788c7 | ||
![]() |
ded83b2ce7 | ||
![]() |
1c8c69f8db | ||
![]() |
4d3f151cf0 | ||
![]() |
8f8ae64ced | ||
![]() |
b93ce24c3d | ||
![]() |
05d1fc44e8 | ||
![]() |
ee056e1ac3 | ||
![]() |
0476bdc68f | ||
![]() |
242a508d50 | ||
![]() |
7b5bebd9c4 | ||
![]() |
68609fd8d0 | ||
![]() |
117f0ab6da | ||
![]() |
64a935515c | ||
![]() |
e6befbaa3f | ||
![]() |
e659601e03 | ||
![]() |
1495ae623a | ||
![]() |
cdba2b4ac8 | ||
![]() |
521a30dcd7 | ||
![]() |
61ef4692b0 | ||
![]() |
6ab7eb55cb | ||
![]() |
fefcc43dd4 | ||
![]() |
2141057ab4 | ||
![]() |
ae7fd777a7 | ||
![]() |
d666981599 | ||
![]() |
f0b8657423 | ||
![]() |
ae25a08fe3 | ||
![]() |
2b7aa3f99d | ||
![]() |
e7b4f7f6ca | ||
![]() |
15cfa5d40d | ||
![]() |
a497909446 | ||
![]() |
75fa259472 | ||
![]() |
6807f19ec2 | ||
![]() |
3c49fb2c84 | ||
![]() |
b15eacf6f2 | ||
![]() |
3eb2bb9c0b | ||
![]() |
ee0f872b5b | ||
![]() |
14ff8a8570 | ||
![]() |
0d5246fbc7 | ||
![]() |
bf53a03c9d | ||
![]() |
3b32f44a60 | ||
![]() |
a8cd5e675d | ||
![]() |
bc269a966d | ||
![]() |
d39606cb47 | ||
![]() |
b04517b146 | ||
![]() |
024ee4213f | ||
![]() |
e861fbb517 | ||
![]() |
2e028ce36d | ||
![]() |
bd5b5cda06 | ||
![]() |
fee63d83ee | ||
![]() |
0333bc172c | ||
![]() |
71d2175e19 | ||
![]() |
bd8f620480 | ||
![]() |
3fbc26dfc9 | ||
![]() |
a867400d56 | ||
![]() |
acebcbffc8 | ||
![]() |
449cbdfd02 | ||
![]() |
3bdcfd9160 | ||
![]() |
9c0b81cee0 | ||
![]() |
6b8f60efcf | ||
![]() |
950832e56b | ||
![]() |
535a1fc8cf | ||
![]() |
548ae5b023 | ||
![]() |
16d1610d75 | ||
![]() |
e02240450a | ||
![]() |
5eee76764d | ||
![]() |
dabda9d4ef | ||
![]() |
135893f067 | ||
![]() |
95120c3f21 | ||
![]() |
47b695c3c5 | ||
![]() |
7306b5ac45 | ||
![]() |
0854bab124 | ||
![]() |
fa51121f29 | ||
![]() |
0b4c6f6477 | ||
![]() |
e5768454f1 | ||
![]() |
89b5eb56f2 | ||
![]() |
616c969a03 | ||
![]() |
4fd826ac8c | ||
![]() |
6d5a6ad0c8 | ||
![]() |
e0cd76e6fd | ||
![]() |
f03364f328 | ||
![]() |
25bc381361 | ||
![]() |
38e5c3a81e | ||
![]() |
43aa831dd2 | ||
![]() |
4492c5ed4e | ||
![]() |
5dec9eb2f5 | ||
![]() |
02903be558 | ||
![]() |
f36cf5b321 | ||
![]() |
82ac667535 |
@@ -3,4 +3,6 @@ dist/**
|
|||||||
docs/Setup.md
|
docs/Setup.md
|
||||||
cypress.config.js
|
cypress.config.js
|
||||||
cypress/plugins/index.js
|
cypress/plugins/index.js
|
||||||
coverage
|
coverage
|
||||||
|
*.json
|
||||||
|
node_modules
|
||||||
|
150
.eslintrc.cjs
Normal file
150
.eslintrc.cjs
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es6: true,
|
||||||
|
'jest/globals': true,
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
ecmaFeatures: {
|
||||||
|
experimentalObjectRestSpread: true,
|
||||||
|
jsx: true,
|
||||||
|
},
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
sourceType: 'module',
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
allowAutomaticSingleRunInference: true,
|
||||||
|
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
},
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:json/recommended',
|
||||||
|
'plugin:markdown/recommended',
|
||||||
|
'plugin:@cspell/recommended',
|
||||||
|
'prettier',
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
'@typescript-eslint',
|
||||||
|
'no-only-tests',
|
||||||
|
'html',
|
||||||
|
'jest',
|
||||||
|
'jsdoc',
|
||||||
|
'json',
|
||||||
|
'@cspell',
|
||||||
|
'lodash',
|
||||||
|
'unicorn',
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
curly: 'error',
|
||||||
|
'no-console': 'error',
|
||||||
|
'no-prototype-builtins': 'off',
|
||||||
|
'no-unused-vars': 'off',
|
||||||
|
'cypress/no-async-tests': 'off',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
|
'@typescript-eslint/no-misused-promises': 'error',
|
||||||
|
'@typescript-eslint/ban-ts-comment': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'ts-expect-error': 'allow-with-description',
|
||||||
|
'ts-ignore': 'allow-with-description',
|
||||||
|
'ts-nocheck': 'allow-with-description',
|
||||||
|
'ts-check': 'allow-with-description',
|
||||||
|
minimumDescriptionLength: 10,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'json/*': ['error', 'allowComments'],
|
||||||
|
'@cspell/spellchecker': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
checkIdentifiers: false,
|
||||||
|
checkStrings: false,
|
||||||
|
checkStringTemplates: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-empty': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowEmptyCatch: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-only-tests/no-only-tests': 'error',
|
||||||
|
'lodash/import-scope': ['error', 'method'],
|
||||||
|
'unicorn/better-regex': 'error',
|
||||||
|
'unicorn/no-abusive-eslint-disable': 'error',
|
||||||
|
'unicorn/no-array-push-push': 'error',
|
||||||
|
'unicorn/no-for-loop': 'error',
|
||||||
|
'unicorn/no-instanceof-array': 'error',
|
||||||
|
'unicorn/no-typeof-undefined': 'error',
|
||||||
|
'unicorn/no-unnecessary-await': 'error',
|
||||||
|
'unicorn/no-unsafe-regex': 'warn',
|
||||||
|
'unicorn/no-useless-promise-resolve-reject': 'error',
|
||||||
|
'unicorn/prefer-array-find': 'error',
|
||||||
|
'unicorn/prefer-array-flat-map': 'error',
|
||||||
|
'unicorn/prefer-array-index-of': 'error',
|
||||||
|
'unicorn/prefer-array-some': 'error',
|
||||||
|
'unicorn/prefer-default-parameters': 'error',
|
||||||
|
'unicorn/prefer-includes': 'error',
|
||||||
|
'unicorn/prefer-negative-index': 'error',
|
||||||
|
'unicorn/prefer-object-from-entries': 'error',
|
||||||
|
'unicorn/prefer-string-starts-ends-with': 'error',
|
||||||
|
'unicorn/prefer-string-trim-start-end': 'error',
|
||||||
|
'unicorn/string-content': 'error',
|
||||||
|
'unicorn/prefer-spread': 'error',
|
||||||
|
'unicorn/no-lonely-if': 'error',
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['cypress/**', 'demos/**'],
|
||||||
|
rules: {
|
||||||
|
'no-console': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.{js,jsx,mjs,cjs}'],
|
||||||
|
extends: ['plugin:jsdoc/recommended'],
|
||||||
|
rules: {
|
||||||
|
'jsdoc/check-indentation': 'off',
|
||||||
|
'jsdoc/check-alignment': 'off',
|
||||||
|
'jsdoc/check-line-alignment': 'off',
|
||||||
|
'jsdoc/multiline-blocks': 'off',
|
||||||
|
'jsdoc/newline-after-description': 'off',
|
||||||
|
'jsdoc/tag-lines': 'off',
|
||||||
|
'jsdoc/require-param-description': 'off',
|
||||||
|
'jsdoc/require-param-type': 'off',
|
||||||
|
'jsdoc/require-returns': 'off',
|
||||||
|
'jsdoc/require-returns-description': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.{ts,tsx}'],
|
||||||
|
plugins: ['tsdoc'],
|
||||||
|
rules: {
|
||||||
|
'tsdoc/syntax': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.spec.{ts,js}', 'cypress/**', 'demos/**', '**/docs/**'],
|
||||||
|
rules: {
|
||||||
|
'jsdoc/require-jsdoc': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.html', '*.md', '**/*.md/*'],
|
||||||
|
rules: {
|
||||||
|
'no-var': 'error',
|
||||||
|
'no-undef': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'off',
|
||||||
|
'@typescript-eslint/no-misused-promises': 'off',
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
project: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
138
.eslintrc.json
138
.eslintrc.json
@@ -1,138 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"es6": true,
|
|
||||||
"jest/globals": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"experimentalObjectRestSpread": true,
|
|
||||||
"jsx": true
|
|
||||||
},
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"plugin:json/recommended",
|
|
||||||
"plugin:markdown/recommended",
|
|
||||||
"plugin:@cspell/recommended",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"@typescript-eslint",
|
|
||||||
"no-only-tests",
|
|
||||||
"html",
|
|
||||||
"jest",
|
|
||||||
"jsdoc",
|
|
||||||
"json",
|
|
||||||
"@cspell",
|
|
||||||
"lodash",
|
|
||||||
"unicorn"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"curly": "error",
|
|
||||||
"no-console": "error",
|
|
||||||
"no-prototype-builtins": "off",
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"cypress/no-async-tests": "off",
|
|
||||||
"@typescript-eslint/ban-ts-comment": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"ts-expect-error": "allow-with-description",
|
|
||||||
"ts-ignore": "allow-with-description",
|
|
||||||
"ts-nocheck": "allow-with-description",
|
|
||||||
"ts-check": "allow-with-description",
|
|
||||||
"minimumDescriptionLength": 10
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"json/*": ["error", "allowComments"],
|
|
||||||
"@cspell/spellchecker": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"checkIdentifiers": false,
|
|
||||||
"checkStrings": false,
|
|
||||||
"checkStringTemplates": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-empty": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"allowEmptyCatch": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-only-tests/no-only-tests": "error",
|
|
||||||
"lodash/import-scope": ["error", "method"],
|
|
||||||
"unicorn/better-regex": "error",
|
|
||||||
"unicorn/no-abusive-eslint-disable": "error",
|
|
||||||
"unicorn/no-array-push-push": "error",
|
|
||||||
"unicorn/no-for-loop": "error",
|
|
||||||
"unicorn/no-null": "error",
|
|
||||||
"unicorn/no-instanceof-array": "error",
|
|
||||||
"unicorn/no-typeof-undefined": "error",
|
|
||||||
"unicorn/no-unnecessary-await": "error",
|
|
||||||
"unicorn/no-unsafe-regex": "warn",
|
|
||||||
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
||||||
"unicorn/prefer-array-find": "error",
|
|
||||||
"unicorn/prefer-array-flat-map": "error",
|
|
||||||
"unicorn/prefer-array-index-of": "error",
|
|
||||||
"unicorn/prefer-array-some": "error",
|
|
||||||
"unicorn/prefer-default-parameters": "error",
|
|
||||||
"unicorn/prefer-includes": "error",
|
|
||||||
"unicorn/prefer-negative-index": "error",
|
|
||||||
"unicorn/prefer-object-from-entries": "error",
|
|
||||||
"unicorn/prefer-string-starts-ends-with": "error",
|
|
||||||
"unicorn/prefer-string-trim-start-end": "error",
|
|
||||||
"unicorn/string-content": "error",
|
|
||||||
"unicorn/prefer-spread": "error",
|
|
||||||
"unicorn/no-lonely-if": "error"
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["cypress/**", "demos/**"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.{js,jsx,mjs,cjs}"],
|
|
||||||
"extends": ["plugin:jsdoc/recommended"],
|
|
||||||
"rules": {
|
|
||||||
"jsdoc/check-indentation": "off",
|
|
||||||
"jsdoc/check-alignment": "off",
|
|
||||||
"jsdoc/check-line-alignment": "off",
|
|
||||||
"jsdoc/multiline-blocks": "off",
|
|
||||||
"jsdoc/newline-after-description": "off",
|
|
||||||
"jsdoc/tag-lines": "off",
|
|
||||||
"jsdoc/require-param-description": "off",
|
|
||||||
"jsdoc/require-param-type": "off",
|
|
||||||
"jsdoc/require-returns": "off",
|
|
||||||
"jsdoc/require-returns-description": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.{ts,tsx}"],
|
|
||||||
"plugins": ["tsdoc"],
|
|
||||||
"rules": {
|
|
||||||
"tsdoc/syntax": "error"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.spec.{ts,js}", "cypress/**", "demos/**", "**/docs/**"],
|
|
||||||
"rules": {
|
|
||||||
"jsdoc/require-jsdoc": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.html", "*.md", "**/*.md/*"],
|
|
||||||
"rules": {
|
|
||||||
"no-var": "error",
|
|
||||||
"no-undef": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1,6 +1,8 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [knsv]
|
github:
|
||||||
|
- knsv
|
||||||
|
- sidharthv96
|
||||||
#patreon: # Replace with a single Patreon username
|
#patreon: # Replace with a single Patreon username
|
||||||
#open_collective: # Replace with a single Open Collective username
|
#open_collective: # Replace with a single Open Collective username
|
||||||
#ko_fi: # Replace with a single Ko-fi username
|
#ko_fi: # Replace with a single Ko-fi username
|
||||||
|
14
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
14
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -50,19 +50,11 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Setup
|
label: Setup
|
||||||
description: |-
|
description: |-
|
||||||
Please fill out the below info.
|
Please fill out the info below.
|
||||||
Note that you only need to fill out one and not both sections.
|
Note that you only need to fill out the relevant section
|
||||||
value: |-
|
value: |-
|
||||||
**Desktop**
|
- Mermaid version:
|
||||||
|
|
||||||
- OS and Version: [Windows, Linux, Mac, ...]
|
|
||||||
- Browser and Version: [Chrome, Edge, Firefox]
|
- Browser and Version: [Chrome, Edge, Firefox]
|
||||||
|
|
||||||
**Smartphone**
|
|
||||||
|
|
||||||
- Device: [Samsung, iPhone, ...]
|
|
||||||
- OS and Version: [Android, iOS, ...]
|
|
||||||
- Browser and Version: [Chrome, Safari, ...]
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Additional Context
|
label: Additional Context
|
||||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: true
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: GitHub Discussions
|
- name: GitHub Discussions
|
||||||
url: https://github.com/mermaid-js/mermaid/discussions
|
url: https://github.com/mermaid-js/mermaid/discussions
|
||||||
|
26
.github/ISSUE_TEMPLATE/diagram_proposal.yml
vendored
26
.github/ISSUE_TEMPLATE/diagram_proposal.yml
vendored
@@ -3,6 +3,7 @@ description: Suggest a new Diagram Type to add to Mermaid.
|
|||||||
labels:
|
labels:
|
||||||
- 'Status: Triage'
|
- 'Status: Triage'
|
||||||
- 'Type: Enhancement'
|
- 'Type: Enhancement'
|
||||||
|
- 'Type: New Diagram'
|
||||||
|
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
@@ -17,6 +18,14 @@ body:
|
|||||||
- Use a clear and concise title
|
- Use a clear and concise title
|
||||||
- Fill out the text fields with as much detail as possible.
|
- Fill out the text fields with as much detail as possible.
|
||||||
- Never be shy to give us screenshots and/or code samples. It will help!
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
|
||||||
|
## Example issues
|
||||||
|
|
||||||
|
Refer to the discussions here to get an idea of how the diagram syntax is created.
|
||||||
|
|
||||||
|
- https://github.com/mermaid-js/mermaid/issues/4269
|
||||||
|
- https://github.com/mermaid-js/mermaid/issues/4282
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Proposal
|
label: Proposal
|
||||||
@@ -35,8 +44,17 @@ body:
|
|||||||
description: If applicable, add screenshots to show possible examples of how the diagram may look like.
|
description: If applicable, add screenshots to show possible examples of how the diagram may look like.
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Code Sample
|
label: Syntax
|
||||||
description: |-
|
description: |-
|
||||||
If applicable, add a code sample for how to implement this new diagram.
|
If possible, include a syntax which could be used to write the diagram.
|
||||||
The text will automatically be rendered as JavaScript code.
|
Try to add one or two examples of valid use-cases here.
|
||||||
render: javascript
|
- type: dropdown
|
||||||
|
id: implementation
|
||||||
|
attributes:
|
||||||
|
label: Implementation
|
||||||
|
description: |-
|
||||||
|
Would you like to implement this yourself, or is it a proposal for the community?
|
||||||
|
If there is no corresponding PR from your side after 30 days, the diagram will be open for everyone to implement.
|
||||||
|
options:
|
||||||
|
- I will try and implement it myself.
|
||||||
|
- This is a proposal which I'd love to see built into mermaid by the wonderful community.
|
||||||
|
29
.github/workflows/build-docs.yml
vendored
Normal file
29
.github/workflows/build-docs.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Build Vitepress docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Build job
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: pnpm
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run Build
|
||||||
|
run: pnpm --filter mermaid run docs:build:vitepress
|
2
.github/workflows/dependency-review.yml
vendored
2
.github/workflows/dependency-review.yml
vendored
@@ -17,4 +17,4 @@ jobs:
|
|||||||
- name: 'Checkout Repository'
|
- name: 'Checkout Repository'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@v2
|
uses: actions/dependency-review-action@v3
|
||||||
|
20
.github/workflows/e2e-applitools.yml
vendored
20
.github/workflows/e2e-applitools.yml
vendored
@@ -38,15 +38,8 @@ jobs:
|
|||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: pnpm
|
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
env:
|
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
|
||||||
|
|
||||||
- if: ${{ env.USE_APPLI }}
|
- if: ${{ env.USE_APPLI }}
|
||||||
name: Notify applitools of new batch
|
name: Notify applitools of new batch
|
||||||
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
|
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
|
||||||
@@ -54,19 +47,22 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
# e.g. mermaid-js/mermaid/my-branch
|
# e.g. mermaid-js/mermaid/my-branch
|
||||||
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
|
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
|
||||||
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
|
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
|
||||||
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
|
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
|
||||||
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
||||||
|
|
||||||
- name: Run E2E Tests
|
- name: Cypress run
|
||||||
run: pnpm run e2e
|
uses: cypress-io/github-action@v4
|
||||||
|
id: cypress
|
||||||
|
with:
|
||||||
|
start: pnpm run dev
|
||||||
|
wait-on: 'http://localhost:9000'
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
|
||||||
# Mermaid applitools.config.js uses this to pick batch name.
|
# Mermaid applitools.config.js uses this to pick batch name.
|
||||||
APPLI_BRANCH: ${{ github.ref_name }}
|
APPLI_BRANCH: ${{ github.ref_name }}
|
||||||
APPLITOOLS_BATCH_ID: ${{ github.sha }}
|
APPLITOOLS_BATCH_ID: ${{ github.sha }}
|
||||||
# e.g. mermaid-js/mermaid/my-branch
|
# e.g. mermaid-js/mermaid/my-branch
|
||||||
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
|
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
|
||||||
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
|
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
|
||||||
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
|
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
|
||||||
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
||||||
|
12
.github/workflows/e2e.yml
vendored
12
.github/workflows/e2e.yml
vendored
@@ -21,17 +21,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
# Need to skip setup if Cypress run is skipped, otherwise an error
|
|
||||||
# is thrown since the pnpm cache step fails
|
|
||||||
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
|
||||||
with:
|
with:
|
||||||
cache: pnpm
|
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
# Install NPM dependencies, cache them correctly
|
# Install NPM dependencies, cache them correctly
|
||||||
# and run all Cypress tests
|
# and run all Cypress tests
|
||||||
- name: Cypress run
|
- name: Cypress run
|
||||||
uses: cypress-io/github-action@v4
|
uses: cypress-io/github-action@v4
|
||||||
|
id: cypress
|
||||||
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
|
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
|
||||||
# Otherwise (e.g. if running from fork), we run on a single container only
|
# Otherwise (e.g. if running from fork), we run on a single container only
|
||||||
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
||||||
@@ -44,3 +41,10 @@ jobs:
|
|||||||
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
|
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
|
||||||
env:
|
env:
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
|
||||||
|
with:
|
||||||
|
name: error-snapshots
|
||||||
|
path: cypress/snapshots/**/__diff_output__/*
|
||||||
|
12
.github/workflows/link-checker.yml
vendored
12
.github/workflows/link-checker.yml
vendored
@@ -14,6 +14,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
# * is a special character in YAML so you have to quote this string
|
# * is a special character in YAML so you have to quote this string
|
||||||
- cron: '30 8 * * *'
|
- cron: '30 8 * * *'
|
||||||
@@ -35,9 +36,16 @@ jobs:
|
|||||||
restore-keys: cache-lychee-
|
restore-keys: cache-lychee-
|
||||||
|
|
||||||
- name: Link Checker
|
- name: Link Checker
|
||||||
uses: lycheeverse/lychee-action@v1.5.4
|
uses: lycheeverse/lychee-action@v1.8.0
|
||||||
with:
|
with:
|
||||||
args: --verbose --no-progress --cache --max-cache-age 1d packages/mermaid/src/docs/**/*.md README.md README.zh-CN.md
|
args: >-
|
||||||
|
--verbose
|
||||||
|
--no-progress
|
||||||
|
--cache
|
||||||
|
--max-cache-age 1d
|
||||||
|
packages/mermaid/src/docs/**/*.md
|
||||||
|
README.md
|
||||||
|
README.zh-CN.md
|
||||||
fail: true
|
fail: true
|
||||||
jobSummary: true
|
jobSummary: true
|
||||||
env:
|
env:
|
||||||
|
15
.github/workflows/lint.yml
vendored
15
.github/workflows/lint.yml
vendored
@@ -37,7 +37,20 @@ jobs:
|
|||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Linting
|
- name: Run Linting
|
||||||
run: pnpm run lint
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! pnpm run lint; then
|
||||||
|
# print a nice error message on lint failure
|
||||||
|
ERROR_MESSAGE='Running `pnpm run lint` failed.'
|
||||||
|
ERROR_MESSAGE+=' Running `pnpm -w run lint:fix` may fix this issue. '
|
||||||
|
ERROR_MESSAGE+=" If this error doesn't occur on your local machine,"
|
||||||
|
ERROR_MESSAGE+=' make sure your packages are up-to-date by running `pnpm install`.'
|
||||||
|
ERROR_MESSAGE+=' You may also need to delete your prettier cache by running'
|
||||||
|
ERROR_MESSAGE+=' `rm ./node_modules/.cache/prettier/.prettier-cache`.'
|
||||||
|
echo "::error title=Lint failure::${ERROR_MESSAGE}"
|
||||||
|
# make sure to return an error exitcode so that GitHub actions shows a red-cross
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Verify Docs
|
- name: Verify Docs
|
||||||
id: verifyDocs
|
id: verifyDocs
|
||||||
|
2
.github/workflows/pr-labeler.yml
vendored
2
.github/workflows/pr-labeler.yml
vendored
@@ -8,6 +8,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Label PR
|
- name: Label PR
|
||||||
uses: TimonVS/pr-labeler-action@v3
|
uses: TimonVS/pr-labeler-action@v4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
7
.github/workflows/publish-docs.yml
vendored
7
.github/workflows/publish-docs.yml
vendored
@@ -6,9 +6,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -40,7 +37,7 @@ jobs:
|
|||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v2
|
uses: actions/configure-pages@v3
|
||||||
|
|
||||||
- name: Run Build
|
- name: Run Build
|
||||||
run: pnpm --filter mermaid run docs:build:vitepress
|
run: pnpm --filter mermaid run docs:build:vitepress
|
||||||
@@ -59,4 +56,4 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v1
|
uses: actions/deploy-pages@v2
|
||||||
|
21
.github/workflows/release-publish.yml
vendored
21
.github/workflows/release-publish.yml
vendored
@@ -9,20 +9,23 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: fregante/setup-git-user@v1
|
- uses: fregante/setup-git-user@v2
|
||||||
|
|
||||||
- name: Setup Node.js
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
|
- name: Setup Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
|
cache: pnpm
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Json
|
|
||||||
run: npm i json --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: yarn install --frozen-lockfile
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
npm i json --global
|
||||||
|
env:
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Prepare release
|
- name: Prepare release
|
||||||
run: |
|
run: |
|
||||||
@@ -31,7 +34,7 @@ jobs:
|
|||||||
git checkout -t origin/release/$VERSION
|
git checkout -t origin/release/$VERSION
|
||||||
npm version --no-git-tag-version --allow-same-version $VERSION
|
npm version --no-git-tag-version --allow-same-version $VERSION
|
||||||
git add package.json
|
git add package.json
|
||||||
git commit -m "Bump version $VERSION"
|
git commit -nm "Bump version $VERSION"
|
||||||
git checkout -t origin/master
|
git checkout -t origin/master
|
||||||
git merge -m "Release $VERSION" --no-ff release/$VERSION
|
git merge -m "Release $VERSION" --no-ff release/$VERSION
|
||||||
git push --no-verify
|
git push --no-verify
|
||||||
|
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@@ -33,11 +33,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pnpm run ci --coverage
|
pnpm run ci --coverage
|
||||||
|
|
||||||
- name: Upload Coverage to Coveralls
|
- name: Run ganttDb tests using California timezone
|
||||||
# it feels a bit weird to use @master, but that's what the docs use
|
env:
|
||||||
# (coveralls also doesn't publish a @v1 we can use)
|
# Makes sure that gantt db works even in a timezone that has daylight savings
|
||||||
# https://github.com/marketplace/actions/coveralls-github-action
|
# since some days have 25 hours instead of 24.
|
||||||
uses: coverallsapp/github-action@master
|
TZ: America/Los_Angeles
|
||||||
with:
|
run: |
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
pnpm exec vitest run ./packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts
|
||||||
flag-name: unit
|
|
||||||
|
# Coveralls is throwing 500. Disabled for now.
|
||||||
|
# - name: Upload Coverage to Coveralls
|
||||||
|
# uses: coverallsapp/github-action@v2
|
||||||
|
# with:
|
||||||
|
# github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# flag-name: unit
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@@ -3,8 +3,10 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
coverage/
|
coverage/
|
||||||
.idea/
|
.idea/
|
||||||
|
.pnpm-store/
|
||||||
|
|
||||||
dist
|
dist
|
||||||
|
v8-compile-cache-0
|
||||||
|
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
.npmrc
|
.npmrc
|
||||||
@@ -36,3 +38,7 @@ tsconfig.tsbuildinfo
|
|||||||
knsv*.html
|
knsv*.html
|
||||||
local*.html
|
local*.html
|
||||||
stats/
|
stats/
|
||||||
|
|
||||||
|
**/user-avatars/*
|
||||||
|
**/contributor-names.json
|
||||||
|
.pnpm-store
|
||||||
|
@@ -1,5 +1,11 @@
|
|||||||
export default {
|
export default {
|
||||||
'!(docs/**/*)*.{ts,js,json,html,md,mts}': ['eslint --fix', 'prettier --write'],
|
'!(docs/**/*)*.{ts,js,html,md,mts}': [
|
||||||
|
'eslint --cache --cache-strategy content --fix',
|
||||||
|
// don't cache prettier yet, since we use `prettier-plugin-jsdoc`,
|
||||||
|
// and prettier doesn't invalidate cache on plugin updates"
|
||||||
|
// https://prettier.io/docs/en/cli.html#--cache
|
||||||
|
'prettier --write',
|
||||||
|
],
|
||||||
'cSpell.json': ['ts-node-esm scripts/fixCSpell.ts'],
|
'cSpell.json': ['ts-node-esm scripts/fixCSpell.ts'],
|
||||||
'**/*.jison': ['pnpm -w run lint:jison'],
|
'**/*.jison': ['pnpm -w run lint:jison'],
|
||||||
};
|
};
|
||||||
|
@@ -4,13 +4,14 @@
|
|||||||
# Network error: Forbidden
|
# Network error: Forbidden
|
||||||
https://codepen.io
|
https://codepen.io
|
||||||
|
|
||||||
# Network error: The certificate was not trusted
|
# Timeout error, maybe Twitter has anti-bot defenses against GitHub's CI servers?
|
||||||
https://mkdocs.org/
|
|
||||||
https://osawards.com/javascript/#nominees
|
|
||||||
https://osawards.com/javascript/2019
|
|
||||||
|
|
||||||
# Timeout error, maybe Twitter has anti-bot defences against GitHub's CI servers?
|
|
||||||
https://twitter.com/mermaidjs_
|
https://twitter.com/mermaidjs_
|
||||||
|
|
||||||
# Don't check files that are generated during the build via `pnpm docs:code`
|
# Don't check files that are generated during the build via `pnpm docs:code`
|
||||||
packages/mermaid/src/docs/config/setup/*
|
packages/mermaid/src/docs/config/setup/*
|
||||||
|
|
||||||
|
# Ignore localhost
|
||||||
|
http://localhost:3333/
|
||||||
|
|
||||||
|
# Ignore slack invite
|
||||||
|
https://join.slack.com/
|
||||||
|
1
.npmrc
1
.npmrc
@@ -1,3 +1,2 @@
|
|||||||
auto-install-peers=true
|
auto-install-peers=true
|
||||||
strict-peer-dependencies=false
|
strict-peer-dependencies=false
|
||||||
use-inline-specifiers-lockfile-format=true
|
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
version: 2
|
|
||||||
snapshot:
|
|
||||||
widths:
|
|
||||||
- 1280
|
|
||||||
discovery:
|
|
||||||
disable-cache: true
|
|
@@ -4,4 +4,5 @@ cypress/platform/xss3.html
|
|||||||
coverage
|
coverage
|
||||||
# Autogenerated by PNPM
|
# Autogenerated by PNPM
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
stats
|
stats
|
||||||
|
packages/mermaid/src/docs/.vitepress/components.d.ts
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"ecmaVersion": 6,
|
|
||||||
"libs": ["browser"],
|
|
||||||
"loadEagerly": [],
|
|
||||||
"dontLoad": ["node_modules/**"],
|
|
||||||
"plugins": {
|
|
||||||
"modules": {},
|
|
||||||
"es_modules": {},
|
|
||||||
"node": {},
|
|
||||||
"doc_comment": {
|
|
||||||
"fullDocs": true,
|
|
||||||
"strong": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -3,6 +3,7 @@ import { resolve } from 'path';
|
|||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import jisonPlugin from './jisonPlugin.js';
|
import jisonPlugin from './jisonPlugin.js';
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
|
import typescript from '@rollup/plugin-typescript';
|
||||||
import { visualizer } from 'rollup-plugin-visualizer';
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||||||
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';
|
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ const visualize = process.argv.includes('--visualize');
|
|||||||
const watch = process.argv.includes('--watch');
|
const watch = process.argv.includes('--watch');
|
||||||
const mermaidOnly = process.argv.includes('--mermaid');
|
const mermaidOnly = process.argv.includes('--mermaid');
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
|
const sourcemap = false;
|
||||||
|
|
||||||
type OutputOptions = Exclude<
|
type OutputOptions = Exclude<
|
||||||
Exclude<InlineConfig['build'], undefined>['rollupOptions'],
|
Exclude<InlineConfig['build'], undefined>['rollupOptions'],
|
||||||
@@ -20,13 +22,14 @@ const visualizerOptions = (packageName: string, core = false): PluginOption[] =>
|
|||||||
if (packageName !== 'mermaid' || !visualize) {
|
if (packageName !== 'mermaid' || !visualize) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return ['network', 'treemap', 'sunburst'].map((chartType) =>
|
return ['network', 'treemap', 'sunburst'].map(
|
||||||
visualizer({
|
(chartType) =>
|
||||||
filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
|
visualizer({
|
||||||
template: chartType as TemplateType,
|
filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
|
||||||
gzipSize: true,
|
template: chartType as TemplateType,
|
||||||
brotliSize: true,
|
gzipSize: true,
|
||||||
})
|
brotliSize: true,
|
||||||
|
}) as PluginOption
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -36,21 +39,16 @@ const packageOptions = {
|
|||||||
packageName: 'mermaid',
|
packageName: 'mermaid',
|
||||||
file: 'mermaid.ts',
|
file: 'mermaid.ts',
|
||||||
},
|
},
|
||||||
'mermaid-mindmap': {
|
'mermaid-example-diagram': {
|
||||||
name: 'mermaid-mindmap',
|
name: 'mermaid-example-diagram',
|
||||||
packageName: 'mermaid-mindmap',
|
packageName: 'mermaid-example-diagram',
|
||||||
file: 'detector.ts',
|
file: 'detector.ts',
|
||||||
},
|
},
|
||||||
'mermaid-flowchart-v3': {
|
'mermaid-zenuml': {
|
||||||
name: 'mermaid-flowchart-v3',
|
name: 'mermaid-zenuml',
|
||||||
packageName: 'mermaid-flowchart-v3',
|
packageName: 'mermaid-zenuml',
|
||||||
file: 'detector.ts',
|
file: 'detector.ts',
|
||||||
},
|
},
|
||||||
// 'mermaid-example-diagram-detector': {
|
|
||||||
// name: 'mermaid-example-diagram-detector',
|
|
||||||
// packageName: 'mermaid-example-diagram',
|
|
||||||
// file: 'detector.ts',
|
|
||||||
// },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface BuildOptions {
|
interface BuildOptions {
|
||||||
@@ -68,13 +66,13 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
sourcemap: true,
|
sourcemap,
|
||||||
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
|
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
format: 'umd',
|
format: 'umd',
|
||||||
sourcemap: true,
|
sourcemap,
|
||||||
entryFileNames: `${name}${minify ? '.min' : ''}.js`,
|
entryFileNames: `${name}${minify ? '.min' : ''}.js`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -93,7 +91,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
sourcemap: true,
|
sourcemap,
|
||||||
entryFileNames: `${name}.core.mjs`,
|
entryFileNames: `${name}.core.mjs`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -117,19 +115,19 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.jison', '.js', '.ts', '.json'],
|
extensions: [],
|
||||||
},
|
},
|
||||||
plugins: [jisonPlugin(), ...visualizerOptions(packageName, core)],
|
plugins: [
|
||||||
|
jisonPlugin(),
|
||||||
|
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
||||||
|
typescript({ compilerOptions: { declaration: false } }),
|
||||||
|
...visualizerOptions(packageName, core),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (watch && config.build) {
|
if (watch && config.build) {
|
||||||
config.build.watch = {
|
config.build.watch = {
|
||||||
include: [
|
include: ['packages/mermaid-example-diagram/src/**', 'packages/mermaid/src/**'],
|
||||||
'packages/mermaid-flowchart-v3/src/**',
|
|
||||||
'packages/mermaid-mindmap/src/**',
|
|
||||||
'packages/mermaid/src/**',
|
|
||||||
// 'packages/mermaid-example-diagram/src/**',
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,11 +135,9 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
||||||
return Promise.allSettled([
|
await build(getBuildConfig({ minify: false, entryName }));
|
||||||
build(getBuildConfig({ minify: false, entryName })),
|
await build(getBuildConfig({ minify: 'esbuild', entryName }));
|
||||||
build(getBuildConfig({ minify: 'esbuild', entryName })),
|
await build(getBuildConfig({ minify: false, core: true, entryName }));
|
||||||
build(getBuildConfig({ minify: false, core: true, entryName })),
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
@@ -154,9 +150,8 @@ const main = async () => {
|
|||||||
if (watch) {
|
if (watch) {
|
||||||
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
||||||
if (!mermaidOnly) {
|
if (!mermaidOnly) {
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-flowchart-v3' }));
|
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' }));
|
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
|
||||||
// build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
|
||||||
}
|
}
|
||||||
} else if (visualize) {
|
} else if (visualize) {
|
||||||
await build(getBuildConfig({ minify: false, core: true, entryName: 'mermaid' }));
|
await build(getBuildConfig({ minify: false, core: true, entryName: 'mermaid' }));
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
// @ts-ignore No typings for jison
|
|
||||||
import jison from 'jison';
|
import jison from 'jison';
|
||||||
|
|
||||||
export const transformJison = (src: string): string => {
|
export const transformJison = (src: string): string => {
|
||||||
// @ts-ignore No typings for jison
|
|
||||||
const parser = new jison.Generator(src, {
|
const parser = new jison.Generator(src, {
|
||||||
moduleType: 'js',
|
moduleType: 'js',
|
||||||
'token-stack': true,
|
'token-stack': true,
|
||||||
|
@@ -1,14 +1,6 @@
|
|||||||
import express, { NextFunction, Request, Response } from 'express';
|
import express from 'express';
|
||||||
|
import cors from 'cors';
|
||||||
import { createServer as createViteServer } from 'vite';
|
import { createServer as createViteServer } from 'vite';
|
||||||
// import { getBuildConfig } from './build';
|
|
||||||
|
|
||||||
const cors = (req: Request, res: Response, next: NextFunction) => {
|
|
||||||
res.header('Access-Control-Allow-Origin', '*');
|
|
||||||
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
|
||||||
res.header('Access-Control-Allow-Headers', 'Content-Type');
|
|
||||||
|
|
||||||
next();
|
|
||||||
};
|
|
||||||
|
|
||||||
async function createServer() {
|
async function createServer() {
|
||||||
const app = express();
|
const app = express();
|
||||||
@@ -16,14 +8,15 @@ async function createServer() {
|
|||||||
// Create Vite server in middleware mode
|
// Create Vite server in middleware mode
|
||||||
const vite = await createViteServer({
|
const vite = await createViteServer({
|
||||||
configFile: './vite.config.ts',
|
configFile: './vite.config.ts',
|
||||||
|
mode: 'production',
|
||||||
server: { middlewareMode: true },
|
server: { middlewareMode: true },
|
||||||
appType: 'custom', // don't include Vite's default HTML handling middlewares
|
appType: 'custom', // don't include Vite's default HTML handling middleware
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(cors);
|
app.use(cors());
|
||||||
app.use(express.static('./packages/mermaid/dist'));
|
app.use(express.static('./packages/mermaid/dist'));
|
||||||
|
app.use(express.static('./packages/mermaid-zenuml/dist'));
|
||||||
app.use(express.static('./packages/mermaid-example-diagram/dist'));
|
app.use(express.static('./packages/mermaid-example-diagram/dist'));
|
||||||
app.use(express.static('./packages/mermaid-mindmap/dist'));
|
|
||||||
app.use(vite.middlewares);
|
app.use(vite.middlewares);
|
||||||
app.use(express.static('demos'));
|
app.use(express.static('demos'));
|
||||||
app.use(express.static('cypress/platform'));
|
app.use(express.static('cypress/platform'));
|
||||||
@@ -33,5 +26,4 @@ async function createServer() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// build(getBuildConfig({ minify: false, watch: true }));
|
|
||||||
createServer();
|
createServer();
|
||||||
|
103
CHANGELOG.md
103
CHANGELOG.md
@@ -1,6 +1,105 @@
|
|||||||
# Change Log
|
# Changelog
|
||||||
|
|
||||||
// TODO: Populate changelog
|
## [10.0.0](https://github.com/mermaid-js/mermaid/releases/tag/v10.0.0)
|
||||||
|
|
||||||
|
### Mermaid is ESM only!
|
||||||
|
|
||||||
|
We've dropped CJS support. So, you will have to update your import scripts as follows.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
|
||||||
|
mermaid.initialize({ startOnLoad: true });
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can keep using v9 by adding the `@9` in the CDN URL.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.js"></script>
|
||||||
|
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
### mermaid.render is async and doesn't accept callbacks
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.render('id', 'graph TD;\nA-->B', (svg, bindFunctions) => {
|
||||||
|
element.innerHTML = svg;
|
||||||
|
if (bindFunctions) {
|
||||||
|
bindFunctions(element);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Shorter syntax
|
||||||
|
if (bindFunctions) {
|
||||||
|
bindFunctions(element);
|
||||||
|
}
|
||||||
|
// can be replaced with the `?.` shorthand
|
||||||
|
bindFunctions?.(element);
|
||||||
|
|
||||||
|
// >= v10 with async/await
|
||||||
|
const { svg, bindFunctions } = await mermaid.render('id', 'graph TD;\nA-->B');
|
||||||
|
element.innerHTML = svg;
|
||||||
|
bindFunctions?.(element);
|
||||||
|
|
||||||
|
// >= v10 with promise.then
|
||||||
|
mermaid.render('id', 'graph TD;A-->B').then(({ svg, bindFunctions }) => {
|
||||||
|
element.innerHTML = svg;
|
||||||
|
bindFunctions?.(element);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### mermaid.parse is async and ParseError is removed
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.parse(text, parseError);
|
||||||
|
|
||||||
|
//>= v10
|
||||||
|
await mermaid.parse(text).catch(parseError);
|
||||||
|
// or
|
||||||
|
try {
|
||||||
|
await mermaid.parse(text);
|
||||||
|
} catch (err) {
|
||||||
|
parseError(err);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Init deprecated and InitThrowsErrors removed
|
||||||
|
|
||||||
|
The config passed to `init` was not being used eariler.
|
||||||
|
It will now be used.
|
||||||
|
The `init` function is deprecated and will be removed in the next major release.
|
||||||
|
init currently works as a wrapper to `initialize` and `run`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.init(config, selector, cb);
|
||||||
|
|
||||||
|
//>= v10
|
||||||
|
mermaid.initialize(config);
|
||||||
|
mermaid.run({
|
||||||
|
querySelector: selector,
|
||||||
|
postRenderCallback: cb,
|
||||||
|
suppressErrors: true,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.initThrowsErrors(config, selector, cb);
|
||||||
|
|
||||||
|
//>= v10
|
||||||
|
mermaid.initialize(config);
|
||||||
|
mermaid.run({
|
||||||
|
querySelector: selector,
|
||||||
|
postRenderCallback: cb,
|
||||||
|
suppressErrors: false,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
// TODO: Populate changelog pre v10
|
||||||
|
|
||||||
- Config has a lot of changes
|
- Config has a lot of changes
|
||||||
- globalReset resets to `defaultConfig` instead of current config. Use `reset` instead.
|
- globalReset resets to `defaultConfig` instead of current config. Use `reset` instead.
|
||||||
|
171
CONTRIBUTING.md
171
CONTRIBUTING.md
@@ -1,14 +1,10 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
So you want to help? That's great!
|
Please read in detail about how to contribute documentation and code on the [Mermaid documentation site.](https://mermaid-js.github.io/mermaid/#/development)
|
||||||
|
|
||||||

|
---
|
||||||
|
|
||||||
Here are a few things to know to get you started on the right path.
|
# Mermaid contribution cheat-sheet
|
||||||
|
|
||||||
Below link will help you making a copy of the repository in your local system.
|
|
||||||
|
|
||||||
https://docs.github.com/en/get-started/quickstart/fork-a-repo
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -18,139 +14,58 @@ https://docs.github.com/en/get-started/quickstart/fork-a-repo
|
|||||||
|
|
||||||
## Development Installation
|
## Development Installation
|
||||||
|
|
||||||
|
If you don't have direct access to push to mermaid repositories, make a fork first. Then clone. Or clone directly from mermaid-js:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:mermaid-js/mermaid.git
|
git clone git@github.com:mermaid-js/mermaid.git
|
||||||
cd mermaid
|
cd mermaid
|
||||||
|
```
|
||||||
|
|
||||||
|
Install required packages:
|
||||||
|
|
||||||
|
```bash
|
||||||
# npx is required for first install as volta support for pnpm is not added yet.
|
# npx is required for first install as volta support for pnpm is not added yet.
|
||||||
npx pnpm install
|
npx pnpm install
|
||||||
pnpm test
|
pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Committing code
|
### Docker
|
||||||
|
|
||||||
We make all changes via pull requests. As we have many pull requests from developers new to mermaid, the current approach is to have _knsv, Knut Sveidqvist_ as a main reviewer of changes and merging pull requests. More precisely like this:
|
If you are using docker and docker-compose, you have self-documented `run` bash script, which is a convenient alias for docker-compose commands:
|
||||||
|
|
||||||
- Large changes reviewed by knsv or other developer asked to review by knsv
|
|
||||||
- Smaller low-risk changes like dependencies, documentation, etc. can be merged by active collaborators
|
|
||||||
- Documentation (updates to the `package/mermaid/src/docs` folder is also allowed via direct commits)
|
|
||||||
|
|
||||||
To commit code, create a branch, let it start with the type like feature or bug followed by the issue number for reference and some describing text.
|
|
||||||
|
|
||||||
One example:
|
|
||||||
|
|
||||||
`feature/945_state_diagrams`
|
|
||||||
|
|
||||||
Another:
|
|
||||||
|
|
||||||
`bug/123_nasty_bug_branch`
|
|
||||||
|
|
||||||
## Committing documentation
|
|
||||||
|
|
||||||
Less strict here, it is OK to commit directly in the `develop` branch if you are a collaborator.
|
|
||||||
|
|
||||||
The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
|
|
||||||
|
|
||||||
### Documentation source files are in [`/packages/mermaid/src/docs`](packages/mermaid/src/docs)
|
|
||||||
|
|
||||||
The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
|
|
||||||
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
flowchart LR
|
|
||||||
classDef default fill:#fff,color:black,stroke:black
|
|
||||||
|
|
||||||
source["files in /packages/mermaid/src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./run install # npx pnpm install
|
||||||
|
./run test # pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run unit test
|
||||||
|
pnpm test
|
||||||
|
# Run unit test in watch mode
|
||||||
|
pnpm test:watch
|
||||||
|
# Run E2E test
|
||||||
|
pnpm e2e
|
||||||
|
# Debug E2E tests
|
||||||
|
pnpm dev
|
||||||
|
pnpm cypress:open # in another terminal
|
||||||
|
```
|
||||||
|
|
||||||
|
## Branch name format:
|
||||||
|
|
||||||
|
```text
|
||||||
|
[feature | bug | chore | docs]/[issue number]_[short description using dashes ('-') or underscores ('_') instead of spaces]
|
||||||
|
```
|
||||||
|
|
||||||
|
eg: `feature/2945_state-diagram-new-arrow-florbs`, `bug/1123_fix_random_ugly_red_text`
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
Documentation is necessary for all non bugfix/refactoring changes.
|
||||||
|
|
||||||
|
Only make changes to files are in [`/packages/mermaid/src/docs`](packages/mermaid/src/docs)
|
||||||
|
|
||||||
**_DO NOT CHANGE FILES IN `/docs`_**
|
**_DO NOT CHANGE FILES IN `/docs`_**
|
||||||
|
|
||||||
### The official documentation site
|
|
||||||
|
|
||||||
**[The mermaid documentation site](https://mermaid-js.github.io/mermaid/) is powered by [Vitepress](https://vitepress.vuejs.org/), a simple documentation site generator.**
|
|
||||||
|
|
||||||
If you want to preview the whole documentation site on your machine:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd packages/mermaid
|
|
||||||
pnpm i
|
|
||||||
pnpm docs:dev
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now build and serve the documentation site:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm docs:serve
|
|
||||||
```
|
|
||||||
|
|
||||||
## Branching
|
|
||||||
|
|
||||||
Going forward we will use a git flow inspired approach to branching. So development is done in develop, to do the development in the develop.
|
|
||||||
|
|
||||||
Once development is done we branch a release branch from develop for testing.
|
|
||||||
|
|
||||||
Once the release happens we merge the release branch to master and kill the release branch.
|
|
||||||
|
|
||||||
This means... **branch off your pull request from develop**
|
|
||||||
|
|
||||||
## Content of a pull request
|
|
||||||
|
|
||||||
A new feature has been born. Great! But without the steps below it might just ... fade away ...
|
|
||||||
|
|
||||||
### **Add unit tests for the parsing part**
|
|
||||||
|
|
||||||
This is important so that, if someone else does a change to the grammar that does not know about this great feature, gets notified early on when that change breaks the parser. Another important aspect is that without proper parsing tests refactoring is pretty much impossible.
|
|
||||||
|
|
||||||
### **Add e2e tests**
|
|
||||||
|
|
||||||
This tests the rendering and visual appearance of the diagram. This ensures that the rendering of that feature in the e2e will be reviewed in the release process going forward. Less chance that it breaks!
|
|
||||||
|
|
||||||
To start working with the e2e tests, run `pnpm run dev` to start the dev server, after that start cypress by running `pnpm exec cypress open` in the mermaid folder.
|
|
||||||
|
|
||||||
The rendering tests are very straightforward to create. There is a function imgSnapshotTest. This function takes a diagram in text form, the mermaid options and renders that diagram in cypress.
|
|
||||||
|
|
||||||
When running in ci it will take a snapshot of the rendered diagram and compare it with the snapshot from last build and flag for review it if it differs.
|
|
||||||
|
|
||||||
This is what a rendering test looks like:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
it('should render forks and joins', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
stateDiagram
|
|
||||||
state fork_state <<fork>>
|
|
||||||
[*] --> fork_state
|
|
||||||
fork_state --> State2
|
|
||||||
fork_state --> State3
|
|
||||||
|
|
||||||
state join_state <<join>>
|
|
||||||
State2 --> join_state
|
|
||||||
State3 --> join_state
|
|
||||||
join_state --> State4
|
|
||||||
State4 --> [*]
|
|
||||||
`,
|
|
||||||
{ logLevel: 0 }
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Add documentation for it**
|
|
||||||
|
|
||||||
Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?
|
|
||||||
|
|
||||||
The source files for documentation are in `/packages/mermaid/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated.
|
|
||||||
|
|
||||||
#### Adding to or changing the documentation organization
|
|
||||||
|
|
||||||
If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `mermaid/src/docs/.vitepress/config.js`.
|
|
||||||
|
|
||||||
When changes are committed and then released, they become part of the `master` branch and become part of the published documentation on https://mermaid-js.github.io/mermaid/
|
|
||||||
|
|
||||||
## Last words
|
|
||||||
|
|
||||||
Don't get daunted if it is hard in the beginning. We have a great community with only encouraging words. So if you get stuck, ask for help and hints in the slack forum. If you want to show off something good, show it off there.
|
|
||||||
|
|
||||||
[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
|
||||||

|
|
||||||
|
93
README.md
93
README.md
@@ -1,8 +1,37 @@
|
|||||||
# mermaid
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/develop/docs/public/favicon.svg" height="150">
|
||||||
|
</p>
|
||||||
|
<h1 align="center">
|
||||||
|
Mermaid
|
||||||
|
</h1>
|
||||||
|
<p align="center">
|
||||||
|
Generate diagrams from markdown-like text.
|
||||||
|
<p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.npmjs.com/package/mermaid"><img src="https://img.shields.io/npm/v/mermaid?color=ff3670&label="></a>
|
||||||
|
<p>
|
||||||
|
|
||||||
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml) [](https://www.npmjs.com/package/mermaid) [](https://bundlephobia.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://www.jsdelivr.com/package/npm/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://twitter.com/mermaidjs_)
|
<p align="center">
|
||||||
|
<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://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE" title="Slack invite">🙌 Join Us</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.zh-CN.md">简体中文</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
English | [简体中文](./README.zh-CN.md)
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml)
|
||||||
|
[](https://bundlephobia.com/package/mermaid)
|
||||||
|
[](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
|
||||||
|
[](https://www.jsdelivr.com/package/npm/mermaid)
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
[](https://twitter.com/mermaidjs_)
|
||||||
|
|
||||||
<img src="./img/header.png" alt="" />
|
<img src="./img/header.png" alt="" />
|
||||||
|
|
||||||
@@ -27,14 +56,12 @@ Mermaid addresses this problem by enabling users to create easily modifiable dia
|
|||||||
|
|
||||||
Mermaid allows even non-programmers to easily create detailed diagrams through the [Mermaid Live Editor](https://mermaid.live/).<br/>
|
Mermaid allows even non-programmers to easily create detailed diagrams through the [Mermaid Live Editor](https://mermaid.live/).<br/>
|
||||||
[Tutorials](./docs/config/Tutorials.md) has video tutorials.
|
[Tutorials](./docs/config/Tutorials.md) has video tutorials.
|
||||||
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/misc/integrations.md).
|
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/ecosystem/integrations.md).
|
||||||
|
|
||||||
You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid](./docs/misc/integrations.md).
|
You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid](./docs/ecosystem/integrations.md).
|
||||||
|
|
||||||
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/community/n00b-overview.md), [Usage](./docs/config/usage.md) and [Tutorials](./docs/config/Tutorials.md).
|
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/community/n00b-overview.md), [Usage](./docs/config/usage.md) and [Tutorials](./docs/config/Tutorials.md).
|
||||||
|
|
||||||
🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [Documentation](https://mermaidjs.github.io) | 🙌 [Contribution](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [Changelog](./docs/CHANGELOG.md)
|
|
||||||
|
|
||||||
In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests.
|
In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests.
|
||||||
|
|
||||||
<a href="https://applitools.com/">
|
<a href="https://applitools.com/">
|
||||||
@@ -138,6 +165,13 @@ class Class10 {
|
|||||||
int id
|
int id
|
||||||
size()
|
size()
|
||||||
}
|
}
|
||||||
|
namespace Namespace01 {
|
||||||
|
class Class11
|
||||||
|
class Class12 {
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
@@ -157,6 +191,13 @@ class Class10 {
|
|||||||
int id
|
int id
|
||||||
size()
|
size()
|
||||||
}
|
}
|
||||||
|
namespace Namespace01 {
|
||||||
|
class Class11
|
||||||
|
class Class12 {
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### State diagram [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkEFvgzAMhf8K8nEqpYSNthx22Xbcqcexg0sCiZQQlDhIFeK_L8A6TfXp6fOz9ewJGssFVOAJSbwr7ByadGR1n8T6evpO0vQ1uZDSekOrXGFsPqJPO6q-2-imH8f_0TeHXm50lfelsAMjnEHFY6xpMdRAUhhRQxUlFy0GTTXU_RytYeAx-AdXZB1ULWovdoCB7OXWN1CRC-Ju-r3uz6UtchGHJqDbsPygU57iysb2reoWHpyOWBINvsqypb3vFMlw3TfWZF5xiY7keC6zkpUnZIUojwW-FAVvrvn51LLnvOXHQ84Q5nn-AVtLcwk">live editor</a>]
|
### State diagram [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkEFvgzAMhf8K8nEqpYSNthx22Xbcqcexg0sCiZQQlDhIFeK_L8A6TfXp6fOz9ewJGssFVOAJSbwr7ByadGR1n8T6evpO0vQ1uZDSekOrXGFsPqJPO6q-2-imH8f_0TeHXm50lfelsAMjnEHFY6xpMdRAUhhRQxUlFy0GTTXU_RytYeAx-AdXZB1ULWovdoCB7OXWN1CRC-Ju-r3uz6UtchGHJqDbsPygU57iysb2reoWHpyOWBINvsqypb3vFMlw3TfWZF5xiY7keC6zkpUnZIUojwW-FAVvrvn51LLnvOXHQ84Q5nn-AVtLcwk">live editor</a>]
|
||||||
@@ -199,6 +240,44 @@ pie
|
|||||||
|
|
||||||
### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]
|
### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]
|
||||||
|
|
||||||
|
### Bar chart (using gantt chart) [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaid.live/edit#pako:eNptkU1vhCAQhv8KIenNugiI4rkf6bmXpvEyFVxJFDYyNt1u9r8X63Z7WQ9m5pknLzieaBeMpQ3dg0dsPUkPOhwteXZIXmJcbCT3xMAxkuh8Z8kIEclyMIB209fqKcwTICFvG4IvFy_oLrZ-g9F26ILfQgvNFN94VaRXQ1iWqpumZBcu1J8p1E1TXDx59eQNr5LyEqjJn6hv5QnGNlxevZJmdLLpy5xJSzut45biYCfb0iaVxvawjNjS1p-TCguG16PvaIPzYjO67e3BwX6GiTY9jPFKH43DMF_hGMDY1J4oHg-_f8hFTJFd8L3br3yZx4QHxENsdrt1nO8dDstH3oVpF50ZYMbhU6ud4qoGLqyqBJRCmO6j0HXPZdGbihUc6Pmc0QP49xD-b5X69ZQv2gjO81IwzWqhC1lKrjJ6pA3nVS7SMiVjrKirWlYp5fs3osgrWeo00lorLWvOzz8JVbXm">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
|
gantt
|
||||||
|
title Git Issues - days since last update
|
||||||
|
dateFormat X
|
||||||
|
axisFormat %s
|
||||||
|
|
||||||
|
section Issue19062
|
||||||
|
71 : 0, 71
|
||||||
|
section Issue19401
|
||||||
|
36 : 0, 36
|
||||||
|
section Issue193
|
||||||
|
34 : 0, 34
|
||||||
|
section Issue7441
|
||||||
|
9 : 0, 9
|
||||||
|
section Issue1300
|
||||||
|
5 : 0, 5
|
||||||
|
```
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
gantt
|
||||||
|
title Git Issues - days since last update
|
||||||
|
dateFormat X
|
||||||
|
axisFormat %s
|
||||||
|
|
||||||
|
section Issue19062
|
||||||
|
71 : 0, 71
|
||||||
|
section Issue19401
|
||||||
|
36 : 0, 36
|
||||||
|
section Issue193
|
||||||
|
34 : 0, 34
|
||||||
|
section Issue7441
|
||||||
|
9 : 0, 9
|
||||||
|
section Issue1300
|
||||||
|
5 : 0, 5
|
||||||
|
```
|
||||||
|
|
||||||
### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]
|
### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@@ -1,8 +1,37 @@
|
|||||||
# mermaid
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/develop/docs/public/favicon.svg" height="150">
|
||||||
|
</p>
|
||||||
|
<h1 align="center">
|
||||||
|
Mermaid
|
||||||
|
</h1>
|
||||||
|
<p align="center">
|
||||||
|
通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。
|
||||||
|
<p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.npmjs.com/package/mermaid"><img src="https://img.shields.io/npm/v/mermaid?color=ff3670&label="></a>
|
||||||
|
<p>
|
||||||
|
|
||||||
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml) [](https://www.npmjs.com/package/mermaid) [](https://bundlephobia.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://www.jsdelivr.com/package/npm/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://twitter.com/mermaidjs_)
|
<p align="center">
|
||||||
|
<a href="https://mermaid.live/"><b>Live Editor!</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://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE" title="Slack invite">🙌 加入我们</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.md">English</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[English](./README.md) | 简体中文
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml)
|
||||||
|
[](https://bundlephobia.com/package/mermaid)
|
||||||
|
[](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
|
||||||
|
[](https://www.jsdelivr.com/package/npm/mermaid)
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
[](https://twitter.com/mermaidjs_)
|
||||||
|
|
||||||
<img src="./img/header.png" alt="" />
|
<img src="./img/header.png" alt="" />
|
||||||
|
|
||||||
@@ -24,12 +53,10 @@ Mermaid 是一个基于 Javascript 的图表绘制工具,通过解析类 Markd
|
|||||||
Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它也可以作为生产脚本(或其他代码)的一部分。<br/>
|
Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它也可以作为生产脚本(或其他代码)的一部分。<br/>
|
||||||
<br/>
|
<br/>
|
||||||
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid.live/) 轻松创建详细的图表。<br/>
|
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid.live/) 轻松创建详细的图表。<br/>
|
||||||
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/misc/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/ecosystem/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
||||||
|
|
||||||
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/community/n00b-overview.md), [用法](./docs/config/usage.md) 和 [教程](./docs/config/Tutorials.md).
|
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/community/n00b-overview.md), [用法](./docs/config/usage.md) 和 [教程](./docs/config/Tutorials.md).
|
||||||
|
|
||||||
🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [文档](https://mermaidjs.github.io) | 🙌 [贡献](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [更新日志](./docs/CHANGELOG.md)
|
|
||||||
|
|
||||||
<!-- </Main description> -->
|
<!-- </Main description> -->
|
||||||
|
|
||||||
## 示例
|
## 示例
|
||||||
@@ -325,7 +352,7 @@ _很不幸的是,鱼与熊掌不可兼得,在这个场景下它意味着在
|
|||||||
|
|
||||||
来自 Knut Sveidqvist:
|
来自 Knut Sveidqvist:
|
||||||
|
|
||||||
> _特别感谢 [d3](https://d3js.org/) 和 [dagre-d3](https://github.com/cpettitt/dagre-d3) 这两个优秀的项目,它们提供了图形布局和绘图工具库! _ >_同样感谢 [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) 提供了时序图语法的使用。 感谢 Jessica Peter 提供了甘特图渲染的灵感。_ >_感谢 [Tyler Long](https://github.com/tylerlong) 从 2017 年四月开始成为了项目的合作者。_
|
> _特别感谢 [d3](https://d3js.org/) 和 [dagre-d3](https://github.com/cpettitt/dagre-d3) 这两个优秀的项目,它们提供了图形布局和绘图工具库!_ > _同样感谢 [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) 提供了时序图语法的使用。 感谢 Jessica Peter 提供了甘特图渲染的灵感。_ > _感谢 [Tyler Long](https://github.com/tylerlong) 从 2017 年四月开始成为了项目的合作者。_
|
||||||
>
|
>
|
||||||
> _感谢越来越多的 [贡献者们](https://github.com/knsv/mermaid/graphs/contributors),没有你们,就没有这个项目的今天!_
|
> _感谢越来越多的 [贡献者们](https://github.com/knsv/mermaid/graphs/contributors),没有你们,就没有这个项目的今天!_
|
||||||
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
# A collection of updates that change the behaviour
|
|
||||||
|
|
||||||
## Lazy loading and asynchronisity
|
|
||||||
|
|
||||||
- Invalid dates are rendered as syntax error instead of returning best guess or the current date
|
|
@@ -1,5 +1,4 @@
|
|||||||
// @ts-nocheck TODO: Fix TS
|
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3.js';
|
||||||
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3';
|
|
||||||
|
|
||||||
export const select = function () {
|
export const select = function () {
|
||||||
return new MockedD3();
|
return new MockedD3();
|
||||||
|
43
cSpell.json
43
cSpell.json
@@ -5,26 +5,34 @@
|
|||||||
"acyclicer",
|
"acyclicer",
|
||||||
"adamiecki",
|
"adamiecki",
|
||||||
"alois",
|
"alois",
|
||||||
|
"aloisklink",
|
||||||
"antiscript",
|
"antiscript",
|
||||||
|
"antlr",
|
||||||
|
"appli",
|
||||||
"applitools",
|
"applitools",
|
||||||
"asciidoctor",
|
"asciidoctor",
|
||||||
"ashish",
|
"ashish",
|
||||||
|
"ashishjain",
|
||||||
"astah",
|
"astah",
|
||||||
"bbox",
|
"bbox",
|
||||||
"bilkent",
|
"bilkent",
|
||||||
"bisheng",
|
"bisheng",
|
||||||
|
"blrs",
|
||||||
"braintree",
|
"braintree",
|
||||||
"brkt",
|
"brkt",
|
||||||
"brolin",
|
"brolin",
|
||||||
"brotli",
|
"brotli",
|
||||||
|
"città",
|
||||||
"classdef",
|
"classdef",
|
||||||
"codedoc",
|
"codedoc",
|
||||||
"colour",
|
"colour",
|
||||||
|
"commitlint",
|
||||||
"cpettitt",
|
"cpettitt",
|
||||||
"customizability",
|
"customizability",
|
||||||
"cuzon",
|
"cuzon",
|
||||||
"cytoscape",
|
"cytoscape",
|
||||||
"dagre",
|
"dagre",
|
||||||
|
"deepdwn",
|
||||||
"descr",
|
"descr",
|
||||||
"docsify",
|
"docsify",
|
||||||
"docsy",
|
"docsy",
|
||||||
@@ -43,28 +51,43 @@
|
|||||||
"graphviz",
|
"graphviz",
|
||||||
"grav",
|
"grav",
|
||||||
"greywolf",
|
"greywolf",
|
||||||
|
"huynh",
|
||||||
|
"huynhicode",
|
||||||
"inkdrop",
|
"inkdrop",
|
||||||
"jaoude",
|
"jaoude",
|
||||||
|
"jgreywolf",
|
||||||
"jison",
|
"jison",
|
||||||
|
"jiti",
|
||||||
"kaufmann",
|
"kaufmann",
|
||||||
"khroma",
|
"khroma",
|
||||||
"klemm",
|
"klemm",
|
||||||
"klink",
|
"klink",
|
||||||
"knsv",
|
"knsv",
|
||||||
"knut",
|
"knut",
|
||||||
|
"knutsveidqvist",
|
||||||
"laganeckas",
|
"laganeckas",
|
||||||
|
"linetype",
|
||||||
"lintstagedrc",
|
"lintstagedrc",
|
||||||
|
"logmsg",
|
||||||
"lucida",
|
"lucida",
|
||||||
|
"markdownish",
|
||||||
"matthieu",
|
"matthieu",
|
||||||
|
"matthieumorel",
|
||||||
|
"mdast",
|
||||||
"mdbook",
|
"mdbook",
|
||||||
|
"mermaidjs",
|
||||||
"mermerd",
|
"mermerd",
|
||||||
"mindaugas",
|
"mindaugas",
|
||||||
"mindmap",
|
"mindmap",
|
||||||
"mindmaps",
|
"mindmaps",
|
||||||
"mitigations",
|
"mitigations",
|
||||||
"mkdocs",
|
"mkdocs",
|
||||||
|
"mmorel",
|
||||||
"mult",
|
"mult",
|
||||||
|
"nextra",
|
||||||
"orlandoni",
|
"orlandoni",
|
||||||
|
"pathe",
|
||||||
|
"pbrolin",
|
||||||
"phpbb",
|
"phpbb",
|
||||||
"plantuml",
|
"plantuml",
|
||||||
"playfair",
|
"playfair",
|
||||||
@@ -76,14 +99,22 @@
|
|||||||
"rect",
|
"rect",
|
||||||
"rects",
|
"rects",
|
||||||
"redmine",
|
"redmine",
|
||||||
|
"rehype",
|
||||||
"roledescription",
|
"roledescription",
|
||||||
"sandboxed",
|
"sandboxed",
|
||||||
"setupgraphviewbox",
|
"setupgraphviewbox",
|
||||||
"shiki",
|
"shiki",
|
||||||
"sidharth",
|
"sidharth",
|
||||||
|
"sidharthv",
|
||||||
"sphinxcontrib",
|
"sphinxcontrib",
|
||||||
|
"startx",
|
||||||
|
"starty",
|
||||||
"statediagram",
|
"statediagram",
|
||||||
|
"steph",
|
||||||
|
"stopx",
|
||||||
|
"stopy",
|
||||||
"stylis",
|
"stylis",
|
||||||
|
"subhash-halder",
|
||||||
"substate",
|
"substate",
|
||||||
"sveidqvist",
|
"sveidqvist",
|
||||||
"swimm",
|
"swimm",
|
||||||
@@ -92,16 +123,23 @@
|
|||||||
"textlength",
|
"textlength",
|
||||||
"treemap",
|
"treemap",
|
||||||
"ts-nocheck",
|
"ts-nocheck",
|
||||||
|
"tsdoc",
|
||||||
"tuleap",
|
"tuleap",
|
||||||
|
"tylerlong",
|
||||||
"ugge",
|
"ugge",
|
||||||
"unist",
|
"unist",
|
||||||
|
"unocss",
|
||||||
|
"upvoting",
|
||||||
|
"valign",
|
||||||
"verdana",
|
"verdana",
|
||||||
"viewports",
|
"viewports",
|
||||||
"vinod",
|
"vinod",
|
||||||
"visio",
|
"visio",
|
||||||
"vitepress",
|
"vitepress",
|
||||||
|
"vueuse",
|
||||||
"xlink",
|
"xlink",
|
||||||
"yash"
|
"yash",
|
||||||
|
"zenuml"
|
||||||
],
|
],
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{ "name": "Markdown links", "pattern": "\\((.*)\\)", "description": "" },
|
{ "name": "Markdown links", "pattern": "\\((.*)\\)", "description": "" },
|
||||||
@@ -141,6 +179,7 @@
|
|||||||
],
|
],
|
||||||
"ignorePaths": [
|
"ignorePaths": [
|
||||||
"packages/mermaid/src/docs/CHANGELOG.md",
|
"packages/mermaid/src/docs/CHANGELOG.md",
|
||||||
"packages/mermaid/src/docs/.vitepress/redirect.ts"
|
"packages/mermaid/src/docs/.vitepress/redirect.ts",
|
||||||
|
"packages/mermaid/src/docs/.vitepress/contributor-names.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@ const utf8ToB64 = (str) => {
|
|||||||
return window.btoa(unescape(encodeURIComponent(str)));
|
return window.btoa(unescape(encodeURIComponent(str)));
|
||||||
};
|
};
|
||||||
|
|
||||||
const batchId = 'mermid-batch' + new Date().getTime();
|
const batchId = 'mermaid-batch' + new Date().getTime();
|
||||||
|
|
||||||
export const mermaidUrl = (graphStr, options, api) => {
|
export const mermaidUrl = (graphStr, options, api) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
@@ -22,7 +22,7 @@ export const mermaidUrl = (graphStr, options, api) => {
|
|||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const imgSnapshotTest = (graphStr, _options, api = false, validation) => {
|
export const imgSnapshotTest = (graphStr, _options = {}, api = false, validation = undefined) => {
|
||||||
cy.log(_options);
|
cy.log(_options);
|
||||||
const options = Object.assign(_options);
|
const options = Object.assign(_options);
|
||||||
if (!options.fontFamily) {
|
if (!options.fontFamily) {
|
||||||
@@ -46,8 +46,22 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
|
|||||||
if (!options.fontSize) {
|
if (!options.fontSize) {
|
||||||
options.fontSize = '16px';
|
options.fontSize = '16px';
|
||||||
}
|
}
|
||||||
|
const url = mermaidUrl(graphStr, options, api);
|
||||||
|
openURLAndVerifyRendering(url, options, validation);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
||||||
|
const options = Object.assign(_options);
|
||||||
|
openURLAndVerifyRendering(url, options, validation);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const renderGraph = (graphStr, options, api) => {
|
||||||
|
const url = mermaidUrl(graphStr, options, api);
|
||||||
|
openURLAndVerifyRendering(url, options);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const openURLAndVerifyRendering = (url, options, validation = undefined) => {
|
||||||
const useAppli = Cypress.env('useAppli');
|
const useAppli = Cypress.env('useAppli');
|
||||||
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
|
||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
@@ -60,82 +74,20 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = mermaidUrl(graphStr, options, api);
|
|
||||||
|
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
|
cy.window().should('have.property', 'rendered', true);
|
||||||
|
cy.get('svg').should('be.visible');
|
||||||
|
|
||||||
if (validation) {
|
if (validation) {
|
||||||
cy.get('svg').should(validation);
|
cy.get('svg').should(validation);
|
||||||
}
|
}
|
||||||
cy.get('svg');
|
|
||||||
// Default name to test title
|
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
cy.log('Check eyes' + Cypress.spec.name);
|
cy.log('Check eyes' + Cypress.spec.name);
|
||||||
cy.eyesCheckWindow('Click!');
|
cy.eyesCheckWindow('Click!');
|
||||||
cy.log('Closing eyes: ' + Cypress.spec.name);
|
cy.log('Closing eyes' + Cypress.spec.name);
|
||||||
cy.eyesClose();
|
cy.eyesClose();
|
||||||
} else {
|
} else {
|
||||||
cy.matchImageSnapshot(name);
|
cy.matchImageSnapshot(name);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
|
||||||
cy.log(_options);
|
|
||||||
const options = Object.assign(_options);
|
|
||||||
if (!options.fontFamily) {
|
|
||||||
options.fontFamily = 'courier';
|
|
||||||
}
|
|
||||||
if (!options.sequence) {
|
|
||||||
options.sequence = {};
|
|
||||||
}
|
|
||||||
if (!options.sequence || (options.sequence && !options.sequence.actorFontFamily)) {
|
|
||||||
options.sequence.actorFontFamily = 'courier';
|
|
||||||
}
|
|
||||||
if (options.sequence && !options.sequence.noteFontFamily) {
|
|
||||||
options.sequence.noteFontFamily = 'courier';
|
|
||||||
}
|
|
||||||
options.sequence.actorFontFamily = 'courier';
|
|
||||||
options.sequence.noteFontFamily = 'courier';
|
|
||||||
options.sequence.messageFontFamily = 'courier';
|
|
||||||
if (options.sequence && !options.sequence.actorFontFamily) {
|
|
||||||
options.sequence.actorFontFamily = 'courier';
|
|
||||||
}
|
|
||||||
if (!options.fontSize) {
|
|
||||||
options.fontSize = '16px';
|
|
||||||
}
|
|
||||||
const useAppli = Cypress.env('useAppli');
|
|
||||||
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
|
||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
|
||||||
|
|
||||||
if (useAppli) {
|
|
||||||
cy.log('Opening eyes 2' + Cypress.spec.name);
|
|
||||||
cy.eyesOpen({
|
|
||||||
appName: 'Mermaid',
|
|
||||||
testName: name,
|
|
||||||
batchName: Cypress.spec.name,
|
|
||||||
batchId: batchId + Cypress.spec.name,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cy.visit(url);
|
|
||||||
if (validation) {
|
|
||||||
cy.get('svg').should(validation);
|
|
||||||
}
|
|
||||||
cy.get('body');
|
|
||||||
// Default name to test title
|
|
||||||
|
|
||||||
if (useAppli) {
|
|
||||||
cy.log('Check eyes 2' + Cypress.spec.name);
|
|
||||||
cy.eyesCheckWindow('Click!');
|
|
||||||
cy.log('Closing eyes 2' + Cypress.spec.name);
|
|
||||||
cy.eyesClose();
|
|
||||||
} else {
|
|
||||||
cy.matchImageSnapshot(name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const renderGraph = (graphStr, options, api) => {
|
|
||||||
const url = mermaidUrl(graphStr, options, api);
|
|
||||||
|
|
||||||
cy.visit(url);
|
|
||||||
};
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { renderGraph } from '../../helpers/util';
|
import { renderGraph } from '../../helpers/util.js';
|
||||||
describe('Configuration', () => {
|
describe('Configuration', () => {
|
||||||
describe('arrowMarkerAbsolute', () => {
|
describe('arrowMarkerAbsolute', () => {
|
||||||
it('should handle default value false of arrowMarkerAbsolute', () => {
|
it('should handle default value false of arrowMarkerAbsolute', () => {
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { urlSnapshotTest } from '../../helpers/util';
|
import { urlSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('mermaid', () => {
|
describe('mermaid', () => {
|
||||||
describe('registerDiagram', () => {
|
describe('registerDiagram', () => {
|
||||||
it('should work on @mermaid-js/mermaid-mindmap and mermaid-example-diagram', () => {
|
it('should work on @mermaid-js/mermaid-example-diagram', () => {
|
||||||
const url = 'http://localhost:9000/external-diagrams-mindmap.html';
|
const url = 'http://localhost:9000/external-diagrams-example-diagram.html';
|
||||||
urlSnapshotTest(url, {}, false, false);
|
urlSnapshotTest(url, {}, false, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { urlSnapshotTest } from '../../helpers/util';
|
import { urlSnapshotTest, openURLAndVerifyRendering } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('CSS injections', () => {
|
describe('CSS injections', () => {
|
||||||
it('should not allow CSS injections outside of the diagram', () => {
|
it('should not allow CSS injections outside of the diagram', () => {
|
||||||
@@ -13,4 +13,11 @@ describe('CSS injections', () => {
|
|||||||
flowchart: { htmlLabels: false },
|
flowchart: { htmlLabels: false },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('should not allow manipulating styletags using arrowheads', () => {
|
||||||
|
openURLAndVerifyRendering('http://localhost:9000/xss23-css.html', {
|
||||||
|
logLevel: 1,
|
||||||
|
arrowMarkerAbsolute: false,
|
||||||
|
flowchart: { htmlLabels: true },
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
describe('Class diagram V2', () => {
|
describe('Class diagram V2', () => {
|
||||||
it('0: should render a simple class diagram', () => {
|
it('0: should render a simple class diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -13,7 +13,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('1: should render a simple class diagram', () => {
|
it('1: should render a simple class diagram', () => {
|
||||||
@@ -47,7 +46,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('2: should render a simple class diagrams with cardinality', () => {
|
it('2: should render a simple class diagrams with cardinality', () => {
|
||||||
@@ -76,7 +74,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a simple class diagram with different visibilities', () => {
|
it('should render a simple class diagram with different visibilities', () => {
|
||||||
@@ -94,7 +91,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render multiple class diagrams', () => {
|
it('should render multiple class diagrams', () => {
|
||||||
@@ -147,7 +143,6 @@ describe('Class diagram V2', () => {
|
|||||||
],
|
],
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('4: should render a simple class diagram with comments', () => {
|
it('4: should render a simple class diagram with comments', () => {
|
||||||
@@ -177,7 +172,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('5: should render a simple class diagram with abstract method', () => {
|
it('5: should render a simple class diagram with abstract method', () => {
|
||||||
@@ -189,7 +183,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('6: should render a simple class diagram with static method', () => {
|
it('6: should render a simple class diagram with static method', () => {
|
||||||
@@ -201,7 +194,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('7: should render a simple class diagram with Generic class', () => {
|
it('7: should render a simple class diagram with Generic class', () => {
|
||||||
@@ -221,7 +213,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('8: should render a simple class diagram with Generic class and relations', () => {
|
it('8: should render a simple class diagram with Generic class and relations', () => {
|
||||||
@@ -242,7 +233,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('9: should render a simple class diagram with clickable link', () => {
|
it('9: should render a simple class diagram with clickable link', () => {
|
||||||
@@ -264,7 +254,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('10: should render a simple class diagram with clickable callback', () => {
|
it('10: should render a simple class diagram with clickable callback', () => {
|
||||||
@@ -286,7 +275,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('11: should render a simple class diagram with return type on method', () => {
|
it('11: should render a simple class diagram with return type on method', () => {
|
||||||
@@ -301,7 +289,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('12: should render a simple class diagram with generic types', () => {
|
it('12: should render a simple class diagram with generic types', () => {
|
||||||
@@ -317,7 +304,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('13: should render a simple class diagram with css classes applied', () => {
|
it('13: should render a simple class diagram with css classes applied', () => {
|
||||||
@@ -335,7 +321,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('14: should render a simple class diagram with css classes applied directly', () => {
|
it('14: should render a simple class diagram with css classes applied directly', () => {
|
||||||
@@ -351,7 +336,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
|
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
|
||||||
@@ -365,7 +349,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('16a: should render a simple class diagram with static field', () => {
|
it('16a: should render a simple class diagram with static field', () => {
|
||||||
@@ -378,7 +361,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('16b: should handle the direction statement with TB', () => {
|
it('16b: should handle the direction statement with TB', () => {
|
||||||
@@ -403,7 +385,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('18: should handle the direction statement with LR', () => {
|
it('18: should handle the direction statement with LR', () => {
|
||||||
@@ -428,7 +409,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('17a: should handle the direction statement with BT', () => {
|
it('17a: should handle the direction statement with BT', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -452,7 +432,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('17b: should handle the direction statement with RL', () => {
|
it('17b: should handle the direction statement with RL', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -476,7 +455,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('18: should render a simple class diagram with notes', () => {
|
it('18: should render a simple class diagram with notes', () => {
|
||||||
@@ -493,7 +471,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('1433: should render a simple class with a title', () => {
|
it('1433: should render a simple class with a title', () => {
|
||||||
@@ -503,8 +480,86 @@ title: simple class diagram
|
|||||||
---
|
---
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class Class10
|
class Class10
|
||||||
`,
|
`
|
||||||
{}
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a class with text label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class 1 with text label"]
|
||||||
|
C1 --> C2`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render two classes with text labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class 1 with text label"]
|
||||||
|
class C2["Class 2 with chars @?"]
|
||||||
|
C1 --> C2`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render a class with a text label, members and annotation', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class 1 with text label"] {
|
||||||
|
<<interface>>
|
||||||
|
+member1
|
||||||
|
}
|
||||||
|
C1 --> C2`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render multiple classes with same text labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class with text label"]
|
||||||
|
class C2["Class with text label"]
|
||||||
|
class C3["Class with text label"]
|
||||||
|
C1 --> C2
|
||||||
|
C3 ..> C2
|
||||||
|
`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render classes with different text labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["OneWord"]
|
||||||
|
class C2["With, Comma"]
|
||||||
|
class C3["With (Brackets)"]
|
||||||
|
class C4["With [Brackets]"]
|
||||||
|
class C5["With {Brackets}"]
|
||||||
|
class C7["With 1 number"]
|
||||||
|
class C8["With . period..."]
|
||||||
|
class C9["With - dash"]
|
||||||
|
class C10["With _ underscore"]
|
||||||
|
class C11["With ' single quote"]
|
||||||
|
class C12["With ~!@#$%^&*()_+=-/?"]
|
||||||
|
class C13["With Città foreign language"]
|
||||||
|
`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render classLabel if class has already been defined earlier', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
Animal <|-- Duck
|
||||||
|
class Duck["Duck with text label"]
|
||||||
|
`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should add classes namespaces', function () {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
classDiagram
|
||||||
|
namespace Namespace1 {
|
||||||
|
class C1
|
||||||
|
class C2
|
||||||
|
}
|
||||||
|
C1 --> C2
|
||||||
|
class C3
|
||||||
|
class C4
|
||||||
|
`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Class diagram', () => {
|
describe('Class diagram', () => {
|
||||||
it('1: should render a simple class diagram', () => {
|
it('1: should render a simple class diagram', () => {
|
||||||
@@ -286,7 +286,7 @@ describe('Class diagram', () => {
|
|||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
|
it('15: should render a simple class diagram with css classes applied to multiple classes', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
classDiagram
|
classDiagram
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Current diagram', () => {
|
describe('Current diagram', () => {
|
||||||
it('should render a state with states in it', () => {
|
it('should render a state with states in it', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Flowchart', () => {
|
describe('Flowchart', () => {
|
||||||
it('34: testing the label width in percy', () => {
|
it('34: testing the label width in percy', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Entity Relationship Diagram', () => {
|
describe('Entity Relationship Diagram', () => {
|
||||||
it('should render a simple ER diagram', () => {
|
it('should render a simple ER diagram', () => {
|
||||||
@@ -10,7 +10,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagram with a recursive relationship', () => {
|
it('should render an ER diagram with a recursive relationship', () => {
|
||||||
@@ -23,7 +22,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagram with multiple relationships between the same two entities', () => {
|
it('should render an ER diagram with multiple relationships between the same two entities', () => {
|
||||||
@@ -35,7 +33,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a cyclical ER diagram', () => {
|
it('should render a cyclical ER diagram', () => {
|
||||||
@@ -48,7 +45,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a not-so-simple ER diagram', () => {
|
it('should render a not-so-simple ER diagram', () => {
|
||||||
@@ -66,7 +62,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render multiple ER diagrams', () => {
|
it('should render multiple ER diagrams', () => {
|
||||||
@@ -85,7 +80,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
],
|
],
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagram with blank or empty labels', () => {
|
it('should render an ER diagram with blank or empty labels', () => {
|
||||||
@@ -98,7 +92,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagrams when useMaxWidth is true (default)', () => {
|
it('should render an ER diagrams when useMaxWidth is true (default)', () => {
|
||||||
@@ -151,7 +144,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ er: { useMaxWidth: false } }
|
{ er: { useMaxWidth: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with and without attributes', () => {
|
it('should render entities with and without attributes', () => {
|
||||||
@@ -164,7 +156,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with generic and array attributes', () => {
|
it('should render entities with generic and array attributes', () => {
|
||||||
@@ -179,7 +170,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with length in attributes type', () => {
|
it('should render entities with length in attributes type', () => {
|
||||||
@@ -188,12 +178,11 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
erDiagram
|
erDiagram
|
||||||
CLUSTER {
|
CLUSTER {
|
||||||
varchar(99) name
|
varchar(99) name
|
||||||
string(255) description
|
string(255) description
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities and attributes with big and small entity names', () => {
|
it('should render entities and attributes with big and small entity names', () => {
|
||||||
@@ -209,7 +198,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with keys', () => {
|
it('should render entities with keys', () => {
|
||||||
@@ -228,7 +216,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with comments', () => {
|
it('should render entities with comments', () => {
|
||||||
@@ -247,7 +234,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with keys and comments', () => {
|
it('should render entities with keys and comments', () => {
|
||||||
@@ -267,7 +253,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with aliases', () => {
|
it('should render entities with aliases', () => {
|
||||||
@@ -285,7 +270,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('1433: should render a simple ER diagram with a title', () => {
|
it('1433: should render a simple ER diagram with a title', () => {
|
||||||
|
45
cypress/integration/rendering/errorDiagram.spec.js
Normal file
45
cypress/integration/rendering/errorDiagram.spec.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util';
|
||||||
|
|
||||||
|
describe('Error Diagrams', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.on('uncaught:exception', (err) => {
|
||||||
|
expect(err.message).to.include('Parse error');
|
||||||
|
// return false to prevent the error from
|
||||||
|
// failing this test
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a simple ER diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
error
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render error diagram for actual errors', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart TD
|
||||||
|
A[Christmas] --|Get money| B(Go shopping)
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render error for wrong ER diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
erDiagram
|
||||||
|
ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
|
||||||
|
ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
|
||||||
|
ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
|
||||||
|
MONGODB-CLUSTERS ||..|{
|
||||||
|
ATLAS-TEAMS ||..|{
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
846
cypress/integration/rendering/flowchart-elk.spec.js
Normal file
846
cypress/integration/rendering/flowchart-elk.spec.js
Normal file
@@ -0,0 +1,846 @@
|
|||||||
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe.skip('Flowchart ELK', () => {
|
||||||
|
it('1-elk: should render a simple flowchart', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { defaultRenderer: 'elk' } }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('2-elk: should render a simple flowchart with diagramPadding set to 0', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
%% this is a comment
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { diagramPadding: 0 } }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('3-elk: a link with correct arrowhead to a subgraph', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
P1
|
||||||
|
P1 -->P1.5
|
||||||
|
subgraph P1.5
|
||||||
|
P2
|
||||||
|
P2.5(( A ))
|
||||||
|
P3
|
||||||
|
end
|
||||||
|
P2 --> P4
|
||||||
|
P3 --> P6
|
||||||
|
P1.5 --> P5
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('4-elk: Length of edges', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
L1 --- L2
|
||||||
|
L2 --- C
|
||||||
|
M1 ---> C
|
||||||
|
R1 .-> R2
|
||||||
|
R2 <.-> C
|
||||||
|
C -->|Label 1| E1
|
||||||
|
C <-- Label 2 ---> E2
|
||||||
|
C ----> E3
|
||||||
|
C <-...-> E4
|
||||||
|
C ======> E5
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('5-elk: should render escaped without html labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
a["<strong>Haiya</strong>"]---->b
|
||||||
|
`,
|
||||||
|
{ htmlLabels: false, flowchart: { htmlLabels: false } }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('6-elk: should render non-escaped with html labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
a["<strong>Haiya</strong>"]===>b
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('7-elk: should render a flowchart when useMaxWidth is true (default)', () => {
|
||||||
|
renderGraph(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { useMaxWidth: true } }
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
expect(svg).to.have.attr('width', '100%');
|
||||||
|
// expect(svg).to.have.attr('height');
|
||||||
|
// use within because the absolute value can be slightly different depending on the environment ±5%
|
||||||
|
// const height = parseFloat(svg.attr('height'));
|
||||||
|
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
||||||
|
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(230 * 0.95, 230 * 1.05);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('8-elk: should render a flowchart when useMaxWidth is false', () => {
|
||||||
|
renderGraph(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { useMaxWidth: false } }
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
// const height = parseFloat(svg.attr('height'));
|
||||||
|
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(230 * 0.95, 230 * 1.05);
|
||||||
|
expect(svg).to.not.have.attr('style');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('V2 elk - 16: Render Stadium shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
` flowchart-elk TD
|
||||||
|
A([stadium shape test])
|
||||||
|
A -->|Get money| B([Go shopping])
|
||||||
|
B --> C([Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?])
|
||||||
|
C -->|One| D([Laptop])
|
||||||
|
C -->|Two| E([iPhone])
|
||||||
|
C -->|Three| F([Car<br/>wroom wroom])
|
||||||
|
click A "index.html#link-clicked" "link test"
|
||||||
|
click B testClick "click test"
|
||||||
|
classDef someclass fill:#f96;
|
||||||
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
|
`,
|
||||||
|
{ flowchart: { htmlLabels: false }, fontFamily: 'courier' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('50-elk: handle nested subgraphs in reverse order', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk LR
|
||||||
|
a -->b
|
||||||
|
subgraph A
|
||||||
|
B
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
b
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('51-elk: handle nested subgraphs in reverse order', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk LR
|
||||||
|
a -->b
|
||||||
|
subgraph A
|
||||||
|
B
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
b
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('52-elk: handle nested subgraphs in several levels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
b-->B
|
||||||
|
a-->c
|
||||||
|
subgraph O
|
||||||
|
A
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
c
|
||||||
|
end
|
||||||
|
subgraph A
|
||||||
|
a
|
||||||
|
b
|
||||||
|
B
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('53-elk: handle nested subgraphs with edges in and out', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk 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
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('54-elk: handle nested subgraphs with outgoing links', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
subgraph main
|
||||||
|
subgraph subcontainer
|
||||||
|
subcontainer-child
|
||||||
|
end
|
||||||
|
subcontainer-child--> subcontainer-sibling
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('55-elk: handle nested subgraphs with outgoing links 2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
|
||||||
|
subgraph one[One]
|
||||||
|
subgraph sub_one[Sub One]
|
||||||
|
_sub_one
|
||||||
|
end
|
||||||
|
subgraph sub_two[Sub Two]
|
||||||
|
_sub_two
|
||||||
|
end
|
||||||
|
_one
|
||||||
|
end
|
||||||
|
|
||||||
|
%% here, either the first or the second one
|
||||||
|
sub_one --> sub_two
|
||||||
|
_one --> b
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('56-elk: handle nested subgraphs with outgoing links 3', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
subgraph container_Beta
|
||||||
|
process_C-->Process_D
|
||||||
|
end
|
||||||
|
subgraph container_Alpha
|
||||||
|
process_A-->process_B
|
||||||
|
process_A-->|messages|process_C
|
||||||
|
end
|
||||||
|
process_B-->|via_AWSBatch|container_Beta
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('57-elk: handle nested subgraphs with outgoing links 4', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk LR
|
||||||
|
subgraph A
|
||||||
|
a -->b
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
b
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('57-elk: handle nested subgraphs with outgoing links 2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
c1-->a2
|
||||||
|
subgraph one
|
||||||
|
a1-->a2
|
||||||
|
end
|
||||||
|
subgraph two
|
||||||
|
b1-->b2
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c1-->c2
|
||||||
|
end
|
||||||
|
one --> two
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('57.x: handle nested subgraphs with outgoing links 5', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%% this does not produce the desired result
|
||||||
|
flowchart-elk TB
|
||||||
|
subgraph container_Beta
|
||||||
|
process_C-->Process_D
|
||||||
|
end
|
||||||
|
subgraph container_Alpha
|
||||||
|
process_A-->process_B
|
||||||
|
process_B-->|via_AWSBatch|container_Beta
|
||||||
|
process_A-->|messages|process_C
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('58-elk: handle styling with style expressions', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk 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
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('59-elk: handle styling of subgraphs and links', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TD
|
||||||
|
A[Christmas] ==> D
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
A[Christmas] ==> C
|
||||||
|
subgraph T ["Test"]
|
||||||
|
A
|
||||||
|
B
|
||||||
|
C
|
||||||
|
end
|
||||||
|
|
||||||
|
classDef Test fill:#F84E68,stroke:#333,color:white;
|
||||||
|
class A,T Test
|
||||||
|
classDef TestSub fill:green;
|
||||||
|
class T TestSub
|
||||||
|
linkStyle 0,1 color:orange, stroke: orange;
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('60-elk: handle styling for all node shapes - v2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
A[red text] -->|default style| B(blue text)
|
||||||
|
C([red text]) -->|default style| D[[blue text]]
|
||||||
|
E[(red text)] -->|default style| F((blue text))
|
||||||
|
G>red text] -->|default style| H{blue text}
|
||||||
|
I{{red text}} -->|default style| J[/blue text/]
|
||||||
|
K[\\ red text\\] -->|default style| L[/blue text\\]
|
||||||
|
M[\\ red text/] -->|default style| N[blue text];
|
||||||
|
O(((red text))) -->|default style| P(((blue text)));
|
||||||
|
linkStyle default color:Sienna;
|
||||||
|
style A stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style B stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style D stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style E stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style F stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style G stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style H stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style I stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style J stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style K stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style L stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style M stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style N stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style O stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style P stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose', logLevel: 2 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('61-elk: fontawesome icons in edge labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TD
|
||||||
|
C -->|fa:fa-car Car| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('62-elk: should render styled subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TB
|
||||||
|
A
|
||||||
|
B
|
||||||
|
subgraph foo[Foo SubGraph]
|
||||||
|
C
|
||||||
|
D
|
||||||
|
end
|
||||||
|
subgraph bar[Bar SubGraph]
|
||||||
|
E
|
||||||
|
F
|
||||||
|
end
|
||||||
|
G
|
||||||
|
|
||||||
|
A-->B
|
||||||
|
B-->C
|
||||||
|
C-->D
|
||||||
|
B-->D
|
||||||
|
D-->E
|
||||||
|
E-->A
|
||||||
|
E-->F
|
||||||
|
F-->D
|
||||||
|
F-->G
|
||||||
|
B-->G
|
||||||
|
G-->D
|
||||||
|
|
||||||
|
style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
|
||||||
|
style bar fill:#999,stroke-width:10px,stroke:#0F0,color:blue
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('63-elk: title on subgraphs should be themable', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%%
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph A
|
||||||
|
a --> b
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
i -->f
|
||||||
|
end
|
||||||
|
A --> B
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('65-elk: text-color from classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
classDef dark fill:#000,stroke:#000,stroke-width:4px,color:#fff
|
||||||
|
Lorem --> Ipsum --> Dolor
|
||||||
|
class Lorem,Dolor dark
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('66-elk: More nested subgraph cases (TB)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TB
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('67-elk: More nested subgraph cases (RL)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('68-elk: More nested subgraph cases (BT)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk BT
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('69-elk: More nested subgraph cases (LR)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('70-elk: Handle nested subgraph cases (TB) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TB
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('71-elk: Handle nested subgraph cases (RL) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('72-elk: Handle nested subgraph cases (BT) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk BT
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('74-elk: Handle nested subgraph cases (RL) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('74-elk: Handle labels for multiple edges from and to the same couple of nodes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph one
|
||||||
|
a1 -- l1 --> a2
|
||||||
|
a1 -- l2 --> a2
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('76-elk: handle unicode encoded character with HTML labels true', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
a{{"Lorem 'ipsum' dolor 'sit' amet, 'consectetur' adipiscing 'elit'."}}
|
||||||
|
--> b{{"Lorem #quot;ipsum#quot; dolor #quot;sit#quot; amet,#quot;consectetur#quot; adipiscing #quot;elit#quot;."}}
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('2050-elk: handling of different rendering direction in subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
|
||||||
|
subgraph TOP
|
||||||
|
direction TB
|
||||||
|
subgraph B1
|
||||||
|
direction RL
|
||||||
|
i1 -->f1
|
||||||
|
end
|
||||||
|
subgraph B2
|
||||||
|
direction BT
|
||||||
|
i2 -->f2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
A --> TOP --> B
|
||||||
|
B1 --> B2
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('2388-elk: handling default in the node name', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
default-index.js --> dot.template.js
|
||||||
|
index.js --> module-utl.js
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('2824-elk: Clipping of edges', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TD
|
||||||
|
A --> B
|
||||||
|
A --> C
|
||||||
|
B --> C
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('1433-elk: should render a titled flowchart with titleTopMargin set to 0', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: Simple flowchart
|
||||||
|
---
|
||||||
|
flowchart-elk TD
|
||||||
|
A --> B
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('elk: should include classes on the edges', () => {
|
||||||
|
renderGraph(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A --> B --> C --> D
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
const edges = svg.querySelectorAll('.edges > path');
|
||||||
|
edges.forEach((edge) => {
|
||||||
|
expect(edge).to.have.class('flowchart-link');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('Markdown strings flowchart-elk (#4220)', () => {
|
||||||
|
describe('html labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b(\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`) --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('svg text labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Flowchart v2', () => {
|
describe('Flowchart v2', () => {
|
||||||
it('1: should render a simple flowchart', () => {
|
it('1: should render a simple flowchart', () => {
|
||||||
@@ -172,7 +172,7 @@ describe('Flowchart v2', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('52: handle nested subgraphs in several levels', () => {
|
it('52: handle nested subgraphs in several levels.', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`flowchart TB
|
`flowchart TB
|
||||||
b-->B
|
b-->B
|
||||||
@@ -674,4 +674,170 @@ A --> B
|
|||||||
{ titleTopMargin: 0 }
|
{ titleTopMargin: 0 }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('3192: It should be possieble to render flowcharts with invisible edges', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: Simple flowchart with invisible edges
|
||||||
|
---
|
||||||
|
flowchart TD
|
||||||
|
A ~~~ B
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('4023: Should render html labels with images and-or text correctly', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart TD
|
||||||
|
B[<img src='https://mermaid.js.org/mermaid-logo.svg'>]
|
||||||
|
B-->C[<img src="https://mermaid.js.org/mermaid-logo.svg"> more text <img src='https://mermaid.js.org/mermaid-logo.svg'>]
|
||||||
|
B-->D(<img src='https://mermaid.js.org/mermaid-logo.svg'> some text)
|
||||||
|
B-->E(plain)`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
describe('Markdown strings flowchart (#4220)', () => {
|
||||||
|
describe('html labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('svg text labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Graph', () => {
|
describe('Graph', () => {
|
||||||
it('1: should render a simple flowchart no htmlLabels', () => {
|
it('1: should render a simple flowchart no htmlLabels', () => {
|
||||||
|
@@ -133,6 +133,24 @@ describe('Gantt diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should default to showing today marker', () => {
|
||||||
|
// This test only works if the environment thinks today is 1010-10-10
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title Show today marker (vertical line should be visible)
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %d
|
||||||
|
%% Should default to being on
|
||||||
|
%% todayMarker on
|
||||||
|
section Section1
|
||||||
|
Yesterday: 1010-10-09, 1d
|
||||||
|
Today: 1010-10-10, 1d
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('should hide today marker', () => {
|
it('should hide today marker', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -142,7 +160,8 @@ describe('Gantt diagram', () => {
|
|||||||
axisFormat %d
|
axisFormat %d
|
||||||
todayMarker off
|
todayMarker off
|
||||||
section Section1
|
section Section1
|
||||||
Today: 1, -1h
|
Yesterday: 1010-10-09, 1d
|
||||||
|
Today: 1010-10-10, 1d
|
||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
@@ -157,7 +176,8 @@ describe('Gantt diagram', () => {
|
|||||||
axisFormat %d
|
axisFormat %d
|
||||||
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
||||||
section Section1
|
section Section1
|
||||||
Today: 1, -1h
|
Yesterday: 1010-10-09, 1d
|
||||||
|
Today: 1010-10-10, 1d
|
||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
@@ -435,4 +455,39 @@ describe('Gantt diagram', () => {
|
|||||||
{ gantt: { topAxis: true } }
|
{ gantt: { topAxis: true } }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should render when compact is true', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
---
|
||||||
|
displayMode: compact
|
||||||
|
---
|
||||||
|
gantt
|
||||||
|
title GANTT compact
|
||||||
|
dateFormat HH:mm:ss
|
||||||
|
axisFormat %Hh%M
|
||||||
|
|
||||||
|
section DB Clean
|
||||||
|
Clean: 12:00:00, 10m
|
||||||
|
Clean: 12:30:00, 12m
|
||||||
|
Clean: 13:00:00, 8m
|
||||||
|
Clean: 13:30:00, 9m
|
||||||
|
Clean: 14:00:00, 13m
|
||||||
|
Clean: 14:30:00, 10m
|
||||||
|
Clean: 15:00:00, 11m
|
||||||
|
|
||||||
|
section Sessions
|
||||||
|
A: 12:00:00, 63m
|
||||||
|
B: 12:30:00, 12m
|
||||||
|
C: 13:05:00, 12m
|
||||||
|
D: 13:06:00, 33m
|
||||||
|
E: 13:15:00, 55m
|
||||||
|
F: 13:20:00, 12m
|
||||||
|
G: 13:32:00, 18m
|
||||||
|
H: 13:50:00, 20m
|
||||||
|
I: 14:10:00, 10m
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util.js';
|
|
||||||
|
|
||||||
describe('Sequencediagram', () => {
|
|
||||||
it('should render a simple info diagrams', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
info
|
|
||||||
showInfo
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
11
cypress/integration/rendering/info.spec.ts
Normal file
11
cypress/integration/rendering/info.spec.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('info diagram', () => {
|
||||||
|
it('should handle an info definition', () => {
|
||||||
|
imgSnapshotTest(`info`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle an info definition with showInfo', () => {
|
||||||
|
imgSnapshotTest(`info showInfo`);
|
||||||
|
});
|
||||||
|
});
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the SVG Element has a Mindmap root
|
* Check whether the SVG Element has a Mindmap root
|
||||||
@@ -52,6 +52,17 @@ root[A root with a long text that wraps to keep the node size in check]
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('a root with wrapping text and long words that exceed width', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root[A few smaller words but then averylongsetofcharacterswithoutwhitespacetoseparate that we expect to wrapontonextlinesandnotexceedwidthparameters]
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('a root with an icon', () => {
|
it('a root with an icon', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`mindmap
|
`mindmap
|
||||||
@@ -158,7 +169,6 @@ mindmap
|
|||||||
undefined,
|
undefined,
|
||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('rounded rect shape', () => {
|
it('rounded rect shape', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -172,7 +182,6 @@ mindmap
|
|||||||
undefined,
|
undefined,
|
||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('circle shape', () => {
|
it('circle shape', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -186,7 +195,6 @@ mindmap
|
|||||||
undefined,
|
undefined,
|
||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('default shape', () => {
|
it('default shape', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -198,7 +206,6 @@ mindmap
|
|||||||
undefined,
|
undefined,
|
||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('adding children', () => {
|
it('adding children', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -212,7 +219,6 @@ mindmap
|
|||||||
undefined,
|
undefined,
|
||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('adding grand children', () => {
|
it('adding grand children', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -227,7 +233,19 @@ mindmap
|
|||||||
undefined,
|
undefined,
|
||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
});
|
||||||
|
describe('Markdown strings mindmaps (#4220)', () => {
|
||||||
|
it('Formatted label with linebreak and a wrapping label and emojis', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
id1[\`**Start** with
|
||||||
|
a second line 😎\`]
|
||||||
|
id2[\`The dog in **the** hog... a *very long text* about it
|
||||||
|
Word!\`]
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
/* The end */
|
/* The end */
|
||||||
});
|
});
|
||||||
|
@@ -75,4 +75,15 @@ describe('Pie Chart', () => {
|
|||||||
expect(svg).to.not.have.attr('style');
|
expect(svg).to.not.have.attr('style');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('should render a pie diagram when textPosition is set', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
pie
|
||||||
|
"Dogs": 50
|
||||||
|
"Cats": 25
|
||||||
|
`,
|
||||||
|
{ logLevel: 1, pie: { textPosition: 0.9 } }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
163
cypress/integration/rendering/quadrantChart.spec.js
Normal file
163
cypress/integration/rendering/quadrantChart.spec.js
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('Quadrant Chart', () => {
|
||||||
|
it('should render if only chart type is provided', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
quadrantChart
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render a complete quadrant chart', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
Campaign A: [0.3, 0.6]
|
||||||
|
Campaign B: [0.45, 0.23]
|
||||||
|
Campaign C: [0.57, 0.69]
|
||||||
|
Campaign D: [0.78, 0.34]
|
||||||
|
Campaign E: [0.40, 0.34]
|
||||||
|
Campaign F: [0.35, 0.78]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render without points', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should able to render y-axix on right side', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: {"quadrantChart": {"yAxisPosition": "right"}}}%%
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should able to render x-axix on bottom', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: {"quadrantChart": {"xAxisPosition": "bottom"}}}%%
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should able to render x-axix on bottom and y-axis on right', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: {"quadrantChart": {"xAxisPosition": "bottom", "yAxisPosition": "right"}}}%%
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render without title', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
quadrantChart
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should use all the config', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: {"quadrantChart": {"chartWidth": 600, "chartHeight": 600, "titlePadding": 20, "titleFontSize": 10, "quadrantPadding": 20, "quadrantTextTopPadding": 40, "quadrantLabelFontSize": 20, "quadrantInternalBorderStrokeWidth": 3, "quadrantExternalBorderStrokeWidth": 5, "xAxisLabelPadding": 20, "xAxisLabelFontSize": 20, "yAxisLabelPadding": 20, "yAxisLabelFontSize": 20, "pointTextPadding": 20, "pointLabelFontSize": 20, "pointRadius": 10 }}}%%
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
Campaign A: [0.3, 0.6]
|
||||||
|
Campaign B: [0.45, 0.23]
|
||||||
|
Campaign C: [0.57, 0.69]
|
||||||
|
Campaign D: [0.78, 0.34]
|
||||||
|
Campaign E: [0.40, 0.34]
|
||||||
|
Campaign F: [0.35, 0.78]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should use all the theme variable', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: {"themeVariables": {"quadrant1Fill": "#b4dcff","quadrant2Fill": "#fef0ff", "quadrant3Fill": "#fffaf0", "quadrant4Fill": "#f0fff2", "quadrant1TextFill": "#ff0000", "quadrant2TextFill": "#2d00df", "quadrant3TextFill": "#00ffda", "quadrant4TextFill": "#e68300", "quadrantPointFill": "#0149ff", "quadrantPointTextFill": "#dc00ff", "quadrantXAxisTextFill": "#ffb500", "quadrantYAxisTextFill": "#fae604", "quadrantInternalBorderStrokeFill": "#3636f2", "quadrantExternalBorderStrokeFill": "#ff1010", "quadrantTitleFill": "#00ea19"} }}%%
|
||||||
|
quadrantChart
|
||||||
|
title Reach and engagement of campaigns
|
||||||
|
x-axis Low Reach --> High Reach
|
||||||
|
y-axis Low Engagement --> High Engagement
|
||||||
|
quadrant-1 We should expand
|
||||||
|
quadrant-2 Need to promote
|
||||||
|
quadrant-3 Re-evaluate
|
||||||
|
quadrant-4 May be improved
|
||||||
|
Campaign A: [0.3, 0.6]
|
||||||
|
Campaign B: [0.45, 0.23]
|
||||||
|
Campaign C: [0.57, 0.69]
|
||||||
|
Campaign D: [0.78, 0.34]
|
||||||
|
Campaign E: [0.40, 0.34]
|
||||||
|
Campaign F: [0.35, 0.78]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
});
|
@@ -1,8 +1,44 @@
|
|||||||
/// <reference types="Cypress" />
|
/// <reference types="Cypress" />
|
||||||
|
|
||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
context('Sequence diagram', () => {
|
context('Sequence diagram', () => {
|
||||||
|
it('should render a sequence diagram with boxes', () => {
|
||||||
|
renderGraph(
|
||||||
|
`
|
||||||
|
sequenceDiagram
|
||||||
|
box LightGrey Alice and Bob
|
||||||
|
participant Alice
|
||||||
|
participant Bob
|
||||||
|
end
|
||||||
|
participant John as John<br/>Second Line
|
||||||
|
Alice ->> Bob: Hello Bob, how are you?
|
||||||
|
Bob-->>John: How about you John?
|
||||||
|
Bob--x Alice: I am good thanks!
|
||||||
|
Bob-x John: I am good thanks!
|
||||||
|
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
|
||||||
|
Bob-->Alice: Checking with John...
|
||||||
|
alt either this
|
||||||
|
Alice->>John: Yes
|
||||||
|
else or this
|
||||||
|
Alice->>John: No
|
||||||
|
else or this will happen
|
||||||
|
Alice->John: Maybe
|
||||||
|
end
|
||||||
|
par this happens in parallel
|
||||||
|
Alice -->> Bob: Parallel message 1
|
||||||
|
and
|
||||||
|
Alice -->> John: Parallel message 2
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ sequence: { useMaxWidth: false } }
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
const width = parseFloat(svg.attr('width'));
|
||||||
|
expect(width).to.be.within(830 * 0.95, 830 * 1.05);
|
||||||
|
expect(svg).to.not.have.attr('style');
|
||||||
|
});
|
||||||
|
});
|
||||||
it('should render a simple sequence diagram', () => {
|
it('should render a simple sequence diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -52,6 +88,16 @@ context('Sequence diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('should handle empty lines', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>John: Hello John<br/>
|
||||||
|
John-->>Alice: Great<br/><br/>day!
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
it('should handle line breaks and wrap annotations', () => {
|
it('should handle line breaks and wrap annotations', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -80,7 +126,34 @@ context('Sequence diagram', () => {
|
|||||||
loop Loopy
|
loop Loopy
|
||||||
Bob->>Alice: Pasten
|
Bob->>Alice: Pasten
|
||||||
end `,
|
end `,
|
||||||
{ wrap: true }
|
{
|
||||||
|
sequence: {
|
||||||
|
wrap: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render a sequence diagram with par_over', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
sequenceDiagram
|
||||||
|
participant Alice
|
||||||
|
participant Bob
|
||||||
|
participant John
|
||||||
|
par_over Section title
|
||||||
|
Alice ->> Bob: Message 1<br>Second line
|
||||||
|
Bob ->> John: Message 2
|
||||||
|
end
|
||||||
|
par_over Two line<br>section title
|
||||||
|
Note over Alice: Alice note
|
||||||
|
Note over Bob: Bob note<br>Second line
|
||||||
|
Note over John: John note
|
||||||
|
end
|
||||||
|
par_over Mixed section
|
||||||
|
Alice ->> Bob: Message 1
|
||||||
|
Note left of Bob: Alice/Bob Note
|
||||||
|
end
|
||||||
|
`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
context('font settings', () => {
|
context('font settings', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('State diagram', () => {
|
describe('State diagram', () => {
|
||||||
it('v2 should render a simple info', () => {
|
it('v2 should render a simple info', () => {
|
||||||
@@ -530,7 +530,7 @@ stateDiagram-v2
|
|||||||
[*] --> A
|
[*] --> A
|
||||||
A --> B: test({ foo#colon; 'far' })
|
A --> B: test({ foo#colon; 'far' })
|
||||||
B --> [*]
|
B --> [*]
|
||||||
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
class B badBadEvent
|
class B badBadEvent
|
||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
@@ -543,14 +543,14 @@ stateDiagram-v2
|
|||||||
classDef notMoving fill:white
|
classDef notMoving fill:white
|
||||||
classDef movement font-style:italic;
|
classDef movement font-style:italic;
|
||||||
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
|
|
||||||
[*] --> Still
|
[*] --> Still
|
||||||
Still --> [*]
|
Still --> [*]
|
||||||
Still --> Moving
|
Still --> Moving
|
||||||
Moving --> Still
|
Moving --> Still
|
||||||
Moving --> Crash
|
Moving --> Crash
|
||||||
Crash --> [*]
|
Crash --> [*]
|
||||||
|
|
||||||
class Still notMoving
|
class Still notMoving
|
||||||
class Moving, Crash movement
|
class Moving, Crash movement
|
||||||
class Crash badBadEvent
|
class Crash badBadEvent
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('State diagram', () => {
|
describe('State diagram', () => {
|
||||||
it('should render a simple state diagrams', () => {
|
it('should render a simple state diagrams', () => {
|
||||||
|
164
cypress/integration/rendering/timeline.spec.ts
Normal file
164
cypress/integration/rendering/timeline.spec.ts
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('Timeline diagram', () => {
|
||||||
|
it('1: should render a simple timeline with no specific sections', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('2: should render a timeline diagram with sections', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`timeline
|
||||||
|
title Timeline of Industrial Revolution
|
||||||
|
section 17th-20th century
|
||||||
|
Industry 1.0 : Machinery, Water power, Steam <br>power
|
||||||
|
Industry 2.0 : Electricity, Internal combustion engine, Mass production
|
||||||
|
Industry 3.0 : Electronics, Computers, Automation
|
||||||
|
section 21st century
|
||||||
|
Industry 4.0 : Internet, Robotics, Internet of Things
|
||||||
|
Industry 5.0 : Artificial intelligence, Big data,3D printing
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('3: should render a complex timeline with sections, and long events text with <br>', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`timeline
|
||||||
|
title England's History Timeline
|
||||||
|
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 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.
|
||||||
|
: The first metal objects are made in Britain.Some other nice things happen. it is a good time to be alive.
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('4: should render a simple timeline with directives and disableMultiColor:true ', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'base', 'timeline': {'disableMulticolor': true}}}%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('5: should render a simple timeline with directive overriden colors', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
` %%{init: { 'logLevel': 'debug', 'theme': 'default' , 'themeVariables': {
|
||||||
|
'cScale0': '#ff0000',
|
||||||
|
'cScale1': '#00ff00',
|
||||||
|
'cScale2': '#0000ff'
|
||||||
|
} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('6: should render a simple timeline in base theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('7: should render a simple timeline in default theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'default' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('8: should render a simple timeline in dark theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'dark' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('9: should render a simple timeline in neutral theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'neutral' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('10: should render a simple timeline in forest theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
19
cypress/integration/rendering/zenuml.spec.js
Normal file
19
cypress/integration/rendering/zenuml.spec.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('Zen UML', () => {
|
||||||
|
it('Basic Zen UML diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
zenuml
|
||||||
|
A.method() {
|
||||||
|
if(x) {
|
||||||
|
B.method() {
|
||||||
|
selfCall() { return X }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
231
cypress/platform/ashish2.html
Normal file
231
cypress/platform/ashish2.html
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
<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"
|
||||||
|
/>
|
||||||
|
<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: #eee;
|
||||||
|
background-image: radial-gradient(#fff 1%, transparent 11%),
|
||||||
|
radial-gradient(#fff 1%, transparent 11%);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
timeline
|
||||||
|
title My day
|
||||||
|
section section with no tasks
|
||||||
|
section Go to work at the dog office
|
||||||
|
1930 : first step : second step is a long step
|
||||||
|
: third step
|
||||||
|
1940 : fourth step : fifth step
|
||||||
|
section Go home
|
||||||
|
1950 : India got independent and already won war against Pakistan
|
||||||
|
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 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
|
||||||
|
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
|
||||||
|
Buttet 3 : sub-point <br> 3a : sub-point 3b
|
||||||
|
: sub-point 3c
|
||||||
|
Bullet 4 : sub-point 4a : sub-point 4b
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
timeline
|
||||||
|
title England's History Timeline
|
||||||
|
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 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.
|
||||||
|
: The first metal objects are made in Britain.Some other nice things happen. it is a good time to be alive.
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{'init': { 'logLevel': 'debug', 'theme': 'default', 'timeline': {'disableMulticolor':false} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google : Pixar
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008s : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'themeVariables': {
|
||||||
|
'cScale0': '#ff0000',
|
||||||
|
'cScale1': '#00ff00',
|
||||||
|
'cScale2': '#ff0000'
|
||||||
|
} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google : Pixar
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008s : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: { 'logLevel': 'debug', 'theme': 'default' , 'themeVariables': {
|
||||||
|
'cScale0': '#ff0000',
|
||||||
|
'cScale1': '#00ff00',
|
||||||
|
'cScale2': '#0000ff'
|
||||||
|
} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008s : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
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>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart-elk TB
|
||||||
|
a --> b
|
||||||
|
a --> c
|
||||||
|
b --> d
|
||||||
|
c --> d
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<!-- <div id="cy"></div> -->
|
||||||
|
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
||||||
|
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
||||||
|
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
||||||
|
<script type="module">
|
||||||
|
//import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
|
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
|
// import timeline from '../../packages/mermaid-timeline/src/detector';
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
// await mermaid.registerExternalDiagrams([]);
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'base',
|
||||||
|
startOnLoad: true,
|
||||||
|
logLevel: 0,
|
||||||
|
flowchart: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
timeline: {
|
||||||
|
disableMulticolor: false,
|
||||||
|
htmlLabels: false,
|
||||||
|
},
|
||||||
|
useMaxWidth: true,
|
||||||
|
lazyLoadedDiagrams: [
|
||||||
|
// './mermaid-mindmap-detector.esm.mjs',
|
||||||
|
// './mermaid-example-diagram-detector.esm.mjs',
|
||||||
|
//'./mermaid-timeline-detector.esm.mjs',
|
||||||
|
],
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
// mermaid.test1('first_slow', 1200).then((r) => console.info(r));
|
||||||
|
// mermaid.test1('second_fast', 200).then((r) => console.info(r));
|
||||||
|
// mermaid.test1('third_fast', 200).then((r) => console.info(r));
|
||||||
|
// mermaid.test1('forth_slow', 1200).then((r) => console.info(r));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -1,4 +1,5 @@
|
|||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
// TODO: this file should be testing the ./mermaid.core.mjs file, as that's the file listed in the package.json file that users will use
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
|
||||||
let code = `flowchart LR
|
let code = `flowchart LR
|
||||||
Power_Supply --> Transmitter_A
|
Power_Supply --> Transmitter_A
|
||||||
@@ -49,13 +50,9 @@ mermaid.initialize({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
mermaid.render(
|
void (async () => {
|
||||||
'the-id-of-the-svg',
|
const { svg } = await mermaid.render('the-id-of-the-svg', code);
|
||||||
code,
|
console.log(svg);
|
||||||
(svg) => {
|
const elem = document.querySelector('#graph-to-be');
|
||||||
console.log(svg);
|
elem.innerHTML = svg;
|
||||||
const elem = document.querySelector('#graph-to-be');
|
})();
|
||||||
elem.innerHTML = svg;
|
|
||||||
}
|
|
||||||
// ,document.querySelector('#tmp')
|
|
||||||
);
|
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background: rgb(221, 208, 208);
|
background: rgb(221, 208, 208);
|
||||||
/*background:#333;*/
|
|
||||||
font-family: 'Arial';
|
font-family: 'Arial';
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
@@ -46,13 +45,9 @@
|
|||||||
<pre class="mermaid" style="width: 100%; height: 20%">
|
<pre class="mermaid" style="width: 100%; height: 20%">
|
||||||
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class BankAccount{
|
classA <|-- classB : implements
|
||||||
+String owner
|
classC *-- classD : composition
|
||||||
+BigDecimal balance
|
classE o-- classF : aggregation
|
||||||
+deposit(amount) bool
|
|
||||||
+withdrawl(amount) int
|
|
||||||
}
|
|
||||||
cssClass "BankAccount" customCss
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 100%; height: 20%">
|
<pre class="mermaid2" style="width: 100%; height: 20%">
|
||||||
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
||||||
@@ -117,24 +112,16 @@
|
|||||||
callback Shape "callbackFunction" "This is a tooltip for a callback"
|
callback Shape "callbackFunction" "This is a tooltip for a callback"
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
// arrowMarkerAbsolute: true,
|
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'linear', htmlLabels: true },
|
flowchart: { curve: 'linear', htmlLabels: true },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
|
||||||
// fontFamily: '"arial", sans-serif',
|
|
||||||
// themeVariables: {
|
|
||||||
// fontFamily: '"arial", sans-serif',
|
|
||||||
// },
|
|
||||||
curve: 'linear',
|
curve: 'linear',
|
||||||
securityLevel: 'loose',
|
securityLevel: 'loose',
|
||||||
});
|
});
|
||||||
|
@@ -125,7 +125,6 @@
|
|||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
@@ -162,6 +161,9 @@
|
|||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -59,8 +59,8 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click';
|
div.className = 'created-by-click';
|
||||||
|
@@ -125,8 +125,8 @@
|
|||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click';
|
div.className = 'created-by-click';
|
||||||
|
@@ -61,8 +61,8 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click';
|
div.className = 'created-by-click';
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
end
|
end
|
||||||
A --> B
|
A --> B
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
|
@@ -107,8 +107,8 @@ Note over Alice,Bob: Looks
|
|||||||
Note over Bob,Alice: Looks back
|
Note over Bob,Alice: Looks back
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -1,32 +1,12 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<!-- <meta charset="iso-8859-15"/> -->
|
|
||||||
<script src="./viewer.js" type="module"></script>
|
<script src="./viewer.js" type="module"></script>
|
||||||
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
|
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
<style>
|
<style>
|
||||||
body {
|
|
||||||
/* font-family: 'Mansalva', cursive;*/
|
|
||||||
/* font-family: 'Mansalva', cursive; */
|
|
||||||
/* font-family: 'arial'; */
|
|
||||||
/* font-family: "trebuchet ms", verdana, arial; */
|
|
||||||
}
|
|
||||||
/* div {
|
|
||||||
font-family: 'arial';
|
|
||||||
} */
|
|
||||||
/* .mermaid-main-font {
|
|
||||||
font-family: "trebuchet ms", verdana, arial;
|
|
||||||
font-family: var(--mermaid-font-family);
|
|
||||||
} */
|
|
||||||
/* :root {
|
|
||||||
--mermaid-font-family: '"trebuchet ms", verdana, arial';
|
|
||||||
--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive;
|
|
||||||
--mermaid-font-family: '"Lucida Console", Monaco, monospace';
|
|
||||||
} */
|
|
||||||
svg {
|
svg {
|
||||||
border: 2px solid darkred;
|
border: 2px solid darkred;
|
||||||
}
|
}
|
||||||
@@ -36,21 +16,5 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body></body>
|
||||||
<!-- <script src="./mermaid.js"></script> -->
|
|
||||||
<script>
|
|
||||||
// Notice startOnLoad=false
|
|
||||||
// This prevents default handling in mermaid from render before the e2e logic is applied
|
|
||||||
// mermaid.initialize({
|
|
||||||
// startOnLoad: false,
|
|
||||||
// useMaxWidth: true,
|
|
||||||
// // "themeCSS": ":root { --mermaid-font-family: \"trebuchet ms\", verdana, arial;}",
|
|
||||||
// // fontFamily: '\"trebuchet ms\", verdana, arial;'
|
|
||||||
// // fontFamily: '"Comic Sans MS", "Comic Sans", cursive'
|
|
||||||
// // fontFamily: '"Mansalva", cursive',
|
|
||||||
// // fontFamily: '"Noto Sans SC", sans-serif'
|
|
||||||
// fontFamily: '"Noto Sans SC", sans-serif'
|
|
||||||
// });
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
@@ -2,34 +2,8 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>Should correctly load a third-party diagram using registerDiagram</h1>
|
<h1>Should correctly load a third-party diagram using registerDiagram</h1>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
mindmap
|
example-diagram
|
||||||
root
|
|
||||||
A
|
|
||||||
B
|
|
||||||
C
|
|
||||||
D
|
|
||||||
E
|
|
||||||
A2
|
|
||||||
B2
|
|
||||||
C2
|
|
||||||
D2
|
|
||||||
E2
|
|
||||||
child1((Circle))
|
|
||||||
grandchild 1
|
|
||||||
grandchild 2
|
|
||||||
child2(Round rectangle)
|
|
||||||
grandchild 3
|
|
||||||
grandchild 4
|
|
||||||
child3[Square]
|
|
||||||
grandchild 5
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
gc6((grand<br/>child 6))
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
gc7((grand<br/>grand<br/>child 8))
|
|
||||||
</pre>
|
</pre>
|
||||||
<!-- <pre id="diagram" class="mermaid2">
|
|
||||||
example-diagram
|
|
||||||
</pre> -->
|
|
||||||
|
|
||||||
<!-- <div id="cy"></div> -->
|
<!-- <div id="cy"></div> -->
|
||||||
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
||||||
@@ -37,13 +11,16 @@ mindmap
|
|||||||
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
||||||
<!-- <script type="module" src="./external-diagrams-mindmap.mjs" /> -->
|
<!-- <script type="module" src="./external-diagrams-mindmap.mjs" /> -->
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
import exampleDiagram from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
|
||||||
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
|
||||||
await mermaid.registerExternalDiagrams([mindmap]);
|
await mermaid.registerExternalDiagrams([exampleDiagram]);
|
||||||
await mermaid.initialize({ logLevel: 0 });
|
await mermaid.initialize({ logLevel: 0 });
|
||||||
await mermaid.initThrowsErrorsAsync();
|
await mermaid.run();
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -29,8 +29,8 @@
|
|||||||
click a_a "http://www.aftonbladet.se" "apa"
|
click a_a "http://www.aftonbladet.se" "apa"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
|
46
cypress/platform/flow2.html
Normal file
46
cypress/platform/flow2.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<pre class="mermaid">
|
||||||
|
graph TB
|
||||||
|
subgraph One
|
||||||
|
a1-->a2-->a3
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
graph TB
|
||||||
|
a_a --> b_b:::apa --> c_c:::apa
|
||||||
|
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
||||||
|
class a_a apa;
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
graph TB
|
||||||
|
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" "apa"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
|
logLevel: 3,
|
||||||
|
flowchart: { curve: 'linear' },
|
||||||
|
gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorMargin: 50 },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -8,19 +8,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<svg id="diagram"></svg>
|
<svg id="diagram"></svg>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
||||||
|
|
||||||
const graph = `
|
const graph = `
|
||||||
%%{ init: { "themeVariables" : { "textColor": "green;} #target { background-color: crimson }", "mainBkg": "#fff000" } } }%%
|
%%{ init: { "themeVariables" : { "textColor": "green;} #target { background-color: crimson }", "mainBkg": "#fff000" } } }%%
|
||||||
graph TD
|
graph TD
|
||||||
A[Goose]
|
A[Goose]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const diagram = document.getElementById('diagram');
|
const diagram = document.getElementById('diagram');
|
||||||
const svg = mermaid.render('diagram-svg', graph);
|
const { svg } = await mermaid.render('diagram-svg', graph);
|
||||||
diagram.innerHTML = svg;
|
diagram.innerHTML = svg;
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<svg id="diagram"></svg>
|
<svg id="diagram"></svg>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
||||||
|
|
||||||
const graph = `
|
const graph = `
|
||||||
@@ -19,8 +19,11 @@
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const diagram = document.getElementById('diagram');
|
const diagram = document.getElementById('diagram');
|
||||||
const svg = mermaid.render('diagram-svg', graph);
|
const { svg } = await mermaid.render('diagram-svg', graph);
|
||||||
diagram.innerHTML = svg;
|
diagram.innerHTML = svg;
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -91,10 +91,11 @@
|
|||||||
diagram += 'le> * { background : red}</style>test</p>"]';
|
diagram += 'le> * { background : red}</style>test</p>"]';
|
||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
document.querySelector('#res').innerHTML = svg;
|
||||||
document.querySelector('#res').innerHTML = res;
|
if (window.Cypress) {
|
||||||
});
|
window.rendered = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -43,8 +43,8 @@
|
|||||||
cssClass "BankAccount" customCss
|
cssClass "BankAccount" customCss
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -130,8 +130,8 @@
|
|||||||
commit
|
commit
|
||||||
merge main
|
merge main
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -98,8 +98,8 @@
|
|||||||
commit
|
commit
|
||||||
merge main
|
merge main
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -1,23 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>info below</h1>
|
|
||||||
<pre class="mermaid">
|
|
||||||
info
|
|
||||||
</pre>
|
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
|
||||||
mermaid.initialize({
|
|
||||||
theme: 'forest',
|
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
|
||||||
logLevel: 3,
|
|
||||||
flowchart: { curve: 'linear' },
|
|
||||||
gantt: { axisFormat: '%m/%d/%Y' },
|
|
||||||
sequence: { actorMargin: 50 },
|
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -87,8 +87,8 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click';
|
div.className = 'created-by-click';
|
||||||
|
@@ -42,368 +42,86 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid" style="width: 50%">
|
||||||
flowchart LR
|
%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
subgraph one
|
flowchart LR
|
||||||
direction LR
|
b("`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
A[myClass1] --> B[default]
|
Word!
|
||||||
subgraph two
|
|
||||||
direction BT
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words.`") --apa--> c
|
||||||
C[myClass2] --> D[default]
|
|
||||||
end
|
</pre
|
||||||
end
|
>
|
||||||
|
<pre class="mermaid" style="width: 50%">
|
||||||
|
classDiagram-v2
|
||||||
|
|
||||||
|
classA -- classB : Inheritance
|
||||||
|
classA -- classC : link
|
||||||
|
classC -- classD : link
|
||||||
|
classB -- classD
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid" style="width: 50%">
|
||||||
flowchart LR
|
sequenceDiagram
|
||||||
classDef aPID stroke:#4e4403,fill:#fdde29,color:#4e4403,rx:5px,ry:5px;
|
Alice->>Bob: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||||
classDef crm stroke:#333333,fill:#DCDCDC,color:#333333,rx:5px,ry:5px;
|
loop Loopy
|
||||||
classDef type stroke:#502604,fill:#FAB565,color:#502604,rx:20px,ry:20px;;
|
Bob->>Alice: Pasten
|
||||||
|
end
|
||||||
O0("Joe")
|
|
||||||
class O0 aPID;
|
|
||||||
|
|
||||||
O1("Person")
|
|
||||||
class O1 crm;
|
|
||||||
O0 -- has type -->O1["Person"]
|
|
||||||
|
|
||||||
O2("aat:300411314")
|
|
||||||
class O2 type;
|
|
||||||
click O2 function "Sorry the newline html tags are not being processed correctly<br/> So all of this appears on the <br/> same line."
|
|
||||||
O0 -- has type -->O2["Bug"]
|
|
||||||
click O0 function "Lots of great info about Joe<br>Lots of great info about Joe<br>burt<br>fred";
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid" style="width: 50%">
|
||||||
flowchart TD
|
%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
subgraph test
|
flowchart LR
|
||||||
direction TB
|
b("`The dog in **the** hog.(1)
|
||||||
subgraph test2
|
NL`") --"`1o **bold**`"--> c[new strings svg labels]
|
||||||
direction LR
|
|
||||||
F --> D
|
|
||||||
end
|
|
||||||
subgraph test3
|
|
||||||
direction TB
|
|
||||||
G --> H
|
|
||||||
end
|
|
||||||
end
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid" style="width: 50%">
|
||||||
flowchart TD
|
%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
release-branch[Create Release Branch]:::relClass
|
b("`The dog in **the** hog.(1)
|
||||||
develop-branch[Update Develop Branch]:::relClass
|
NL`") --"`1o **bold**`"--> c[new strings html labels]
|
||||||
github-release-draft[GitHub Release Draft]:::relClass
|
|
||||||
trigger-pipeline[Trigger Jenkins pipeline]:::fixClass
|
|
||||||
github-release[GitHub Release]:::postClass
|
|
||||||
|
|
||||||
build-ready --> release-branch
|
|
||||||
build-ready --> develop-branch
|
|
||||||
release-branch --> jenkins-release-build
|
|
||||||
jenkins-release-build --> github-release-draft
|
|
||||||
jenkins-release-build --> install-release
|
|
||||||
install-release --> verify-release
|
|
||||||
jenkins-release-build --> announce
|
|
||||||
github-release-draft --> github-release
|
|
||||||
verify-release --> verify-check
|
|
||||||
verify-check -- Yes --> github-release
|
|
||||||
verify-check -- No --> release-fix
|
|
||||||
release-fix --> release-branch-pr
|
|
||||||
verify-check -- No --> delete-artifacts
|
|
||||||
release-branch-pr --> trigger-pipeline
|
|
||||||
delete-artifacts --> trigger-pipeline
|
|
||||||
trigger-pipeline --> jenkins-release-build
|
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid" style="width: 50%">
|
||||||
flowchart LR
|
%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
a["<strong>Haiya</strong>"]===>b
|
flowchart LR
|
||||||
|
b("The dog in the hog.(1)\nNL") --"1o bold"--> c[old strings svg labels]
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<script type="module">
|
||||||
flowchart TD
|
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
A --> B
|
// import example from '../../packages/mermaid-example-diagram/src/mermaid-example-diagram.core.mjs';
|
||||||
A --> C
|
import mermaid from './mermaid.esm.mjs';
|
||||||
B --> C
|
// await mermaid.registerExternalDiagrams([example]);
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 50%">
|
|
||||||
flowchart TD
|
|
||||||
A([stadium shape test])
|
|
||||||
A -->|Get money| B([Go shopping])
|
|
||||||
B --> C([Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?])
|
|
||||||
C -->|One| D([Laptop])
|
|
||||||
C -->|Two| E([iPhone])
|
|
||||||
C -->|Three| F([Car<br/>wroom wroom])
|
|
||||||
click A "index.html#link-clicked" "link test"
|
|
||||||
click B testClick "click test"
|
|
||||||
classDef someclass fill:#f96;
|
|
||||||
class A someclass;
|
|
||||||
class C someclass;
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 50%">
|
|
||||||
sequenceDiagram
|
|
||||||
title: My Sequence Diagram Title
|
|
||||||
accTitle: My Acc Sequence Diagram
|
|
||||||
accDescr: My Sequence Diagram Description
|
|
||||||
|
|
||||||
Alice->>John: Hello John, how are you?
|
|
||||||
John-->>Alice: Great!
|
|
||||||
Alice-)John: See you later!
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 50%">
|
|
||||||
graph TD
|
|
||||||
A -->|000| B
|
|
||||||
B -->|111| C
|
|
||||||
|
|
||||||
linkStyle 1 stroke:#ff3,stroke-width:4px,color:red;
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
journey
|
|
||||||
accTitle: My User Journey Diagram
|
|
||||||
accDescr: My User Journey Diagram Description
|
|
||||||
|
|
||||||
title My working day
|
|
||||||
section Go to work
|
|
||||||
Make tea: 5: Me
|
|
||||||
Go upstairs: 3: Me
|
|
||||||
Do work: 1: Me, Cat
|
|
||||||
section Go home
|
|
||||||
Go downstairs: 5: Me
|
|
||||||
Sit down: 5: Me
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
info
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
requirementDiagram
|
|
||||||
accTitle: My req Diagram
|
|
||||||
accDescr: My req Diagram Description
|
|
||||||
|
|
||||||
requirement test_req {
|
|
||||||
id: 1
|
|
||||||
text: the test text.
|
|
||||||
risk: high
|
|
||||||
verifymethod: test
|
|
||||||
}
|
|
||||||
|
|
||||||
functionalRequirement test_req2 {
|
|
||||||
id: 1.1
|
|
||||||
text: the second test text.
|
|
||||||
risk: low
|
|
||||||
verifymethod: inspection
|
|
||||||
}
|
|
||||||
|
|
||||||
performanceRequirement test_req3 {
|
|
||||||
id: 1.2
|
|
||||||
text: the third test text.
|
|
||||||
risk: medium
|
|
||||||
verifymethod: demonstration
|
|
||||||
}
|
|
||||||
|
|
||||||
element test_entity {
|
|
||||||
type: simulation
|
|
||||||
}
|
|
||||||
|
|
||||||
element test_entity2 {
|
|
||||||
type: word doc
|
|
||||||
docRef: reqs/test_entity
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
test_entity - satisfies -> test_req2
|
|
||||||
test_req - traces -> test_req2
|
|
||||||
test_req - contains -> test_req3
|
|
||||||
test_req <- copies - test_entity2
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
gantt
|
|
||||||
dateFormat YYYY-MM-DD
|
|
||||||
title Adding GANTT diagram functionality to mermaid
|
|
||||||
excludes weekends
|
|
||||||
%% (`excludes` accepts specific dates in YYYY-MM-DD format, days of the week ("sunday") or "weekends", but not the word "weekdays".)
|
|
||||||
|
|
||||||
section A section
|
|
||||||
Completed task :done, des1, 2014-01-06,2014-01-08
|
|
||||||
Active task :active, des2, 2014-01-09, 3d
|
|
||||||
Future task : des3, after des2, 5d
|
|
||||||
Future task2 : des4, after des3, 5d
|
|
||||||
|
|
||||||
section Critical tasks
|
|
||||||
Completed task in the critical line :crit, done, 2014-01-06,24h
|
|
||||||
Implement parser and jison :crit, done, after des1, 2d
|
|
||||||
Create tests for parser :crit, active, 3d
|
|
||||||
Future task in critical line :crit, 5d
|
|
||||||
Create tests for renderer :2d
|
|
||||||
Add to mermaid :1d
|
|
||||||
Functionality added :milestone, 2014-01-25, 0d
|
|
||||||
|
|
||||||
section Documentation
|
|
||||||
Describe gantt syntax :active, a1, after des1, 3d
|
|
||||||
Add gantt diagram to demo page :after a1 , 20h
|
|
||||||
Add another diagram to demo page :doc1, after a1 , 48h
|
|
||||||
|
|
||||||
section Last section
|
|
||||||
Describe gantt syntax :after doc1, 3d
|
|
||||||
Add gantt diagram to demo page :20h
|
|
||||||
Add another diagram to demo page :48h
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
stateDiagram
|
|
||||||
state Active {
|
|
||||||
Idle
|
|
||||||
}
|
|
||||||
Inactive --> Idle: ACT
|
|
||||||
Active --> Active: LOG
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
flowchart TB
|
|
||||||
accTitle: My flowchart
|
|
||||||
accDescr: My flowchart Description
|
|
||||||
subgraph One
|
|
||||||
a1-->a2-->a3
|
|
||||||
end
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
sequenceDiagram
|
|
||||||
A ->> B: 1
|
|
||||||
rect rgb(204, 0, 102)
|
|
||||||
break yes
|
|
||||||
rect rgb(0, 204, 204)
|
|
||||||
C ->> C: 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
B ->> A: Return
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
classDiagram
|
|
||||||
accTitle: My class diagram
|
|
||||||
accDescr: My class diagram Description
|
|
||||||
Class01 <|-- AveryLongClass : Cool
|
|
||||||
Class09 --> C2 : Where am i?
|
|
||||||
Class09 --* C3
|
|
||||||
Class09 --|> Class07
|
|
||||||
Class07 : equals()
|
|
||||||
Class07 : Object[] elementData
|
|
||||||
Class01 : size()
|
|
||||||
Class01 : int chimp
|
|
||||||
Class01 : int gorilla
|
|
||||||
class Class10 {
|
|
||||||
int id
|
|
||||||
size()
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
%%{init: {'config': {'wrap': true }}}%%
|
|
||||||
sequenceDiagram
|
|
||||||
participant A as Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
|
||||||
A->>Bob: Hola
|
|
||||||
Bob-->A: Pasten !
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
gitGraph
|
|
||||||
commit id: "ZERO"
|
|
||||||
branch develop
|
|
||||||
commit id:"A"
|
|
||||||
checkout main
|
|
||||||
commit id:"ONE"
|
|
||||||
checkout develop
|
|
||||||
commit id:"B"
|
|
||||||
branch featureA
|
|
||||||
commit id:"FIX"
|
|
||||||
commit id: "FIX-2"
|
|
||||||
checkout main
|
|
||||||
commit id:"TWO"
|
|
||||||
cherry-pick id:"A"
|
|
||||||
commit id:"THREE"
|
|
||||||
cherry-pick id:"FIX"
|
|
||||||
checkout develop
|
|
||||||
commit id:"C"
|
|
||||||
merge featureA
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
flowchart TD
|
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
|
||||||
B --> C{Let me think}
|
|
||||||
C -->|One| D[Laptop]
|
|
||||||
C -->|Two| E[iPhone]
|
|
||||||
C -->|Three| F[fa:fa-car Car]
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
classDiagram
|
|
||||||
Animal "1" <|-- Duck
|
|
||||||
Animal <|-- Fish
|
|
||||||
Animal <--o Zebra
|
|
||||||
Animal : +int age
|
|
||||||
Animal : +String gender
|
|
||||||
Animal: +isMammal()
|
|
||||||
Animal: +mate()
|
|
||||||
class Duck{
|
|
||||||
+String beakColor
|
|
||||||
+swim()
|
|
||||||
+quack()
|
|
||||||
}
|
|
||||||
class Fish{
|
|
||||||
-int sizeInFeet
|
|
||||||
-canEat()
|
|
||||||
}
|
|
||||||
class Zebra{
|
|
||||||
+bool is_wild
|
|
||||||
+run()
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 100%">
|
|
||||||
erDiagram
|
|
||||||
CAR ||--o{ NAMED-DRIVER : allows
|
|
||||||
CAR {
|
|
||||||
string registrationNumber
|
|
||||||
string make
|
|
||||||
string model
|
|
||||||
}
|
|
||||||
PERSON ||--o{ NAMED-DRIVER : is
|
|
||||||
PERSON {
|
|
||||||
string firstName
|
|
||||||
string lastName
|
|
||||||
int age
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<!-- <script src="./mermaid.js"></script> -->
|
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
maxTextSize: 900000,
|
// theme: 'forest',
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
securityLevel: 'loose',
|
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
fontFamily: 'courier',
|
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// curve: 'curveLinear',
|
// defaultRenderer: 'elk',
|
||||||
useMaxWidth: true,
|
useMaxWidth: false,
|
||||||
htmlLabels: false,
|
// htmlLabels: false,
|
||||||
fontFamily: 'courier',
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
lazyLoadedDiagrams: ['./mermaid-mindmap-detector.js'],
|
// htmlLabels: false,
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
sequence: {
|
||||||
|
wrap: true,
|
||||||
|
},
|
||||||
|
useMaxWidth: false,
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickByFlow(elemName) {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.className = 'created-by-click';
|
|
||||||
div.style = 'padding: 20px; background: green; color: white;';
|
|
||||||
div.innerText = 'Clicked By Flow';
|
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
|
||||||
}
|
|
||||||
|
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
console.error('In parse error:');
|
console.error('In parse error:');
|
||||||
console.error(err);
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -29,9 +29,9 @@
|
|||||||
}
|
}
|
||||||
.mermaid svg {
|
.mermaid svg {
|
||||||
/* font-size: 18px !important; */
|
/* font-size: 18px !important; */
|
||||||
background-color: #eee;
|
background-color: #efefef;
|
||||||
background-image: radial-gradient(#fff 1%, transparent 11%),
|
background-image: radial-gradient(#fff 51%, transparent 91%),
|
||||||
radial-gradient(#fff 1%, transparent 11%);
|
radial-gradient(#fff 51%, transparent 91%);
|
||||||
background-size: 20px 20px;
|
background-size: 20px 20px;
|
||||||
background-position: 0 0, 10px 10px;
|
background-position: 0 0, 10px 10px;
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
@@ -51,16 +51,101 @@
|
|||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 72px;
|
font-size: 72px;
|
||||||
}
|
}
|
||||||
|
/* tspan {
|
||||||
|
font-size: 6px !important;
|
||||||
|
} */
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
stateDiagram-v2
|
||||||
graph TB
|
[*] --> Still
|
||||||
a --> b
|
Still --> [*]
|
||||||
a --> c
|
Still --> Moving
|
||||||
b --> d
|
Moving --> Still
|
||||||
c --> d
|
Moving --> Crash
|
||||||
|
Crash --> [*] </pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart RL
|
||||||
|
subgraph "`one`"
|
||||||
|
a1 -- l1 --> a2
|
||||||
|
a1 -- l2 --> a2
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
flowchart RL
|
||||||
|
subgraph "`one`"
|
||||||
|
a1 -- l1 --> a2
|
||||||
|
a1 -- l2 --> a2
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart
|
||||||
|
id["`A root with a long text that wraps to keep the node size in check. A root with a long text that wraps to keep the node size in check`"]</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart LR
|
||||||
|
A[A text that needs to be wrapped wraps to another line]
|
||||||
|
B[A text that needs to be<br/>wrapped wraps to another line]
|
||||||
|
C["`A text that needs to be wrapped to another line`"]</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart LR
|
||||||
|
C["`A text
|
||||||
|
that needs
|
||||||
|
to be wrapped
|
||||||
|
in another
|
||||||
|
way`"]
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
classDiagram-v2
|
||||||
|
note "I love this diagram!\nDo you love it?"
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
stateDiagram-v2
|
||||||
|
State1: The state with a note with minus - and plus + in it
|
||||||
|
note left of State1
|
||||||
|
Important information! You can write
|
||||||
|
notes with . and in them.
|
||||||
|
end note </pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
root
|
||||||
|
Child3(A node with an icon and with a long text that wraps to keep the node size in check)
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: {"theme": "forest"} }%%
|
||||||
|
mindmap
|
||||||
|
id1[**Start2**<br/>end]
|
||||||
|
id2[**Start2**<br />end]
|
||||||
|
%% Another comment
|
||||||
|
id3[**Start2**<br>end] %% Comment
|
||||||
|
id4[**Start2**<br >end<br >the very end]
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
id1["`**Start2**
|
||||||
|
second line 😎 with long text that is wrapping to the next line`"]
|
||||||
|
id2["`Child **with bold** text`"]
|
||||||
|
id3["`Children of which some
|
||||||
|
is using *italic type of* text`"]
|
||||||
|
id4[Child]
|
||||||
|
id5["`Child
|
||||||
|
Row
|
||||||
|
and another
|
||||||
|
`"]
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
id1("`**Root**`"]
|
||||||
|
id2["`A formatted text... with **bold** and *italics*`"]
|
||||||
|
id3[Regular labels works as usual]
|
||||||
|
id4["`Emojis and unicode works too: 🤓
|
||||||
|
शान्तिः سلام 和平 `"]
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
||||||
@@ -78,7 +163,7 @@ flowchart TB
|
|||||||
rom --> core2
|
rom --> core2
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph amd[AMD Latte GPU]
|
subgraph amd["`**AMD** Latte GPU`"]
|
||||||
mem[Memory & I/O Bridge]
|
mem[Memory & I/O Bridge]
|
||||||
dram[DRAM Controller]
|
dram[DRAM Controller]
|
||||||
edram[32 MB EDRAM MEM1]
|
edram[32 MB EDRAM MEM1]
|
||||||
@@ -117,8 +202,64 @@ flowchart TB
|
|||||||
rtc{{rtc}}
|
rtc{{rtc}}
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: {"flowchart": {"defaultRenderer": "elk", "htmlLabels": false}} }%%
|
||||||
|
flowchart TB
|
||||||
|
%% I could not figure out how to use double quotes in labels in Mermaid
|
||||||
|
subgraph ibm[IBM Espresso CPU]
|
||||||
|
core0[IBM PowerPC Broadway Core 0]
|
||||||
|
core1[IBM PowerPC Broadway Core 1]
|
||||||
|
core2[IBM PowerPC Broadway Core 2]
|
||||||
|
|
||||||
|
rom[16 KB ROM]
|
||||||
|
|
||||||
|
core0 --- core2
|
||||||
|
|
||||||
|
rom --> core2
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph amd["`**AMD** Latte GPU`"]
|
||||||
|
mem[Memory & I/O Bridge]
|
||||||
|
dram[DRAM Controller]
|
||||||
|
edram[32 MB EDRAM MEM1]
|
||||||
|
rom[512 B SEEPROM]
|
||||||
|
|
||||||
|
sata[SATA IF]
|
||||||
|
exi[EXI]
|
||||||
|
|
||||||
|
subgraph gx[GX]
|
||||||
|
sram[3 MB 1T-SRAM]
|
||||||
|
end
|
||||||
|
|
||||||
|
radeon[AMD Radeon R7xx GX2]
|
||||||
|
|
||||||
|
mem --- gx
|
||||||
|
mem --- radeon
|
||||||
|
|
||||||
|
rom --- mem
|
||||||
|
|
||||||
|
mem --- sata
|
||||||
|
mem --- exi
|
||||||
|
|
||||||
|
dram --- sata
|
||||||
|
dram --- exi
|
||||||
|
end
|
||||||
|
|
||||||
|
ddr3[2 GB DDR3 RAM MEM2]
|
||||||
|
|
||||||
|
mem --- ddr3
|
||||||
|
dram --- ddr3
|
||||||
|
edram --- ddr3
|
||||||
|
|
||||||
|
core1 --- mem
|
||||||
|
|
||||||
|
exi --- rtc
|
||||||
|
rtc{{rtc}}
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid2">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
%% I could not figure out how to use double quotes in labels in Mermaid
|
%% I could not figure out how to use double quotes in labels in Mermaid
|
||||||
subgraph ibm[IBM Espresso CPU]
|
subgraph ibm[IBM Espresso CPU]
|
||||||
@@ -221,13 +362,27 @@ sequenceDiagram
|
|||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
gantt
|
mindmap
|
||||||
title Style today marker (vertical line should be 5px wide and half-transparent blue)
|
root((mindmap))
|
||||||
dateFormat YYYY-MM-DD
|
Origins
|
||||||
axisFormat %d
|
Long history
|
||||||
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
::icon(fa fa-book)
|
||||||
section Section1
|
Popularisation
|
||||||
Today: 1, -1h
|
British popular psychology author Tony Buzan
|
||||||
|
Research
|
||||||
|
On effectiveness<br/>and features
|
||||||
|
On Automatic creation
|
||||||
|
Uses
|
||||||
|
Creative techniques
|
||||||
|
Strategic planning
|
||||||
|
Argument mapping
|
||||||
|
Tools
|
||||||
|
Pen and paper
|
||||||
|
Mermaid
|
||||||
|
</pre>
|
||||||
|
<br />
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
example-diagram
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<!-- <div id="cy"></div> -->
|
<!-- <div id="cy"></div> -->
|
||||||
@@ -237,11 +392,10 @@ sequenceDiagram
|
|||||||
<!-- <script src="./mermaid.js"></script> -->
|
<!-- <script src="./mermaid.js"></script> -->
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
import flowV3 from '../../packages/mermaid-flowchart-v3/src/detector';
|
// import example from '../../packages/mermaid-example-diagram/src/mermaid-example-diagram.core.mjs';
|
||||||
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
// await mermaid.registerExternalDiagrams([example]);
|
||||||
await mermaid.registerExternalDiagrams([mindmap, flowV3]);
|
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -252,8 +406,10 @@ sequenceDiagram
|
|||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'elk',
|
// defaultRenderer: 'elk',
|
||||||
useMaxWidth: false,
|
useMaxWidth: false,
|
||||||
|
// htmlLabels: false,
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
|
// htmlLabels: false,
|
||||||
gantt: {
|
gantt: {
|
||||||
useMaxWidth: false,
|
useMaxWidth: false,
|
||||||
},
|
},
|
||||||
|
@@ -1,81 +1,93 @@
|
|||||||
<html>
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
<meta charset="utf-8" />
|
||||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<link
|
<title>Mindmap Mermaid Quick Test Page</title>
|
||||||
rel="stylesheet"
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||||
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"
|
|
||||||
/>
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
div.mermaid {
|
||||||
/* background: rgb(221, 208, 208); */
|
/* font-family: 'trebuchet ms', verdana, arial; */
|
||||||
/* background:#333; */
|
font-family: 'Courier New', Courier, monospace !important;
|
||||||
font-family: 'Arial';
|
|
||||||
/* font-size: 18px !important; */
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
color: grey;
|
|
||||||
}
|
|
||||||
.mermaid2 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.mermaid svg {
|
|
||||||
/* font-size: 18px !important; */
|
|
||||||
background-color: #eee;
|
|
||||||
background-image: radial-gradient(#fff 1%, transparent 11%),
|
|
||||||
radial-gradient(#fff 1%, transparent 11%);
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div>Security check</div>
|
<h1>Mindmap diagram demo</h1>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
mindmap
|
||||||
A["test"] --"<p><style> * { display : none}</style>test</p>"--> B
|
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>
|
</pre>
|
||||||
|
|
||||||
<!-- <div id="cy"></div> -->
|
<h2>Mindmap with root wrapping text and a shape</h2>
|
||||||
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
<pre class="mermaid">
|
||||||
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
mindmap
|
||||||
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
root[A root with a long text that wraps to keep the node size in check]
|
||||||
<!-- <script src="./mermaid.js"></script> -->
|
</pre>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
// import mermaid from './mermaid.esm.mjs';
|
||||||
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
import mermaid from '../../packages/mermaid/dist/mermaid.esm.mjs';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
// import mermaidMindmap from './mermaid-mindmap.esm.mjs';
|
||||||
await mermaid.registerExternalDiagrams([mindmap]);
|
|
||||||
|
// import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';
|
||||||
|
// await mermaid.registerExternalDiagrams([mermaidMindmap]);
|
||||||
|
|
||||||
|
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.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'default',
|
theme: 'base',
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: {
|
flowchart: {
|
||||||
@@ -94,10 +106,6 @@
|
|||||||
console.error('In parse error:');
|
console.error('In parse error:');
|
||||||
console.error(err);
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -59,7 +59,7 @@ A-->B
|
|||||||
>
|
>
|
||||||
<script src="./packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script>
|
<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-mindmap/dist/mermaid-example-diagram-detector.js"></script>
|
||||||
<script src="./packages/mermaid/dist/mermaid.js"></script>
|
<script src="./packages/mermaid/dist/mermaid.esm.mjs"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
<script src="http://localhost:9000/mermaid.js"></script>
|
|
||||||
<script>
|
|
||||||
mermaid.initialize({
|
|
||||||
theme: 'base',
|
|
||||||
themeVariables: {},
|
|
||||||
startOnLoad: true,
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Example</h1>
|
<h1>Example</h1>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
@@ -26,4 +16,12 @@ sequenceDiagram
|
|||||||
Note left of Ernie: Cookies are good
|
Note left of Ernie: Cookies are good
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from '/mermaid.esm.mjs';
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'base',
|
||||||
|
themeVariables: {},
|
||||||
|
startOnLoad: true,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -9,19 +9,19 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="graph"></div>
|
<div id="graph"></div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.init({ startOnLoad: false });
|
await mermaid.initialize({ startOnLoad: false });
|
||||||
|
await mermaid.run();
|
||||||
|
|
||||||
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
await mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
||||||
try {
|
try {
|
||||||
console.log('rendering');
|
console.log('rendering');
|
||||||
mermaid.mermaidAPI.render('graphDiv', `>`);
|
await mermaid.mermaidAPI.render('graphDiv', `>`);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => {
|
const { svg } = await mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`);
|
||||||
document.getElementById('graph').innerHTML = html;
|
document.getElementById('graph').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -9,20 +9,20 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="graph"></div>
|
<div id="graph"></div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.init({ startOnLoad: false });
|
mermaid.initialize({ startOnLoad: false });
|
||||||
mermaid.mermaidAPI.initialize();
|
mermaid.mermaidAPI.initialize();
|
||||||
|
|
||||||
rerender('XMas');
|
async function rerender(text) {
|
||||||
|
|
||||||
function rerender(text) {
|
|
||||||
const graphText = `graph TD
|
const graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`;
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
const graph = mermaid.mermaidAPI.render('id', graphText);
|
const { svg } = await mermaid.mermaidAPI.render('id', graphText);
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', svg);
|
||||||
document.getElementById('graph').innerHTML = graph;
|
document.getElementById('graph').innerHTML = svg;
|
||||||
}
|
}
|
||||||
|
window.rerender = rerender;
|
||||||
|
await rerender('XMas');
|
||||||
</script>
|
</script>
|
||||||
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -313,8 +313,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -308,8 +308,8 @@ gitGraph
|
|||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -308,8 +308,8 @@ gitGraph
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -301,8 +301,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -305,8 +305,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -305,8 +305,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -1,14 +1,50 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<pre class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
none
|
graph TB
|
||||||
hello world
|
a --> b
|
||||||
|
a --> c
|
||||||
|
b --> d
|
||||||
|
c --> d
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
<div id="d2"></div>
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from '/mermaid.esm.mjs';
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
logLevel: 1,
|
// theme: 'forest',
|
||||||
|
startOnLoad: true,
|
||||||
|
logLevel: 0,
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'elk',
|
||||||
|
useMaxWidth: false,
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
useMaxWidth: false,
|
||||||
});
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
const value = `graph TD\nHello --> World`;
|
||||||
|
const el = document.getElementById('d2');
|
||||||
|
const { svg } = await mermaid.render('d22', value);
|
||||||
|
console.log(svg);
|
||||||
|
el.innerHTML = svg;
|
||||||
|
// 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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -34,8 +34,8 @@
|
|||||||
9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
|
9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
|
||||||
style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
|
style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
|
@@ -120,8 +120,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -25,8 +25,8 @@
|
|||||||
Get into car:4: Dad, Mum, Child 1, Child 2
|
Get into car:4: Dad, Mum, Child 1, Child 2
|
||||||
Drive home:3: Dad
|
Drive home:3: Dad
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
logLevel: 3,
|
logLevel: 3,
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
A --> B --> C
|
A --> B --> C
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,18 @@
|
|||||||
import mermaid2 from '../../packages/mermaid/src/mermaid';
|
import mermaid2 from './mermaid.esm.mjs';
|
||||||
import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
import externalExample from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
|
||||||
|
import zenUml from '../../packages/mermaid-zenuml/dist/mermaid-zenuml.core.mjs';
|
||||||
|
|
||||||
function b64ToUtf8(str) {
|
function b64ToUtf8(str) {
|
||||||
return decodeURIComponent(escape(window.atob(str)));
|
return decodeURIComponent(escape(window.atob(str)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adds a rendered flag to window when rendering is done, so cypress can wait for it.
|
||||||
|
function markRendered() {
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
* ##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
||||||
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
|
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
|
||||||
@@ -37,9 +45,9 @@ const contentLoaded = async function () {
|
|||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
await mermaid2.registerExternalDiagrams([mindmap]);
|
await mermaid2.registerExternalDiagrams([externalExample, zenUml]);
|
||||||
mermaid2.initialize(graphObj.mermaid);
|
mermaid2.initialize(graphObj.mermaid);
|
||||||
mermaid2.init();
|
await mermaid2.run();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -67,7 +75,7 @@ function merge(current, update) {
|
|||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
const contentLoadedApi = function () {
|
const contentLoadedApi = async function () {
|
||||||
let pos = document.location.href.indexOf('?graph=');
|
let pos = document.location.href.indexOf('?graph=');
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
pos = pos + 7;
|
pos = pos + 7;
|
||||||
@@ -94,38 +102,25 @@ const contentLoadedApi = function () {
|
|||||||
mermaid2.initialize(cnf);
|
mermaid2.initialize(cnf);
|
||||||
|
|
||||||
for (let i = 0; i < numCodes; i++) {
|
for (let i = 0; i < numCodes; i++) {
|
||||||
mermaid2.render(
|
const { svg, bindFunctions } = await mermaid2.render(
|
||||||
'newid' + i,
|
'newid' + i,
|
||||||
graphObj.code[i],
|
graphObj.code[i],
|
||||||
(svgCode, bindFunctions) => {
|
|
||||||
div.innerHTML = svgCode;
|
|
||||||
|
|
||||||
bindFunctions(div);
|
|
||||||
},
|
|
||||||
divs[i]
|
divs[i]
|
||||||
);
|
);
|
||||||
|
div.innerHTML = svg;
|
||||||
|
bindFunctions(div);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.id = 'block';
|
div.id = 'block';
|
||||||
div.className = 'mermaid';
|
div.className = 'mermaid';
|
||||||
// div.innerHTML = graphObj.code
|
|
||||||
console.warn('graphObj.mermaid', graphObj.mermaid);
|
console.warn('graphObj.mermaid', graphObj.mermaid);
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
mermaid2.initialize(graphObj.mermaid);
|
mermaid2.initialize(graphObj.mermaid);
|
||||||
|
|
||||||
mermaid2.render(
|
const { svg, bindFunctions } = await mermaid2.render('newid', graphObj.code, div);
|
||||||
'newid',
|
div.innerHTML = svg;
|
||||||
graphObj.code,
|
bindFunctions(div);
|
||||||
(svgCode, bindFunctions) => {
|
|
||||||
div.innerHTML = svgCode;
|
|
||||||
|
|
||||||
if (bindFunctions) {
|
|
||||||
bindFunctions(div);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
div
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -139,10 +134,10 @@ if (typeof document !== 'undefined') {
|
|||||||
function () {
|
function () {
|
||||||
if (this.location.href.match('xss.html')) {
|
if (this.location.href.match('xss.html')) {
|
||||||
this.console.log('Using api');
|
this.console.log('Using api');
|
||||||
contentLoadedApi();
|
void contentLoadedApi().finally(markRendered);
|
||||||
} else {
|
} else {
|
||||||
this.console.log('Not using api');
|
this.console.log('Not using api');
|
||||||
contentLoaded();
|
void contentLoaded().finally(markRendered);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
|
@@ -33,8 +33,8 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user