mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 12:54:08 +01:00 
			
		
		
		
	Compare commits
	
		
			538 Commits
		
	
	
		
			3881_subgr
			...
			sidv/prPro
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9491e7035e | ||
| 
						 | 
					0409c5ac27 | ||
| 
						 | 
					19e5ccfdda | ||
| 
						 | 
					870550bd7e | ||
| 
						 | 
					7372d7d6c5 | ||
| 
						 | 
					378e6b59e6 | ||
| 
						 | 
					8910ecb463 | ||
| 
						 | 
					ca97210d67 | ||
| 
						 | 
					f8abc9c6d5 | ||
| 
						 | 
					ef20e0b77a | ||
| 
						 | 
					f3b313ec1d | ||
| 
						 | 
					8f830a1698 | ||
| 
						 | 
					6a6b200a04 | ||
| 
						 | 
					15231924cd | ||
| 
						 | 
					7d4692f7b2 | ||
| 
						 | 
					fd6ce89933 | ||
| 
						 | 
					0df8c149f9 | ||
| 
						 | 
					bdf2667389 | ||
| 
						 | 
					b868777184 | ||
| 
						 | 
					fe2ef5e0c6 | ||
| 
						 | 
					ac21fe2d5c | ||
| 
						 | 
					6b251de227 | ||
| 
						 | 
					bb56492afe | ||
| 
						 | 
					2a9e846a49 | ||
| 
						 | 
					3b25cd3238 | ||
| 
						 | 
					4bc997cb8f | ||
| 
						 | 
					555d4f2cdc | ||
| 
						 | 
					75633ba125 | ||
| 
						 | 
					ec5fa31a11 | ||
| 
						 | 
					bfb8a75fca | ||
| 
						 | 
					14c15b221a | ||
| 
						 | 
					8743e9e30e | ||
| 
						 | 
					22b18a4320 | ||
| 
						 | 
					786023ffa6 | ||
| 
						 | 
					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 | ||
| 
						 | 
					6aa3ea43ae | ||
| 
						 | 
					735aceb37a | ||
| 
						 | 
					d2927435ab | ||
| 
						 | 
					eaa84d2d91 | ||
| 
						 | 
					941b959da3 | ||
| 
						 | 
					ae36586b58 | ||
| 
						 | 
					d22e8d92c6 | ||
| 
						 | 
					45adc5fb6b | ||
| 
						 | 
					c1aad5975c | ||
| 
						 | 
					0c18c0309b | ||
| 
						 | 
					631ff8fb9e | ||
| 
						 | 
					31629fe93f | ||
| 
						 | 
					735faa83e9 | ||
| 
						 | 
					2c062d648a | ||
| 
						 | 
					ea8128e881 | ||
| 
						 | 
					bd98f1477f | ||
| 
						 | 
					0f36bbf3e1 | ||
| 
						 | 
					3c4a6a19bb | ||
| 
						 | 
					e31924eadc | ||
| 
						 | 
					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 | ||
| 
						 | 
					9d75665460 | ||
| 
						 | 
					6fcba87ee8 | ||
| 
						 | 
					a956be7bbf | ||
| 
						 | 
					e0286be8d2 | ||
| 
						 | 
					3e9978a58c | ||
| 
						 | 
					fd8fb96ec2 | ||
| 
						 | 
					ad6a43cf81 | ||
| 
						 | 
					f6d9868e35 | ||
| 
						 | 
					94d4ee3a2c | ||
| 
						 | 
					004432fae9 | ||
| 
						 | 
					08ac41113f | ||
| 
						 | 
					e9d2d084fd | ||
| 
						 | 
					34c98717d5 | ||
| 
						 | 
					f22ce38ada | ||
| 
						 | 
					8ba33a994c | ||
| 
						 | 
					07764348eb | ||
| 
						 | 
					803c8ca45b | ||
| 
						 | 
					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 | ||
| 
						 | 
					01a535b8e0 | ||
| 
						 | 
					3c12e66f73 | ||
| 
						 | 
					fba3f8481e | ||
| 
						 | 
					f0e3bcc37b | ||
| 
						 | 
					ae7c9475ef | ||
| 
						 | 
					d320e788c7 | ||
| 
						 | 
					376d1a583c | ||
| 
						 | 
					ea3d7bc594 | ||
| 
						 | 
					ded83b2ce7 | ||
| 
						 | 
					1c8c69f8db | ||
| 
						 | 
					4d3f151cf0 | ||
| 
						 | 
					8f8ae64ced | ||
| 
						 | 
					b93ce24c3d | ||
| 
						 | 
					0a4a3bda16 | ||
| 
						 | 
					874f4c0641 | ||
| 
						 | 
					60175cd84f | ||
| 
						 | 
					ac6d325a00 | ||
| 
						 | 
					e44e1210e2 | ||
| 
						 | 
					05d1fc44e8 | ||
| 
						 | 
					075f55418b | ||
| 
						 | 
					164b9bc2cb | ||
| 
						 | 
					16540f3005 | ||
| 
						 | 
					6c862565aa | ||
| 
						 | 
					ee056e1ac3 | ||
| 
						 | 
					0476bdc68f | ||
| 
						 | 
					242a508d50 | ||
| 
						 | 
					9ca2e0c5fc | ||
| 
						 | 
					9acd562b9e | ||
| 
						 | 
					3238ee4c2e | ||
| 
						 | 
					7b5bebd9c4 | ||
| 
						 | 
					b67c023b0a | ||
| 
						 | 
					e28a766e7d | ||
| 
						 | 
					3f7f04e02f | ||
| 
						 | 
					68609fd8d0 | ||
| 
						 | 
					ce6f62e24e | ||
| 
						 | 
					094b97de12 | ||
| 
						 | 
					0e3dadc53c | ||
| 
						 | 
					1fca5131c3 | ||
| 
						 | 
					fcb41e4579 | ||
| 
						 | 
					a56d0bc36b | ||
| 
						 | 
					e6fd3bfb28 | ||
| 
						 | 
					568a3329e1 | ||
| 
						 | 
					1968d1bb28 | ||
| 
						 | 
					117f0ab6da | ||
| 
						 | 
					64a935515c | ||
| 
						 | 
					e6befbaa3f | ||
| 
						 | 
					ae7833bdfa | ||
| 
						 | 
					412eec06d4 | ||
| 
						 | 
					e659601e03 | ||
| 
						 | 
					10cb3e26d5 | ||
| 
						 | 
					75b19eaa0c | ||
| 
						 | 
					ef51111b86 | ||
| 
						 | 
					36c0a30c50 | ||
| 
						 | 
					f233ce1fed | ||
| 
						 | 
					d13c1bce47 | ||
| 
						 | 
					967d3bbb60 | ||
| 
						 | 
					06c357916e | ||
| 
						 | 
					406d663bff | ||
| 
						 | 
					78443861a6 | ||
| 
						 | 
					34aef1a6f5 | ||
| 
						 | 
					7d0cec0a49 | ||
| 
						 | 
					d8c3f8fc16 | ||
| 
						 | 
					d8aa44f0c5 | ||
| 
						 | 
					2c88c6b526 | ||
| 
						 | 
					8ed1ad5a8e | ||
| 
						 | 
					c23cd49322 | ||
| 
						 | 
					a58b41a38e | ||
| 
						 | 
					03c5bc1129 | ||
| 
						 | 
					df42f96b5a | ||
| 
						 | 
					c535b10534 | ||
| 
						 | 
					d75f70f808 | ||
| 
						 | 
					1da20d7aa5 | ||
| 
						 | 
					913ba34386 | ||
| 
						 | 
					dbfb29de27 | ||
| 
						 | 
					69928e3ede | ||
| 
						 | 
					22b66193dc | ||
| 
						 | 
					895c16a793 | ||
| 
						 | 
					b375f79b9c | ||
| 
						 | 
					b220718b96 | ||
| 
						 | 
					0f337d654f | ||
| 
						 | 
					3beb828988 | ||
| 
						 | 
					cdba2b4ac8 | ||
| 
						 | 
					469bdcef2f | ||
| 
						 | 
					72d9e87284 | ||
| 
						 | 
					2baa36fd1f | ||
| 
						 | 
					4859947eab | ||
| 
						 | 
					fca58f5942 | ||
| 
						 | 
					f17f81d12c | ||
| 
						 | 
					86946c9bfd | ||
| 
						 | 
					95e4443ff2 | ||
| 
						 | 
					81aee3554e | ||
| 
						 | 
					fd5780d5a1 | ||
| 
						 | 
					8e7dd1d148 | ||
| 
						 | 
					14ea1430d8 | ||
| 
						 | 
					e46e918b23 | ||
| 
						 | 
					61fdca58a1 | ||
| 
						 | 
					a6ea439ef3 | ||
| 
						 | 
					5a8975a4dd | ||
| 
						 | 
					56e28a7f40 | ||
| 
						 | 
					5705515483 | ||
| 
						 | 
					612f9327e9 | ||
| 
						 | 
					24bd36b087 | ||
| 
						 | 
					1e3d76a0aa | ||
| 
						 | 
					7670ada9ac | ||
| 
						 | 
					bb9b0b015e | ||
| 
						 | 
					521a30dcd7 | ||
| 
						 | 
					3e64b439ce | ||
| 
						 | 
					1bf636d697 | ||
| 
						 | 
					f019250494 | ||
| 
						 | 
					528facf88d | ||
| 
						 | 
					7855edae6b | ||
| 
						 | 
					33f78a5429 | ||
| 
						 | 
					60d0185698 | ||
| 
						 | 
					2743b72a87 | ||
| 
						 | 
					61ef4692b0 | ||
| 
						 | 
					7b13b489c2 | ||
| 
						 | 
					d6ddf9568e | ||
| 
						 | 
					6ab7eb55cb | ||
| 
						 | 
					ec026eaf82 | ||
| 
						 | 
					c7f085a138 | ||
| 
						 | 
					32a8061cc2 | ||
| 
						 | 
					d6fad1bbd8 | ||
| 
						 | 
					e2b05d3cf6 | ||
| 
						 | 
					1495baac2c | ||
| 
						 | 
					ac5a1b4501 | ||
| 
						 | 
					ff7ed7f49f | ||
| 
						 | 
					333b974f10 | ||
| 
						 | 
					01039c574c | ||
| 
						 | 
					4e70f327c4 | ||
| 
						 | 
					fefcc43dd4 | ||
| 
						 | 
					2141057ab4 | ||
| 
						 | 
					54bb2ef00e | ||
| 
						 | 
					992d1623a7 | ||
| 
						 | 
					78dd03dcdb | ||
| 
						 | 
					9f2d29b68b | ||
| 
						 | 
					d841ad8f3e | ||
| 
						 | 
					3fb0b2792e | ||
| 
						 | 
					bbc4e90c89 | ||
| 
						 | 
					5735efacbe | ||
| 
						 | 
					774512df57 | ||
| 
						 | 
					152994047e | ||
| 
						 | 
					d194e78677 | ||
| 
						 | 
					16b51800d0 | ||
| 
						 | 
					2176bef537 | ||
| 
						 | 
					9f9c95b0b3 | ||
| 
						 | 
					3f0b13a131 | ||
| 
						 | 
					3c44379af9 | ||
| 
						 | 
					1d529d80d1 | ||
| 
						 | 
					89451ca640 | ||
| 
						 | 
					fac3a4d29b | ||
| 
						 | 
					d7610dda8f | ||
| 
						 | 
					dfa1d26952 | ||
| 
						 | 
					32fcea3bdd | ||
| 
						 | 
					a975c8c9cd | ||
| 
						 | 
					e4622ba06e | ||
| 
						 | 
					6fb9b3b353 | ||
| 
						 | 
					07d8684fc7 | ||
| 
						 | 
					1b0ea981f9 | ||
| 
						 | 
					72a3cff13e | ||
| 
						 | 
					14f7756fdb | ||
| 
						 | 
					e97bef2ff7 | ||
| 
						 | 
					e4c9aa198e | ||
| 
						 | 
					76e9e07370 | ||
| 
						 | 
					ae7fd777a7 | ||
| 
						 | 
					d666981599 | ||
| 
						 | 
					f0b8657423 | ||
| 
						 | 
					ae25a08fe3 | ||
| 
						 | 
					2b7aa3f99d | ||
| 
						 | 
					e7b4f7f6ca | ||
| 
						 | 
					de795a915e | ||
| 
						 | 
					e59b830d74 | ||
| 
						 | 
					0b01c3376d | ||
| 
						 | 
					6c2647e8cf | ||
| 
						 | 
					e1a501c66b | ||
| 
						 | 
					4f169dd2b8 | ||
| 
						 | 
					23a44952ac | ||
| 
						 | 
					7656916cef | ||
| 
						 | 
					88357ba751 | ||
| 
						 | 
					98fc866444 | ||
| 
						 | 
					c6fce2431b | ||
| 
						 | 
					9b27396344 | ||
| 
						 | 
					90d9724d1a | ||
| 
						 | 
					1c9a559362 | ||
| 
						 | 
					b1dd0008bc | ||
| 
						 | 
					ebf76e3d1f | ||
| 
						 | 
					033201ff1f | ||
| 
						 | 
					af212331ef | ||
| 
						 | 
					59fdaa3b53 | ||
| 
						 | 
					f2a85eafac | ||
| 
						 | 
					9b547edbe9 | ||
| 
						 | 
					48518a56c7 | ||
| 
						 | 
					1a767ee492 | ||
| 
						 | 
					b2489523f2 | ||
| 
						 | 
					7553827985 | ||
| 
						 | 
					792c1a8320 | ||
| 
						 | 
					963a1f1eb1 | ||
| 
						 | 
					4dadf8a72d | ||
| 
						 | 
					fdf261bda3 | ||
| 
						 | 
					f2ee20fdf5 | ||
| 
						 | 
					7a086890fd | ||
| 
						 | 
					49ca2e3588 | ||
| 
						 | 
					c5653156d9 | ||
| 
						 | 
					2cce562bc4 | ||
| 
						 | 
					f0aea0e6af | ||
| 
						 | 
					24560b7d13 | ||
| 
						 | 
					d451a0c508 | ||
| 
						 | 
					96996d0fba | ||
| 
						 | 
					4124d186d0 | ||
| 
						 | 
					4863d0d29d | ||
| 
						 | 
					a1e4ffb3f0 | ||
| 
						 | 
					c7471f1755 | ||
| 
						 | 
					4f1b26fd76 | ||
| 
						 | 
					accba3f408 | ||
| 
						 | 
					bfe3f309d2 | ||
| 
						 | 
					f036d58ec3 | ||
| 
						 | 
					f884b745dc | ||
| 
						 | 
					15cfa5d40d | ||
| 
						 | 
					2bf753a769 | ||
| 
						 | 
					6044e9e9e8 | ||
| 
						 | 
					e9d4372c41 | ||
| 
						 | 
					2030885fd3 | ||
| 
						 | 
					6e486d3c49 | ||
| 
						 | 
					4cc3b17d36 | ||
| 
						 | 
					5cfa919672 | ||
| 
						 | 
					f1bc2deafd | ||
| 
						 | 
					7508cd796d | ||
| 
						 | 
					626a4741c0 | ||
| 
						 | 
					14ff8a8570 | ||
| 
						 | 
					0d5246fbc7 | ||
| 
						 | 
					a9c337302a | ||
| 
						 | 
					2a98791ec9 | ||
| 
						 | 
					bf53a03c9d | ||
| 
						 | 
					3b32f44a60 | ||
| 
						 | 
					a8cd5e675d | ||
| 
						 | 
					bc269a966d | ||
| 
						 | 
					d39606cb47 | ||
| 
						 | 
					b04517b146 | ||
| 
						 | 
					024ee4213f | ||
| 
						 | 
					e861fbb517 | ||
| 
						 | 
					2e028ce36d | ||
| 
						 | 
					7306b5ac45 | ||
| 
						 | 
					0854bab124 | ||
| 
						 | 
					fa51121f29 | ||
| 
						 | 
					0b4c6f6477 | ||
| 
						 | 
					e5768454f1 | ||
| 
						 | 
					89b5eb56f2 | ||
| 
						 | 
					616c969a03 | ||
| 
						 | 
					4fd826ac8c | ||
| 
						 | 
					6d5a6ad0c8 | ||
| 
						 | 
					e0cd76e6fd | ||
| 
						 | 
					f03364f328 | ||
| 
						 | 
					25bc381361 | ||
| 
						 | 
					38e5c3a81e | ||
| 
						 | 
					43aa831dd2 | ||
| 
						 | 
					4492c5ed4e | ||
| 
						 | 
					5dec9eb2f5 | ||
| 
						 | 
					02903be558 | ||
| 
						 | 
					67a015c71d | ||
| 
						 | 
					69526402e2 | ||
| 
						 | 
					b51759d36e | ||
| 
						 | 
					68b1805c40 | ||
| 
						 | 
					9cc862b951 | ||
| 
						 | 
					4fb4aa417c | ||
| 
						 | 
					0adc6a6112 | ||
| 
						 | 
					29efc116f3 | ||
| 
						 | 
					f62c5d9698 | ||
| 
						 | 
					1ad537bc4d | ||
| 
						 | 
					1fc02940ae | ||
| 
						 | 
					8a3c4f64b2 | ||
| 
						 | 
					4d7496b8dd | ||
| 
						 | 
					03a11e103e | ||
| 
						 | 
					c3313050ce | ||
| 
						 | 
					d99707641b | ||
| 
						 | 
					0d9566dd71 | ||
| 
						 | 
					8d96518092 | ||
| 
						 | 
					f36cf5b321 | ||
| 
						 | 
					82ac667535 | ||
| 
						 | 
					563c51d431 | ||
| 
						 | 
					455c61b2cf | ||
| 
						 | 
					0a547e524e | ||
| 
						 | 
					9c5c85d34a | ||
| 
						 | 
					8d6af3dfed | ||
| 
						 | 
					3bae25fe6b | ||
| 
						 | 
					1d8d677d81 | ||
| 
						 | 
					75db08a60c | ||
| 
						 | 
					d367e832be | ||
| 
						 | 
					8d9800c727 | ||
| 
						 | 
					058f1c2edf | ||
| 
						 | 
					9425b8adc2 | ||
| 
						 | 
					21caa3eb72 | 
@@ -3,4 +3,5 @@ dist/**
 | 
			
		||||
docs/Setup.md
 | 
			
		||||
cypress.config.js
 | 
			
		||||
cypress/plugins/index.js
 | 
			
		||||
coverage
 | 
			
		||||
coverage
 | 
			
		||||
*.json
 | 
			
		||||
							
								
								
									
										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,
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  ],
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										137
									
								
								.eslintrc.json
									
									
									
									
									
								
							
							
						
						
									
										137
									
								
								.eslintrc.json
									
									
									
									
									
								
							@@ -1,137 +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-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
 | 
			
		||||
 | 
			
		||||
github: [knsv]
 | 
			
		||||
github:
 | 
			
		||||
  - knsv
 | 
			
		||||
  - sidharthv96
 | 
			
		||||
#patreon: # Replace with a single Patreon username
 | 
			
		||||
#open_collective: # Replace with a single Open Collective username
 | 
			
		||||
#ko_fi: # Replace with a single Ko-fi username
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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:
 | 
			
		||||
  - name: GitHub Discussions
 | 
			
		||||
    url: https://github.com/mermaid-js/mermaid/discussions
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,18 @@
 | 
			
		||||
## :bookmark_tabs: Summary
 | 
			
		||||
 | 
			
		||||
Brief description about the content of your PR.
 | 
			
		||||
 | 
			
		||||
Resolves #<your issue id here>
 | 
			
		||||
 | 
			
		||||
## :straight_ruler: Design Decisions
 | 
			
		||||
 | 
			
		||||
Describe the way your implementation works or what design decisions you made if applicable.
 | 
			
		||||
 | 
			
		||||
### :clipboard: Tasks
 | 
			
		||||
 | 
			
		||||
Make sure you
 | 
			
		||||
 | 
			
		||||
- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
 | 
			
		||||
- [ ] :computer: have added unit/e2e tests (if appropriate)
 | 
			
		||||
- [ ] :bookmark: targeted `develop` branch
 | 
			
		||||
## :bookmark_tabs: Summary
 | 
			
		||||
 | 
			
		||||
Brief description about the content of your PR.
 | 
			
		||||
 | 
			
		||||
Resolves #<your issue id here>
 | 
			
		||||
 | 
			
		||||
## :straight_ruler: Design Decisions
 | 
			
		||||
 | 
			
		||||
Describe the way your implementation works or what design decisions you made if applicable.
 | 
			
		||||
 | 
			
		||||
### :clipboard: Tasks
 | 
			
		||||
 | 
			
		||||
Make sure you
 | 
			
		||||
 | 
			
		||||
- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
 | 
			
		||||
- [ ] :computer: have added unit/e2e tests (if appropriate)
 | 
			
		||||
- [ ] :notebook: have added documentation (if appropriate)
 | 
			
		||||
- [ ] :bookmark: targeted `develop` branch
 | 
			
		||||
							
								
								
									
										19
									
								
								.github/PULL_REQUEST_TEMPLATE/release.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								.github/PULL_REQUEST_TEMPLATE/release.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
# Release vX.X.X
 | 
			
		||||
 | 
			
		||||
## Release checklist
 | 
			
		||||
 | 
			
		||||
    - [ ] Forked from `develop` branch
 | 
			
		||||
    - [ ] Draft PR created, targeting `master` branch
 | 
			
		||||
    - [ ] Ready for review
 | 
			
		||||
    - [ ] Ready for testing
 | 
			
		||||
    - [ ] Tested by -
 | 
			
		||||
    - [ ] Ready for merge
 | 
			
		||||
 | 
			
		||||
## Release process
 | 
			
		||||
 | 
			
		||||
- The PR is marked as `Ready for review` by the author
 | 
			
		||||
- The PR is reviewed by at least one other person
 | 
			
		||||
- The PR is marked as `Ready for testing` by the reviewer once the review and necessary changes are complete
 | 
			
		||||
- The PR is tested by the someone other than the author
 | 
			
		||||
- The PR is marked as `Tested by - @testerName` by the tester once the testing is complete
 | 
			
		||||
- The PR is marked as `Ready for merge` by the author once the testing is complete and CI is green.
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/dependency-review.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/dependency-review.yml
									
									
									
									
										vendored
									
									
								
							@@ -17,4 +17,4 @@ jobs:
 | 
			
		||||
      - name: 'Checkout Repository'
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      - name: 'Dependency Review'
 | 
			
		||||
        uses: actions/dependency-review-action@v2
 | 
			
		||||
        uses: actions/dependency-review-action@v3
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							@@ -32,6 +32,7 @@ jobs:
 | 
			
		||||
      # and run all Cypress tests
 | 
			
		||||
      - name: Cypress run
 | 
			
		||||
        uses: cypress-io/github-action@v4
 | 
			
		||||
        id: cypress
 | 
			
		||||
        # 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
 | 
			
		||||
        if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
 | 
			
		||||
@@ -44,3 +45,10 @@ jobs:
 | 
			
		||||
          parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
 | 
			
		||||
        env:
 | 
			
		||||
          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__/*
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								.github/workflows/link-checker.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/link-checker.yml
									
									
									
									
										vendored
									
									
								
							@@ -13,11 +13,10 @@ on:
 | 
			
		||||
      - master
 | 
			
		||||
  pull_request:
 | 
			
		||||
    branches:
 | 
			
		||||
      - develop
 | 
			
		||||
      - master
 | 
			
		||||
  schedule:
 | 
			
		||||
    # * is a special character in YAML so you have to quote this string
 | 
			
		||||
    - cron: '30 8 * * 5'
 | 
			
		||||
    - cron: '30 8 * * *'
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  linkChecker:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32
									
								
								.github/workflows/lint.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								.github/workflows/lint.yml
									
									
									
									
										vendored
									
									
								
							@@ -7,9 +7,10 @@ on:
 | 
			
		||||
      - opened
 | 
			
		||||
      - synchronize
 | 
			
		||||
      - ready_for_review
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
 | 
			
		||||
permissions:
 | 
			
		||||
  contents: read
 | 
			
		||||
  contents: write
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  lint:
 | 
			
		||||
@@ -36,8 +37,35 @@ jobs:
 | 
			
		||||
          CYPRESS_CACHE_FOLDER: .cache/Cypress
 | 
			
		||||
 | 
			
		||||
      - 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 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
 | 
			
		||||
        id: verifyDocs
 | 
			
		||||
        working-directory: ./packages/mermaid
 | 
			
		||||
        continue-on-error: ${{ github.event_name == 'push' }}
 | 
			
		||||
        run: pnpm run docs:verify
 | 
			
		||||
 | 
			
		||||
      - name: Rebuild Docs
 | 
			
		||||
        if: ${{ steps.verifyDocs.outcome == 'failure' && github.event_name == 'push' }}
 | 
			
		||||
        working-directory: ./packages/mermaid
 | 
			
		||||
        run: pnpm run docs:build
 | 
			
		||||
 | 
			
		||||
      - name: Commit changes
 | 
			
		||||
        uses: EndBug/add-and-commit@v9
 | 
			
		||||
        if: ${{ steps.verifyDocs.outcome == 'failure' && github.event_name == 'push' }}
 | 
			
		||||
        with:
 | 
			
		||||
          message: 'Update docs'
 | 
			
		||||
          add: 'docs/*'
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/pr-labeler.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/pr-labeler.yml
									
									
									
									
										vendored
									
									
								
							@@ -8,6 +8,6 @@ jobs:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Label PR
 | 
			
		||||
        uses: TimonVS/pr-labeler-action@v3
 | 
			
		||||
        uses: TimonVS/pr-labeler-action@v4
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								.github/workflows/publish-docs.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/publish-docs.yml
									
									
									
									
										vendored
									
									
								
							@@ -5,6 +5,7 @@ on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - master
 | 
			
		||||
  pull_request:
 | 
			
		||||
 | 
			
		||||
  # Allows you to run this workflow manually from the Actions tab
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
@@ -40,7 +41,7 @@ jobs:
 | 
			
		||||
        run: pnpm install --frozen-lockfile
 | 
			
		||||
 | 
			
		||||
      - name: Setup Pages
 | 
			
		||||
        uses: actions/configure-pages@v2
 | 
			
		||||
        uses: actions/configure-pages@v3
 | 
			
		||||
 | 
			
		||||
      - name: Run Build
 | 
			
		||||
        run: pnpm --filter mermaid run docs:build:vitepress
 | 
			
		||||
@@ -52,6 +53,7 @@ jobs:
 | 
			
		||||
 | 
			
		||||
  # Deployment job
 | 
			
		||||
  deploy:
 | 
			
		||||
    if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
 | 
			
		||||
    environment:
 | 
			
		||||
      name: github-pages
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								.github/workflows/release-publish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								.github/workflows/release-publish.yml
									
									
									
									
										vendored
									
									
								
							@@ -11,18 +11,21 @@ jobs:
 | 
			
		||||
      - uses: actions/checkout@v3
 | 
			
		||||
      - uses: fregante/setup-git-user@v1
 | 
			
		||||
 | 
			
		||||
      - 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
 | 
			
		||||
        with:
 | 
			
		||||
          cache: pnpm
 | 
			
		||||
          node-version: 18.x
 | 
			
		||||
      - name: Install Yarn
 | 
			
		||||
        run: npm i yarn --global
 | 
			
		||||
 | 
			
		||||
      - name: Install Json
 | 
			
		||||
        run: npm i json --global
 | 
			
		||||
 | 
			
		||||
      - 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
 | 
			
		||||
        run: |
 | 
			
		||||
@@ -31,7 +34,7 @@ jobs:
 | 
			
		||||
          git checkout -t origin/release/$VERSION
 | 
			
		||||
          npm version --no-git-tag-version --allow-same-version $VERSION
 | 
			
		||||
          git add package.json
 | 
			
		||||
          git commit -m "Bump version $VERSION"
 | 
			
		||||
          git commit -nm "Bump version $VERSION"
 | 
			
		||||
          git checkout -t origin/master
 | 
			
		||||
          git merge -m "Release $VERSION" --no-ff release/$VERSION
 | 
			
		||||
          git push --no-verify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,11 @@
 | 
			
		||||
export default {
 | 
			
		||||
  '!(docs/**/*)*.{ts,js,json,html,md,mts}': ['eslint --fix', 'prettier --write'],
 | 
			
		||||
  '!(docs/**/*)*.{ts,js,json,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'],
 | 
			
		||||
  '**/*.jison': ['pnpm -w run lint:jison'],
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -9,5 +9,8 @@ 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_
 | 
			
		||||
 | 
			
		||||
# Don't check files that are generated during the build via `pnpm docs:code`
 | 
			
		||||
packages/mermaid/src/docs/config/setup/*
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +0,0 @@
 | 
			
		||||
version: 2
 | 
			
		||||
snapshot:
 | 
			
		||||
  widths:
 | 
			
		||||
    - 1280
 | 
			
		||||
discovery:
 | 
			
		||||
  disable-cache: true
 | 
			
		||||
@@ -1,15 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "ecmaVersion": 6,
 | 
			
		||||
  "libs": ["browser"],
 | 
			
		||||
  "loadEagerly": [],
 | 
			
		||||
  "dontLoad": ["node_modules/**"],
 | 
			
		||||
  "plugins": {
 | 
			
		||||
    "modules": {},
 | 
			
		||||
    "es_modules": {},
 | 
			
		||||
    "node": {},
 | 
			
		||||
    "doc_comment": {
 | 
			
		||||
      "fullDocs": true,
 | 
			
		||||
      "strong": true
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -20,13 +20,14 @@ const visualizerOptions = (packageName: string, core = false): PluginOption[] =>
 | 
			
		||||
  if (packageName !== 'mermaid' || !visualize) {
 | 
			
		||||
    return [];
 | 
			
		||||
  }
 | 
			
		||||
  return ['network', 'treemap', 'sunburst'].map((chartType) =>
 | 
			
		||||
    visualizer({
 | 
			
		||||
      filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
 | 
			
		||||
      template: chartType as TemplateType,
 | 
			
		||||
      gzipSize: true,
 | 
			
		||||
      brotliSize: true,
 | 
			
		||||
    })
 | 
			
		||||
  return ['network', 'treemap', 'sunburst'].map(
 | 
			
		||||
    (chartType) =>
 | 
			
		||||
      visualizer({
 | 
			
		||||
        filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
 | 
			
		||||
        template: chartType as TemplateType,
 | 
			
		||||
        gzipSize: true,
 | 
			
		||||
        brotliSize: true,
 | 
			
		||||
      }) as PluginOption
 | 
			
		||||
  );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -36,16 +37,11 @@ const packageOptions = {
 | 
			
		||||
    packageName: 'mermaid',
 | 
			
		||||
    file: 'mermaid.ts',
 | 
			
		||||
  },
 | 
			
		||||
  'mermaid-mindmap': {
 | 
			
		||||
    name: 'mermaid-mindmap',
 | 
			
		||||
    packageName: 'mermaid-mindmap',
 | 
			
		||||
  'mermaid-example-diagram': {
 | 
			
		||||
    name: 'mermaid-example-diagram',
 | 
			
		||||
    packageName: 'mermaid-example-diagram',
 | 
			
		||||
    file: 'detector.ts',
 | 
			
		||||
  },
 | 
			
		||||
  // 'mermaid-example-diagram-detector': {
 | 
			
		||||
  //   name: 'mermaid-example-diagram-detector',
 | 
			
		||||
  //   packageName: 'mermaid-example-diagram',
 | 
			
		||||
  //   file: 'detector.ts',
 | 
			
		||||
  // },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
interface BuildOptions {
 | 
			
		||||
@@ -66,12 +62,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
 | 
			
		||||
      sourcemap: true,
 | 
			
		||||
      entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      name,
 | 
			
		||||
      format: 'umd',
 | 
			
		||||
      sourcemap: true,
 | 
			
		||||
      entryFileNames: `${name}${minify ? '.min' : ''}.js`,
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  if (core) {
 | 
			
		||||
@@ -119,11 +109,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
 | 
			
		||||
 | 
			
		||||
  if (watch && config.build) {
 | 
			
		||||
    config.build.watch = {
 | 
			
		||||
      include: [
 | 
			
		||||
        'packages/mermaid-mindmap/src/**',
 | 
			
		||||
        'packages/mermaid/src/**',
 | 
			
		||||
        // 'packages/mermaid-example-diagram/src/**',
 | 
			
		||||
      ],
 | 
			
		||||
      include: ['packages/mermaid-example-diagram/src/**', 'packages/mermaid/src/**'],
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -131,11 +117,9 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const buildPackage = async (entryName: keyof typeof packageOptions) => {
 | 
			
		||||
  return Promise.allSettled([
 | 
			
		||||
    build(getBuildConfig({ minify: false, entryName })),
 | 
			
		||||
    build(getBuildConfig({ minify: 'esbuild', entryName })),
 | 
			
		||||
    build(getBuildConfig({ minify: false, core: true, entryName })),
 | 
			
		||||
  ]);
 | 
			
		||||
  await build(getBuildConfig({ minify: false, entryName }));
 | 
			
		||||
  await build(getBuildConfig({ minify: 'esbuild', entryName }));
 | 
			
		||||
  await build(getBuildConfig({ minify: false, core: true, entryName }));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const main = async () => {
 | 
			
		||||
@@ -146,10 +130,9 @@ const main = async () => {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (watch) {
 | 
			
		||||
  build(getBuildConfig({ minify: false, watch, core: true, entryName: 'mermaid' }));
 | 
			
		||||
  build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
 | 
			
		||||
  if (!mermaidOnly) {
 | 
			
		||||
    build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' }));
 | 
			
		||||
    // build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
 | 
			
		||||
    build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
 | 
			
		||||
  }
 | 
			
		||||
} else if (visualize) {
 | 
			
		||||
  await build(getBuildConfig({ minify: false, core: true, entryName: 'mermaid' }));
 | 
			
		||||
 
 | 
			
		||||
@@ -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 { 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() {
 | 
			
		||||
  const app = express();
 | 
			
		||||
@@ -16,14 +8,14 @@ async function createServer() {
 | 
			
		||||
  // Create Vite server in middleware mode
 | 
			
		||||
  const vite = await createViteServer({
 | 
			
		||||
    configFile: './vite.config.ts',
 | 
			
		||||
    mode: 'production',
 | 
			
		||||
    server: { middlewareMode: true },
 | 
			
		||||
    appType: 'custom', // don't include Vite's default HTML handling middlewares
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  app.use(cors);
 | 
			
		||||
  app.use(cors());
 | 
			
		||||
  app.use(express.static('./packages/mermaid/dist'));
 | 
			
		||||
  app.use(express.static('./packages/mermaid-example-diagram/dist'));
 | 
			
		||||
  app.use(express.static('./packages/mermaid-mindmap/dist'));
 | 
			
		||||
  app.use(vite.middlewares);
 | 
			
		||||
  app.use(express.static('demos'));
 | 
			
		||||
  app.use(express.static('cypress/platform'));
 | 
			
		||||
@@ -33,5 +25,4 @@ async function createServer() {
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// build(getBuildConfig({ minify: false, watch: true }));
 | 
			
		||||
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
 | 
			
		||||
- globalReset resets to `defaultConfig` instead of current config. Use `reset` instead.
 | 
			
		||||
 
 | 
			
		||||
@@ -63,6 +63,28 @@ flowchart LR
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
You can use `note`, `tip`, `warning` and `danger` in triple backticks to add a note, tip, warning or danger box.
 | 
			
		||||
Do not use vitepress specific markdown syntax `::: warning` as it will not be processed correctly.
 | 
			
		||||
 | 
			
		||||
````
 | 
			
		||||
```note
 | 
			
		||||
Note content
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```tip
 | 
			
		||||
Tip content
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```warning
 | 
			
		||||
Warning content
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```danger
 | 
			
		||||
Danger content
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
**_DO NOT CHANGE FILES IN `/docs`_**
 | 
			
		||||
 | 
			
		||||
### The official documentation site
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								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="" />
 | 
			
		||||
 | 
			
		||||
@@ -10,7 +39,7 @@ English | [简体中文](./README.zh-CN.md)
 | 
			
		||||
 | 
			
		||||
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
 | 
			
		||||
 | 
			
		||||
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
 | 
			
		||||
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
 | 
			
		||||
 | 
			
		||||
## About
 | 
			
		||||
 | 
			
		||||
@@ -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/>
 | 
			
		||||
[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).
 | 
			
		||||
 | 
			
		||||
🌐 [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.
 | 
			
		||||
 | 
			
		||||
<a href="https://applitools.com/">
 | 
			
		||||
 
 | 
			
		||||
@@ -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="" />
 | 
			
		||||
 | 
			
		||||
@@ -10,7 +39,7 @@
 | 
			
		||||
 | 
			
		||||
**感谢所有参与进来提交 PR,解答疑问的人们! 🙏**
 | 
			
		||||
 | 
			
		||||
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/img/book-banner-pre-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
 | 
			
		||||
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
 | 
			
		||||
 | 
			
		||||
## 关于 Mermaid
 | 
			
		||||
 | 
			
		||||
@@ -24,12 +53,10 @@ Mermaid 是一个基于 Javascript 的图表绘制工具,通过解析类 Markd
 | 
			
		||||
Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它也可以作为生产脚本(或其他代码)的一部分。<br/>
 | 
			
		||||
<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).
 | 
			
		||||
 | 
			
		||||
🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [文档](https://mermaidjs.github.io) | 🙌 [贡献](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [更新日志](./docs/CHANGELOG.md)
 | 
			
		||||
 | 
			
		||||
<!-- </Main description> -->
 | 
			
		||||
 | 
			
		||||
## 示例
 | 
			
		||||
@@ -325,7 +352,7 @@ _很不幸的是,鱼与熊掌不可兼得,在这个场景下它意味着在
 | 
			
		||||
 | 
			
		||||
来自 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),没有你们,就没有这个项目的今天!_
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
							
								
								
									
										21
									
								
								__mocks__/c4Renderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								__mocks__/c4Renderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked C4Context diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const drawPersonOrSystemArray = vi.fn();
 | 
			
		||||
export const drawBoundary = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  drawPersonOrSystemArray,
 | 
			
		||||
  drawBoundary,
 | 
			
		||||
  setConf,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								__mocks__/classRenderer-v2.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								__mocks__/classRenderer-v2.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked class diagram v2 renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setConf,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										13
									
								
								__mocks__/classRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								__mocks__/classRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked class diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
@@ -1,79 +1,14 @@
 | 
			
		||||
// @ts-nocheck TODO: Fix TS
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
const NewD3 = function () {
 | 
			
		||||
  /**
 | 
			
		||||
   *
 | 
			
		||||
   */
 | 
			
		||||
  function returnThis() {
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
  return {
 | 
			
		||||
    append: function () {
 | 
			
		||||
      return NewD3();
 | 
			
		||||
    },
 | 
			
		||||
    lower: returnThis,
 | 
			
		||||
    attr: returnThis,
 | 
			
		||||
    style: returnThis,
 | 
			
		||||
    text: returnThis,
 | 
			
		||||
    0: {
 | 
			
		||||
      0: {
 | 
			
		||||
        getBBox: function () {
 | 
			
		||||
          return {
 | 
			
		||||
            height: 10,
 | 
			
		||||
            width: 20,
 | 
			
		||||
          };
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3';
 | 
			
		||||
 | 
			
		||||
export const select = function () {
 | 
			
		||||
  return new NewD3();
 | 
			
		||||
  return new MockedD3();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const selectAll = function () {
 | 
			
		||||
  return new NewD3();
 | 
			
		||||
  return new MockedD3();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const curveBasis = 'basis';
 | 
			
		||||
export const curveLinear = 'linear';
 | 
			
		||||
export const curveCardinal = 'cardinal';
 | 
			
		||||
 | 
			
		||||
export const MockD3 = (name, parent) => {
 | 
			
		||||
  const children = [];
 | 
			
		||||
  const elem = {
 | 
			
		||||
    get __children() {
 | 
			
		||||
      return children;
 | 
			
		||||
    },
 | 
			
		||||
    get __name() {
 | 
			
		||||
      return name;
 | 
			
		||||
    },
 | 
			
		||||
    get __parent() {
 | 
			
		||||
      return parent;
 | 
			
		||||
    },
 | 
			
		||||
    node() {
 | 
			
		||||
      return {
 | 
			
		||||
        getBBox() {
 | 
			
		||||
          return {
 | 
			
		||||
            x: 5,
 | 
			
		||||
            y: 10,
 | 
			
		||||
            height: 15,
 | 
			
		||||
            width: 20,
 | 
			
		||||
          };
 | 
			
		||||
        },
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
  elem.append = (name) => {
 | 
			
		||||
    const mockElem = MockD3(name, elem);
 | 
			
		||||
    children.push(mockElem);
 | 
			
		||||
    return mockElem;
 | 
			
		||||
  };
 | 
			
		||||
  elem.lower = vi.fn(() => elem);
 | 
			
		||||
  elem.attr = vi.fn(() => elem);
 | 
			
		||||
  elem.text = vi.fn(() => elem);
 | 
			
		||||
  elem.style = vi.fn(() => elem);
 | 
			
		||||
  return elem;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								__mocks__/erRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								__mocks__/erRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked er diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setConf,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										24
									
								
								__mocks__/flowRenderer-v2.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								__mocks__/flowRenderer-v2.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked flow (flowchart) diagram v2 renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
export const addVertices = vi.fn();
 | 
			
		||||
export const addEdges = vi.fn();
 | 
			
		||||
export const getClasses = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return {};
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setConf,
 | 
			
		||||
  addVertices,
 | 
			
		||||
  addEdges,
 | 
			
		||||
  getClasses,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								__mocks__/ganttRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								__mocks__/ganttRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked gantt diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setConf,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										13
									
								
								__mocks__/gitGraphRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								__mocks__/gitGraphRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked git (graph) diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										15
									
								
								__mocks__/journeyRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								__mocks__/journeyRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked pie (picChart) diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setConf,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										13
									
								
								__mocks__/pieRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								__mocks__/pieRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked pie (picChart) diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										13
									
								
								__mocks__/requirementRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								__mocks__/requirementRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked requirement diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										23
									
								
								__mocks__/sequenceRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								__mocks__/sequenceRenderer.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked sequence diagram renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const bounds = vi.fn();
 | 
			
		||||
export const drawActors = vi.fn();
 | 
			
		||||
export const drawActorsPopup = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  bounds,
 | 
			
		||||
  drawActors,
 | 
			
		||||
  drawActorsPopup,
 | 
			
		||||
  setConf,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										22
									
								
								__mocks__/stateRenderer-v2.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								__mocks__/stateRenderer-v2.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mocked state diagram v2 renderer
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { vi } from 'vitest';
 | 
			
		||||
 | 
			
		||||
export const setConf = vi.fn();
 | 
			
		||||
export const getClasses = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return {};
 | 
			
		||||
});
 | 
			
		||||
export const stateDomId = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return 'mocked-stateDiagram-stateDomId';
 | 
			
		||||
});
 | 
			
		||||
export const draw = vi.fn().mockImplementation(() => {
 | 
			
		||||
  return '';
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setConf,
 | 
			
		||||
  getClasses,
 | 
			
		||||
  draw,
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										20
									
								
								cSpell.json
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								cSpell.json
									
									
									
									
									
								
							@@ -6,6 +6,7 @@
 | 
			
		||||
    "adamiecki",
 | 
			
		||||
    "alois",
 | 
			
		||||
    "antiscript",
 | 
			
		||||
    "appli",
 | 
			
		||||
    "applitools",
 | 
			
		||||
    "asciidoctor",
 | 
			
		||||
    "ashish",
 | 
			
		||||
@@ -13,7 +14,9 @@
 | 
			
		||||
    "bbox",
 | 
			
		||||
    "bilkent",
 | 
			
		||||
    "bisheng",
 | 
			
		||||
    "blrs",
 | 
			
		||||
    "braintree",
 | 
			
		||||
    "brkt",
 | 
			
		||||
    "brolin",
 | 
			
		||||
    "brotli",
 | 
			
		||||
    "classdef",
 | 
			
		||||
@@ -24,12 +27,14 @@
 | 
			
		||||
    "cuzon",
 | 
			
		||||
    "cytoscape",
 | 
			
		||||
    "dagre",
 | 
			
		||||
    "deepdwn",
 | 
			
		||||
    "descr",
 | 
			
		||||
    "docsify",
 | 
			
		||||
    "docsy",
 | 
			
		||||
    "doku",
 | 
			
		||||
    "dompurify",
 | 
			
		||||
    "edgechromium",
 | 
			
		||||
    "elkjs",
 | 
			
		||||
    "faber",
 | 
			
		||||
    "flatmap",
 | 
			
		||||
    "ftplugin",
 | 
			
		||||
@@ -38,6 +43,7 @@
 | 
			
		||||
    "gitgraph",
 | 
			
		||||
    "globby",
 | 
			
		||||
    "graphlib",
 | 
			
		||||
    "graphviz",
 | 
			
		||||
    "grav",
 | 
			
		||||
    "greywolf",
 | 
			
		||||
    "inkdrop",
 | 
			
		||||
@@ -51,8 +57,10 @@
 | 
			
		||||
    "knut",
 | 
			
		||||
    "laganeckas",
 | 
			
		||||
    "lintstagedrc",
 | 
			
		||||
    "logmsg",
 | 
			
		||||
    "lucida",
 | 
			
		||||
    "matthieu",
 | 
			
		||||
    "mdast",
 | 
			
		||||
    "mdbook",
 | 
			
		||||
    "mermerd",
 | 
			
		||||
    "mindaugas",
 | 
			
		||||
@@ -60,26 +68,38 @@
 | 
			
		||||
    "mindmaps",
 | 
			
		||||
    "mitigations",
 | 
			
		||||
    "mkdocs",
 | 
			
		||||
    "mult",
 | 
			
		||||
    "orlandoni",
 | 
			
		||||
    "phpbb",
 | 
			
		||||
    "plantuml",
 | 
			
		||||
    "playfair",
 | 
			
		||||
    "pnpm",
 | 
			
		||||
    "podlite",
 | 
			
		||||
    "quence",
 | 
			
		||||
    "radious",
 | 
			
		||||
    "ranksep",
 | 
			
		||||
    "rect",
 | 
			
		||||
    "rects",
 | 
			
		||||
    "redmine",
 | 
			
		||||
    "roledescription",
 | 
			
		||||
    "sandboxed",
 | 
			
		||||
    "setupgraphviewbox",
 | 
			
		||||
    "shiki",
 | 
			
		||||
    "sidharth",
 | 
			
		||||
    "sidharthv",
 | 
			
		||||
    "sphinxcontrib",
 | 
			
		||||
    "statediagram",
 | 
			
		||||
    "stylis",
 | 
			
		||||
    "substate",
 | 
			
		||||
    "sveidqvist",
 | 
			
		||||
    "swimm",
 | 
			
		||||
    "techn",
 | 
			
		||||
    "teststr",
 | 
			
		||||
    "textlength",
 | 
			
		||||
    "treemap",
 | 
			
		||||
    "ts-nocheck",
 | 
			
		||||
    "tuleap",
 | 
			
		||||
    "ugge",
 | 
			
		||||
    "unist",
 | 
			
		||||
    "verdana",
 | 
			
		||||
    "viewports",
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ const utf8ToB64 = (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) => {
 | 
			
		||||
  const obj = {
 | 
			
		||||
@@ -46,8 +46,22 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
 | 
			
		||||
  if (!options.fontSize) {
 | 
			
		||||
    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);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const openURLAndVerifyRendering = (url, options, validation = undefined) => {
 | 
			
		||||
  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) {
 | 
			
		||||
@@ -60,82 +74,20 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const url = mermaidUrl(graphStr, options, api);
 | 
			
		||||
 | 
			
		||||
  cy.visit(url);
 | 
			
		||||
  cy.window().should('have.property', 'rendered', true);
 | 
			
		||||
  cy.get('svg').should('be.visible');
 | 
			
		||||
 | 
			
		||||
  if (validation) {
 | 
			
		||||
    cy.get('svg').should(validation);
 | 
			
		||||
  }
 | 
			
		||||
  cy.get('svg');
 | 
			
		||||
  // Default name to test title
 | 
			
		||||
 | 
			
		||||
  if (useAppli) {
 | 
			
		||||
    cy.log('Check eyes' + Cypress.spec.name);
 | 
			
		||||
    cy.eyesCheckWindow('Click!');
 | 
			
		||||
    cy.log('Closing eyes: ' + Cypress.spec.name);
 | 
			
		||||
    cy.log('Closing eyes' + Cypress.spec.name);
 | 
			
		||||
    cy.eyesClose();
 | 
			
		||||
  } else {
 | 
			
		||||
    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,13 +1,10 @@
 | 
			
		||||
import { urlSnapshotTest } from '../../helpers/util';
 | 
			
		||||
 | 
			
		||||
describe('mermaid', () => {
 | 
			
		||||
  describe('registerDiagram', () => {
 | 
			
		||||
    it('should work on @mermaid-js/mermaid-mindmap and mermaid-example-diagram', () => {
 | 
			
		||||
      const url = 'http://localhost:9000/external-diagrams-mindmap.html';
 | 
			
		||||
      cy.visit(url);
 | 
			
		||||
 | 
			
		||||
      cy.get('svg', {
 | 
			
		||||
        // may be a bit slower than normal, since vite might need to re-compile mermaid/mermaid-mindmap/mermaid-example-diagram
 | 
			
		||||
        timeout: 10000,
 | 
			
		||||
      }).matchImageSnapshot();
 | 
			
		||||
    it('should work on @mermaid-js/mermaid-example-diagram', () => {
 | 
			
		||||
      const url = 'http://localhost:9000/external-diagrams-example-diagram.html';
 | 
			
		||||
      urlSnapshotTest(url, {}, false, false);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -7,4 +7,10 @@ describe('CSS injections', () => {
 | 
			
		||||
      flowchart: { htmlLabels: false },
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
  it('should not allow adding styletags affecting the page', () => {
 | 
			
		||||
    urlSnapshotTest('http://localhost:9000/ghsa3.html', {
 | 
			
		||||
      logLevel: 1,
 | 
			
		||||
      flowchart: { htmlLabels: false },
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										122
									
								
								cypress/integration/rendering/c4.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										122
									
								
								cypress/integration/rendering/c4.spec.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,122 @@
 | 
			
		||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
 | 
			
		||||
 | 
			
		||||
describe('C4 diagram', () => {
 | 
			
		||||
  it('should render a simple C4Context diagram', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
      C4Context
 | 
			
		||||
      accTitle: C4 context demo
 | 
			
		||||
      accDescr: Many large C4 diagrams
 | 
			
		||||
 | 
			
		||||
      title System Context diagram for Internet Banking System
 | 
			
		||||
 | 
			
		||||
      Enterprise_Boundary(b0, "BankBoundary0") {
 | 
			
		||||
          Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
 | 
			
		||||
 | 
			
		||||
          System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
 | 
			
		||||
 | 
			
		||||
          Enterprise_Boundary(b1, "BankBoundary") {
 | 
			
		||||
            System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      BiRel(customerA, SystemAA, "Uses")
 | 
			
		||||
      Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
 | 
			
		||||
      Rel(SystemC, customerA, "Sends e-mails to")
 | 
			
		||||
 | 
			
		||||
      UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
 | 
			
		||||
      UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
 | 
			
		||||
      UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('should render a simple C4Container diagram', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
      C4Container
 | 
			
		||||
      title Container diagram for Internet Banking System
 | 
			
		||||
 | 
			
		||||
      System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system", $tags="v1.0")
 | 
			
		||||
      Person(customer, Customer, "A customer of the bank, with personal bank accounts", $tags="v1.0")
 | 
			
		||||
 | 
			
		||||
      Container_Boundary(c1, "Internet Banking") {
 | 
			
		||||
          Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to customers via their web browser")
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      Rel(customer, spa, "Uses", "HTTPS")
 | 
			
		||||
      Rel(email_system, customer, "Sends e-mails to")
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('should render a simple C4Component diagram', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
      C4Component
 | 
			
		||||
      title Component diagram for Internet Banking System - API Application
 | 
			
		||||
 | 
			
		||||
      Container(spa, "Single Page Application", "javascript and angular", "Provides all the internet banking functionality to customers via their web browser.")
 | 
			
		||||
 | 
			
		||||
      Container_Boundary(api, "API Application") {
 | 
			
		||||
        Component(sign, "Sign In Controller", "MVC Rest Controller", "Allows users to sign in to the internet banking system")
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      Rel_Back(spa, sign, "Uses", "JSON/HTTPS")
 | 
			
		||||
      UpdateRelStyle(spa, sign, $offsetY="-40")
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('should render a simple C4Dynamic diagram', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
      C4Dynamic
 | 
			
		||||
      title Dynamic diagram for Internet Banking System - API Application
 | 
			
		||||
 | 
			
		||||
      ContainerDb(c4, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")
 | 
			
		||||
      Container(c1, "Single-Page Application", "JavaScript and Angular", "Provides all of the Internet banking functionality to customers via their web browser.")
 | 
			
		||||
      Container_Boundary(b, "API Application") {
 | 
			
		||||
        Component(c3, "Security Component", "Spring Bean", "Provides functionality Related to signing in, changing passwords, etc.")
 | 
			
		||||
        Component(c2, "Sign In Controller", "Spring MVC Rest Controller", "Allows users to sign in to the Internet Banking System.")
 | 
			
		||||
      }
 | 
			
		||||
      Rel(c1, c2, "Submits credentials to", "JSON/HTTPS")
 | 
			
		||||
      Rel(c2, c3, "Calls isAuthenticated() on")
 | 
			
		||||
      Rel(c3, c4, "select * from users where username = ?", "JDBC")
 | 
			
		||||
 | 
			
		||||
      UpdateRelStyle(c1, c2, $textColor="red", $offsetY="-40")
 | 
			
		||||
      UpdateRelStyle(c2, c3, $textColor="red", $offsetX="-40", $offsetY="60")
 | 
			
		||||
      UpdateRelStyle(c3, c4, $textColor="red", $offsetY="-40", $offsetX="10")
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('should render a simple C4Deployment diagram', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
      C4Deployment
 | 
			
		||||
      title Deployment Diagram for Internet Banking System - Live
 | 
			
		||||
 | 
			
		||||
      Deployment_Node(mob, "Customer's mobile device", "Apple IOS or Android"){
 | 
			
		||||
          Container(mobile, "Mobile App", "Xamarin", "Provides a limited subset of the Internet Banking functionality to customers via their mobile device.")
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      Deployment_Node(plc, "Big Bank plc", "Big Bank plc data center"){
 | 
			
		||||
          Deployment_Node(dn, "bigbank-api*** x8", "Ubuntu 16.04 LTS"){
 | 
			
		||||
              Deployment_Node(apache, "Apache Tomcat", "Apache Tomcat 8.x"){
 | 
			
		||||
                  Container(api, "API Application", "Java and Spring MVC", "Provides Internet Banking functionality via a JSON/HTTPS API.")
 | 
			
		||||
              }
 | 
			
		||||
          }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      Rel(mobile, api, "Makes API calls to", "json/HTTPS")
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
@@ -485,8 +485,7 @@ describe('Class diagram V2', () => {
 | 
			
		||||
      classDiagram-v2
 | 
			
		||||
        note "I love this diagram!\nDo you love it?"
 | 
			
		||||
        class Class10 {
 | 
			
		||||
          <<service>>
 | 
			
		||||
          int id
 | 
			
		||||
            int id
 | 
			
		||||
          size()
 | 
			
		||||
        }
 | 
			
		||||
        note for Class10 "Cool class\nI said it's very cool class!"
 | 
			
		||||
 
 | 
			
		||||
@@ -414,7 +414,6 @@ describe('Class diagram', () => {
 | 
			
		||||
    classDiagram
 | 
			
		||||
      note "I love this diagram!\nDo you love it?"
 | 
			
		||||
      class Class10 {
 | 
			
		||||
        <<service>>
 | 
			
		||||
        int id
 | 
			
		||||
        size()
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
import { imgSnapshotTest } from '../../helpers/util';
 | 
			
		||||
 | 
			
		||||
describe('State diagram', () => {
 | 
			
		||||
describe('Current diagram', () => {
 | 
			
		||||
  it('should render a state with states in it', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
 
 | 
			
		||||
@@ -182,6 +182,20 @@ describe('Entity Relationship Diagram', () => {
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render entities with length in attributes type', () => {
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
    erDiagram
 | 
			
		||||
        CLUSTER {
 | 
			
		||||
          varchar(99) name
 | 
			
		||||
          string(255) description
 | 
			
		||||
        }
 | 
			
		||||
      `,
 | 
			
		||||
      { logLevel: 1 }
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render entities and attributes with big and small entity names', () => {
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										687
									
								
								cypress/integration/rendering/flowchart-elk.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										687
									
								
								cypress/integration/rendering/flowchart-elk.spec.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,687 @@
 | 
			
		||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
 | 
			
		||||
 | 
			
		||||
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 }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
@@ -670,6 +670,17 @@ title: Simple flowchart
 | 
			
		||||
---
 | 
			
		||||
flowchart TD
 | 
			
		||||
A --> B
 | 
			
		||||
`,
 | 
			
		||||
      { 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 }
 | 
			
		||||
    );
 | 
			
		||||
 
 | 
			
		||||
@@ -310,38 +310,6 @@ describe('Gantt diagram', () => {
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render accessibility tags', function () {
 | 
			
		||||
    const expectedTitle = 'Gantt Diagram';
 | 
			
		||||
    const expectedAccDescription = 'Tasks for Q4';
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
      gantt
 | 
			
		||||
      accTitle: ${expectedTitle}
 | 
			
		||||
      accDescr: ${expectedAccDescription}
 | 
			
		||||
      dateFormat  YYYY-MM-DD
 | 
			
		||||
      section Section
 | 
			
		||||
      A task :a1, 2014-01-01, 30d
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg').should((svg) => {
 | 
			
		||||
      const el = svg.get(0);
 | 
			
		||||
      const children = [...el.children];
 | 
			
		||||
 | 
			
		||||
      const titleEl = children.find(function (node) {
 | 
			
		||||
        return node.tagName === 'title';
 | 
			
		||||
      });
 | 
			
		||||
      const descriptionEl = children.find(function (node) {
 | 
			
		||||
        return node.tagName === 'desc';
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      expect(titleEl).to.exist;
 | 
			
		||||
      expect(titleEl.textContent).to.equal(expectedTitle);
 | 
			
		||||
      expect(descriptionEl).to.exist;
 | 
			
		||||
      expect(descriptionEl.textContent).to.equal(expectedAccDescription);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render a gantt diagram with tick is 15 minutes', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -158,7 +158,6 @@ mindmap
 | 
			
		||||
      undefined,
 | 
			
		||||
      shouldHaveRoot
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('rounded rect shape', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
@@ -172,7 +171,6 @@ mindmap
 | 
			
		||||
      undefined,
 | 
			
		||||
      shouldHaveRoot
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('circle shape', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
@@ -186,7 +184,6 @@ mindmap
 | 
			
		||||
      undefined,
 | 
			
		||||
      shouldHaveRoot
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('default shape', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
@@ -198,7 +195,6 @@ mindmap
 | 
			
		||||
      undefined,
 | 
			
		||||
      shouldHaveRoot
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('adding children', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
@@ -212,7 +208,6 @@ mindmap
 | 
			
		||||
      undefined,
 | 
			
		||||
      shouldHaveRoot
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('adding grand children', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
@@ -227,7 +222,6 @@ mindmap
 | 
			
		||||
      undefined,
 | 
			
		||||
      shouldHaveRoot
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  /* The end */
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -46,69 +46,4 @@ describe('Requirement diagram', () => {
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render accessibility tags', function () {
 | 
			
		||||
    const expectedTitle = 'Gantt Diagram';
 | 
			
		||||
    const expectedAccDescription = 'Tasks for Q4';
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
    requirementDiagram
 | 
			
		||||
    accTitle: ${expectedTitle}
 | 
			
		||||
    accDescr: ${expectedAccDescription}
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg').should((svg) => {
 | 
			
		||||
      const el = svg.get(0);
 | 
			
		||||
      const children = [...el.children];
 | 
			
		||||
 | 
			
		||||
      const titleEl = children.find(function (node) {
 | 
			
		||||
        return node.tagName === 'title';
 | 
			
		||||
      });
 | 
			
		||||
      const descriptionEl = children.find(function (node) {
 | 
			
		||||
        return node.tagName === 'desc';
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      expect(titleEl).to.exist;
 | 
			
		||||
      expect(titleEl.textContent).to.equal(expectedTitle);
 | 
			
		||||
      expect(descriptionEl).to.exist;
 | 
			
		||||
      expect(descriptionEl.textContent).to.equal(expectedAccDescription);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,42 @@
 | 
			
		||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
 | 
			
		||||
 | 
			
		||||
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', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
@@ -80,7 +116,11 @@ context('Sequence diagram', () => {
 | 
			
		||||
        loop Loopy
 | 
			
		||||
            Bob->>Alice: Pasten
 | 
			
		||||
        end      `,
 | 
			
		||||
      { wrap: true }
 | 
			
		||||
      {
 | 
			
		||||
        sequence: {
 | 
			
		||||
          wrap: true,
 | 
			
		||||
        },
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  context('font settings', () => {
 | 
			
		||||
 
 | 
			
		||||
@@ -328,7 +328,7 @@ describe('State diagram', () => {
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('v2 it should be possibel to use a choice', () => {
 | 
			
		||||
  it('v2 it should be possible to use a choice', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
  stateDiagram-v2
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										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 '../../packages/mermaid/src/mermaid';
 | 
			
		||||
      // 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>
 | 
			
		||||
@@ -49,13 +49,9 @@ mermaid.initialize({
 | 
			
		||||
    ],
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
mermaid.render(
 | 
			
		||||
  'the-id-of-the-svg',
 | 
			
		||||
  code,
 | 
			
		||||
  (svg) => {
 | 
			
		||||
    console.log(svg);
 | 
			
		||||
    const elem = document.querySelector('#graph-to-be');
 | 
			
		||||
    elem.innerHTML = svg;
 | 
			
		||||
  }
 | 
			
		||||
  // ,document.querySelector('#tmp')
 | 
			
		||||
);
 | 
			
		||||
void (async () => {
 | 
			
		||||
  const { svg } = await mermaid.render('the-id-of-the-svg', code);
 | 
			
		||||
  console.log(svg);
 | 
			
		||||
  const elem = document.querySelector('#graph-to-be');
 | 
			
		||||
  elem.innerHTML = svg;
 | 
			
		||||
})();
 | 
			
		||||
 
 | 
			
		||||
@@ -46,13 +46,9 @@
 | 
			
		||||
    <pre class="mermaid" style="width: 100%; height: 20%">
 | 
			
		||||
      %%{init: {'theme': 'base',  'fontFamily': 'courier', 'themeVariables': {  'primaryColor': '#fff000'}}}%%
 | 
			
		||||
      classDiagram-v2
 | 
			
		||||
       class BankAccount{
 | 
			
		||||
        +String owner
 | 
			
		||||
        +BigDecimal balance
 | 
			
		||||
        +deposit(amount) bool
 | 
			
		||||
        +withdrawl(amount) int
 | 
			
		||||
       }
 | 
			
		||||
       cssClass "BankAccount" customCss
 | 
			
		||||
classA <|-- classB : implements
 | 
			
		||||
classC *-- classD : composition
 | 
			
		||||
classE o-- classF : aggregation
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre class="mermaid2" style="width: 100%; height: 20%">
 | 
			
		||||
        %%{init: {'theme': 'base',  'fontFamily': 'courier', 'themeVariables': {  'primaryColor': '#fff000'}}}%%
 | 
			
		||||
@@ -117,8 +113,8 @@
 | 
			
		||||
        callback Shape "callbackFunction" "This is a tooltip for a callback"
 | 
			
		||||
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,6 @@
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      function clickByFlow(elemName) {
 | 
			
		||||
        const div = document.createElement('div');
 | 
			
		||||
@@ -162,6 +161,9 @@
 | 
			
		||||
 | 
			
		||||
        document.getElementsByTagName('body')[0].appendChild(div);
 | 
			
		||||
      }
 | 
			
		||||
    </script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
 
 | 
			
		||||
@@ -59,8 +59,8 @@
 | 
			
		||||
    Add another diagram to demo page    : 48h
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function clickByFlow(elemName) {
 | 
			
		||||
        const div = document.createElement('div');
 | 
			
		||||
        div.className = 'created-by-click';
 | 
			
		||||
 
 | 
			
		||||
@@ -125,8 +125,8 @@
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function clickByFlow(elemName) {
 | 
			
		||||
        const div = document.createElement('div');
 | 
			
		||||
        div.className = 'created-by-click';
 | 
			
		||||
 
 | 
			
		||||
@@ -61,8 +61,8 @@
 | 
			
		||||
    Add another diagram to demo page    : 48h
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function clickByFlow(elemName) {
 | 
			
		||||
        const div = document.createElement('div');
 | 
			
		||||
        div.className = 'created-by-click';
 | 
			
		||||
 
 | 
			
		||||
@@ -28,8 +28,8 @@
 | 
			
		||||
    end
 | 
			
		||||
    A --> B
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function showFullFirstSquad(elemName) {
 | 
			
		||||
        console.log('show ' + elemName);
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -107,8 +107,8 @@ Note over Alice,Bob: Looks
 | 
			
		||||
Note over Bob,Alice: Looks back
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -1,32 +1,12 @@
 | 
			
		||||
<html>
 | 
			
		||||
  <head>
 | 
			
		||||
    <meta charset="utf-8" />
 | 
			
		||||
    <!-- <meta charset="iso-8859-15"/> -->
 | 
			
		||||
    <script src="./viewer.js" type="module"></script>
 | 
			
		||||
    <!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
 | 
			
		||||
    <link
 | 
			
		||||
      href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
 | 
			
		||||
      rel="stylesheet"
 | 
			
		||||
    />
 | 
			
		||||
    <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 {
 | 
			
		||||
        border: 2px solid darkred;
 | 
			
		||||
      }
 | 
			
		||||
@@ -36,21 +16,5 @@
 | 
			
		||||
      }
 | 
			
		||||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
  <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>
 | 
			
		||||
  <body></body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,34 +2,8 @@
 | 
			
		||||
  <body>
 | 
			
		||||
    <h1>Should correctly load a third-party diagram using registerDiagram</h1>
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
mindmap
 | 
			
		||||
  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))
 | 
			
		||||
example-diagram
 | 
			
		||||
    </pre>
 | 
			
		||||
    <!-- <pre id="diagram" class="mermaid2">
 | 
			
		||||
      example-diagram
 | 
			
		||||
    </pre> -->
 | 
			
		||||
 | 
			
		||||
    <!-- <div id="cy"></div> -->
 | 
			
		||||
    <!-- <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 type="module" src="./external-diagrams-mindmap.mjs" /> -->
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mindmap from '../../packages/mermaid-mindmap/src/detector';
 | 
			
		||||
      import exampleDiagram from '../../packages/mermaid-example-diagram/src/detector';
 | 
			
		||||
      // import example from '../../packages/mermaid-example-diagram/src/detector';
 | 
			
		||||
      import mermaid from '../../packages/mermaid/src/mermaid';
 | 
			
		||||
 | 
			
		||||
      await mermaid.registerExternalDiagrams([mindmap]);
 | 
			
		||||
      await mermaid.registerExternalDiagrams([exampleDiagram]);
 | 
			
		||||
      await mermaid.initialize({ logLevel: 0 });
 | 
			
		||||
      await mermaid.initThrowsErrorsAsync();
 | 
			
		||||
      await mermaid.run();
 | 
			
		||||
      if (window.Cypress) {
 | 
			
		||||
        window.rendered = true;
 | 
			
		||||
      }
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -29,8 +29,8 @@
 | 
			
		||||
        click a_a "http://www.aftonbladet.se" "apa"
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        theme: 'forest',
 | 
			
		||||
        // 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 '../../packages/mermaid/src/mermaid';
 | 
			
		||||
 | 
			
		||||
      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>
 | 
			
		||||
@@ -4,23 +4,26 @@
 | 
			
		||||
  </script>
 | 
			
		||||
  <body>
 | 
			
		||||
    <div id="target">
 | 
			
		||||
      <h1>This element does not belong to the SVG but we can style it</h1>
 | 
			
		||||
      <h1>Background should be yellow!!!</h1>
 | 
			
		||||
    </div>
 | 
			
		||||
    <svg id="diagram"></svg>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({ startOnLoad: false, logLevel: 0 });
 | 
			
		||||
 | 
			
		||||
      const graph = `
 | 
			
		||||
     %%{ init: { "themeVariables" : { "textColor": "green;} #target { background-color: crimson }", "mainBkg": "#fff000" } } }%%
 | 
			
		||||
            graph TD
 | 
			
		||||
                A[Goose]
 | 
			
		||||
            `;
 | 
			
		||||
      %%{ init: { "themeVariables" : { "textColor": "green;} #target { background-color: crimson }", "mainBkg": "#fff000" } } }%%
 | 
			
		||||
             graph TD
 | 
			
		||||
                 A[Goose]
 | 
			
		||||
             `;
 | 
			
		||||
 | 
			
		||||
      const diagram = document.getElementById('diagram');
 | 
			
		||||
      const svg = mermaid.render('diagram-svg', graph);
 | 
			
		||||
      const { svg } = await mermaid.render('diagram-svg', graph);
 | 
			
		||||
      diagram.innerHTML = svg;
 | 
			
		||||
      if (window.Cypress) {
 | 
			
		||||
        window.rendered = true;
 | 
			
		||||
      }
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,8 @@
 | 
			
		||||
    </div>
 | 
			
		||||
    <svg id="diagram"></svg>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({ startOnLoad: false, logLevel: 0 });
 | 
			
		||||
 | 
			
		||||
      const graph = `
 | 
			
		||||
@@ -19,8 +19,11 @@
 | 
			
		||||
            `;
 | 
			
		||||
 | 
			
		||||
      const diagram = document.getElementById('diagram');
 | 
			
		||||
      const svg = mermaid.render('diagram-svg', graph);
 | 
			
		||||
      const { svg } = await mermaid.render('diagram-svg', graph);
 | 
			
		||||
      diagram.innerHTML = svg;
 | 
			
		||||
      if (window.Cypress) {
 | 
			
		||||
        window.rendered = true;
 | 
			
		||||
      }
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										101
									
								
								cypress/platform/ghsa3.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								cypress/platform/ghsa3.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,101 @@
 | 
			
		||||
<html>
 | 
			
		||||
  <head>
 | 
			
		||||
    <link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
 | 
			
		||||
    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
 | 
			
		||||
    <link
 | 
			
		||||
      rel="stylesheet"
 | 
			
		||||
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
 | 
			
		||||
    />
 | 
			
		||||
    <link
 | 
			
		||||
      href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
 | 
			
		||||
      rel="stylesheet"
 | 
			
		||||
    />
 | 
			
		||||
    <style>
 | 
			
		||||
      body {
 | 
			
		||||
        /* background: rgb(221, 208, 208); */
 | 
			
		||||
        /* background:#333; */
 | 
			
		||||
        font-family: 'Arial';
 | 
			
		||||
        /* font-size: 18px !important; */
 | 
			
		||||
      }
 | 
			
		||||
      h1 {
 | 
			
		||||
        color: grey;
 | 
			
		||||
      }
 | 
			
		||||
      .mermaid2 {
 | 
			
		||||
        display: none;
 | 
			
		||||
      }
 | 
			
		||||
      .mermaid svg {
 | 
			
		||||
        /* font-size: 18px !important; */
 | 
			
		||||
      }
 | 
			
		||||
      .malware {
 | 
			
		||||
        position: fixed;
 | 
			
		||||
        bottom: 0;
 | 
			
		||||
        left: 0;
 | 
			
		||||
        right: 0;
 | 
			
		||||
        height: 150px;
 | 
			
		||||
        background: red;
 | 
			
		||||
        color: black;
 | 
			
		||||
        display: flex;
 | 
			
		||||
        display: flex;
 | 
			
		||||
        justify-content: center;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
        font-family: monospace;
 | 
			
		||||
        font-size: 72px;
 | 
			
		||||
      }
 | 
			
		||||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <h1>PAGE SHOULD NOT BE RED</h1>
 | 
			
		||||
    <div class="flex">
 | 
			
		||||
      <div id="diagram" class="mermaid"></div>
 | 
			
		||||
      <div id="res" class=""></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        theme: 'forest',
 | 
			
		||||
        arrowMarkerAbsolute: true,
 | 
			
		||||
        // themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
 | 
			
		||||
        logLevel: 0,
 | 
			
		||||
        state: {
 | 
			
		||||
          defaultRenderer: 'dagre-wrapper',
 | 
			
		||||
        },
 | 
			
		||||
        flowchart: {
 | 
			
		||||
          // defaultRenderer: 'dagre-wrapper',
 | 
			
		||||
          nodeSpacing: 10,
 | 
			
		||||
          curve: 'cardinal',
 | 
			
		||||
          htmlLabels: true,
 | 
			
		||||
        },
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        // gantt: { axisFormat: '%m/%d/%Y' },
 | 
			
		||||
        sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
 | 
			
		||||
        // sequenceDiagram: { actorMargin: 300 } // deprecated
 | 
			
		||||
        // fontFamily: '"times", sans-serif',
 | 
			
		||||
        // fontFamily: 'courier',
 | 
			
		||||
        fontSize: 18,
 | 
			
		||||
        curve: 'basis',
 | 
			
		||||
        // securityLevel: 'strict',
 | 
			
		||||
        startOnLoad: false,
 | 
			
		||||
        secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
 | 
			
		||||
        // themeVariables: {relationLabelColor: 'red'}
 | 
			
		||||
      });
 | 
			
		||||
      function callback() {
 | 
			
		||||
        alert('It worked');
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      let diagram = '%%{init: {"flowchart": {"htmlLabels": "true"}} }%%\n';
 | 
			
		||||
      diagram += 'flowchart\n';
 | 
			
		||||
      diagram += 'A["<p><sty';
 | 
			
		||||
      diagram += 'le> * { background : red}</style>test</p>"]';
 | 
			
		||||
 | 
			
		||||
      console.log(diagram);
 | 
			
		||||
      const { svg } = await mermaid.render('diagram', diagram);
 | 
			
		||||
      document.querySelector('#res').innerHTML = svg;
 | 
			
		||||
      if (window.Cypress) {
 | 
			
		||||
        window.rendered = true;
 | 
			
		||||
      }
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -43,8 +43,8 @@
 | 
			
		||||
       cssClass "BankAccount" customCss
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -130,8 +130,8 @@
 | 
			
		||||
      commit
 | 
			
		||||
      merge main
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -98,8 +98,8 @@
 | 
			
		||||
      commit
 | 
			
		||||
      merge main
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -7,8 +7,8 @@
 | 
			
		||||
    <pre class="mermaid">
 | 
			
		||||
info
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        theme: 'forest',
 | 
			
		||||
        // themeCSS: '.node rect { fill: red; }',
 | 
			
		||||
 
 | 
			
		||||
@@ -87,8 +87,8 @@
 | 
			
		||||
    Add another diagram to demo page    : 48h
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function clickByFlow(elemName) {
 | 
			
		||||
        const div = document.createElement('div');
 | 
			
		||||
        div.className = 'created-by-click';
 | 
			
		||||
 
 | 
			
		||||
@@ -54,33 +54,205 @@
 | 
			
		||||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <div>Security check</div>
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
flowchart LR
 | 
			
		||||
    subgraph external
 | 
			
		||||
      subgraph internal
 | 
			
		||||
          inside
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
    outside --> inside
 | 
			
		||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
 | 
			
		||||
graph BT
 | 
			
		||||
a{The cat in the hat} -- 1o --> b
 | 
			
		||||
a -- 2o --> c
 | 
			
		||||
a -- 3o --> d
 | 
			
		||||
g --2i--> a
 | 
			
		||||
d --1i--> a
 | 
			
		||||
h --3i -->a
 | 
			
		||||
b --> d(The dog in the hog)
 | 
			
		||||
c --> d
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
flowchart LR
 | 
			
		||||
    subgraph parent
 | 
			
		||||
      subgraph childB
 | 
			
		||||
        grandchild
 | 
			
		||||
      end
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
flowchart-elk TB
 | 
			
		||||
      a --> b
 | 
			
		||||
      a --> c
 | 
			
		||||
      b --> d
 | 
			
		||||
      c --> d
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
 | 
			
		||||
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
 | 
			
		||||
    foo --> childA        </pre
 | 
			
		||||
 | 
			
		||||
    radeon[AMD Radeon R7xx GX2]
 | 
			
		||||
 | 
			
		||||
    mem --- gx
 | 
			
		||||
    mem --- radeon
 | 
			
		||||
 | 
			
		||||
    rom --- mem
 | 
			
		||||
 | 
			
		||||
    mem --- sata
 | 
			
		||||
    mem --- exi
 | 
			
		||||
 | 
			
		||||
    dram --- sata
 | 
			
		||||
    dram --- exi
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  ddr3[2 GB DDR3 RAM MEM2]
 | 
			
		||||
 | 
			
		||||
  mem --- ddr3
 | 
			
		||||
  dram --- ddr3
 | 
			
		||||
  edram --- ddr3
 | 
			
		||||
 | 
			
		||||
  core1 --- mem
 | 
			
		||||
 | 
			
		||||
  exi --- rtc
 | 
			
		||||
  rtc{{rtc}}
 | 
			
		||||
</pre
 | 
			
		||||
    >
 | 
			
		||||
    <br />
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
flowchart TB
 | 
			
		||||
  %% I could not figure out how to use double quotes in labels in Mermaid
 | 
			
		||||
  subgraph ibm[IBM Espresso CPU]
 | 
			
		||||
    core0[IBM PowerPC Broadway Core 0]
 | 
			
		||||
    core1[IBM PowerPC Broadway Core 1]
 | 
			
		||||
    core2[IBM PowerPC Broadway Core 2]
 | 
			
		||||
 | 
			
		||||
    rom[16 KB ROM]
 | 
			
		||||
 | 
			
		||||
    core0 --- core2
 | 
			
		||||
 | 
			
		||||
    rom --> core2
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  subgraph amd[AMD Latte GPU]
 | 
			
		||||
    mem[Memory & I/O Bridge]
 | 
			
		||||
    dram[DRAM Controller]
 | 
			
		||||
    edram[32 MB EDRAM MEM1]
 | 
			
		||||
    rom[512 B SEEPROM]
 | 
			
		||||
 | 
			
		||||
    sata[SATA IF]
 | 
			
		||||
    exi[EXI]
 | 
			
		||||
 | 
			
		||||
    subgraph gx[GX]
 | 
			
		||||
      sram[3 MB 1T-SRAM]
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    radeon[AMD Radeon R7xx GX2]
 | 
			
		||||
 | 
			
		||||
    mem --- gx
 | 
			
		||||
    mem --- radeon
 | 
			
		||||
 | 
			
		||||
    rom --- mem
 | 
			
		||||
 | 
			
		||||
    mem --- sata
 | 
			
		||||
    mem --- exi
 | 
			
		||||
 | 
			
		||||
    dram --- sata
 | 
			
		||||
    dram --- exi
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  ddr3[2 GB DDR3 RAM MEM2]
 | 
			
		||||
 | 
			
		||||
  mem --- ddr3
 | 
			
		||||
  dram --- ddr3
 | 
			
		||||
  edram --- ddr3
 | 
			
		||||
 | 
			
		||||
  core1 --- mem
 | 
			
		||||
 | 
			
		||||
  exi --- rtc
 | 
			
		||||
  rtc{{rtc}}
 | 
			
		||||
</pre
 | 
			
		||||
    >
 | 
			
		||||
    <br />
 | 
			
		||||
     
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
      flowchart LR
 | 
			
		||||
  B1 --be be--x B2
 | 
			
		||||
  B1 --bo bo--o B3
 | 
			
		||||
  subgraph Ugge
 | 
			
		||||
      B2
 | 
			
		||||
      B3
 | 
			
		||||
      subgraph inner
 | 
			
		||||
          B4
 | 
			
		||||
          B5
 | 
			
		||||
      end
 | 
			
		||||
      subgraph inner2
 | 
			
		||||
        subgraph deeper
 | 
			
		||||
          C4
 | 
			
		||||
          C5
 | 
			
		||||
        end
 | 
			
		||||
        C6
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      B4 --> C4
 | 
			
		||||
 | 
			
		||||
      B3 -- X --> B4
 | 
			
		||||
      B2 --> inner
 | 
			
		||||
 | 
			
		||||
      C4 --> C5
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  subgraph outer
 | 
			
		||||
      B6
 | 
			
		||||
  end
 | 
			
		||||
  B6 --> B5
 | 
			
		||||
  </pre
 | 
			
		||||
    >
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
      gantt
 | 
			
		||||
        title Style today marker (vertical line should be 5px wide and half-transparent blue)
 | 
			
		||||
        dateFormat YYYY-MM-DD
 | 
			
		||||
        axisFormat %d
 | 
			
		||||
        todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
 | 
			
		||||
        section Section1
 | 
			
		||||
        Today: 1, -1h
 | 
			
		||||
sequenceDiagram
 | 
			
		||||
    Customer->>+Stripe: Makes a payment request
 | 
			
		||||
    Stripe->>+Bank: Forwards the payment request to the bank
 | 
			
		||||
    Bank->>+Customer: Asks for authorization
 | 
			
		||||
    Customer->>+Bank: Provides authorization
 | 
			
		||||
    Bank->>+Stripe: Sends a response with payment details
 | 
			
		||||
    Stripe->>+Merchant: Sends a notification of payment receipt
 | 
			
		||||
    Merchant->>+Stripe: Confirms the payment
 | 
			
		||||
    Stripe->>+Customer: Sends a confirmation of payment
 | 
			
		||||
    Customer->>+Merchant: Receives goods or services
 | 
			
		||||
        </pre
 | 
			
		||||
    >
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
mindmap
 | 
			
		||||
  root((mindmap))
 | 
			
		||||
    Origins
 | 
			
		||||
      Long history
 | 
			
		||||
      ::icon(fa fa-book)
 | 
			
		||||
      Popularisation
 | 
			
		||||
        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>
 | 
			
		||||
 | 
			
		||||
    <!-- <div id="cy"></div> -->
 | 
			
		||||
@@ -90,18 +262,19 @@ flowchart LR
 | 
			
		||||
    <!-- <script src="./mermaid.js"></script> -->
 | 
			
		||||
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mindmap from '../../packages/mermaid-mindmap/src/detector';
 | 
			
		||||
      // import example from '../../packages/mermaid-example-diagram/src/detector';
 | 
			
		||||
      // import mindmap from '../../packages/mermaid-mindmap/src/detector';
 | 
			
		||||
      import example from '../../packages/mermaid-example-diagram/src/detector';
 | 
			
		||||
      import mermaid from '../../packages/mermaid/src/mermaid';
 | 
			
		||||
      await mermaid.registerExternalDiagrams([mindmap]);
 | 
			
		||||
      await mermaid.registerExternalDiagrams([example]);
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        theme: 'default',
 | 
			
		||||
        theme: 'forest',
 | 
			
		||||
        startOnLoad: true,
 | 
			
		||||
        logLevel: 0,
 | 
			
		||||
        logLevel: 5,
 | 
			
		||||
        flowchart: {
 | 
			
		||||
          // defaultRenderer: 'elk',
 | 
			
		||||
          useMaxWidth: false,
 | 
			
		||||
          htmlLabels: true,
 | 
			
		||||
        },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,257 +1,111 @@
 | 
			
		||||
<html>
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
  <head>
 | 
			
		||||
    <link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
 | 
			
		||||
    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
 | 
			
		||||
    <link
 | 
			
		||||
      rel="stylesheet"
 | 
			
		||||
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
 | 
			
		||||
    />
 | 
			
		||||
    <link
 | 
			
		||||
      href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
 | 
			
		||||
      rel="stylesheet"
 | 
			
		||||
    />
 | 
			
		||||
    <meta charset="utf-8" />
 | 
			
		||||
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 | 
			
		||||
    <title>Mindmap Mermaid Quick Test Page</title>
 | 
			
		||||
    <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
 | 
			
		||||
    <style>
 | 
			
		||||
      body {
 | 
			
		||||
        /* background: rgb(221, 208, 208); */
 | 
			
		||||
        /* background:#333; */
 | 
			
		||||
        font-family: 'Courier New', Courier, monospace;
 | 
			
		||||
        /* font-size: 18px !important; */
 | 
			
		||||
      }
 | 
			
		||||
      h1 {
 | 
			
		||||
        color: grey;
 | 
			
		||||
      }
 | 
			
		||||
      .mermaid2 {
 | 
			
		||||
        display: none;
 | 
			
		||||
      }
 | 
			
		||||
      .mermaid {
 | 
			
		||||
        border: 1px solid red;
 | 
			
		||||
        font-family: 'Courier New', Courier, monospace;
 | 
			
		||||
        /* font-size: 18px !important; */
 | 
			
		||||
      div.mermaid {
 | 
			
		||||
        /* font-family: 'trebuchet ms', verdana, arial; */
 | 
			
		||||
        font-family: 'Courier New', Courier, monospace !important;
 | 
			
		||||
      }
 | 
			
		||||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
 | 
			
		||||
  <body>
 | 
			
		||||
    <div>info below</div>
 | 
			
		||||
    <div class="">
 | 
			
		||||
      <pre class="mermaid2" style="width: 100%; height: 400px">
 | 
			
		||||
flowchart TB;subgraph "number as labels";1;end;
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="width: 100%; height: 400px">
 | 
			
		||||
flowchart TB;a[APA];
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="margin-left: 100px">
 | 
			
		||||
graph TD
 | 
			
		||||
      work --> sleep
 | 
			
		||||
      sleep --> work
 | 
			
		||||
      eat --> sleep
 | 
			
		||||
      work --> eat
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="margin-left: 100px">
 | 
			
		||||
flowchart TD
 | 
			
		||||
      work --> sleep
 | 
			
		||||
      sleep --> work
 | 
			
		||||
      eat --> sleep
 | 
			
		||||
      work --> eat
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
 graph TB
 | 
			
		||||
      A
 | 
			
		||||
      B
 | 
			
		||||
      subgraph foo[Foo SubGraph]
 | 
			
		||||
        C
 | 
			
		||||
        D
 | 
			
		||||
      end
 | 
			
		||||
      subgraph bar[Bar SubGraph]
 | 
			
		||||
        E
 | 
			
		||||
        F
 | 
			
		||||
      end
 | 
			
		||||
      G
 | 
			
		||||
    <h1>Mindmap diagram demo</h1>
 | 
			
		||||
    <pre class="mermaid">
 | 
			
		||||
        mindmap
 | 
			
		||||
        root
 | 
			
		||||
            child1((Circle))
 | 
			
		||||
                grandchild 1
 | 
			
		||||
                grandchild 2
 | 
			
		||||
            child2(Round rectangle)
 | 
			
		||||
                grandchild 3
 | 
			
		||||
                grandchild 4
 | 
			
		||||
            child3[Square]
 | 
			
		||||
                grandchild 5
 | 
			
		||||
                ::icon(mdi mdi-fire)
 | 
			
		||||
                gc6((grand<br/>child 6))
 | 
			
		||||
                ::icon(mdi mdi-fire)
 | 
			
		||||
                gc7((grand<br/>grand<br/>child 8))
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
      A-->B
 | 
			
		||||
      B-->C
 | 
			
		||||
      C-->D
 | 
			
		||||
      B-->D
 | 
			
		||||
      D-->E
 | 
			
		||||
      E-->A
 | 
			
		||||
      E-->F
 | 
			
		||||
      F-->D
 | 
			
		||||
      F-->G
 | 
			
		||||
      B-->G
 | 
			
		||||
      G-->D
 | 
			
		||||
    <h2>Mindmap with root wrapping text and a shape</h2>
 | 
			
		||||
    <pre class="mermaid">
 | 
			
		||||
        mindmap
 | 
			
		||||
            root[A root with a long text that wraps to keep the node size in check]
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
      style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
 | 
			
		||||
      style bar fill:#999,stroke-width:2px,stroke:#0F0,color:blue
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      graph TB
 | 
			
		||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
 | 
			
		||||
      A
 | 
			
		||||
      B
 | 
			
		||||
      subgraph foo[Foo SubGraph]
 | 
			
		||||
        C
 | 
			
		||||
        D
 | 
			
		||||
      end
 | 
			
		||||
      subgraph bar[Bar SubGraph]
 | 
			
		||||
        E
 | 
			
		||||
        F
 | 
			
		||||
      end
 | 
			
		||||
      G
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      // import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      import mermaid from '../../packages/mermaid/src/mermaid';
 | 
			
		||||
      // import mermaidMindmap from './mermaid-mindmap.esm.mjs';
 | 
			
		||||
 | 
			
		||||
      A-->B
 | 
			
		||||
      B-->C
 | 
			
		||||
      C-->D
 | 
			
		||||
      B-->D
 | 
			
		||||
      D-->E
 | 
			
		||||
      E-->A
 | 
			
		||||
      E-->F
 | 
			
		||||
      F-->D
 | 
			
		||||
      F-->G
 | 
			
		||||
      B-->G
 | 
			
		||||
      G-->D
 | 
			
		||||
      // import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';
 | 
			
		||||
      // await mermaid.registerExternalDiagrams([mermaidMindmap]);
 | 
			
		||||
 | 
			
		||||
      style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
 | 
			
		||||
      style bar fill:#999,stroke-width:10px,stroke:#0F0,color:blue
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      graph TD
 | 
			
		||||
        A[Christmas] ==> D
 | 
			
		||||
        A[Christmas] -->|Get money| B(Go shopping)
 | 
			
		||||
        A[Christmas] ==> C
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      graph TD
 | 
			
		||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
 | 
			
		||||
        A[Christmas] ==> D
 | 
			
		||||
        A[Christmas] -->|Get money| B(Go shopping)
 | 
			
		||||
        A[Christmas] ==> C
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      flowchart TD
 | 
			
		||||
        A[Christmas] ==> D
 | 
			
		||||
        A[Christmas] -->|Get money| B(Go shopping)
 | 
			
		||||
        A[Christmas] ==> C
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      flowchart TD
 | 
			
		||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
 | 
			
		||||
        A[Christmas] ==> D
 | 
			
		||||
        A[Christmas] -->|Get money| B(Go shopping)
 | 
			
		||||
        A[Christmas] ==> C
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
flowchart LR
 | 
			
		||||
        a["<strong>Haiya</strong>"]---->b
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid" style="">
 | 
			
		||||
flowchart LR
 | 
			
		||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
 | 
			
		||||
        a["<strong>Haiya</strong>"]---->b
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      flowchart TD
 | 
			
		||||
        A[Christmas] ==> D
 | 
			
		||||
        A[Christmas] -->|Get money| B(Go shopping)
 | 
			
		||||
        A[Christmas] ==> C
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      flowchart TD
 | 
			
		||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
 | 
			
		||||
        A[Christmas] ==> D
 | 
			
		||||
        A[Christmas] -->|Get money| B(Go shopping)
 | 
			
		||||
        A[Christmas] ==> C
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
      %%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
 | 
			
		||||
classDiagram-v2
 | 
			
		||||
      Class01 <|-- AveryLongClass : Cool
 | 
			
		||||
      <<interface>> Class01
 | 
			
		||||
      Class03 *-- Class04
 | 
			
		||||
      Class05 o-- Class06
 | 
			
		||||
      Class07 .. Class08
 | 
			
		||||
      Class09 --> C2 : Where am i?
 | 
			
		||||
      Class09 --* C3
 | 
			
		||||
      Class09 --|> Class07
 | 
			
		||||
      Class12 <|.. Class08
 | 
			
		||||
      Class11 ..>Class12
 | 
			
		||||
      Class07 : equals()
 | 
			
		||||
      Class07 : Object[] elementData
 | 
			
		||||
      Class01 : size()
 | 
			
		||||
      Class01 : int chimp
 | 
			
		||||
      Class01 : int gorilla
 | 
			
		||||
      Class01 : -int privateChimp
 | 
			
		||||
      Class01 : +int publicGorilla
 | 
			
		||||
      Class01 : #int protectedMarmoset
 | 
			
		||||
      Class08 <--> C2: Cool label
 | 
			
		||||
      class Class10 {
 | 
			
		||||
        <<service>>
 | 
			
		||||
        int id
 | 
			
		||||
        test()
 | 
			
		||||
      }
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid2" style="">
 | 
			
		||||
classDiagram-v2
 | 
			
		||||
      Class01 <|-- AveryLongClass : Cool
 | 
			
		||||
      <<interface>> Class01
 | 
			
		||||
      Class03 *-- Class04
 | 
			
		||||
      Class05 o-- Class06
 | 
			
		||||
      Class07 .. Class08
 | 
			
		||||
      Class09 --> C2 : Where am i?
 | 
			
		||||
      Class09 --* C3
 | 
			
		||||
      Class09 --|> Class07
 | 
			
		||||
      Class12 <|.. Class08
 | 
			
		||||
      Class11 ..>Class12
 | 
			
		||||
      Class07 : equals()
 | 
			
		||||
      Class07 : Object[] elementData
 | 
			
		||||
      Class01 : size()
 | 
			
		||||
      Class01 : int chimp
 | 
			
		||||
      Class01 : int gorilla
 | 
			
		||||
      Class01 : -int privateChimp
 | 
			
		||||
      Class01 : +int publicGorilla
 | 
			
		||||
      Class01 : #int protectedMarmoset
 | 
			
		||||
      Class08 <--> C2: Cool label
 | 
			
		||||
      class Class10 {
 | 
			
		||||
        <<service>>
 | 
			
		||||
        int id
 | 
			
		||||
        test()
 | 
			
		||||
      }
 | 
			
		||||
      </pre>
 | 
			
		||||
      <pre class="mermaid" style="">
 | 
			
		||||
flowchart BT
 | 
			
		||||
   subgraph S1
 | 
			
		||||
    sub1 -->sub2
 | 
			
		||||
   end
 | 
			
		||||
  subgraph S2
 | 
			
		||||
    sub4
 | 
			
		||||
   end
 | 
			
		||||
   S1 --> S2
 | 
			
		||||
   sub1 --> sub4
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      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) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        // theme: 'neutral',
 | 
			
		||||
        // arrowMarkerAbsolute: true,
 | 
			
		||||
        // themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
 | 
			
		||||
        theme: 'base',
 | 
			
		||||
        startOnLoad: true,
 | 
			
		||||
        logLevel: 0,
 | 
			
		||||
        flowchart: { curve: 'cardinal', htmlLabels: false },
 | 
			
		||||
        // htmlLabels: true,
 | 
			
		||||
        // gantt: { axisFormat: '%m/%d/%Y' },
 | 
			
		||||
        // sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
 | 
			
		||||
        // sequenceDiagram: { actorMargin: 300 } // deprecated
 | 
			
		||||
        // fontFamily: '"times", sans-serif',
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
        // fontSize: 18,
 | 
			
		||||
        // curve: 'cardinal',
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
        // themeVariables: {relationLabelColor: 'red'}
 | 
			
		||||
        flowchart: {
 | 
			
		||||
          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);
 | 
			
		||||
      };
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</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-example-diagram-detector.js"></script>
 | 
			
		||||
    <script src="./packages/mermaid/dist/mermaid.js"></script>
 | 
			
		||||
    <script src="./packages/mermaid/dist/mermaid.esm.mjs"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,4 @@
 | 
			
		||||
<html>
 | 
			
		||||
  <head>
 | 
			
		||||
    <script src="http://localhost:9000/mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        theme: 'base',
 | 
			
		||||
        themeVariables: {},
 | 
			
		||||
        startOnLoad: true,
 | 
			
		||||
      });
 | 
			
		||||
    </script>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <h1>Example</h1>
 | 
			
		||||
    <pre class="mermaid">
 | 
			
		||||
@@ -26,4 +16,12 @@ sequenceDiagram
 | 
			
		||||
    Note left of Ernie: Cookies are good
 | 
			
		||||
    </pre>
 | 
			
		||||
  </body>
 | 
			
		||||
  <script type="module">
 | 
			
		||||
    import mermaid from '/mermaid.esm.mjs';
 | 
			
		||||
    mermaid.initialize({
 | 
			
		||||
      theme: 'base',
 | 
			
		||||
      themeVariables: {},
 | 
			
		||||
      startOnLoad: true,
 | 
			
		||||
    });
 | 
			
		||||
  </script>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,19 +9,19 @@
 | 
			
		||||
  <body>
 | 
			
		||||
    <div id="graph"></div>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      mermaid.init({ startOnLoad: false });
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      await mermaid.initialize({ startOnLoad: false });
 | 
			
		||||
      await mermaid.run();
 | 
			
		||||
 | 
			
		||||
      mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
 | 
			
		||||
      await mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
 | 
			
		||||
      try {
 | 
			
		||||
        console.log('rendering');
 | 
			
		||||
        mermaid.mermaidAPI.render('graphDiv', `>`);
 | 
			
		||||
        await mermaid.mermaidAPI.render('graphDiv', `>`);
 | 
			
		||||
      } catch (e) {}
 | 
			
		||||
 | 
			
		||||
      mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => {
 | 
			
		||||
        document.getElementById('graph').innerHTML = html;
 | 
			
		||||
      });
 | 
			
		||||
      const { svg } = await mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`);
 | 
			
		||||
      document.getElementById('graph').innerHTML = svg;
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,20 +9,20 @@
 | 
			
		||||
  <body>
 | 
			
		||||
    <div id="graph"></div>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      mermaid.init({ startOnLoad: false });
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({ startOnLoad: false });
 | 
			
		||||
      mermaid.mermaidAPI.initialize();
 | 
			
		||||
 | 
			
		||||
      rerender('XMas');
 | 
			
		||||
 | 
			
		||||
      function rerender(text) {
 | 
			
		||||
      async function rerender(text) {
 | 
			
		||||
        const graphText = `graph TD
 | 
			
		||||
        A[${text}] -->|Get money| B(Go shopping)`;
 | 
			
		||||
        const graph = mermaid.mermaidAPI.render('id', graphText);
 | 
			
		||||
        console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
 | 
			
		||||
        document.getElementById('graph').innerHTML = graph;
 | 
			
		||||
        const { svg } = await mermaid.mermaidAPI.render('id', graphText);
 | 
			
		||||
        console.log('\x1b[35m%s\x1b[0m', '>> graph', svg);
 | 
			
		||||
        document.getElementById('graph').innerHTML = svg;
 | 
			
		||||
      }
 | 
			
		||||
      window.rerender = rerender;
 | 
			
		||||
      await rerender('XMas');
 | 
			
		||||
    </script>
 | 
			
		||||
    <button id="rerender" onclick="rerender('Saturday')">Rerender</button>
 | 
			
		||||
  </body>
 | 
			
		||||
 
 | 
			
		||||
@@ -313,8 +313,8 @@ requirementDiagram
 | 
			
		||||
      merge release
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -308,8 +308,8 @@ gitGraph
 | 
			
		||||
   
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -308,8 +308,8 @@ gitGraph
 | 
			
		||||
      merge release
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -301,8 +301,8 @@ requirementDiagram
 | 
			
		||||
      merge release
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -305,8 +305,8 @@ requirementDiagram
 | 
			
		||||
      merge release
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -305,8 +305,8 @@ requirementDiagram
 | 
			
		||||
      merge release
 | 
			
		||||
      </pre>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,274 @@
 | 
			
		||||
<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>
 | 
			
		||||
    <pre class="mermaid">
 | 
			
		||||
    none
 | 
			
		||||
    hello world
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
 | 
			
		||||
graph TB
 | 
			
		||||
      a --> b
 | 
			
		||||
      a --> c
 | 
			
		||||
      b --> d
 | 
			
		||||
      c --> d
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
flowchart-elk LR
 | 
			
		||||
  subgraph A
 | 
			
		||||
  a --> b
 | 
			
		||||
  end
 | 
			
		||||
  subgraph B
 | 
			
		||||
  b
 | 
			
		||||
  end
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
 | 
			
		||||
flowchart TB
 | 
			
		||||
  %% I could not figure out how to use double quotes in labels in Mermaid
 | 
			
		||||
  subgraph ibm[IBM Espresso CPU]
 | 
			
		||||
    core0[IBM PowerPC Broadway Core 0]
 | 
			
		||||
    core1[IBM PowerPC Broadway Core 1]
 | 
			
		||||
    core2[IBM PowerPC Broadway Core 2]
 | 
			
		||||
 | 
			
		||||
    rom[16 KB ROM]
 | 
			
		||||
 | 
			
		||||
    core0 --- core2
 | 
			
		||||
 | 
			
		||||
    rom --> core2
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  subgraph amd[AMD Latte GPU]
 | 
			
		||||
    mem[Memory & I/O Bridge]
 | 
			
		||||
    dram[DRAM Controller]
 | 
			
		||||
    edram[32 MB EDRAM MEM1]
 | 
			
		||||
    rom[512 B SEEPROM]
 | 
			
		||||
 | 
			
		||||
    sata[SATA IF]
 | 
			
		||||
    exi[EXI]
 | 
			
		||||
 | 
			
		||||
    subgraph gx[GX]
 | 
			
		||||
      sram[3 MB 1T-SRAM]
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    radeon[AMD Radeon R7xx GX2]
 | 
			
		||||
 | 
			
		||||
    mem --- gx
 | 
			
		||||
    mem --- radeon
 | 
			
		||||
 | 
			
		||||
    rom --- mem
 | 
			
		||||
 | 
			
		||||
    mem --- sata
 | 
			
		||||
    mem --- exi
 | 
			
		||||
 | 
			
		||||
    dram --- sata
 | 
			
		||||
    dram --- exi
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  ddr3[2 GB DDR3 RAM MEM2]
 | 
			
		||||
 | 
			
		||||
  mem --- ddr3
 | 
			
		||||
  dram --- ddr3
 | 
			
		||||
  edram --- ddr3
 | 
			
		||||
 | 
			
		||||
  core1 --- mem
 | 
			
		||||
 | 
			
		||||
  exi --- rtc
 | 
			
		||||
  rtc{{rtc}}
 | 
			
		||||
</pre
 | 
			
		||||
    >
 | 
			
		||||
    <br />
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
flowchart TB
 | 
			
		||||
  %% I could not figure out how to use double quotes in labels in Mermaid
 | 
			
		||||
  subgraph ibm[IBM Espresso CPU]
 | 
			
		||||
    core0[IBM PowerPC Broadway Core 0]
 | 
			
		||||
    core1[IBM PowerPC Broadway Core 1]
 | 
			
		||||
    core2[IBM PowerPC Broadway Core 2]
 | 
			
		||||
 | 
			
		||||
    rom[16 KB ROM]
 | 
			
		||||
 | 
			
		||||
    core0 --- core2
 | 
			
		||||
 | 
			
		||||
    rom --> core2
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  subgraph amd[AMD Latte GPU]
 | 
			
		||||
    mem[Memory & I/O Bridge]
 | 
			
		||||
    dram[DRAM Controller]
 | 
			
		||||
    edram[32 MB EDRAM MEM1]
 | 
			
		||||
    rom[512 B SEEPROM]
 | 
			
		||||
 | 
			
		||||
    sata[SATA IF]
 | 
			
		||||
    exi[EXI]
 | 
			
		||||
 | 
			
		||||
    subgraph gx[GX]
 | 
			
		||||
      sram[3 MB 1T-SRAM]
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    radeon[AMD Radeon R7xx GX2]
 | 
			
		||||
 | 
			
		||||
    mem --- gx
 | 
			
		||||
    mem --- radeon
 | 
			
		||||
 | 
			
		||||
    rom --- mem
 | 
			
		||||
 | 
			
		||||
    mem --- sata
 | 
			
		||||
    mem --- exi
 | 
			
		||||
 | 
			
		||||
    dram --- sata
 | 
			
		||||
    dram --- exi
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  ddr3[2 GB DDR3 RAM MEM2]
 | 
			
		||||
 | 
			
		||||
  mem --- ddr3
 | 
			
		||||
  dram --- ddr3
 | 
			
		||||
  edram --- ddr3
 | 
			
		||||
 | 
			
		||||
  core1 --- mem
 | 
			
		||||
 | 
			
		||||
  exi --- rtc
 | 
			
		||||
  rtc{{rtc}}
 | 
			
		||||
</pre
 | 
			
		||||
    >
 | 
			
		||||
    <br />
 | 
			
		||||
     
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
      flowchart LR
 | 
			
		||||
  B1 --be be--x B2
 | 
			
		||||
  B1 --bo bo--o B3
 | 
			
		||||
  subgraph Ugge
 | 
			
		||||
      B2
 | 
			
		||||
      B3
 | 
			
		||||
      subgraph inner
 | 
			
		||||
          B4
 | 
			
		||||
          B5
 | 
			
		||||
      end
 | 
			
		||||
      subgraph inner2
 | 
			
		||||
        subgraph deeper
 | 
			
		||||
          C4
 | 
			
		||||
          C5
 | 
			
		||||
        end
 | 
			
		||||
        C6
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      B4 --> C4
 | 
			
		||||
 | 
			
		||||
      B3 -- X --> B4
 | 
			
		||||
      B2 --> inner
 | 
			
		||||
 | 
			
		||||
      C4 --> C5
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  subgraph outer
 | 
			
		||||
      B6
 | 
			
		||||
  end
 | 
			
		||||
  B6 --> B5
 | 
			
		||||
  </pre
 | 
			
		||||
    >
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
sequenceDiagram
 | 
			
		||||
    Customer->>+Stripe: Makes a payment request
 | 
			
		||||
    Stripe->>+Bank: Forwards the payment request to the bank
 | 
			
		||||
    Bank->>+Customer: Asks for authorization
 | 
			
		||||
    Customer->>+Bank: Provides authorization
 | 
			
		||||
    Bank->>+Stripe: Sends a response with payment details
 | 
			
		||||
    Stripe->>+Merchant: Sends a notification of payment receipt
 | 
			
		||||
    Merchant->>+Stripe: Confirms the payment
 | 
			
		||||
    Stripe->>+Customer: Sends a confirmation of payment
 | 
			
		||||
    Customer->>+Merchant: Receives goods or services
 | 
			
		||||
        </pre
 | 
			
		||||
    >
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
      gantt
 | 
			
		||||
        title Style today marker (vertical line should be 5px wide and half-transparent blue)
 | 
			
		||||
        dateFormat YYYY-MM-DD
 | 
			
		||||
        axisFormat %d
 | 
			
		||||
        todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
 | 
			
		||||
        section Section1
 | 
			
		||||
        Today: 1, -1h
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from '../../packages/mermaid/src/mermaid';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
      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);
 | 
			
		||||
      };
 | 
			
		||||
      // 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>
 | 
			
		||||
 
 | 
			
		||||
@@ -34,8 +34,8 @@
 | 
			
		||||
      9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
 | 
			
		||||
      style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function showFullFirstSquad(elemName) {
 | 
			
		||||
        console.log('show ' + elemName);
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -120,8 +120,8 @@
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
 
 | 
			
		||||
@@ -25,8 +25,8 @@
 | 
			
		||||
          Get into car:4: Dad, Mum, Child 1, Child 2
 | 
			
		||||
          Drive home:3: Dad
 | 
			
		||||
    </pre>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        theme: 'forest',
 | 
			
		||||
        logLevel: 3,
 | 
			
		||||
 
 | 
			
		||||
@@ -26,8 +26,8 @@
 | 
			
		||||
      A --> B --> C
 | 
			
		||||
    </pre>
 | 
			
		||||
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      function showFullFirstSquad(elemName) {
 | 
			
		||||
        console.log('show ' + elemName);
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,17 @@
 | 
			
		||||
import mermaid2 from '../../packages/mermaid/src/mermaid';
 | 
			
		||||
import mindmap from '../../packages/mermaid-mindmap/src/detector';
 | 
			
		||||
import externalExample from '../../packages/mermaid-example-diagram/src/detector';
 | 
			
		||||
 | 
			
		||||
function b64ToUtf8(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
 | 
			
		||||
 * configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
 | 
			
		||||
@@ -37,9 +44,10 @@ const contentLoaded = async function () {
 | 
			
		||||
      document.getElementsByTagName('body')[0].appendChild(div);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await mermaid2.registerExternalDiagrams([mindmap]);
 | 
			
		||||
    await mermaid2.registerExternalDiagrams([externalExample]);
 | 
			
		||||
    mermaid2.initialize(graphObj.mermaid);
 | 
			
		||||
    mermaid2.init();
 | 
			
		||||
    await mermaid2.run();
 | 
			
		||||
    markRendered();
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -67,7 +75,7 @@ function merge(current, update) {
 | 
			
		||||
  return current;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const contentLoadedApi = function () {
 | 
			
		||||
const contentLoadedApi = async function () {
 | 
			
		||||
  let pos = document.location.href.indexOf('?graph=');
 | 
			
		||||
  if (pos > 0) {
 | 
			
		||||
    pos = pos + 7;
 | 
			
		||||
@@ -94,40 +102,28 @@ const contentLoadedApi = function () {
 | 
			
		||||
      mermaid2.initialize(cnf);
 | 
			
		||||
 | 
			
		||||
      for (let i = 0; i < numCodes; i++) {
 | 
			
		||||
        mermaid2.render(
 | 
			
		||||
        const { svg, bindFunctions } = await mermaid2.render(
 | 
			
		||||
          'newid' + i,
 | 
			
		||||
          graphObj.code[i],
 | 
			
		||||
          (svgCode, bindFunctions) => {
 | 
			
		||||
            div.innerHTML = svgCode;
 | 
			
		||||
 | 
			
		||||
            bindFunctions(div);
 | 
			
		||||
          },
 | 
			
		||||
          divs[i]
 | 
			
		||||
        );
 | 
			
		||||
        div.innerHTML = svg;
 | 
			
		||||
        bindFunctions(div);
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      const div = document.createElement('div');
 | 
			
		||||
      div.id = 'block';
 | 
			
		||||
      div.className = 'mermaid';
 | 
			
		||||
      // div.innerHTML = graphObj.code
 | 
			
		||||
      console.warn('graphObj.mermaid', graphObj.mermaid);
 | 
			
		||||
      document.getElementsByTagName('body')[0].appendChild(div);
 | 
			
		||||
      mermaid2.initialize(graphObj.mermaid);
 | 
			
		||||
 | 
			
		||||
      mermaid2.render(
 | 
			
		||||
        'newid',
 | 
			
		||||
        graphObj.code,
 | 
			
		||||
        (svgCode, bindFunctions) => {
 | 
			
		||||
          div.innerHTML = svgCode;
 | 
			
		||||
 | 
			
		||||
          if (bindFunctions) {
 | 
			
		||||
            bindFunctions(div);
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        div
 | 
			
		||||
      );
 | 
			
		||||
      const { svg, bindFunctions } = await mermaid2.render('newid', graphObj.code, div);
 | 
			
		||||
      div.innerHTML = svg;
 | 
			
		||||
      bindFunctions(div);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  markRendered();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (typeof document !== 'undefined') {
 | 
			
		||||
@@ -139,10 +135,10 @@ if (typeof document !== 'undefined') {
 | 
			
		||||
    function () {
 | 
			
		||||
      if (this.location.href.match('xss.html')) {
 | 
			
		||||
        this.console.log('Using api');
 | 
			
		||||
        contentLoadedApi();
 | 
			
		||||
        void contentLoadedApi();
 | 
			
		||||
      } else {
 | 
			
		||||
        this.console.log('Not using api');
 | 
			
		||||
        contentLoaded();
 | 
			
		||||
        void contentLoaded();
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    false
 | 
			
		||||
 
 | 
			
		||||
@@ -33,8 +33,8 @@
 | 
			
		||||
    </script>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.initialize({
 | 
			
		||||
        startOnLoad: false,
 | 
			
		||||
        useMaxWidth: true,
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,8 @@
 | 
			
		||||
      <div id="diagram" class="mermaid"></div>
 | 
			
		||||
      <div id="res" class=""></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
@@ -104,10 +104,9 @@
 | 
			
		||||
      //  diagram += "=xssAttack()> --> B";
 | 
			
		||||
      console.log(diagram);
 | 
			
		||||
      // document.querySelector('#diagram').innerHTML = diagram;
 | 
			
		||||
      mermaid.render('diagram', diagram, (res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        document.querySelector('#res').innerHTML = res;
 | 
			
		||||
      });
 | 
			
		||||
      const { svg } = await mermaid.render('diagram', diagram);
 | 
			
		||||
      console.log(res);
 | 
			
		||||
      document.querySelector('#res').innerHTML = svg;
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,8 @@
 | 
			
		||||
      <div id="diagram" class="mermaid"></div>
 | 
			
		||||
      <div id="res" class=""></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
@@ -102,10 +102,9 @@
 | 
			
		||||
      //  diagram += "=xssAttack()> --> B";
 | 
			
		||||
      console.log(diagram);
 | 
			
		||||
      // document.querySelector('#diagram').innerHTML = diagram;
 | 
			
		||||
      mermaid.render('diagram', diagram, (res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        document.querySelector('#res').innerHTML = res;
 | 
			
		||||
      });
 | 
			
		||||
      const { svg } = await mermaid.render('diagram', diagram);
 | 
			
		||||
      console.log(res);
 | 
			
		||||
      document.querySelector('#res').innerHTML = svg;
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,8 @@
 | 
			
		||||
      <div id="diagram" class="mermaid"></div>
 | 
			
		||||
      <div id="res" class=""></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
@@ -102,10 +102,9 @@
 | 
			
		||||
      //  diagram += "=xssAttack()> --> B";
 | 
			
		||||
      console.log(diagram);
 | 
			
		||||
      // document.querySelector('#diagram').innerHTML = diagram;
 | 
			
		||||
      mermaid.render('diagram', diagram, (res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        document.querySelector('#res').innerHTML = res;
 | 
			
		||||
      });
 | 
			
		||||
      const { svg } = await mermaid.render('diagram', diagram);
 | 
			
		||||
      console.log(res);
 | 
			
		||||
      document.querySelector('#res').innerHTML = svg;
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,8 @@
 | 
			
		||||
      <div id="diagram" class="mermaid"></div>
 | 
			
		||||
      <div id="res" class=""></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script src="./mermaid.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
    <script type="module">
 | 
			
		||||
      import mermaid from './mermaid.esm.mjs';
 | 
			
		||||
      mermaid.parseError = function (err, hash) {
 | 
			
		||||
        // console.error('Mermaid error: ', err);
 | 
			
		||||
      };
 | 
			
		||||
@@ -102,10 +102,9 @@
 | 
			
		||||
      //  diagram += "=xssAttack()> --> B";
 | 
			
		||||
      console.log(diagram);
 | 
			
		||||
      // document.querySelector('#diagram').innerHTML = diagram;
 | 
			
		||||
      mermaid.render('diagram', diagram, (res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        document.querySelector('#res').innerHTML = res;
 | 
			
		||||
      });
 | 
			
		||||
      const { svg } = await mermaid.render('diagram', diagram);
 | 
			
		||||
      console.log(res);
 | 
			
		||||
      document.querySelector('#res').innerHTML = svg;
 | 
			
		||||
    </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user