Compare commits

...

1913 Commits

Author SHA1 Message Date
Knut Sveidqvist
d6b2bcf0d2 v8.8.4 2020-12-05 14:43:29 +01:00
Knut Sveidqvist
3b55a19119 Merge pull request #1805 from BastianZim/patch-1
Update copyright years
2020-12-03 18:24:12 +01:00
Bastian Zimmermann
8ed7d22010 Updated copyright years
Changed 2018 - 2020
2020-12-02 16:49:09 +01:00
Knut Sveidqvist
96ac13cdac Merge branch 'master' into develop 2020-11-26 19:25:57 +01:00
Knut Sveidqvist
d409006a44 Merge remote-tracking branch 'origin/develop' into develop 2020-11-26 19:22:26 +01:00
Knut Sveidqvist
2e7452f067 Lint fix 2020-11-26 19:15:45 +01:00
Ashish Jain
ddc31870bf Merge pull request #1786 from JiChao99/patch-1
remove classDiagram duplicate options
2020-11-26 19:10:22 +01:00
Knut Sveidqvist
77d6048005 #1771 Fixed broken link 2020-11-26 19:09:39 +01:00
Knut Sveidqvist
8748e661e8 Merge pull request #1796 from kciter/bug/fix_markdown_bug
Fixed markdown error in Relationship Syntax
2020-11-26 18:59:31 +01:00
Knut Sveidqvist
a50086ddec Merge pull request #1789 from mermaid-js/dependabot/npm_and_yarn/highlight.js-9.18.5
Bump highlight.js from 9.18.1 to 9.18.5
2020-11-26 18:57:53 +01:00
Knut Sveidqvist
465fa571d2 Merge pull request #1787 from julianbei/feature/727_deterministic_svg_ids
Add different id generators
2020-11-26 18:56:58 +01:00
Lee Sun-Hyoup
d72ba16664 Fixed markdown error in Relationship Syntax 2020-11-26 14:25:22 +09:00
dependabot[bot]
efd14f4c24 Bump highlight.js from 9.18.1 to 9.18.5
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.18.1...9.18.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-25 00:41:08 +00:00
Julian Amelung
c472024921 Add test cases for utils.initIdGeneratior 2020-11-23 23:54:00 +01:00
Julian Amelung
35cd3918df Add different id generators 2020-11-23 23:05:41 +01:00
alec ji
a2a0851978 remove classDiagram duplicate options
remove classDiagram `#Multiplicity on relations` duplicate options
2020-11-21 02:42:27 +00:00
Knut Sveidqvist
b329679d2d Merge pull request #1773 from tomatoman25/bug/1759_state_notes
Changed regex for multi-line state notes
2020-11-19 17:48:53 +01:00
Knut Sveidqvist
39657e6537 Merge pull request #1784 from gwatts/patch-1
Add Doscy to list of integrations
2020-11-19 17:48:02 +01:00
Knut Sveidqvist
ee99d15df4 Merge pull request #1772 from glensc/babel-dev-dep
Move babel-eslint to devDependencies
2020-11-19 17:47:29 +01:00
Gareth Watts
813b993819 Add Doscy to list of integrations
Docsy includes support for Mermaid in the theme.
2020-11-18 21:57:12 -06:00
GDFaber
f62189b381 Merge pull request #1781 from mermaid-js/bug/1751_flowchart_subgraph_styles
Apply style settings to subgraphs in "flowchart" diagrams
2020-11-18 00:42:30 +01:00
GDFaber
dfa306c8c2 Merge pull request #1782 from mermaid-js/bug/1742_replace_console_log_with_logger_info
Narrow down console logging when flowchart subgraphs are added
2020-11-18 00:40:29 +01:00
GDFaber
df7e90f4b5 Merge pull request #1780 from manicki/bug/typo_lagom_explanation
Fixed typo in the docs
2020-11-18 00:39:54 +01:00
Marc Faber
55532c00b4 Revert updates on integration tests due to failing PR tests 2020-11-18 00:34:02 +01:00
Marc Faber
7ea18f5462 #1742 narrow down console logging when flowchart subgraphs are added 2020-11-18 00:02:10 +01:00
Marc Faber
a16bbb8046 #1751 apply style settings to subgraphs in "flowchart" diagrams 2020-11-17 23:18:11 +01:00
Leszek Manicki
1d30241871 Fixed typo in the docs 2020-11-17 20:40:16 +01:00
Marc Faber
a0e5ec1d13 Merge branch 'bug/1423_ignore_build_files_in_dist' into develop 2020-11-17 15:50:25 +01:00
Marc Faber
830620740a Unix line endings 2020-11-17 15:44:00 +01:00
GDFaber
d34e8c4336 Merge pull request #1777 from mermaid-js/bug/1423_ignore_build_files_in_dist
ignore build files in dist folder
2020-11-17 14:54:45 +01:00
Marc Faber
2370531e75 #1423 ignore build files in dist folder 2020-11-17 14:48:48 +01:00
Marc Faber
06f74a8c15 updated integration tests 2020-11-17 14:34:48 +01:00
GDFaber
e0ad5eaf5e Merge pull request #1776 from mermaid-js/bug/1767_add_sansserif_to_default_fonts
Add sans-serif to default font settings
2020-11-17 13:11:35 +01:00
Marc Faber
067f356010 #1767 Add sans-serif to default font settings 2020-11-17 11:36:34 +01:00
Neil Cuzon
555a38b819 Update mermaidAPI.js 2020-11-15 13:52:21 -08:00
Neil Cuzon
88f2ede8fe Update usage.md 2020-11-15 13:51:45 -08:00
Neil Cuzon
9b2f61d778 Update flowchart.md 2020-11-15 13:44:47 -08:00
Marc Faber
0801047fe6 added a file for graph<->flowchart comparisons to dist folder 2020-11-15 19:22:55 +01:00
Neil Cuzon
f8b8d03e15 Add files via upload 2020-11-15 07:57:22 -08:00
Neil Cuzon
f4270a0d75 Delete GitHub-Mark-32px.png 2020-11-15 07:57:08 -08:00
Neil Cuzon
0ab629e32d Add files via upload 2020-11-15 07:56:15 -08:00
Neil Cuzon
4259611726 Add files via upload 2020-11-15 07:34:36 -08:00
Neil Cuzon
24e2429fc0 Add files via upload 2020-11-15 07:34:05 -08:00
Neil Cuzon
ebf046ebc0 Delete GitHub-Mark-32px.png.png 2020-11-15 07:33:31 -08:00
Neil Cuzon
0155171c0d Add files via upload 2020-11-15 07:24:37 -08:00
Neil Cuzon
5a92b77560 Update flowchart.md 2020-11-15 07:19:13 -08:00
Marc Faber
0604b1a822 Merge branch 'forkgroup-docs/update_edit_this_page' into develop 2020-11-15 16:15:14 +01:00
Marc Faber
d54f3afe25 Merge branch 'docs/update_edit_this_page' of https://github.com/forkgroup/mermaid into forkgroup-docs/update_edit_this_page 2020-11-15 16:13:42 +01:00
Neil Cuzon
acc2392c3d Update mermaidAPI.js 2020-11-15 05:00:54 -08:00
Neil Cuzon
3044c63773 Update usage.md 2020-11-15 04:51:33 -08:00
Neil Cuzon
f963238a75 Update mermaidAPI.js 2020-11-15 03:45:20 -08:00
Neil Cuzon
46d41ba67a Update n00b-gettingStarted.md 2020-11-15 03:25:02 -08:00
Neil Cuzon
00921ce713 Add files via upload 2020-11-15 03:22:44 -08:00
Neil Cuzon
55073bd891 Add files via upload 2020-11-15 03:19:33 -08:00
Neil Cuzon
2b4ceda937 Update n00b-gettingStarted.md 2020-11-15 03:19:28 -08:00
Neil Cuzon
93ddc0b4f5 Delete liveEditorOptions.png 2020-11-15 03:14:49 -08:00
Neil Cuzon
a74fc5aac7 Delete n00b-Confluence1.png 2020-11-15 03:14:38 -08:00
Neil Cuzon
e1032498e2 Delete n00b-Confluence2.png 2020-11-15 03:14:32 -08:00
Neil Cuzon
f43e07bc68 Delete n00b-Confluence3.png 2020-11-15 03:14:25 -08:00
Neil Cuzon
e61207ab41 Delete n00b-Confluence4.png 2020-11-15 03:14:18 -08:00
Neil Cuzon
0f87b1b5da Delete n00b-liveEditor.png 2020-11-15 03:14:11 -08:00
Neil Cuzon
6032e33290 Update _sidebar.md 2020-11-15 03:07:01 -08:00
Neil Cuzon
037cba9a13 Update n00b-gettingStarted.md 2020-11-15 02:48:45 -08:00
sy-records
cb41569a5a feat: Auto generation of Edit this Page 2020-11-15 10:28:47 +08:00
sy-records
6167f5d7b4 chore: update resources links and fix typo 2020-11-15 10:27:08 +08:00
GDFaber
b50a453fe0 Merge pull request #1764 from AloisMahdal/doc_df_table
Re-align gantt chart dateFormat table with spaces
2020-11-13 23:25:34 +01:00
Anthony
52d7f02dcb Changed regex for multi-line state notes 2020-11-13 14:10:42 -05:00
Elan Ruusamäe
cce90a2bed Move babel-eslint to devDependencies
It was added to runtime dependencies with bulk commit a4bf85b1b6

refs:
- https://github.com/mermaid-js/mermaid/pull/1586
2020-11-13 13:53:10 +02:00
Alois Mahdal
973b6fc355 Re-align gantt chart dateFormat table with spaces
With tabs, the table does not render in a readable way.  This commit is
replacing tabs with spaces.
2020-11-10 11:31:14 +01:00
Neil Cuzon
331c7d1a1a Update 8.6.0_docs.md 2020-11-08 19:32:11 -08:00
Neil Cuzon
e35ee592ad Update directives.md 2020-11-08 18:59:32 -08:00
Neil Cuzon
2e646d722c Update directives.md 2020-11-08 18:58:46 -08:00
Neil Cuzon
fff29fcd69 Update Setup.md 2020-11-08 01:29:00 -08:00
Neil Cuzon
4fd8bcd7c7 Update usage.md 2020-11-07 23:42:35 -08:00
Neil Cuzon
9fd97d89c0 Update usage.md 2020-11-07 23:41:58 -08:00
Neil Cuzon
0544f96980 Update README.md 2020-11-07 21:28:33 -08:00
Neil Cuzon
4671a49fd8 Update _sidebar.md 2020-11-07 21:24:38 -08:00
Knut Sveidqvist
e3cf8b7843 Updated version oif mermaid in the docs 2020-11-05 20:09:08 +01:00
Knut Sveidqvist
997257ff79 Merge branch 'release/8.8.3'
Conflicts:
	docs/diagrams-and-syntax-and-examples/flowchart.md
	docs/flowchart.md
2020-11-05 20:08:18 +01:00
Ashish Jain
153da33311 Updating minor changes on Docs 2020-11-05 19:29:29 +01:00
Knut Sveidqvist
93f613d6af Merge branch 'release/8.8.3' of github.com:mermaid-js/mermaid into release/8.8.3 2020-11-05 19:23:41 +01:00
Knut Sveidqvist
608c0df0f7 Updated docs 2020-11-05 19:23:38 +01:00
Ashish Jain
4f568d5d19 Updating minor changes on Docs 2020-11-05 19:16:12 +01:00
Knut Sveidqvist
331c952212 Merge pull request #1757 from spopida/bug/1756_ERD_padding
Fix padding for entities with no attributes
2020-11-05 18:53:46 +01:00
Adrian Hall
879da091d3 Fix padding for entities with no attributes 2020-11-05 11:56:57 +00:00
Knut Sveidqvist
68410b9c58 Merge branch 'release/8.8.3' into develop 2020-11-04 20:33:25 +01:00
Knut Sveidqvist
7a3ecb339b Updated the docs, updated the sections and fixed some bad links 2020-11-04 20:28:10 +01:00
Knut Sveidqvist
144cba7f10 Merge pull request #1755 from loris-intergalactique/develop
Fixed spelling errors
2020-11-04 19:24:50 +01:00
Knut Sveidqvist
ee4571071d Merge pull request #1750 from spopida/feature/1531_ERD_attributes
Feature/1531 erd attributes
2020-11-04 19:24:22 +01:00
LORIS INTERGALACTIQUE
47a3ca44ba Add scss path in docs 2020-11-04 16:59:28 +01:00
LORIS INTERGALACTIQUE
0e7ad3feeb Removed an incomplete line 2020-11-04 16:56:12 +01:00
LORIS INTERGALACTIQUE
bb6ba758db Fixed spelling errors 2020-11-04 16:52:28 +01:00
Adrian Hall
1ce4805bdc Merge branch 'develop' into feature/1531_ERD_attributes 2020-11-02 09:44:56 +00:00
Adrian Hall
ecdb66f65a Merge branch 'develop' of https://github.com/mermaid-js/mermaid into develop 2020-11-02 09:42:23 +00:00
Adrian Hall
ae1880311e Support attribute definitions for entities in ERDs 2020-11-02 09:41:46 +00:00
Knut Sveidqvist
6652319283 Merge branch 'release/8.8.3' into develop 2020-11-01 11:09:40 +01:00
Knut Sveidqvist
855dec7fcd Fix for build 2020-11-01 11:08:47 +01:00
Knut Sveidqvist
e57120fa61 Version update in package.json to 8.8.3 2020-10-31 11:14:39 +01:00
Knut Sveidqvist
f955eef31e Merge branch 'spopida-bug/1710_underscore_in_entity_names' into develop 2020-10-31 11:10:53 +01:00
Knut Sveidqvist
6aaec3dc96 Merge branch 'bug/1710_underscore_in_entity_names' of https://github.com/spopida/mermaid into spopida-bug/1710_underscore_in_entity_names 2020-10-31 11:10:24 +01:00
Knut Sveidqvist
f59e5128d7 Merge pull request #1749 from levlas/bug/1748-broken-links
fix broken links in README
2020-10-31 11:06:54 +01:00
Knut Sveidqvist
29fa2dfcfb Merge pull request #1743 from lishid/patch-1
Fixed bad tertiary operator
2020-10-31 11:05:50 +01:00
Neil Cuzon
6363cb0d80 Update README.md 2020-10-30 18:14:10 -07:00
Neil Cuzon
17d9f4fb46 Update README.md 2020-10-30 18:11:35 -07:00
Neil Cuzon
2c6329310a Update README.md 2020-10-30 18:09:31 -07:00
Neil Cuzon
48089e869e Update README.md 2020-10-30 18:06:57 -07:00
Neil Cuzon
5cb735eb8f Update README.md 2020-10-30 18:02:26 -07:00
Neil Cuzon
d034e32703 Update README.md 2020-10-30 17:59:54 -07:00
Neil Cuzon
a3b8c84e39 Update README.md 2020-10-30 17:58:42 -07:00
Neil Cuzon
bf2376d504 Update README.md 2020-10-30 17:58:34 -07:00
Neil Cuzon
aba8c0356a Update README.md 2020-10-30 17:57:36 -07:00
Adrian Hall
8870ba3b65 merge from updated develop 2020-10-30 14:40:45 +00:00
Adrian Hall
26e0283fc7 Merge remote-tracking branch 'origin/bug/1710_underscore_in_entity_names' into develop 2020-10-30 13:56:22 +00:00
Adrian Hall
0c38e014d7 Support entity attributes 2020-10-30 13:45:35 +00:00
Levente Laszlo
b89f79d901 fix broken links in README 2020-10-29 20:21:21 +01:00
Neil Cuzon
56fbbef133 Update stateDiagram.md 2020-10-28 01:10:39 -07:00
Neil Cuzon
6ece2537ee Update usage.md 2020-10-28 01:10:34 -07:00
Neil Cuzon
f7b722f10f Update user-journey.md 2020-10-28 01:10:29 -07:00
Neil Cuzon
64544a6e7c Update pie.md 2020-10-28 01:09:49 -07:00
Neil Cuzon
1ef7a097a6 Update integrations.md 2020-10-28 00:44:37 -07:00
Neil Cuzon
b70297dc7a Update n00b-gettingStarted.md 2020-10-28 00:44:34 -07:00
Neil Cuzon
732b3289f0 Update n00b-overview.md 2020-10-28 00:44:31 -07:00
Neil Cuzon
bc0caa5dd6 Update n00b-syntaxReference.md 2020-10-28 00:44:29 -07:00
Neil Cuzon
f835b34f57 Update newDiagram.md 2020-10-28 00:44:27 -07:00
Neil Cuzon
3aa33bd720 Update examples.md 2020-10-28 00:40:31 -07:00
Neil Cuzon
87601fba1b Update faq.md 2020-10-28 00:40:29 -07:00
Neil Cuzon
adc900a03a Update flowchart.md 2020-10-28 00:40:25 -07:00
Neil Cuzon
de52808e9f Update gantt.md 2020-10-28 00:40:23 -07:00
Neil Cuzon
31aebca134 Update classDiagram.md 2020-10-28 00:38:21 -07:00
Neil Cuzon
9d09bdc1f3 Update development.md 2020-10-28 00:38:02 -07:00
Neil Cuzon
a9c3019433 Update entityRelationshipDiagram.md 2020-10-28 00:37:35 -07:00
Neil Cuzon
3f56830170 Update directives.md 2020-10-28 00:37:33 -07:00
Neil Cuzon
73b1953c09 Update Tutorials.md 2020-10-28 00:20:35 -07:00
Neil Cuzon
4e0fc58f60 Update Tutorials.md 2020-10-28 00:20:20 -07:00
Neil Cuzon
108f102360 Update CHANGELOG.md 2020-10-28 00:19:36 -07:00
Neil Cuzon
be73811c53 Update README.md 2020-10-28 00:18:12 -07:00
Neil Cuzon
f3fbc004f3 Update 8.6.0_docs.md 2020-10-28 00:17:17 -07:00
Neil Cuzon
be71cf5689 Update 8.6.0_docs.md 2020-10-28 00:16:40 -07:00
Neil Cuzon
bd53fce4a7 Update 8.6.0_docs.md 2020-10-28 00:15:17 -07:00
Neil Cuzon
80c72c8f83 Merge pull request #1746 from NeilCuzon/develop
Switching to Docsify and adding search
2020-10-27 00:11:03 -07:00
NeilCuzon
445daaeba2 Switching to Docsify and adding search 2020-10-25 00:30:20 -07:00
Adrian Hall
851cff4bb8 Merge branch 'develop' into bug/1710_underscore_in_entity_names 2020-10-23 10:02:50 +01:00
Adrian Hall
245e25f4b7 Allow underscores in entity names, and entities with no relationships 2020-10-23 10:00:17 +01:00
Lishid
69113a988f Update theme-base.js 2020-10-22 22:17:43 -04:00
Lishid
521bfc66f0 Update theme-base.js 2020-10-22 22:14:10 -04:00
Lishid
d473f3904a Fixed bad tertiary operator
This fixes the tertiary operator used to compute the `edgeLabelBackground` theme variable.
2020-10-22 21:55:13 -04:00
Ashish Jain
74d09b5468 Merge pull request #1741 from mermaid-js/1740_nested_subgraps_directions
1740 nested subgraps directions
2020-10-22 20:59:01 +02:00
Knut Sveidqvist
b495772118 #1740 Adding fixing another tests 2020-10-22 18:52:23 +02:00
Knut Sveidqvist
7c939860d6 #1740 Adding test 2020-10-22 18:47:32 +02:00
Knut Sveidqvist
310420fda1 2020-10-22 18:45:46 +02:00
Knut Sveidqvist
a679d2a0ed Merge pull request #1733 from AndreasVolkmann/patch-1
Update flowchart.md
2020-10-22 17:29:38 +02:00
Knut Sveidqvist
3f60107885 Merge pull request #1739 from BastianZim/develop
Updated docs
2020-10-22 17:28:22 +02:00
Knut Sveidqvist
3c2e8cb71c Merge pull request #1735 from fregante/patch-1
Replace `fregante/setup-git-token` with `setup-git-user`
2020-10-22 17:27:25 +02:00
Bastian Zimmermann
cff55e91b0 Fixed bold 2020-10-22 15:41:36 +02:00
Bastian Zimmermann
005390f54b Updated http to https 2020-10-22 15:36:52 +02:00
Bastian Zimmermann
82ce848d24 Pointed Live editor and CLI to new repo 2020-10-22 15:32:59 +02:00
Bastian Zimmermann
dfdae7f046 Added space 2020-10-22 15:00:06 +02:00
Bastian Zimmermann
7a7bad2aa3 Added link to example 2020-10-22 14:59:31 +02:00
Bastian Zimmermann
8f438744cf Added link to example 2020-10-22 14:58:58 +02:00
Bastian Zimmermann
460ccd9b34 Added link to example 2020-10-22 14:56:56 +02:00
Federico
0638d0b2d7 Replace fregante/setup-git-token with setup-git-user 2020-10-19 22:31:33 -05:00
Andreas Volkmann
4c239b7eef Update flowchart.md 2020-10-16 12:34:08 +02:00
Andreas Volkmann
ac8ddd58f0 Update flowchart.md
Fix typos
2020-10-16 12:31:05 +02:00
Neil Cuzon
b49308f0f1 Merge pull request #1703 from wontonst/patch-1
Fix broken links in gantt.md
2020-10-16 02:49:32 -07:00
Neil Cuzon
b435171aa2 Merge branch 'develop' into patch-1 2020-10-16 02:49:06 -07:00
Knut Sveidqvist
8e342e1db7 Merge pull request #1731 from mermaid-js/1724_fontawesome_edge_labels
#1724 Adding fontawesome to edge labels
2020-10-15 19:49:49 +02:00
Knut Sveidqvist
1ade6cdfa5 Merge pull request #1728 from alexislefebvre/patch-1
README: use stateDiagram-v2
2020-10-15 19:46:37 +02:00
Knut Sveidqvist
561ee5c72e Merge pull request #1729 from Eraledm/fixing-broken-diagrams
Fixed empty code examples
2020-10-15 19:44:54 +02:00
Knut Sveidqvist
143566fbf6 Merge pull request #1727 from deining/fix_links
Fixing broken links and misspellings
2020-10-15 19:43:59 +02:00
Knut Sveidqvist
5e0f2e8572 Merge branch 'develop' into fix_links 2020-10-15 19:43:49 +02:00
Knut Sveidqvist
350732d8dd Merge pull request #1705 from hwine/typo-pie.md
Fix typo in pie.md
2020-10-15 19:37:58 +02:00
Knut Sveidqvist
d8da24804f #1724 Adding fontawesome to edge labels 2020-10-15 19:29:37 +02:00
Knut Sveidqvist
15f8856f92 Merge pull request #1730 from mermaid-js/1726_graphDef_linkStyle
1726 graph def link style
2020-10-15 19:27:14 +02:00
Knut Sveidqvist
4ae61ad35a €1726 updated test 2020-10-15 19:06:38 +02:00
Knut Sveidqvist
c2c5cc45fa Merge remote-tracking branch 'refs/remotes/origin/1726_graphDef_linkStyle'
Conflicts:
	cypress/platform/knsv.html
2020-10-15 19:04:48 +02:00
Knut Sveidqvist
7404e436d2 #1726 Handling think lines 2020-10-15 19:00:35 +02:00
Knut Sveidqvist
cc1560d3e3 #1726 fix for link styling and classes for subgraph 2020-10-15 18:42:58 +02:00
Knut Sveidqvist
4812437519 2020-10-15 18:42:58 +02:00
Knut Sveidqvist
53933d934d 2020-10-15 17:45:19 +02:00
Knut Sveidqvist
f108099623 2020-10-15 17:37:16 +02:00
Manuel DeLaRe
7dd82a4a87 Fixed empty code examples 2020-10-14 13:50:44 -05:00
Alexis Lefebvre
1a91b1bd42 README: use stateDiagram-v2 2020-10-14 17:23:10 +02:00
Andreas Deininger
439399b9f1 Fixing various typos/misspellings in documentation 2020-10-14 14:41:15 +02:00
Andreas Deininger
5e95d75f44 Fixing broken links 2020-10-14 13:47:20 +02:00
Neil Cuzon
35deb4a512 Update n00b-overview.md 2020-10-09 18:49:45 -07:00
Neil Cuzon
19ac8e6e61 Update Tutorials.md 2020-10-09 02:14:01 -07:00
Neil Cuzon
68a0506a40 Update Tutorials.md 2020-10-08 18:46:02 -07:00
Knut Sveidqvist
0f9da18cbe Merge branch 'master' into develop 2020-10-08 19:48:33 +02:00
Knut Sveidqvist
acc4f31c3a Merge branch 'release/8.8.2' 2020-10-08 19:45:50 +02:00
Knut Sveidqvist
2e4d1a7b44 Release 8.8.2 2020-10-08 19:43:29 +02:00
Knut Sveidqvist
ec7628924e Version update 2020-10-08 18:52:48 +02:00
Knut Sveidqvist
4c849554da Merge pull request #1709 from mermaid-js/1704_subgraphs
1704 subgraphs
2020-10-08 18:25:43 +02:00
Knut Sveidqvist
582a045457 #1704 Test and lint 2020-10-07 20:43:52 +02:00
Knut Sveidqvist
4b2d98129e #1704 handling of subgraph data 2020-10-07 20:43:31 +02:00
Knut Sveidqvist
8ec99cb244 Merge remote-tracking branch 'origin/develop' into develop 2020-10-07 18:08:42 +02:00
Knut Sveidqvist
088dd8698e Merge branch 'release/8.8.1' into develop 2020-10-07 17:57:52 +02:00
Neil Cuzon
e9f4d2040b Update _sidebar.md 2020-10-05 19:56:32 -07:00
Neil Cuzon
6d58836301 Update _sidebar.md 2020-10-05 19:37:36 -07:00
Neil Cuzon
c81eaccfef Update newDiagram.md 2020-10-05 19:03:45 -07:00
Hal Wine
b21100cc5d Fix typo in pie.md
':' is called a "[colon](https://en.wikipedia.org/wiki/Colon_(punctuation))" (not [semi-colon](https://en.wikipedia.org/wiki/Semicolon))
2020-10-03 09:07:32 -07:00
Neil Cuzon
f6954c898d Update README.md 2020-10-01 18:53:48 -07:00
Neil Cuzon
f1cea37814 Update README.md 2020-10-01 18:53:30 -07:00
Roy Zheng
911d97c0a3 Fix broken links in gantt.md 2020-10-01 16:01:53 -07:00
Knut Sveidqvist
4dc805d25a Release 8.8.1 2020-09-30 19:23:42 +02:00
Knut Sveidqvist
c691ef1899 Removing console.logs 2020-09-30 18:47:50 +02:00
Knut Sveidqvist
04338335d0 Merge branch 'develop' into release/8.8.1 2020-09-30 18:31:08 +02:00
Knut Sveidqvist
4d9d315f10 Merge pull request #1699 from ct-martin/docs/readme-osawards
Update link to Open Source Awards
2020-09-30 18:26:47 +02:00
Christian Martin
eb3ddbcca7 Update link to Open Source Awards 2020-09-24 14:38:37 -07:00
Knut Sveidqvist
13d11633ab 8.8.1-rc1 2020-09-23 20:54:07 +02:00
Knut Sveidqvist
c4572036b3 Bumping version to 8.8.1 2020-09-23 20:50:25 +02:00
Knut Sveidqvist
f0a8eaa5be Merge pull request #1697 from mermaid-js/1676_click_support_v2
Adds support for custom cssClasses for classDiagram-v2. Also, improved test cases for classDiagram.
2020-09-23 20:41:52 +02:00
Ashish Jain
93bf8d7414 #1696 Fix for custom cssClass test cases for classDiagram 2020-09-23 20:16:06 +02:00
Knut Sveidqvist
2cbb2d7b6a Merge pull request #1695 from mermaid-js/1694_style_flowchart
#1694 Applying styles from the graph definition for flowcharts
2020-09-23 20:11:39 +02:00
Knut Sveidqvist
ce23316008 #1694 Applying styles from the graph definition for flowcharts 2020-09-23 19:51:16 +02:00
Ashish Jain
c04dac65ac #1693 Added support for custom cssClass and styling to classDiagram-v2 2020-09-23 19:27:09 +02:00
Neil Cuzon
abba5a5d75 Update newDiagram.md 2020-09-20 07:06:57 -07:00
Neil Cuzon
98b556cb1a Update development.md 2020-09-20 06:25:57 -07:00
Neil Cuzon
488afd64d7 Create newDiagram.md 2020-09-20 06:09:37 -07:00
Neil Cuzon
e2a7e60dad Update _sidebar.md 2020-09-20 06:08:19 -07:00
Knut Sveidqvist
c17778ba47 Merge pull request #1686 from irqbank/develop
Remove console messages
2020-09-20 14:31:31 +02:00
Knut Sveidqvist
753ba194fd Merge pull request #1685 from mermaid-js/1676_click_support_v2
1676 click support v2
2020-09-20 14:28:31 +02:00
Knut Sveidqvist
f856782528 #1657Fix for broken test 2020-09-20 12:31:39 +02:00
Knut Sveidqvist
c9ff70b3cc #1657 Handling class definitions for flowchart beta 2020-09-20 12:14:04 +02:00
Neil Cuzon
6311abec2d Merge pull request #1684 from DavidWittman/docs-noob-syntax-typo
Fix typo in n00b-syntaxReference.md
2020-09-19 07:15:26 -07:00
root
1461d535d4 Remove console messages 2020-09-19 00:52:45 -04:00
David Wittman
77d57b865d Fix typo in n00b-syntaxReference.md 2020-09-17 15:38:44 -05:00
Ashish Jain
57a208d271 Fix for broken Flowchart test cases 2020-09-16 22:02:11 +02:00
Ashish Jain
a26c9fca1e #1676 Fix for additonal usecases for flowchart 2020-09-16 21:53:17 +02:00
Knut Sveidqvist
c679d18888 #1676 Fix for broken tests 2020-09-16 20:33:04 +02:00
Knut Sveidqvist
2a6372cabe #1676 Handling vertices starting with a number 2020-09-16 20:09:02 +02:00
Ashish Jain
22c710ed99 #1676 Fix for broken test cases 2020-09-16 18:59:53 +02:00
Knut Sveidqvist
a14ff7820e #1676 Fix for tests 2020-09-12 13:40:25 +02:00
Knut Sveidqvist
a446b3c600 #1676 Lint fix 2020-09-12 13:35:11 +02:00
Knut Sveidqvist
c8c4554299 #1676 Adding click support and tooltip support for flowchart 2020-09-12 10:56:23 +02:00
Knut Sveidqvist
6360ed52b2 #1676 lint fix 2020-09-10 21:00:25 +02:00
Knut Sveidqvist
9d8c867de8 #1676 Adding click support to the new rendering engine and classDiagram-v2 2020-09-10 20:58:16 +02:00
Knut Sveidqvist
571b8bbd88 Merge pull request #1672 from mermaid-js/1542_take_two
1542 take two
2020-09-09 19:11:42 +02:00
Knut Sveidqvist
b795950892 #1636 Manual update due to conflicts 2020-09-09 18:56:40 +02:00
Ashish Jain
28c01f6476 Merge branch 'develop' of https://github.com/knsv/mermaid into 1542_take_two 2020-09-09 18:43:53 +02:00
Knut Sveidqvist
117988d26d Merge pull request #1664 from saowang/develop
Fixed broken links and syntax in the document
2020-09-09 18:39:18 +02:00
Knut Sveidqvist
137770dc61 Merge pull request #1668 from mermaid-js/dependabot/npm_and_yarn/http-proxy-1.18.1
Bump http-proxy from 1.18.0 to 1.18.1
2020-09-09 18:37:48 +02:00
Ashish Jain
5d57237c3b Merge pull request #1662 from mermaid-js/1660_subgraph_issues
Improved handling of nested subgraphs
2020-09-09 18:37:28 +02:00
dependabot[bot]
9635ef5f16 Bump http-proxy from 1.18.0 to 1.18.1
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-09 04:19:44 +00:00
Neil Cuzon
bbec2c54ed Adding a reference to mermaid.min.js
Forces Docs to adopt new syntax modifications, allowing graphs made in the newer syntax to be parsed and rendered in GitHub Pages.
2020-09-07 19:51:23 +02:00
Ashish Jain
c95b9ffc43 Fix for legacy class Diagram title for class bold styling 2020-09-07 13:33:08 +02:00
saowang
5336e98e18 Update mermaidAPI.js 2020-09-07 14:50:33 +08:00
saowang
1f4be42b3f Fixed broken links and syntax in the document 2020-09-07 14:02:09 +08:00
Neil Cuzon
6a1c88204a Adding a reference to mermaid.min.js
Forces Docs to adopt new syntax modifications, allowing graphs made in the newer syntax to be parsed and rendered in GitHub Pages.
2020-09-06 18:16:03 -07:00
Knut Sveidqvist
4f8e242dac 2020-09-06 22:34:13 +02:00
Knut Sveidqvist
89f616df88 Test commit 2020-09-06 09:18:09 +02:00
Knut Sveidqvist
0918b97e81 Merge branch 'release/8.8.0' 2020-09-05 09:46:24 +02:00
Knut Sveidqvist
a8b7144d62 Back to linux sed 2020-09-05 09:46:01 +02:00
Knut Sveidqvist
9bf97d9dcd Release 8.8.0 2020-09-05 09:38:56 +02:00
Knut Sveidqvist
343703c54f Setting version to 8.8.0 2020-09-05 09:16:36 +02:00
Knut Sveidqvist
2ca8bcad5c Merge pull request #1659 from mermaid-js/1602_order_neste_subgraphs
#1602 Update of handling of nested subgraphs
2020-09-02 21:10:03 +02:00
Knut Sveidqvist
9106c6ad52 #1602 Update of handling of nested subgraphs 2020-09-02 20:34:24 +02:00
Knut Sveidqvist
2a4344ace3 Merge pull request #1642 from Mogztter/issue/1490-svg-height-width
resolves #1490 consistent SVG height and width between diagrams
2020-09-02 18:11:51 +02:00
Knut Sveidqvist
a82c53dd2e Not moving the label away from assigned position 2020-08-29 16:11:42 +02:00
GDFaber
1ac3611e6e Merge pull request #1653 from khink/speling
Fix spelling: it's -> its
2020-08-28 09:56:05 +02:00
Kees Hink
c62f3c2898 Fix spelling: it's -> its
If you mean "the ... that it has", use its. If you mean "it is", use it's.
2020-08-28 09:31:09 +02:00
Ashish Jain
b244118fd9 Fix for class title label css 2020-08-27 20:43:37 +02:00
Ashish Jain
7164eaa8b1 Allow Generics support for Class Title definition 2020-08-27 20:14:26 +02:00
Ashish Jain
a20aa472d6 Fix for Edge label positioning 2020-08-27 19:59:30 +02:00
Knut Sveidqvist
1811153467 Merge pull request #1650 from saowang/develop
Update auto generated Setup.md with front matter
2020-08-27 18:52:21 +02:00
saowang
d003f9c6fd Update auto generated Setup.md with front matter 2020-08-26 01:38:51 +08:00
Guillaume Grossetie
99844b4ca3 Add e2e tests on all diagrams 2020-08-25 17:17:52 +02:00
Guillaume Grossetie
184fcab0b7 resolves #1490 consistent SVG height and width between diagrams 2020-08-25 15:46:10 +02:00
Neil Cuzon
459e07834c Update README.md 2020-08-25 04:07:55 -07:00
Neil Cuzon
c7e7f3b4c1 Update README.md 2020-08-25 04:05:41 -07:00
Neil Cuzon
78a8ae3ba2 Merge pull request #1633 from Mogztter/doc/changelog
Merge changelog and Mermaid Versions
2020-08-25 03:27:58 -07:00
GDFaber
31527e8e87 Merge pull request #1643 from Yash-Singh1/patch-1
Made Capitalization Changes
2020-08-23 23:10:54 +02:00
Yash Singh
c0008bf850 Made Capitalization Changes 2020-08-23 13:47:45 -07:00
GDFaber
3b026ff0cc Merge pull request #1641 from andrewschleifer/patch-1
fix: typo
2020-08-23 20:41:21 +02:00
GDFaber
73b5ffa3ef Merge pull request #1639 from Mogztter/patch-2
Fix image path
2020-08-23 20:40:36 +02:00
Knut Sveidqvist
55f0d0ab9f Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-08-23 20:02:55 +02:00
Knut Sveidqvist
0cbd002667 #1607 Using correct config when to decide about sanitizing text 2020-08-23 20:02:51 +02:00
Andrew Schleifer
5246f81dce fix: typo 2020-08-24 00:56:12 +08:00
Guillaume Grossetie
56a9b8fa94 Fix image path 2020-08-23 15:13:28 +02:00
Guillaume Grossetie
ab130900a1 Merge changelog and Mermaid versions 2020-08-23 15:08:25 +02:00
Neil Cuzon
d4b72ececc Delete _sidebar.md 2020-08-23 03:35:36 -07:00
Neil Cuzon
41b8ac32b3 Delete CHANGELOG.md 2020-08-23 03:35:22 -07:00
Neil Cuzon
7e0e4455b0 Create _sidebar.md 2020-08-23 02:47:29 -07:00
Neil Cuzon
2127c00671 Create CHANGELOG.md 2020-08-23 02:46:55 -07:00
Neil Cuzon
874fc741b5 Update README.md 2020-08-23 02:44:16 -07:00
Neil Cuzon
605241f6e1 Update _sidebar.md 2020-08-22 16:26:02 -07:00
Neil Cuzon
dac7b1c5b1 Delete Tutorials.md 2020-08-21 18:42:39 -07:00
Neil Cuzon
76cb1dc237 Delete Tutorials.md 2020-08-21 18:42:24 -07:00
Neil Cuzon
9440b09c66 Create Tutorials.md 2020-08-21 18:41:57 -07:00
Neil Cuzon
6da0ceec9d Update _sidebar.md 2020-08-21 17:13:34 -07:00
Neil Cuzon
bcb388ea9e Merge pull request #1634 from saowang/develop
Change docs theme from docsify to jekyll-rtd-theme
2020-08-21 17:11:59 -07:00
Neil Cuzon
288f1320a1 Delete _sidebar.md 2020-08-21 17:11:24 -07:00
Neil Cuzon
4aa461e317 Update _sidebar.md 2020-08-21 02:02:35 -07:00
Neil Cuzon
54674158ca Update Tutorials.md 2020-08-21 01:36:08 -07:00
Neil Cuzon
b02a884c16 Update Tutorials.md 2020-08-21 01:17:50 -07:00
Neil Cuzon
91f0f21f45 Create Tutorials.md 2020-08-21 01:16:33 -07:00
Neil Cuzon
44a0115b07 Update Tutorials.md 2020-08-21 01:15:22 -07:00
saowang
95bcd14c1d Update README.md 2020-08-21 14:30:42 +08:00
saowang
9e8c6aed4d Update documents to compatible jekyll-rtd-theme 2020-08-21 01:01:06 +08:00
saowang
f63b58edd9 Docs use remote_theme 2020-08-20 23:03:22 +08:00
saowang
ea47873db3 Add jekyll ignore files 2020-08-20 22:59:18 +08:00
saowang
a608f98ca5 Add jekyll-rtd-theme 2020-08-20 22:55:17 +08:00
Neil Cuzon
e84d0b9334 Update n00b-overview.md 2020-08-20 02:48:59 -07:00
Neil Cuzon
43b0a83b82 Update _sidebar.md 2020-08-20 02:44:09 -07:00
Neil Cuzon
4f7e0941dc Update n00b-overview.md 2020-08-20 02:44:01 -07:00
Neil Cuzon
70a2e934f9 Update n00b-overview.md 2020-08-20 02:41:11 -07:00
Neil Cuzon
14801805ac Update integrations.md 2020-08-20 02:40:24 -07:00
Neil Cuzon
54f2bb1daf Update n00b-overview.md 2020-08-20 02:39:09 -07:00
Marc Faber
75e380fe14 #1609 Fix markdown and example code in docs for state and er diagrams 2020-08-20 11:22:01 +02:00
Neil Cuzon
ec97d40242 Update Tutorials.md 2020-08-20 02:19:16 -07:00
GDFaber
7bb4f5591c Merge pull request #1631 from mermaid-js/bug/improve_docs_gantt_example
Improve gantt example in documentation
2020-08-20 00:56:27 +02:00
Marc Faber
4447366118 Improve gantt example in documentation 2020-08-20 00:38:24 +02:00
GDFaber
7140aa1015 Merge pull request #1625 from it-sec-std/patch-1
Fix comments in gantt docs
2020-08-20 00:18:36 +02:00
GDFaber
16f9b2631e Merge pull request #1629 from Mogztter/patch-2
Explain how to preview the documentation site
2020-08-20 00:14:31 +02:00
Guillaume Grossetie
a6dee9ee0c Explain how to preview the documentation site
The documentation is now powered by Docsify.
Explain how to install `docsify-cli` and how to preview the documentation site locally.
2020-08-19 23:55:53 +02:00
Ashish Jain
89b4f84b0a Update classDiagram-v2 spec test case name 2020-08-19 20:55:46 +02:00
Ashish Jain
09f4c21421 Enable html labels for classDiagram-v2 2020-08-19 20:46:24 +02:00
GDFaber
9fe10d087f Merge pull request #1628 from Lucurus/patch-1
Update usage.md
2020-08-19 20:02:01 +02:00
Lucurus
12a95dfbc6 Update usage.md
Deleted a 0
2020-08-19 19:47:55 +02:00
GDFaber
d9f82806ec Merge pull request #1627 from Lucurus/patch-1
Update usage.md
2020-08-19 18:46:17 +02:00
Ashish Jain
455cd9c696 Merge branch 'develop' of https://github.com/knsv/mermaid into 1542_take_two 2020-08-19 18:45:24 +02:00
Lucurus
f695fa736d Update usage.md
Corrected spelling of responsibility.
2020-08-19 18:34:54 +02:00
GDFaber
51f0a3f42a Merge pull request #1626 from Lucurus/patch-1
Update n00b-gettingStarted.md
2020-08-19 18:25:22 +02:00
Lucurus
b7e953bc1a Update n00b-gettingStarted.md
Changed form of verb contain in 3 b.
2020-08-19 18:14:35 +02:00
it-sec-std
8b508bda9a Update gantt.md
A comment was not marked with propriate syntax, so this example's code didn't work
2020-08-19 16:37:09 +03:00
Neil Cuzon
b69e7fbe2c Update README.md 2020-08-18 19:50:39 -07:00
GDFaber
d5062ec5ae Merge pull request #1621 from mermaid-js/bug/1609_fix_state_and_er_docs
Fix markdown and example code in docs for state and er diagrams
2020-08-18 15:58:12 +02:00
GDFaber
7143a8c806 Merge pull request #1622 from DawMatt/develop
Minor sidebar/version updates page fixes for website
2020-08-18 15:47:12 +02:00
DawMatt
b3d1c548e7 Update versionUpdates.md
Styling in the website sidebar was impacted by inconsistent heading levels and unterminated bold statements. These have been normalised to improve sidebar  display.
2020-08-18 23:22:23 +10:00
DawMatt
b28af56523 Update _sidebar.md
Removed second, broken version updates link
2020-08-18 23:03:51 +10:00
Neil Cuzon
4a08d1d954 Create Tutorials.md 2020-08-17 23:39:23 -07:00
Neil Cuzon
71d977908d Update README.md 2020-08-17 23:17:56 -07:00
Neil Cuzon
cc0da7d8c6 Update README.md 2020-08-17 23:15:35 -07:00
Marc Faber
b55d5c0e39 #1609 Fix markdown and example code in docs for state and er diagrams 2020-08-17 20:26:06 +02:00
Knut Sveidqvist
aafb65f888 Lint fixes 2020-08-17 08:45:20 +02:00
Knut Sveidqvist
12272dfb80 Merge remote-tracking branch 'origin/develop' into develop 2020-08-17 08:43:27 +02:00
Neil Cuzon
7e3848cc76 Update README.md 2020-08-16 23:07:06 -07:00
Neil Cuzon
2ca50de41b Update README.md 2020-08-16 23:04:05 -07:00
Knut Sveidqvist
9561fcea76 Merge branch 'e2e_debug' into develop 2020-08-17 07:54:25 +02:00
Neil Cuzon
b9f45577a7 Update README.md 2020-08-16 22:39:58 -07:00
Neil Cuzon
25dd806a18 Update README.md
Implementing some changes to mirror those, that were made by @Mogztter.
2020-08-16 20:36:25 -07:00
Knut Sveidqvist
6b23c71bb5 Use courier in all rendering tests 2020-08-16 21:49:36 +02:00
Knut Sveidqvist
236332d8c7 Use arial in stateDiagram rendering tests 2020-08-16 13:50:27 +02:00
Knut Sveidqvist
de72d7ba13 Use arial in stateDiagram rendering tests 2020-08-16 13:19:01 +02:00
Knut Sveidqvist
ba6d73fc17 Debug of fonts in percy renderings 2020-08-16 13:01:45 +02:00
Knut Sveidqvist
450d4b5a0a Fix for broken build 2020-08-16 09:06:25 +02:00
Knut Sveidqvist
888b1fb021 #1613 #1495 Adding support for edge length to flowchart (beta) 2020-08-16 08:45:44 +02:00
Knut Sveidqvist
958b032cea Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-08-16 08:34:47 +02:00
Neil Cuzon
e9060a3ad9 Merge pull request #1617 from Mogztter/patch-1
Improve README readability
2020-08-15 19:40:45 -07:00
Guillaume Grossetie
78f43b6e13 Condense about section 2020-08-15 15:10:09 +02:00
Guillaume Grossetie
bbaf7583e4 Improve readme readability
- Fix link to changelog
- Remove changelog from readme
- Use titles sparsely
- Add emojis! 🎉
2020-08-15 14:59:34 +02:00
Knut Sveidqvist
34cc115cdb Merge pull request #1615 from H3RSKO/H3RSKO-readme-typo
Updated Readme
2020-08-15 07:59:56 +02:00
Knut Sveidqvist
93c6272fe2 Merge pull request #1613 from matteodelabre/feature/1495_set_edge_length
Add support for changing the length of edges
2020-08-15 07:58:56 +02:00
H3RSKO
25402c708e Updatd Readme
Fixed Readme typo:

Changed "resposibility" to "responsibility"
2020-08-14 18:18:28 -04:00
Knut Sveidqvist
33cc635fcf Removed illegal logging 2020-08-14 07:37:29 +02:00
Knut Sveidqvist
129b3f9004 Cherry pick of config changes 2020-08-14 07:34:42 +02:00
Mattéo Delabre
01344a991d Add support for changing the length of edges
Resolves #637, resolves #1495.

The syntax for edges is extended to allow for extra
dashes/equals signs/dots (depending on the edge type). Each added
character increases the length of the edge by one rank level, as
follows:

Length            |    1   |    2    |     3    |
------------------|:------:|:-------:|:--------:|
Normal            |  `---` |  `----` |  `-----` |
Normal with arrow |  `-->` |  `--->` |  `---->` |
Thick             |  `===` |  `====` |  `=====` |
Thick with arrow  |  `==>` |  `===>` |  `====>` |
Dotted            |  `-.-` |  `-..-` |  `-...-` |
Dotted with arrow | `-.->` | `-..->` | `-...->` |

This features leverages the `minlen` property exposed by Dagre which was
not previously available when using Mermaid.
2020-08-14 00:15:26 +02:00
Ashish Jain
060ac3bb4a Adjust the class members with proper parsing 2020-08-13 21:06:33 +02:00
Ashish Jain
95677e601a Merge branch '1614_fontFamily' of https://github.com/knsv/mermaid into 1542_take_two 2020-08-13 20:39:39 +02:00
Knut Sveidqvist
a97cc62d0a Merge branch 'jgreywolf-1592-IncorrectSVGytntax' into develop 2020-08-13 20:27:56 +02:00
Knut Sveidqvist
62260aa30b Merge branch '1592-IncorrectSVGytntax' of git://github.com/jgreywolf/mermaid into jgreywolf-1592-IncorrectSVGytntax 2020-08-13 20:26:47 +02:00
Knut Sveidqvist
32457e83f0 Fix for broken build 2020-08-13 20:23:57 +02:00
Ashish Jain
2519486a02 Merge branch '1614_fontFamily' of https://github.com/knsv/mermaid into 1542_take_two 2020-08-13 20:09:13 +02:00
Ashish Jain
bec3cc437d Fix for interface rendering and positioning 2020-08-13 20:08:09 +02:00
Knut Sveidqvist
525a32f9f0 2020-08-13 20:03:42 +02:00
Ashish Jain
36f8f1902c Removing hard coding with dynamic values for cardinalities 2020-08-13 19:41:33 +02:00
Knut Sveidqvist
bde7b1a828 Html labels set to false in tests 2020-08-13 19:19:19 +02:00
Ashish Jain
9891b383e7 Adding classDiagram-v2 test cases 2020-08-13 18:52:04 +02:00
Ashish Jain
28bc87b873 Merge branch 'develop' into 1542_take_two 2020-08-13 18:27:37 +02:00
Knut Sveidqvist
9223173ef2 Merge branch 'master' into develop 2020-08-13 18:25:04 +02:00
Justin Greywolf
5e72416478 1592-SVG syntax error with links
Added xlink namespace to svg definition
2020-08-12 13:47:21 -07:00
Justin Greywolf
595e03c584 Merge pull request #27 from mermaid-js/develop
sync
2020-08-12 13:46:12 -07:00
Knut Sveidqvist
50a0c93cce Updated theming docs 2020-08-09 14:22:54 +02:00
Knut Sveidqvist
e06cf70615 Using mermaid 8.7.0 in docs 2020-08-09 14:05:10 +02:00
Knut Sveidqvist
4c38b1a776 Merge branch 'release/8.7.0' 2020-08-09 14:03:20 +02:00
Knut Sveidqvist
677c6d9f89 Release 8.7.0 2020-08-09 14:02:57 +02:00
Knut Sveidqvist
2743681392 Merge branch 'develop' into release/8.7.0 2020-08-09 13:36:09 +02:00
Knut Sveidqvist
aacf84f78a Some documentation updates 2020-08-09 07:45:37 +02:00
Justin Greywolf
b95a9bb9b4 Merge pull request #26 from mermaid-js/develop
sync
2020-08-08 12:22:25 -07:00
Knut Sveidqvist
77541102af Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-08-08 10:59:59 +02:00
Knut Sveidqvist
b337cf9f95 Merge pull request #1605 from jgreywolf/1594-CommentsInClassDiagramNotWorking
1594 comments in class diagram not working
2020-08-08 07:44:01 +02:00
Justin Greywolf
f914cb0248 1594-Comment in class diagrams not working
Slight modification to comment regex to ensure that all lines were being looked at, not just the first one
2020-08-07 12:08:34 -07:00
Justin Greywolf
c93828569b Merge pull request #25 from mermaid-js/develop
Merge from mermaid
2020-08-07 08:27:21 -07:00
Ashish Jain
61993a032a Initial implementation for cardinality position. 2020-08-07 14:52:42 +02:00
Knut Sveidqvist
b99c14b910 Merge pull request #1599 from jgreywolf/1181-AssignCssClass
1181 assign css class
2020-08-05 20:40:07 +02:00
Knut Sveidqvist
8aa0185cb8 Remiving dist from .gitignore
This due to downstreams libraries that depend on them. We should address this as I agree that dist should be ignored. For now I removed it.
2020-08-05 18:27:30 +02:00
Knut Sveidqvist
2a1161bff4 Merge pull request #1600 from ryenus/patch-1
update mermaid-cli repo url
2020-08-05 18:00:04 +02:00
ryenus
067b495212 update mermaid-cli repo url
new url: https://github.com/mermaid-js/mermaid-cli
2020-08-05 05:46:48 +08:00
Justin Greywolf
894369cc73 stop tracking files in dist 2020-08-04 12:08:21 -07:00
Justin Greywolf
9a86accc62 1181-Minor update to regex 2020-08-04 12:05:56 -07:00
Knut Sveidqvist
77be268a70 Merge pull request #1596 from NeilCuzon/develop
Changes to ReadMe.md, Addition of versionUpdates.md for version tracking.
2020-08-04 20:08:44 +02:00
Justin Greywolf
1f051d7a9f 1181-Css for class diagrams
Initial change for supporting custom CSS for use with classDiagrams.
updated `LABEL` regex for specificity
2020-08-03 12:47:50 -07:00
Justin Greywolf
652b6ae7d2 Update gitignore for dist folder 2020-08-03 12:47:32 -07:00
Justin Greywolf
57a5b09328 Merge pull request #24 from mermaid-js/develop
merge from mermaid-js:develop
2020-08-03 12:43:26 -07:00
Neil Cuzon
9b806f2690 Update config.js 2020-08-01 17:19:26 -07:00
Neil Cuzon
1b56a8b696 Update theming.md 2020-07-31 23:45:56 -07:00
Neil Cuzon
5a5d2c770c Update _sidebar.md 2020-07-31 22:54:47 -07:00
Neil Cuzon
a5d06bde03 Update theming.md 2020-07-31 21:22:18 -07:00
Neil Cuzon
15103ac7fb Update theming.md 2020-07-31 21:20:55 -07:00
Neil Cuzon
439e735d4b Update README.md 2020-07-31 21:20:28 -07:00
Neil Cuzon
7f5df308ad Update README.md 2020-07-31 21:20:26 -07:00
Neil Cuzon
2f97baadc6 Update README.md 2020-07-31 21:16:33 -07:00
Neil Cuzon
c2863156cd Update versionUpdates.md 2020-07-31 21:12:31 -07:00
Neil Cuzon
75762d64c6 Update theming.md 2020-07-31 21:10:43 -07:00
Neil Cuzon
8209cffcd0 Update versionUpdates.md 2020-07-31 21:10:04 -07:00
Neil Cuzon
70976460ff Update _sidebar.md 2020-07-31 20:59:27 -07:00
Neil Cuzon
954155b090 Update theming.md 2020-07-31 20:52:06 -07:00
Neil Cuzon
5265bc20f1 Update theming.md 2020-07-31 20:49:35 -07:00
Neil Cuzon
af60a4d407 Update README.md 2020-07-31 19:54:46 -07:00
Neil Cuzon
c9a6dc4fab Update README.md 2020-07-31 19:14:07 -07:00
Neil Cuzon
9c647dc57a Update README.md 2020-07-31 17:00:57 -07:00
Knut Sveidqvist
52e688df9b Version bump 2020-07-31 17:07:50 +02:00
Knut Sveidqvist
87f12c7d5a Updated with a small example of a custom theme 2020-07-31 16:04:12 +02:00
Knut Sveidqvist
e9e9b13df0 Added themeVariable references and som adjustments in base theme calculations. 2020-07-31 15:05:51 +02:00
Neil Cuzon
7ee9c4fb30 Update n00b-overview.md 2020-07-31 00:56:32 -07:00
Neil Cuzon
e43fd0c48a Update README.md 2020-07-31 00:55:21 -07:00
Neil Cuzon
27bed22fee Update README.md 2020-07-31 00:55:01 -07:00
Neil Cuzon
aae69fa599 Update README.md 2020-07-31 00:38:03 -07:00
Neil Cuzon
8abe138150 Update versionUpdates.md 2020-07-30 23:46:13 -07:00
Neil Cuzon
dccb23bb80 Update theming.md 2020-07-30 13:50:39 -07:00
Neil Cuzon
5e4bf0f019 Update config.js 2020-07-30 13:32:15 -07:00
Knut Sveidqvist
f87c56af5c Merge pull request #1593 from mermaid-js/1590_theme_finalizations
1590 theme finalizations
2020-07-30 19:57:33 +02:00
Knut Sveidqvist
5565aab488 #1590 Theme base tweaked for custom theming 2020-07-30 19:18:18 +02:00
Knut Sveidqvist
dbe6b9dacb #1590 Themes tweaked 2020-07-30 15:28:46 +02:00
Knut Sveidqvist
dd866718b9 Removed console statements 2020-07-30 10:16:29 +02:00
Knut Sveidqvist
116c616561 Merge pull request #1591 from mermaid-js/dependabot/npm_and_yarn/elliptic-6.5.3
Bump elliptic from 6.5.2 to 6.5.3
2020-07-30 10:01:33 +02:00
dependabot[bot]
084e3df8f7 Bump elliptic from 6.5.2 to 6.5.3
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-30 07:50:31 +00:00
Knut Sveidqvist
36e421eb5f Merge pull request #1586 from mermaid-js/1542_take_two
1542 take two
2020-07-30 08:58:56 +02:00
Knut Sveidqvist
a5b01c3f6f #1542 Adding gantt to showcases 2020-07-30 08:34:41 +02:00
Knut Sveidqvist
f1836c281c #1542 Fix for secirity config 2020-07-30 08:20:27 +02:00
Neil Cuzon
292289d16d Update README.md 2020-07-29 23:06:16 -07:00
GDFaber
4e3bdf0925 Merge pull request #1587 from GDFaber/documentation/fix_flowchart_style_example
Flowchart documentation: Fix code example for styling nodes
2020-07-30 01:31:28 +02:00
Marc Faber
b17475f013 #1366 Flowchart documentation: Fix code example for styling nodes 2020-07-30 01:18:58 +02:00
Knut Sveidqvist
ecea0f90d4 #1542 Handling of config 2020-07-29 22:19:23 +02:00
Knut Sveidqvist
a4bf85b1b6 #1542 Making sure config and directives works for overriding theme variables using initialize call or directives + tests 2020-07-29 18:38:59 +02:00
Knut Sveidqvist
d215d31349 Merge pull request #1585 from GDFaber/feature/1460_add_link_target_to_flowchart_click
Add link target option to flowchart click
2020-07-29 15:13:35 +02:00
Neil Cuzon
e4e24399d9 Update theming.md 2020-07-28 19:10:14 -07:00
Neil Cuzon
8f9d132ed6 Update theming.md 2020-07-28 19:06:34 -07:00
Neil Cuzon
e651511c35 Update theming.md 2020-07-28 19:01:01 -07:00
Neil Cuzon
2ecda17618 Update theming.md 2020-07-28 18:56:17 -07:00
Neil Cuzon
db03b5b102 Update theming.md 2020-07-28 18:28:52 -07:00
Neil Cuzon
9fd9a7bc10 Update 8.6.0_docs.md 2020-07-28 16:42:08 -07:00
Justin Greywolf
eda9faf956 Merge pull request #23 from mermaid-js/develop
bring up to date
2020-07-28 09:44:50 -07:00
Knut Sveidqvist
cf70678188 Merge branch 'develop' into feature/1460_add_link_target_to_flowchart_click 2020-07-28 13:21:31 +02:00
Knut Sveidqvist
b23988c947 Merge pull request #1582 from cmmoran/develop
Directive support for many diagrams, config bugfix
2020-07-28 13:17:35 +02:00
chris moran
06f6e75d5a Class diagram parsing
Fixed a class diagram parsing issue
2020-07-28 07:00:04 -04:00
chris moran
c9854b35e2 Fixed flowchart parsing (broken tests - grammar changes were not 100% correct) 2020-07-28 05:48:26 -04:00
Marc Faber
71e4ada39a Trigger tests once more 2020-07-28 11:09:54 +02:00
Marc Faber
d04d8c3a1d #1460 Add link target option to flowchart click 2020-07-28 10:49:54 +02:00
chris moran
283faf7a2f Fixes
GraphObjects.md: [ and ] should be escaped in text (they're links otherwise)
flow.jison: fixed a parsing issue when the direction is omitted (defaults to 'TB')
stateRenderer-v2: was silently failing due to a try/catch in the parse function. (intentional?) removed to show errorHandler
mermaidAPI: removed unnecessary call to updateRendererConfigs since reinitialize does this
2020-07-28 04:45:22 -04:00
chris moran
0299ff0a79 Added directive support to state diagrams
Fixed an issue with markerUnits: (default is 'strokeWidth' not 0
2020-07-27 19:44:45 -04:00
chris moran
4ee65822aa Merge remote-tracking branch 'carlosblanco/feature/1228-support-dashes-in-actor-names-in-sequence-diagrams' into develop 2020-07-27 15:05:57 -04:00
chris moran
e7ca6c16ff Tweaked PIE (got rid of some parsing conflicts) 2020-07-27 14:15:38 -04:00
chris moran
771bf78576 Fixed parsers to use the correct type name in close_directive
Added directive support to pie
(Refactored pie parsing to be a bit more clear)
Added more unit tests to pie
2020-07-27 13:24:23 -04:00
chris moran
b9fa2f4125 Added directive parsing to gannt
Ensured tests pass
2020-07-27 10:16:41 -04:00
chris moran
e5b22684cd Fixed a parser warning in classDiagram
Fixed a regression bug I introduced in theme.spec.js
2020-07-27 09:57:04 -04:00
chris moran
43d37ab1cf Fixed a new config issue
Diagrams now properly reset to siteConfig when there are multiple diagrams on a single page
2020-07-27 08:54:45 -04:00
chris moran
1fc142a59f Fixed a regression with classDiagram supporting comments 2020-07-27 07:38:12 -04:00
chris moran
c4ad95760a Fixed a regression in sequence diagram parsing.
Added the parser as the first argument to parseDirective to support custom directive handling (for now delegated within mermaidAPI but should probably discriminate based on type for delegation)
2020-07-27 06:50:54 -04:00
Knut Sveidqvist
f0ed170b04 #1542 Setting up base theme for custom theming 2020-07-27 11:51:20 +02:00
chris moran
38d4b5be1a Fixed an issue with flowchart rendering. Remember to render html, securityLevel='loose' must be set by the siteConfig. The default securityLevel as of now is 'strict'. This causes html to be url encoded. 2020-07-27 05:33:41 -04:00
Knut Sveidqvist
5a7d770a58 #1542 Setting up base theme for custom theming 2020-07-27 10:01:34 +02:00
chris moran
c8f652aaa8 Merge branch 'mermaid-js-develop' into develop 2020-07-27 03:23:04 -04:00
Neil Cuzon
336793b2a1 Update versionUpdates.md 2020-07-26 23:28:51 -07:00
Neil Cuzon
c29ea2e679 Update README.md 2020-07-26 23:28:24 -07:00
Neil Cuzon
3b6f05800d Update README.md 2020-07-26 23:04:11 -07:00
Neil Cuzon
dda824856a Update usage.md 2020-07-26 22:20:52 -07:00
Neil Cuzon
474ab586f8 Merge pull request #1 from NeilCuzon/release/8.6.0
Release/8.6.0
2020-07-26 21:18:16 -07:00
Neil Cuzon
6bef35d8ef Merge branch 'develop' into release/8.6.0 2020-07-26 21:17:52 -07:00
Neil Cuzon
ad12660019 Update versionUpdates.md 2020-07-26 21:15:13 -07:00
Neil Cuzon
016da1d37d Create versionUpdates.md 2020-07-26 21:13:54 -07:00
Knut Sveidqvist
4e12f959fc Updated after 8.6.4 merge 2020-07-26 22:38:55 +02:00
Knut Sveidqvist
1c06e9d683 Merge remote-tracking branch 'origin/develop' into develop 2020-07-26 22:37:15 +02:00
Knut Sveidqvist
01d7a33230 Merge branch 'master' into develop 2020-07-26 22:37:10 +02:00
Knut Sveidqvist
d92f5621aa Updated mermaid versio in docs 2020-07-26 22:34:15 +02:00
Knut Sveidqvist
8fdc61e227 Merge branch 'release/8.6.4' 2020-07-26 22:30:30 +02:00
Knut Sveidqvist
9825b161ff latest build (8.6.4) 2020-07-26 22:30:09 +02:00
chris moran
108a50f3bb Merge branch 'mermaid-js-develop' into develop 2020-07-26 08:59:22 -04:00
Knut Sveidqvist
95b7e4f9ad Theme tweaks 2020-07-26 14:09:48 +02:00
Knut Sveidqvist
a526386fbb Merge pull request #1579 from NeilCuzon/release/8.6.0
Release/8.6.0
2020-07-26 13:37:39 +02:00
Knut Sveidqvist
3fb3453166 dark theme fixes 2020-07-26 12:13:06 +02:00
Knut Sveidqvist
8dd0fe3c40 Adding showcases 2020-07-26 11:50:36 +02:00
Knut Sveidqvist
b1f0797a1f Updated test 2020-07-26 08:20:45 +02:00
Knut Sveidqvist
416e355495 Build 2020-07-26 08:05:32 +02:00
Knut Sveidqvist
62acc18e7d Merge of cherry pick 2020-07-26 08:03:56 +02:00
Knut Sveidqvist
06d80032fe #1578 Fetching updated configuration before use 2020-07-26 08:00:43 +02:00
Knut Sveidqvist
4e795c81f4 Merge branch 'release/8.6.3' into develop 2020-07-26 07:23:05 +02:00
Neil Cuzon
718ba719ca Update Setup.md 2020-07-25 21:36:15 -07:00
Neil Cuzon
a5ed3ca446 Update 8.6.0_docs.md 2020-07-25 21:36:12 -07:00
Neil Cuzon
3a93c50e38 Update usage.md 2020-07-25 19:14:06 -07:00
Neil Cuzon
654f673def Update usage.md 2020-07-25 19:08:11 -07:00
Neil Cuzon
1111382b53 Update usage.md 2020-07-25 19:04:11 -07:00
Neil Cuzon
1e605cdf0f Update n00b-gettingStarted.md 2020-07-25 18:15:37 -07:00
Neil Cuzon
2c27f422d9 Update n00b-gettingStarted.md 2020-07-25 09:52:11 -07:00
Neil Cuzon
f53a2f1b94 Update Setup.md 2020-07-25 09:52:03 -07:00
Neil Cuzon
4fb40a6af7 Update usage.md 2020-07-24 22:51:27 -07:00
Neil Cuzon
6f6f5738fa Update usage.md 2020-07-24 22:51:13 -07:00
Neil Cuzon
40aacbf279 Update n00b-gettingStarted.md 2020-07-24 12:30:06 -07:00
Knut Sveidqvist
9ea3bfb7c7 Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-07-24 19:14:46 +02:00
Knut Sveidqvist
dc2d52fc09 testing the label width in percy 2020-07-24 19:14:42 +02:00
Knut Sveidqvist
7dcebd51ab Merge pull request #1571 from abhijeet-pathak/bug/1569_document_link_broken
Fixed the path to 8.6.0_docs.md
2020-07-24 13:01:51 +02:00
Neil Cuzon
9ef5769f93 Update usage.md 2020-07-23 23:29:36 -07:00
Knut Sveidqvist
d12b197ec9 Version bump 2020-07-24 08:28:14 +02:00
Knut Sveidqvist
c5b55fa476 Some small interim changes, adding theming.doc 2020-07-24 08:25:57 +02:00
Neil Cuzon
355fcced55 Update usage.md 2020-07-23 23:04:39 -07:00
Neil Cuzon
701fb1378e Update usage.md 2020-07-23 22:36:16 -07:00
Carlos Blanco
b120c34177 Support dashes in actor names in sequence diagrams 2020-07-23 20:15:52 -06:00
Neil Cuzon
c23caf899f Update examples.md 2020-07-23 18:39:43 -07:00
Neil Cuzon
52c30e588c Update 8.6.0_docs.md 2020-07-23 18:33:11 -07:00
Abhijeet Pathak
9da8f4d35b Fixed the path to 8.6.0_docs.md 2020-07-23 19:49:01 +05:30
chris moran
1b89189efa re-add classDiagram as a theme type (in addition to class and classDiagram-v2 for class diagrams) 2020-07-23 06:03:04 -04:00
chris moran
e53c5097f9 Merge branch 'mermaid-js-develop' into develop 2020-07-23 05:59:40 -04:00
chris moran
cb675300b1 Directive support added to journey
Fixed an issue in journey svgDraw.drawText expected an attribute (textMargin) but did not receive one and raised an error: <tspan> attribute x: Expected length, "NaN".
Added parseDirective to journeyDb
2020-07-23 05:58:15 -04:00
Neil Cuzon
c6a1f42c44 Update usage.md 2020-07-23 00:15:44 -07:00
Knut Sveidqvist
dbda90b15b Fix if theme inclusion for classDiagrams 2020-07-23 07:50:22 +02:00
Neil Cuzon
29a04d9d83 Update n00b-gettingStarted.md 2020-07-22 21:31:49 -07:00
Neil Cuzon
0a6dc68d13 Update n00b-gettingStarted.md 2020-07-22 21:28:48 -07:00
Neil Cuzon
a1a85d08af Update n00b-gettingStarted.md 2020-07-22 21:28:02 -07:00
Chris Moran
601eec7da5 Merge pull request #1568 from cmmoran/develop
Refactor Theme to Config Module
2020-07-22 21:02:41 -04:00
chris moran
a54f3c8c7f Refactor
Moved theme variables to the config module
2020-07-22 16:46:41 -04:00
chris moran
17478491e9 Merge branch 'mermaid-js-develop' into develop 2020-07-22 16:33:46 -04:00
Knut Sveidqvist
245cf6d2e0 Merge pull request #1567 from mermaid-js/feature/Issue-1465_Class_migration
Feature/issue 1465 class migration
2020-07-22 21:35:01 +02:00
Ashish Jain
71af9741cc Correct positioning for class title 2020-07-22 21:25:01 +02:00
chris moran
0503b64205 Merge branch 'mermaid-js-develop' into develop 2020-07-22 14:55:02 -04:00
Ashish Jain
c9d4cac3ff Merge branch 'develop' into feature/Issue-1465_Class_migration 2020-07-22 19:33:20 +02:00
Ashish Jain
a2932a0393 Merge branch 'master' into develop 2020-07-22 19:30:55 +02:00
Ashish Jain
6917303e1b Enabled styles.js for classDiagram-v2 2020-07-22 19:25:26 +02:00
Knut Sveidqvist
f685363574 Relase 8.6.2 2020-07-22 19:22:02 +02:00
Ashish Jain
03c19ccae9 Migrated style css from scss file to styles.js 2020-07-22 19:10:28 +02:00
Knut Sveidqvist
7313b4b649 Merge pull request #1566 from mermaid-js/1552_fix_broken_cardinality_class_diagram
#1552 Fix for broken cardinality support for class diagrams
2020-07-22 19:07:25 +02:00
Ashish Jain
ff439369da Updated variable name to cnf 2020-07-22 18:27:25 +02:00
Ashish Jain
24e470a099 Merge branch 'develop' into feature/Issue-1465_Class_migration 2020-07-22 18:23:47 +02:00
Ashish Jain
8e72ddde32 #1552 Update current.html for cardinality test 2020-07-22 18:20:31 +02:00
Ashish Jain
07a7ea1f23 #1552 Fix for broken cardinality support for class diagrams 2020-07-22 17:35:01 +02:00
Neil Cuzon
3c854d4af9 Update _sidebar.md 2020-07-21 16:29:45 -07:00
Neil Cuzon
7f3f011104 Update n00b-gettingStarted.md 2020-07-21 16:29:41 -07:00
Neil Cuzon
a5cfae4b33 Update integrations.md 2020-07-21 16:20:17 -07:00
Ashish Jain
516649a508 Adjusting initial classDiagram shape rendering 2020-07-21 15:27:02 +02:00
Ashish Jain
abe23250c4 Adjusting initial classDiagram shape rendering 2020-07-21 15:25:16 +02:00
Knut Sveidqvist
0f575907c7 Merge pull request #1560 from NeilCuzon/release/8.6.0
Edited Release/8.6.0
2020-07-21 12:56:38 +02:00
Knut Sveidqvist
835a3f6149 Merge pull request #1563 from mermaid-js/bug/1562_arrowheads_in_edges_to_cluster
Bug/1562 arrowheads in edges to cluster
2020-07-21 12:55:40 +02:00
Knut Sveidqvist
b93ef22687 #1562 Fix for test 2020-07-21 12:31:05 +02:00
Knut Sveidqvist
bfd927d395 Merge pull request #1561 from mermaid-js/bug/1532_edge_issue
#Beta flowchart: issues with edges to some types of nodes
2020-07-21 12:12:06 +02:00
Knut Sveidqvist
cb79302867 #1562 Updated handling of pointsarray when the point is already in the array 2020-07-21 12:01:08 +02:00
Knut Sveidqvist
211d6f4005 2020-07-21 11:15:42 +02:00
Neil Cuzon
ddee6d2b6a Update config.js 2020-07-20 20:07:57 -07:00
Neil Cuzon
575c34467f Merge branch 'develop' into release/8.6.0 2020-07-20 20:01:32 -07:00
Neil Cuzon
dc8c27b1f9 Update faq.md 2020-07-20 12:09:49 -07:00
Neil Cuzon
4639ec87d2 Update faq.md 2020-07-20 12:09:38 -07:00
Neil Cuzon
50079670f9 Update user-journey.md 2020-07-20 12:09:02 -07:00
Neil Cuzon
ae12e65712 Update usage.md 2020-07-20 12:00:45 -07:00
Neil Cuzon
2f9be335cb Update n00b-syntaxReference.md 2020-07-20 11:58:36 -07:00
Neil Cuzon
9e59d927f2 Update n00b-overview.md 2020-07-20 11:51:23 -07:00
Neil Cuzon
ced3e5fec8 Update n00b-overview.md 2020-07-20 11:48:15 -07:00
Neil Cuzon
50eb523d8e Update n00b-syntaxReference.md 2020-07-20 11:45:13 -07:00
Neil Cuzon
d6baf1b32a Update n00b-syntaxReference.md 2020-07-20 11:39:59 -07:00
Neil Cuzon
60b8dfaa2d Update n00b-syntaxReference.md 2020-07-20 11:39:39 -07:00
Neil Cuzon
815f398ada Update n00b-syntaxReference.md 2020-07-20 11:39:23 -07:00
Neil Cuzon
56ed31ed6f Update n00b-syntaxReference.md 2020-07-20 11:34:05 -07:00
Neil Cuzon
3213fbff8b Update breakingChanges.md 2020-07-20 09:35:46 -07:00
Neil Cuzon
4bca9c63da Update classDiagram.md 2020-07-20 09:35:12 -07:00
Neil Cuzon
01fe70a29a Update development.md 2020-07-20 09:34:37 -07:00
Neil Cuzon
e43804d950 Update README.md 2020-07-20 09:31:51 -07:00
Neil Cuzon
17206fc538 Update CHANGELOG.md 2020-07-20 09:31:01 -07:00
Neil Cuzon
8cda6ede84 Update 8.6.0_docs.md 2020-07-20 09:30:05 -07:00
Knut Sveidqvist
a6ec038189 Merge pull request #1558 from mermaid-js/less_theme_variables
More theming tweaks
2020-07-20 17:37:18 +02:00
Knut Sveidqvist
ffaf6c14e4 #154 trweaking some more, state diagram composit backgrounds 2020-07-20 17:10:59 +02:00
Knut Sveidqvist
3a6915c0b6 #154 lint fixes 2020-07-20 15:24:12 +02:00
Knut Sveidqvist
93a8c83a68 #1542 Alignment between themes 2020-07-20 15:15:03 +02:00
Knut Sveidqvist
1302addcdd #1542 Base theme for simple custom themeing 2020-07-20 14:13:05 +02:00
Knut Sveidqvist
490cbd3f0d Merge pull request #1557 from cmmoran/develop
Render tweak - each diagram should reset the config to siteConfig upon rendering
2020-07-20 11:01:29 +02:00
Knut Sveidqvist
631355d788 Merge pull request #1556 from mermaid-js/less_theme_variables
Tweaks of the new styling engine and tweaks of theams using is
2020-07-20 11:00:45 +02:00
chris moran
ec1ab05ae6 Deprecated prepush script in package.json ->
This fixes:
```Warning: Setting pre-push script in package.json > scripts will be deprecated
Please move it to husky.hooks in package.json, a .huskyrc file, or a husky.config.js file
Or run ./node_modules/.bin/husky-upgrade for automatic update```
2020-07-20 04:49:43 -04:00
chris moran
f5f26f334f Move detectInit higher in the render function. This prevents getConfig from potentially being called with the config changes from previous diagrams on the same page (or context)
This also allows mermaid the chance to reset the config to the siteConfig in between renderings
2020-07-20 04:45:10 -04:00
Knut Sveidqvist
dba579b546 #1542 Gantt tweaks 2020-07-20 10:24:15 +02:00
Knut Sveidqvist
fa68b8bb35 #1542 Some tweaks for sequence diagram 2020-07-20 10:05:46 +02:00
Knut Sveidqvist
ceb84ce020 #1542 Dark theme fixes for gantt 2020-07-20 10:00:08 +02:00
Knut Sveidqvist
68aa7fa3a4 #1542 Dark theme fixes for pie and user-journey 2020-07-20 09:44:09 +02:00
Knut Sveidqvist
70cd0655ed #1542 Set default theme variables 2020-07-20 08:20:09 +02:00
Neil Cuzon
956ee06ea6 Update n00b-overview.md 2020-07-19 21:18:36 -07:00
Neil Cuzon
e15e34db93 Update n00b-overview.md 2020-07-19 21:13:39 -07:00
Knut Sveidqvist
3c23de9735 #1542 Lint fixes 2020-07-19 21:15:58 +02:00
Knut Sveidqvist
91da46dd63 #1542 Theme adjustments 2020-07-19 21:10:52 +02:00
Knut Sveidqvist
4d280ff010 #1542 Making sure user overrides from directives ocerrides properly 2020-07-19 15:02:53 +02:00
chris moran
0297dd2664 Merge branch 'mermaid-js-develop' into develop 2020-07-19 04:30:37 -04:00
Neil Cuzon
56e328f31f Update usage.md 2020-07-18 20:20:48 -07:00
Neil Cuzon
ac2c1e019f Update n00b-gettingStarted.md 2020-07-18 20:12:08 -07:00
Neil Cuzon
56073fd522 Update usage.md 2020-07-18 20:11:48 -07:00
Neil Cuzon
07f6572816 Update usage.md 2020-07-18 18:04:03 -07:00
Knut Sveidqvist
8a018aa0f2 Merge branch 'feature/1542_simplify_theming' into develop 2020-07-18 20:12:31 +02:00
Knut Sveidqvist
936d5821f9 Merge 2020-07-18 20:12:10 +02:00
Knut Sveidqvist
04493035cd #1542 Adding khroma for color in dark-theme 2020-07-18 15:51:17 +02:00
Knut Sveidqvist
08064c4243 #1542 Adding khroma for color manipulations 2020-07-18 15:15:50 +02:00
Neil Cuzon
ed1c2cb596 Update README.md 2020-07-18 05:18:18 -07:00
Neil Cuzon
212e0e624f Update n00b-overview.md 2020-07-18 04:59:52 -07:00
Knut Sveidqvist
e8af778962 #1542 Updated test 2020-07-18 13:52:51 +02:00
Neil Cuzon
26dba53d99 Update config.js 2020-07-18 04:39:33 -07:00
Neil Cuzon
1c6a64caf2 Update n00b-overview.md 2020-07-18 04:27:17 -07:00
Knut Sveidqvist
f7a6241ac0 #1542 Fix for markers in class diagrams 2020-07-18 09:57:55 +02:00
Knut Sveidqvist
b6453383cf #1542 Handling of default values when no theme is set 2020-07-18 09:37:51 +02:00
Neil Cuzon
615c6cb388 Update directives.md 2020-07-17 20:00:24 -07:00
Neil Cuzon
31f890d55c Update n00b-overview.md 2020-07-17 16:54:55 -07:00
Neil Cuzon
567c09850c Update n00b-overview.md
- Added copy to make it more friendly to beginners.
2020-07-17 16:54:23 -07:00
Knut Sveidqvist
8d076efd71 #1542 Styling for all diagram types 2020-07-17 15:57:02 +02:00
Knut Sveidqvist
062126c43d Test page for directives 2020-07-17 12:44:42 +02:00
Knut Sveidqvist
f9667cd80f #1542 Test page using directoives to switch theme 2020-07-17 12:34:33 +02:00
Knut Sveidqvist
65c2f58a66 #1542 Test page using directoives to switch theme 2020-07-17 09:31:42 +02:00
Knut Sveidqvist
030b945828 #1542 Theme variables setup 2020-07-17 09:16:39 +02:00
Knut Sveidqvist
fd4240b774 #1542 Setting theme options as the regular options 2020-07-16 23:39:38 +02:00
Knut Sveidqvist
8c0e022b44 Template for dynamic styles in place 2020-07-16 20:27:42 +02:00
Knut Sveidqvist
da8e75f98a Merge from master with doc updates 2020-07-16 12:27:03 +02:00
Knut Sveidqvist
a1d2208bf3 Merge branch 'release/8.6.0' 2020-07-16 12:23:55 +02:00
Knut Sveidqvist
b6b76eb137 Docs updated from code 2020-07-16 12:17:21 +02:00
Knut Sveidqvist
19b16fe796 Merge pull request #1545 from NeilCuzon/release/8.6.0
Release/8.6.0
2020-07-16 12:13:00 +02:00
Knut Sveidqvist
fec1553041 Merge pull request #1548 from mermaid-js/bug/1547_crypto_libraries_in_bundle
Bug/1547 crypto libraries in bundle
2020-07-16 12:10:53 +02:00
Knut Sveidqvist
bc2f693c55 Merge pull request #1549 from mermaid-js/feature/1454_theme_base_redering_tests
#1454 Adding showcase diagrams rendered with the different themes
2020-07-16 11:45:57 +02:00
Knut Sveidqvist
594ae20a6e #1547 Remove usage of crypto libraries 2020-07-16 10:48:37 +02:00
Neil Cuzon
14388f4bb1 Update n00b-gettingStarted.md 2020-07-15 21:30:23 -07:00
Neil Cuzon
369e6d1e61 Update README.md 2020-07-15 14:15:28 -07:00
Neil Cuzon
789200d454 Update README.md 2020-07-15 14:11:35 -07:00
Neil Cuzon
dcfab0f4dd Update README.md 2020-07-15 13:27:54 -07:00
Neil Cuzon
9677ed9e2d Update README.md 2020-07-15 10:35:50 -07:00
Neil Cuzon
a4ece6c1c5 Update directives.md 2020-07-15 10:35:19 -07:00
Neil Cuzon
e34396015f Update directives.md 2020-07-15 10:34:57 -07:00
Neil Cuzon
64e3310376 Update directives.md 2020-07-15 10:34:34 -07:00
Neil Cuzon
a955d8f890 Update directives.md 2020-07-15 10:30:57 -07:00
Knut Sveidqvist
bbc9532444 #1454 Adding showcase diagrams rendered with the different themes 2020-07-15 14:02:19 +02:00
Knut Sveidqvist
389afde138 Merge pull request #1543 from mermaid-js/bug/1485_application_of_font_settings
#1485 Setting proper font settings in the root css
2020-07-15 14:00:00 +02:00
Knut Sveidqvist
fe5d9e486b #1485 Fixing for test 2020-07-15 13:29:35 +02:00
Knut Sveidqvist
6959e140af #1485 Fixing font in pie legends after fix 2020-07-15 12:32:43 +02:00
Knut Sveidqvist
3a9306a9c2 #1485 Setting proper font settings in the root css 2020-07-15 12:12:57 +02:00
Neil Cuzon
cd23899e02 Update README.md 2020-07-14 21:01:01 -07:00
Neil Cuzon
5a9fa66b04 Update _sidebar.md 2020-07-14 21:00:45 -07:00
Neil Cuzon
1866244a2a Update 8.6.0_docs.md 2020-07-14 19:37:05 -07:00
Neil Cuzon
5d4583c77f Update 8.6.0_docs.md 2020-07-14 19:33:06 -07:00
Neil Cuzon
66ee81c55f Update 8.6.0_docs.md 2020-07-14 19:27:00 -07:00
Neil Cuzon
9a2321a669 Update config.js 2020-07-14 18:15:42 -07:00
Neil Cuzon
1878e39dfc Update config.js 2020-07-14 18:11:36 -07:00
Neil Cuzon
2b9960e05f Update stateDiagram.md 2020-07-14 14:25:49 -07:00
Neil Cuzon
c2e34cd0f5 Update pie.md 2020-07-14 14:25:46 -07:00
Neil Cuzon
78bb5e09e5 Update sequenceDiagram.md 2020-07-14 14:25:43 -07:00
Neil Cuzon
e8c7ffa872 Update flowchart.md 2020-07-14 14:25:40 -07:00
Neil Cuzon
557a3f0896 Update gantt.md 2020-07-14 14:25:37 -07:00
Neil Cuzon
b2af5390fb Update README.md 2020-07-13 18:14:59 -07:00
Neil Cuzon
eb6c901527 Update README.md 2020-07-13 18:04:41 -07:00
Neil Cuzon
d5a9cbe5a3 Update README.md 2020-07-13 18:03:36 -07:00
Neil Cuzon
0658581bcd Update README.md 2020-07-13 18:02:38 -07:00
Neil Cuzon
26c3f5a2cc Update README.md 2020-07-13 18:01:43 -07:00
Neil Cuzon
34a60d7661 Add files via upload 2020-07-13 18:00:50 -07:00
Neil Cuzon
ea0cd80ea7 Add files via upload 2020-07-13 17:58:25 -07:00
Neil Cuzon
11d35c8410 Update README.md 2020-07-13 17:13:07 -07:00
Neil Cuzon
38359e176f Update README.md 2020-07-13 17:12:29 -07:00
Neil Cuzon
e54d9cf629 Update 8.6.0_docs.md 2020-07-13 14:56:28 -07:00
Neil Cuzon
deccf8891d Update README.md 2020-07-13 14:56:24 -07:00
Neil Cuzon
e5ac551795 Update README.md 2020-07-13 14:47:52 -07:00
Neil Cuzon
7684f79e64 Update README.md 2020-07-13 14:47:36 -07:00
Neil Cuzon
9fdab327c8 Update 8.6.0_docs.md 2020-07-13 14:46:47 -07:00
Neil Cuzon
1908af6f54 Update 8.6.0_docs.md 2020-07-13 14:45:55 -07:00
Neil Cuzon
a677608f1d Update 8.6.0_docs.md 2020-07-13 14:42:57 -07:00
Neil Cuzon
93d462e028 Update README.md 2020-07-13 13:59:55 -07:00
Knut Sveidqvist
661553da68 Fixed broken link to config info 2020-07-13 17:21:18 +02:00
Knut Sveidqvist
b4203992bf Merge branch 'release/8.6.0' 2020-07-13 16:42:10 +02:00
Knut Sveidqvist
686ee1e349 Relase 8.6.0 2020-07-13 16:39:52 +02:00
Knut Sveidqvist
9e8c9e897f Merge pull request #1538 from NeilCuzon/develop
documentation for config and other changes, with minor cosmetic changes to ReadMe
2020-07-12 19:56:37 +02:00
Neil Cuzon
06ceb5e68d Update README.md 2020-07-12 10:44:35 -07:00
Knut Sveidqvist
dc2f9c304d Font fix for rendering tests - back to noto font 2020-07-12 15:25:01 +02:00
Knut Sveidqvist
462d5c3b12 Font fix for rendering tests 2020-07-12 14:56:27 +02:00
Knut Sveidqvist
39e90a20da Font fix for rendering tests 2020-07-12 12:21:17 +02:00
Knut Sveidqvist
b40014d709 Merge pull request #1536 from mermaid-js/bug/1448_mock_clock_in_render_tests
Mocking of clock in gantt tests
2020-07-12 11:24:14 +02:00
Knut Sveidqvist
2bdc229a9a Merge pull request #1496 from polarsquad/fix-git-commit-id
Make gitGraph commit IDs out of hexadecimal chars
2020-07-12 11:22:19 +02:00
Knut Sveidqvist
61684830bf 2020-07-12 11:15:32 +02:00
Knut Sveidqvist
e93a0556e7 Merge pull request #1471 from vantoan8x/securityLevel_antiscript_option
add security level antiscript option, use rich html format but dont permit script element.
2020-07-12 10:58:08 +02:00
Knut Sveidqvist
12668b78b9 Merge pull request #1535 from 72636c/feature/er_classes
Add classes to ERD elements
2020-07-12 10:52:30 +02:00
Knut Sveidqvist
8255088508 Merge pull request #1534 from 72636c/feature/er_use_max_width
Add `er.useMaxWidth` config option
2020-07-12 10:51:00 +02:00
Knut Sveidqvist
e66f7f012e Merge pull request #1533 from 72636c/feature/config_flowchart_diagram_padding
Add `flowchart.diagramPadding` config option
2020-07-12 10:49:31 +02:00
Ryan Ling
3e38da2120 Document er defaults 2020-07-11 20:50:36 +10:00
Ryan Ling
f2e7c82231 Fix table alignment 2020-07-11 20:44:46 +10:00
Ryan Ling
20e56d7dfa Add classes to ERD elements
It's a little hard to style the current ERDs. This aims to make things
easier by associating a distinct class with each type of element within
the diagram.

I've added a common `er` class across the elements so that those that
bring their own `themeCSS` can target styles at this diagram type. This
hasn't really been done elsewhere so I'm open to suggestions; an
alternative may be to add classes to a top-level element so that we can
do e.g. `svg.mermaid.er .entityBox`.
2020-07-11 20:34:57 +10:00
Ryan Ling
13225faa9e Update docs 2020-07-11 18:59:43 +10:00
Ryan Ling
99cb752c71 Add er.useMaxWidth config option
This restores the option of rendering an ERD with an absolute width,
which is consistent with the approach taken with the other diagram
types.

This logic was lost in #1324, which was probably just a small oversight:

9199546dca (diff-7c38d27acbe0676d923bf19283671616L397-L409)

The option defaults to true for backwards compatibility.
2020-07-11 18:54:26 +10:00
Ryan Ling
5da4ced8c1 Add flowchart.diagramPadding config option
This option lets you customise the padding around the whole flowchart.
It is equivalent to `er.diagramPadding` and defaults to 8px for
backwards compatibility with the current hardcoded value.
2020-07-11 16:54:00 +10:00
Neil Cuzon
e363a21619 Update README.md 2020-07-10 08:43:59 -07:00
Neil Cuzon
09efbaf621 Update Setup.md 2020-07-09 11:15:50 -07:00
Neil Cuzon
31027047e3 Update 8.6.0_docs.md 2020-07-09 06:10:07 -07:00
Neil Cuzon
629eb4ca90 Update 8.6.0_docs.md 2020-07-09 05:28:47 -07:00
Neil Cuzon
c4e6e5eca4 Update 8.6.0_docs.md 2020-07-09 05:25:15 -07:00
Neil Cuzon
ea72d41e6d Update 8.6.0_docs.md 2020-07-09 05:23:30 -07:00
Neil Cuzon
c0f5b04472 Update 8.6.0_docs.md 2020-07-09 05:16:50 -07:00
Neil Cuzon
532b32dab5 Update 8.6.0_docs.md 2020-07-09 05:15:47 -07:00
Neil Cuzon
fb5c96731a Update 8.6.0_docs.md 2020-07-09 05:14:20 -07:00
Neil Cuzon
3f8eb8cb6b Update 8.6.0_docs.md 2020-07-09 04:46:55 -07:00
Neil Cuzon
89dc64ab66 Add files via upload 2020-07-09 04:12:07 -07:00
Neil Cuzon
6968cff2b6 Add files via upload 2020-07-09 04:02:05 -07:00
Chris Moran
c390e9e877 Merge pull request #1529 from cmmoran/develop
Missed test case for allowing site owner to append to `secure` field set
2020-07-09 06:32:16 -04:00
chris moran
dee47ec978 Missed test case for allowing site owner to append to secure field set
Missed logic for default-appending src array values where not existing within dst array in assignWithDepth function
2020-07-08 08:41:35 -04:00
Toan
fce2a16e42 add security level antiscript option, to let use rich html format but remove all script element. 2020-07-05 23:04:22 +07:00
Knut Sveidqvist
5242672efb Adding configuration docs to setup.md and bumping version to 8.6.0 2020-07-04 14:25:14 +02:00
Knut Sveidqvist
5c043dd908 Merge pull request #1525 from mermaid-js/bug/1524_message_text_vertical_pos
Bug/1524 message text vertical pos
2020-07-04 12:46:24 +02:00
Knut Sveidqvist
19ed03c44c #1524 Updated tests 2020-07-04 12:35:34 +02:00
Knut Sveidqvist
32b2ee8cab 2020-07-04 11:13:54 +02:00
Knut Sveidqvist
7e9ab546eb Fix for broken build, issue with config use in flowcahart and gantt diagram 2020-07-02 22:34:13 +02:00
Knut Sveidqvist
2af1f9a9d3 Fix for broken build, issue with config use in flowcahart and gantt diagram 2020-07-02 22:27:03 +02:00
Knut Sveidqvist
b6d6d3c980 Merge pull request #1523 from mermaid-js/feature/1483_long_messages
Directives, sequenceDiagram refactor, config normalization, many tweaks
2020-07-02 18:39:25 +02:00
Knut Sveidqvist
c655cfaca8 Merge branch 'develop' into feature/1483_long_messages 2020-07-02 18:38:37 +02:00
Knut Sveidqvist
b3a465dbca Merge branch 'develop' into feature/1483_long_messages 2020-07-02 18:25:49 +02:00
Knut Sveidqvist
33d3bc53b4 Merge pull request #1519 from cmmoran/develop
Utils - memoize, calculateTextDimensions (and friends), assignWithDepth, etc
2020-07-02 17:01:24 +02:00
Knut Sveidqvist
be9da3928b Updated mermaidAPI.md from PR 2020-07-02 16:59:09 +02:00
Knut Sveidqvist
a9fd557c4e Merge branch 'NeilCuzon-patch-8' into develop 2020-07-02 16:57:00 +02:00
Knut Sveidqvist
faac22f6ed Lint fix 2020-07-02 16:56:30 +02:00
Chris Moran
35a47093ab Merge pull request #1522 from cmmoran/feature/1483_long_messages
Fixed dark theme (sequenceDiagram) sequenceNumbers color
2020-07-01 07:59:17 -04:00
chris moran
01a2d90e38 sequence numbers for dark mode should probably be black since the circle is the contrast color 2020-07-01 07:53:03 -04:00
Chris Moran
1cc2e74a03 Merge pull request #1521 from cmmoran/feature/1483_long_messages
added hasBreaks and splitBreaks to common.js
2020-07-01 07:44:37 -04:00
chris moran
ca86ab71f2 added hasBreaks and splitBreaks to common.js
updated parseMessage to set wrap: true when breaks are detected
2020-07-01 07:41:44 -04:00
Chris Moran
ee425d278c Merge pull request #1520 from mermaid-js/develop
Merging changes from develop into feature/1483_long_messages
2020-07-01 06:34:48 -04:00
chris moran
1c3c2b6a74 utils refactor
- memoize to poor-man-cache properly-ish
- wrapLabel, calculateTextDimensions (and friends) moved to utils for all to enjoy
- drawSimpleText getTextObj moved to utils to support the functions listed above
- assignWithDepth - Object.assign but depth-ier
- random - for crypto random numbers
2020-07-01 06:20:53 -04:00
Chris Moran
9952f7734a Merge pull request #1518 from cmmoran/feature/1483_long_messages
Feature/1483 long messages
2020-07-01 05:36:11 -04:00
chris moran
2ffb2988bf One small refactor to fix activation starty
Ensure a minimum amount of space between wrapped / non-wrapped title text and the next element
2020-07-01 05:34:53 -04:00
chris moran
fda1d7c4c5 Merge remote-tracking branch 'upstream/feature/1483_long_messages' into feature/1483_long_messages 2020-07-01 04:49:15 -04:00
Chris Moran
19519ac74e Merge pull request #1 from mermaid-js/develop
Merge upstream
2020-07-01 04:47:47 -04:00
Chris Moran
eb3f62fd90 Merge pull request #1517 from cmmoran/feature/1483_long_messages
Feature/1483 long messages
2020-07-01 04:46:27 -04:00
Neil Cuzon
891b362e7d Update mermaidAPI.js
-Added tables into the comments from mermaidAPI.md, to reflect documentation that I had added through a previous PR, #1509
-as per @knsv 's directions, added comments here.

-also found a list of parameters, who's documentation do not come out in the markdown file. I left them alone, but will be raising a separate issue, for others to review.
2020-07-01 01:35:25 -07:00
chris moran
cbb69bd3cb () => is not the same as function() {} smh
Fixed a few of the text rendering issues
2020-07-01 04:34:29 -04:00
Knut Sveidqvist
200a3e5e8c Merge pull request #1498 from mermaid-js/feature/1424_dark_mode_in_docs
Feature/1424 dark mode in docs
2020-06-30 16:54:06 +02:00
Knut Sveidqvist
0fab2dc24f Merge pull request #1499 from maiconschmitz/patch-1
Update README.md
2020-06-30 16:34:34 +02:00
Knut Sveidqvist
a48654f195 Merge pull request #1503 from NeilCuzon/patch-4
Update sequenceDiagram.md
2020-06-30 16:31:20 +02:00
chris moran
174b098724 loop/opt/alt/etc titles should always wrap 2020-06-30 07:54:51 -04:00
Chris Moran
ecb4671e0d Merge pull request #1513 from cmmoran/feature/1483_long_messages
conf.messageFont() would have a different cacheKey based on the cache…
2020-06-30 07:21:39 -04:00
chris moran
6c6f6838ee conf.messageFont() would have a different cacheKey based on the cacheKey calculations done in this particular branch. This will be normalized with the memoize PR about to be created. 2020-06-30 07:18:28 -04:00
Chris Moran
b4414758a7 Merge pull request #1512 from cmmoran/feature/1483_long_messages
math is hard sometimes?
2020-06-30 06:47:50 -04:00
chris moran
5b37536ce5 math is hard sometimes? 2020-06-30 06:42:29 -04:00
Chris Moran
3365fa174d Merge pull request #1511 from cmmoran/feature/1483_long_messages
Fixed config *font helpers
2020-06-30 06:24:36 -04:00
chris moran
d42b95bab9 messageFont, noteFont, and actorFont getConfig() calls were not specifying the sequence object
take into account width of message over single actor for actors' max message width
2020-06-30 06:20:45 -04:00
Chris Moran
6a3aaf360e Merge pull request #1510 from cmmoran/feature/1483_long_messages
Feature/1483 long messages
2020-06-30 03:51:25 -04:00
chris moran
083d0c90e2 Merge branch 'develop' into feature/1483_long_messages 2020-06-30 03:50:04 -04:00
chris moran
fed142dad2 Merge branch 'mermaid-js-develop' into develop 2020-06-30 03:34:55 -04:00
chris moran
fcd2126330 Getting closer 2020-06-28 08:37:26 -04:00
Neil Cuzon
e5cd0ced53 Update sequenceDiagram.md 2020-06-26 22:46:09 -07:00
Chris Moran
06dad7865c Merge pull request #1502 from cmmoran/develop
Missed `activationWidth` new configuration option for sequence diagrams
2020-06-26 10:19:02 -04:00
chris moran
6915634729 Missed activationWidth new configuration option for sequence diagrams 2020-06-26 10:17:13 -04:00
Chris Moran
d3647e2e8a Merge pull request #1501 from cmmoran/develop
Fixes
2020-06-26 09:33:57 -04:00
chris moran
217bd1f4bf Fixed test cases for sequence diagrams
Updated config to match a conversation knut and i had about the relationship between global, site, and integrator configuration
(Will update docs)
Renamed wrapEnabled to wrap
Poor man's caching for calculateTextDimensions, wrapLabel, and breakString (actually makes a huge difference)
2020-06-26 09:26:56 -04:00
Maicon Schmitz
75fe500305 Update README.md
Correction off CLI link, in Related projects section
2020-06-25 11:24:45 -03:00
Ashish Jain
1e400624e0 Adjusting classDiagram marker styling 2020-06-24 21:46:59 +02:00
Ashish Jain
b190a0eaba Added support for classDiagram relation arrow markers 2020-06-24 21:45:19 +02:00
Knut Sveidqvist
afc779440a #1424 Setting proper loglevel for docs 2020-06-24 21:28:12 +02:00
Knut Sveidqvist
7f71717a9f #1424 Setting dark mode in docs based un user preferences 2020-06-24 21:26:55 +02:00
Knut Sveidqvist
b9931da241 1465 Marking edges witrh new schema for arrow heads 2020-06-24 19:47:12 +02:00
Knut Sveidqvist
eaf0d5e0a0 Merge branch 'feature/Issue-1465_Class_migration' of github.com:mermaid-js/mermaid into feature/Issue-1465_Class_migration 2020-06-24 19:43:00 +02:00
Knut Sveidqvist
832206ef80 Adjust flowchart-v2 to use new arrot type handling 2020-06-24 19:42:56 +02:00
Ashish Jain
85d4f2843e Initial commit for classDiagram v2 2020-06-24 19:34:12 +02:00
Knut Sveidqvist
0849aa3f03 Merge pull request #1488 from abhijeet-pathak/1005_gantt_sequnce_creation_order_change
Fix for the issue 1005
2020-06-24 18:33:01 +02:00
Knut Sveidqvist
4cdeb214a7 Merge pull request #1486 from zwpaper/develop
gitGraph dot and minus should be valid branch name
2020-06-24 18:25:56 +02:00
abhijeet-pathak
3c727bc46f Corrected the test case description 2020-06-24 14:51:08 +05:30
Miika Kankare
955ccfae88 Make gitGraph commit IDs out of hexadecimal chars 2020-06-24 09:28:58 +03:00
GDFaber
e13662dd2c Merge pull request #1492 from NeilCuzon/patch-5
Update flowchart.md
2020-06-23 19:27:15 +02:00
Abhijeet Pathak
2840c98bb0 Added test case for preserving creation order
of tasks
2020-06-23 22:32:49 +05:30
chris moran
7d9bf83f66 addition: added bounds models for bounds checking in unit tests.
addition: bounds.init will clear models
addition: added loop model widths id instead of using title as the id
removed parseMessage debug message
addition: added configuration labelBoxWidth and labelBoxHeight for loop label box width/height
change: adjusted svgDraw drawText to support anchor and valign and whether to output a tspan
change: drawText returns an array regardless of array size
change: hardcoded label width/height uses conf.labelBoxWidth and conf.labelBoxHeight
change: Math.round() on many of the calculations to clean up bounds values
change: getTextObj anchor, width, height start as undefined
2020-06-22 16:59:07 -04:00
GDFaber
d2c47bb153 Merge pull request #1491 from NeilCuzon/patch-4
Update faq.md
2020-06-22 08:04:03 +02:00
Neil Cuzon
9da3402997 Update flowchart.md
-added a few workarounds, I found for writing "end" as a node name alongside the workaround found in the FAQ.

-also made a few minor edits to the contents.
2020-06-21 15:19:45 -07:00
Neil Cuzon
e7784e3c34 Update faq.md 2020-06-21 11:41:46 -07:00
Neil Cuzon
224d6dc93f Update faq.md 2020-06-21 10:03:21 -07:00
Chris Moran
f95b5d05d7 Merge pull request #1489 from cmmoran/develop
noteModel generated during calculation of loop bounds
2020-06-20 20:56:29 -04:00
chris moran
ee109c2279 noteModel generated during calculation of loop bounds
msgModel generated during calculation of loop bounds
simplifies draw messages loop
2020-06-20 18:15:24 -04:00
Abhijeet Pathak
e515c7beb1 Fxed liniting issues. 2020-06-20 18:39:19 +05:30
Abhijeet Pathak
5f56db6f6e Fix for the issue 1005
(https://github.com/mermaid-js/mermaid/issues/1005)
A new attribute 'order' has been introduced in the task which records
the serial number of task in the script.
In ganttRenderer.js, the tasks are sorted by stratTime attribute.
The function which calculates 'y' for task rectangles, lables etc.
has been modified to correctly position it.
2020-06-20 18:03:48 +05:30
zwPapEr
c00b204259 gitGraph: 🔨 dot and minus should be valid branch name 2020-06-20 11:58:38 +08:00
Knut Sveidqvist
280c89a78d Merge pull request #1484 from chrismoran-bkt/develop
PR 1482 redux
2020-06-19 20:04:15 +02:00
Chris Moran
809ba2b392 Fixed: width of notes left of and right of 2020-06-19 13:50:53 -04:00
Chris Moran
18254392ab Merge branch 'mermaid-js-develop' into develop 2020-06-19 13:32:23 -04:00
Chris Moran
5646518352 Tweaked the PR for long messages 2020-06-19 12:45:04 -04:00
Chris Moran
710b88efae Merge branch 'feature/1483_long_messages' of https://github.com/mermaid-js/mermaid into develop 2020-06-19 09:17:04 -04:00
Chris Moran
1118c3399c Fixed incorrect positioning and bounds for actors and notes with wrapping enabled and disabled 2020-06-19 09:13:37 -04:00
Knut Sveidqvist
98a7800fae Merge pull request #1481 from mermaid-js/1474_missplaced_transitions
1474 missplaced transitions
2020-06-19 11:38:43 +02:00
Knut Sveidqvist
b3f9bbe50f Merge branch 'develop' into 1474_missplaced_transitions 2020-06-19 11:38:30 +02:00
Knut Sveidqvist
e37c7e58cf Merge pull request #1479 from chewnoill/chewy/cleanup-after-failed-render
cleanup helper dom elements before rendering
2020-06-19 11:29:46 +02:00
Knut Sveidqvist
feb9ffadec Diagram showing sequence diagram with cut long message text 2020-06-19 11:03:37 +02:00
Knut Sveidqvist
a4d96b032e Diagram showing sequence diagram with long message text 2020-06-19 11:01:54 +02:00
Knut Sveidqvist
038d70a40b Diagram showing sequence diagram with long message text 2020-06-19 10:57:16 +02:00
Knut Sveidqvist
44d5009538 Revert of PR #1482 2020-06-19 10:52:20 +02:00
Knut Sveidqvist
8e1e7fb314 Merge branch 'chrismoran-bkt-develop' into develop 2020-06-19 08:41:52 +02:00
Knut Sveidqvist
dbbfbb2855 Updates after review 2020-06-19 08:40:54 +02:00
Chris Moran
24ed979faf Fixed an incorrect reference to an outer variable (actor) when processing actor widths 2020-06-18 08:51:16 -04:00
Chris Moran
e64a65c41e Refactored rendering sequence diagrams
Fixed default config clobbering issues
Updated/corrected sequenceDiagram.spec to set the config using mermaidAPI
Enabled freeze on mermaidAPI to protect defaultConfig
2020-06-18 08:10:50 -04:00
Chris Moran
67c2fe8005 Refactored rendering sequence diagrams
Fixed default config clobbering issues
2020-06-17 18:13:37 -04:00
will cohen
d3d15b79fb cleanup helper dom elements before rendering 2020-06-17 17:54:01 -04:00
Knut Sveidqvist
60586d8ce0 #1474 Lint changes 2020-06-17 18:31:53 +02:00
Knut Sveidqvist
c95257f32c #1474 Adding some tests 2020-06-17 18:28:49 +02:00
Knut Sveidqvist
f0162557c5 #1474 Handling transitions 2020-06-17 18:16:24 +02:00
Chris Moran
5f257119d6 Merge branch 'develop' into refactor-sequences
# Conflicts:
#	dist/mermaid.core.js
#	dist/mermaid.core.js.map
#	dist/mermaid.js
#	dist/mermaid.js.map
#	dist/mermaid.min.js
#	dist/mermaid.min.js.map
#	src/config.js
#	src/mermaidAPI.js
2020-06-17 06:12:02 -04:00
Chris Moran
e6df4f24f4 Merge remote-tracking branch 'origin/develop' into develop 2020-06-17 06:05:00 -04:00
Chris
d4b733ff16 Merge pull request #5 from mermaid-js/develop
Merging upstream develop
2020-06-17 06:04:04 -04:00
Chris Moran
3c72d28511 Refactored rendering sequence diagrams 2020-06-17 05:54:24 -04:00
Knut Sveidqvist
e4b63a68fd Merge pull request #1477 from mermaid-js/1473_default_config
1473 default config
2020-06-16 08:07:18 +02:00
Knut Sveidqvist
a251029546 #§473 Font update for e2e tests 2020-06-15 22:42:33 +02:00
Knut Sveidqvist
b5d457daa9 Testcommit 2020-06-15 22:26:11 +02:00
Knut Sveidqvist
603f2a2154 1473 Using setConfig instead of initialize from mermaid in some cases 2020-06-15 21:55:20 +02:00
GDFaber
4f40c96d19 Merge pull request #1475 from NKjoep/develop
fix: Update cli link in the Readme
2020-06-15 16:13:10 +02:00
Andrea D
d7fc658bae fix: Update cli link in the Readme 2020-06-15 14:11:54 +02:00
Knut Sveidqvist
08dd2bd93d 1473 Class diagrams 2020-06-15 08:03:13 +02:00
Knut Sveidqvist
10b8a33b55 1473 Updated config handling, removed a logger 2020-06-15 01:12:25 +02:00
Knut Sveidqvist
bd0210cdce 1473 Updated config handling 2020-06-15 01:11:56 +02:00
Knut Sveidqvist
5677523800 1473 Setting default config 2020-06-14 23:37:08 +02:00
Knut Sveidqvist
2150933368 Setting default config 2020-06-14 22:50:45 +02:00
Chris Moran
fd7dbaf0a7 Merge branch 'mermaid-js-develop' into develop 2020-06-14 14:14:28 -04:00
Knut Sveidqvist
d145310447 Merge pull request #1472 from chrismoran-bkt/develop
Fixed theme rendering for note text on non-dark themes.
2020-06-14 19:52:56 +02:00
Chris Moran
9d413680d9 Fixed a rendering issue introduced while trying to fix dark mode. This should fix the rendering of note text for all current themes. 2020-06-14 13:42:25 -04:00
Chris Moran
0e85c814e1 Merge branch 'mermaid-js-develop' into develop 2020-06-14 13:03:13 -04:00
Knut Sveidqvist
3589bb9597 Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-06-14 18:41:31 +02:00
Knut Sveidqvist
10b06eda91 #1458 Adding directives section in the docs 2020-06-14 18:41:27 +02:00
Knut Sveidqvist
145d337db9 Merge pull request #1458 from chrismoran-bkt/develop
Auto-wrap, inline config, initialization, dark theme tweaks, etc
2020-06-14 18:26:32 +02:00
Chris Moran
1d59ae24c6 Merge branch 'mermaid-js-develop' into develop 2020-06-14 11:40:35 -04:00
Chris Moran
6309dd1350 Merge branch 'develop' of https://github.com/mermaid-js/mermaid into mermaid-js-develop 2020-06-14 11:40:15 -04:00
Chris Moran
0ae001ed6d Fixed issue with idea-multimarkdown.
- JavaFX does not support lookbehind
 - (?) It also appears that named regex groups are also unsupported for both mermaid and javafx

Update:
 - Fixed an issue where setLogLevel did not properly handle 'named' log levels
 - Backwards compatibility should be preserved, any/all %%{...}%% directives will be correctly processed by the grammar and properly ignored for any/all graph types that do not support them.

 - Multiline directives will render an error (as they should) if they are not accounted for in the .jison grammar
2020-06-14 11:34:39 -04:00
Knut Sveidqvist
bb8efadb98 Merge pull request #1470 from vantoan8x/click_event_support_keypath_function
Chart Node click event support key-path value for function callback
2020-06-14 14:25:46 +02:00
Chris Moran
620c894929 Fixed issue causing idea-multimarkdown headaches: util changes. Reworking them. 2020-06-14 06:53:22 -04:00
GDFaber
18d2a7fe4d Merge pull request #1467 from CollierCZ/patch-1
docs: update gantt docs
2020-06-14 00:30:52 +02:00
Knut Sveidqvist
78e74cda28 Merge pull request #1469 from mermaid-js/1466_linetypes_in_beta_renderer
1466 linetypes in beta renderer
2020-06-13 23:10:46 +02:00
Knut Sveidqvist
cc9c69c931 #1466 Fixing notes for state diagrams (beta) 2020-06-13 13:44:45 +02:00
Knut Sveidqvist
6559cfd0e1 #1466 Handling line styles using the new rendering engine 2020-06-13 13:12:33 +02:00
Toan
28dcc781b4 Chart Node click event support key-path value for function callback 2020-06-13 17:41:52 +07:00
Aaron Collier
09f10d2d7e docs: update gantt docs
Added descriptions of title and section statements and how to style todayMarker.
2020-06-12 11:44:01 +02:00
Knut Sveidqvist
8492503d4f Merge pull request #1464 from vantoan8x/bug/fix_tooltip_position_when_scroll
when window scroll, the tooltip show incorrect position coz its missing window.scrollXY
2020-06-11 21:56:27 +02:00
Knut Sveidqvist
c48b9b34e9 Merge pull request #1463 from vantoan8x/develop
Naming the link/connector edgeLabel and edgePath to let easy query and custom.
2020-06-11 21:55:57 +02:00
Chris Moran
04b4da0c75 ## Work in progress.
Implemented directives per PR review comment:

%%{directive: json-encoded-arg-string}%%

example:

%%{init: { 'logLevel': 0, 'theme': 'dark' }}%%

Also changed wrap and config to directives:

%%{wrap}%%
%%{config: { 'fontSize': 18 }}%%
2020-06-11 15:35:00 -04:00
Toan
276b171d93 when window scroll, the tooltip show incorrect position coz its missing offset of window.scrollXY 2020-06-11 16:04:39 +07:00
Toan
44675739a1 when window scroll, the tooltip show incorrect position coz its missing offset of window.scrollXY 2020-06-11 16:01:36 +07:00
Toan
6e13718cbd naming the link/connector edgeLabel and edgePath to let easy query and custom. 2020-06-11 11:42:14 +07:00
Knut Sveidqvist
2bb6922e7f Merge pull request #1446 from jgreywolf/1378-AdditionalQualifiersBugWithMultipleArguments
1378 additional qualifiers bug with multiple arguments
2020-06-10 18:57:40 +02:00
Justin Greywolf
67e167427c 1378-Added additional test 2020-06-09 14:54:08 -07:00
Justin Greywolf
969a4e7ba5 1378-refine legacy member parsing to cover additional cases 2020-06-09 14:25:03 -07:00
GDFaber
a5aa38ce3c Merge pull request #1459 from ameech/patch-1
Fixed Typo
2020-06-09 04:34:01 +02:00
Justin Greywolf
0495103635 Fix regex and Fix incorrect test 2020-06-08 19:21:33 -07:00
Justin Greywolf
ae6b75b62a Removed additional unintended change 2020-06-08 18:47:36 -07:00
Justin Greywolf
9091d686ed 1378-Update regex to match multiple parameters
removing node version changes
2020-06-08 18:42:29 -07:00
Justin Greywolf
47b5d7a2df 1378-accept multiple parameters with methods
sec
2020-06-08 18:42:29 -07:00
Justin Greywolf
6298a7a357 Merge pull request #22 from mermaid-js/develop
merge from base fork
2020-06-08 18:42:10 -07:00
Adam Meech
45c63e2b82 Fixed Typo 2020-06-08 17:14:46 -05:00
Chris Moran
dba617a7fe Merge branch 'mermaid-js-develop' into develop 2020-06-08 15:00:52 -04:00
Chris Moran
4a253a7760 Merged with mainline develop 2020-06-08 14:58:42 -04:00
Chris Moran
bd11663e0a Added auto wrap option (and grammar) for sequenceDiagrams
Added inline config and init(ialization) grammar
Added reinitialize functionality to mermaidAPI (not to be confused with initialize)
Added actorFontWeight, noteFontWeight, messageFontWeight, wrapEnabled, wrapPadding
Added wrapLabel and breakWord functions to intelligently wrap text based on a pixel-based width instead of column-based
  - The implementation is largely from Carys Mills: https://medium.com/@CarysMills/wrapping-svg-text-without-svg-2-ecbfb58f7ba4
  - Made slight modifications for mermaid-js
Fixed dark theme color inconsistencies for sequence diagrams
Removed !important from sequence scss as this prevents any client overrides
Fixed various invalid css values in sequence scss which prevented proper rendering of various elements
Added detectInit to utils for initialization json detection
Updated detectType to support the existence or absence of the intialization configuration
Updated calculateTextWidth to include fontWeight
2020-06-08 14:48:03 -04:00
Knut Sveidqvist
7c4bff567b Merge branch 'master' into develop 2020-06-07 11:08:26 +02:00
Knut Sveidqvist
df2a5e97f8 Update index.html 2020-06-07 11:06:07 +02:00
Knut Sveidqvist
e9e5c75dec 8.5.2 Release build 2020-06-07 10:39:21 +02:00
Knut Sveidqvist
21e4387a39 Merge branch 'release/8.5.2' 2020-06-07 10:35:57 +02:00
Knut Sveidqvist
67ef829e04 Bump of version 2020-06-07 10:24:49 +02:00
Knut Sveidqvist
8b2b9713ce Merge pull request #1451 from mermaid-js/dependabot/npm_and_yarn/websocket-extensions-0.1.4
Bump websocket-extensions from 0.1.3 to 0.1.4
2020-06-07 10:22:25 +02:00
Ashish Jain
b7f998094f Merge pull request #1450 from mermaid-js/feature/1447_return_svg_at_syntax_error
Feature/1447 return svg at syntax error
2020-06-06 19:41:32 +02:00
dependabot[bot]
c324200f70 Bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-06 17:20:32 +00:00
Knut Sveidqvist
db3377e170 Lint fixes 2020-06-06 12:53:19 +02:00
Knut Sveidqvist
85a8feec9d Also fix for error handling when setting mermaid.parseError 2020-06-06 12:42:35 +02:00
Knut Sveidqvist
22b0ddfb42 Merge pull request #1439 from GDFaber/feature/build_and_publish_dev_and_prod_code
Build development and production code in one go and include it into the repository
2020-06-02 18:59:28 +02:00
Marc Faber
1cc94f8353 Add js and map files in dist folder to repository 2020-06-01 15:23:46 +02:00
Marc Faber
7d2a7d24a6 Remove entries in git ignore file 2020-06-01 15:16:41 +02:00
Marc Faber
73056f5620 Build development and production code in one go and include it into the repository 2020-06-01 14:44:53 +02:00
Knut Sveidqvist
2c271acfe9 Merge pull request #1438 from mermaid-js/1436_intersection_with_circles
1436 intersection with circles
2020-05-30 18:54:30 +02:00
Knut Sveidqvist
b76e833ea5 #1436 Correcting intersection calculations for circles 2020-05-30 18:04:46 +02:00
Knut Sveidqvist
3bdb9f289f Merge branch 'master' into develop 2020-05-30 17:11:23 +02:00
Justin Greywolf
97b8684e1a Merge pull request #21 from mermaid-js/develop
merge from base
2020-05-27 14:57:39 -07:00
Knut Sveidqvist
8958b2aa1b Merge pull request #1432 from mermaid-js/1418_html_labels_rendering_engine
1418 html labels rendering engine
2020-05-27 22:34:26 +02:00
Knut Sveidqvist
cf0fb69153 #1418 Lint fixes 2020-05-27 22:23:53 +02:00
Knut Sveidqvist
8603cf89b0 #1418 Fix for descriptions in states 2020-05-27 22:18:59 +02:00
Knut Sveidqvist
39ef0107ad #1418 Fix for titles in stateDiagram clusters 2020-05-27 21:47:07 +02:00
Knut Sveidqvist
63d7b63f42 #1418 Fix fr background in notes when using htmlLabels 2020-05-27 21:20:18 +02:00
Knut Sveidqvist
4ea6c98f43 #1418 Adding support for htmlLabels in stateDiagram (v2) 2020-05-27 20:41:59 +02:00
Knut Sveidqvist
39bdf261c6 2020-05-27 19:38:30 +02:00
Knut Sveidqvist
cb3e13e9e5 Merge pull request #1430 from yonasb/develop
Add Azure Devops native support to integrations list
2020-05-27 19:30:46 +02:00
Knut Sveidqvist
7a7e8fe741 Merge pull request #1425 from spopida/bug/1415_erd_empty_label_not_working
Ensure empty quoted relationship labels are accepted in ER diagrams
2020-05-27 19:30:21 +02:00
Yonas
4a9e691747 Merge pull request #1 from yonasb/docs/add-azure-integration
Add Azure Devops native support to integrations list
2020-05-27 10:09:37 -07:00
Yonas
4026c57834 Add Azure Devops to integrations list 2020-05-27 10:05:43 -07:00
Adrian Hall
f1c05bc909 Ensure empty quoted relationship labels are accepted in ER diagrams 2020-05-23 13:33:44 +01:00
Knut Sveidqvist
18d3b3545d Merge pull request #1422 from kevinkhill/patch-1
Update flowchart.md
2020-05-22 09:37:48 +02:00
Knut Sveidqvist
a03d9fba10 Merge pull request #1419 from korycins/patch-1
Fix config param name. Drop duplicated field in css example.
2020-05-22 09:36:24 +02:00
Knut Sveidqvist
ef24020b14 Merge pull request #1411 from ivan-danilov/sequence-over-notes-position-fix
Fixed SequenceDiagram over note horizontal position
2020-05-22 09:33:54 +02:00
Kevin Hill
d16d969799 Update flowchart.md 2020-05-21 04:33:58 -07:00
Maciej Korycinski
232f1fda6d Fix config param name. Drop duplicated field in css example. 2020-05-19 11:09:08 +02:00
Knut Sveidqvist
c1fd7fdad0 Updated version of mermaid in the docs
8.5.1
2020-05-17 10:29:55 +02:00
Knut Sveidqvist
9470a4f1ed Release 8.5.1, bumped version in package.json 2020-05-17 10:04:09 +02:00
Knut Sveidqvist
9da027cf74 Fix for intersect issues for start/end state 2020-05-17 09:34:56 +02:00
Knut Sveidqvist
45e9988700 Lint fix 2020-05-16 21:59:13 +02:00
Knut Sveidqvist
1f9b4703e8 Updated url in docs to use latest version of mermaid 2020-05-16 20:00:44 +02:00
Knut Sveidqvist
c21b61bbd2 Bug fixes in new functionality, intersections not taken into account in nodes used by new graph engine. Graph flowchart not usable when integrating using mermaid.core. Incorrect flwochart docs 2020-05-16 19:58:22 +02:00
Ivan Danilov
61249b0887 Fixed SequenceDiagram over note horizontal position
Previous expression with noteWidth does not make sense as noteWidth is
not used in case of note over two participants - forceWidth is used
instead. It tried to be symmetrical over cases A,B and B,A but failed.

Can be seen with messages over conf.width size (cannot reproduce in the
live editor as it seems to use not the last version where the code
does not use noteWidth).

The changed code explicitly calculates which of the actors is the
"left" one and starts rendering half margin to the left of its cetral
line.
2020-05-13 21:50:25 -07:00
Knut Sveidqvist
0ac48a431a Merge pull request #1409 from mermaid-js/1408_mermaid_on_diet
1408 mermaid on diet
2020-05-13 19:32:56 +02:00
Knut Sveidqvist
7b15fefcaa #1408 Mocking new module in tests 2020-05-13 19:21:53 +02:00
Knut Sveidqvist
6d076284e8 #1408 Removing crypto-random-string and he 2020-05-13 19:14:18 +02:00
Knut Sveidqvist
d7d248fd04 Merge pull request #1388 from mermaid-js/1386_finetuning_rendering_engine
1386 finetuning rendering engine
2020-05-13 17:36:12 +02:00
Knut Sveidqvist
a636aa592b Merge pull request #1392 from hikerpig/feature/remove-lodash
Replace lodash with specific implementations
2020-05-13 17:34:37 +02:00
Knut Sveidqvist
1fc6603f41 Merge branch 'develop' into feature/remove-lodash 2020-05-13 17:34:26 +02:00
Knut Sveidqvist
d36a233cbf Merge pull request #1400 from markotibold/patch-1
Fix a typo; d is close to s.
2020-05-13 17:32:32 +02:00
Knut Sveidqvist
2a11f42318 Merge pull request #1401 from spopida/feature/1390_avoid_wildcard_d3_imports
Do explicit imports for d3 instead of wildcards
2020-05-13 17:31:10 +02:00
GDFaber
e23383be41 Merge pull request #1407 from zakhenry/patch-1
docs(classDiagram): typo
2020-05-13 16:46:21 +02:00
Zak Henry
36a47febc2 docs(classDiagram): typo 2020-05-13 14:57:51 +01:00
Adrian Hall
053a86c0d4 Do explicit imports for d3 instead of wildcards 2020-05-11 07:10:04 +01:00
Marko Tibold
3ded1b6c6e Fix a typo; d is close to s. 2020-05-11 07:53:47 +02:00
hikerpig
28ea68fe7f Replace lodash with specific implementations, #1389 2020-05-07 21:35:34 +08:00
Knut Sveidqvist
6203c27244 #1386 Updated docs 2020-05-06 18:58:26 +02:00
Knut Sveidqvist
57fb800c77 Merge branch 'develop' into 1386_finetuning_rendering_engine 2020-05-06 18:51:55 +02:00
Knut Sveidqvist
9a3ec31191 #1386 Adding support for click events and links 2020-05-06 18:51:12 +02:00
Knut Sveidqvist
8ef3aee7e7 Merge pull request #1384 from mapio/patch-1
Updated the mkdocs-mermaid-plugin link
2020-05-06 17:40:10 +02:00
Knut Sveidqvist
a20e6086cc #1386 Adding subroutine support for new rendering engine 2020-05-03 21:52:44 +02:00
Knut Sveidqvist
66fa8a7595 Merge branch 'develop' into 1386_finetuning_rendering_engine 2020-05-03 13:31:46 +02:00
Knut Sveidqvist
a8f9e3f0b0 #1386 Adding some docs and adjusted sizing for state diagrams 2020-05-03 13:31:09 +02:00
Massimo Santini
215905213b Updated the mkdocs-mermaid-plugin link
It appears that https://github.com/sebastienwarin/mkdocs-mermaid-plugin has been more recently updated and is more feature rich (allowing for options to override the mermaid rendering defaults).
2020-05-02 02:15:47 +02:00
Knut Sveidqvist
f8865c1413 Merge pull request #1383 from mermaid-js/1382_hiearchy_fix
#1382 Fix for lost parentage for nodes in deep structure
2020-05-01 19:32:37 +02:00
Knut Sveidqvist
67aed51742 #1382 Fix for lost parentage for nodes in deep structure 2020-05-01 19:18:07 +02:00
Knut Sveidqvist
2be2b10e59 #1334 Adding docs for user journey to side nav 2020-05-01 16:04:44 +02:00
Knut Sveidqvist
ed5e194b8e Merge branch 'master' into develop 2020-05-01 15:58:52 +02:00
Knut Sveidqvist
a6b4cb24b8 Tmo disabling of coveralls 2020-05-01 15:16:39 +02:00
Knut Sveidqvist
4276fc0b0b Merge pull request #1379 from spopida/bug/1362_NaN_rendering_ERD
Change ERD fontSize config to an integer to prevent NaN errors
2020-05-01 15:14:33 +02:00
Knut Sveidqvist
0d10957441 Merge pull request #1374 from russellgeraghty/feature/docs-fixes
Feature/docs fixes
2020-05-01 15:12:13 +02:00
Knut Sveidqvist
368720538c Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-05-01 15:10:50 +02:00
Adrian Hall
d068a460bd Change ERD fontSize config to an integer to prevent NaN errors 2020-04-30 15:55:14 +01:00
Russell Geraghty
346ff199c6 Updated doc link 2020-04-28 08:45:41 +01:00
Russell Geraghty
480a4a9d38 Match title to example 2020-04-28 08:42:43 +01:00
Russell Geraghty
77cfd0e1a6 Colours 2020-04-28 08:40:48 +01:00
Russell Geraghty
950af2e753 Tidy up documentation, correct rendering in test 2020-04-28 08:28:16 +01:00
Knut Sveidqvist
aa2845a730 Merge pull request #1373 from phschaer/patch-1
expanded documentation on date formats for gantt
2020-04-27 19:51:13 +02:00
Knut Sveidqvist
aedf066337 Disabling coveralls temporarilly 2020-04-27 19:50:49 +02:00
Philipp Schaer
b975cf3ed4 fixed typo in code block 2020-04-27 17:29:22 +02:00
Philipp Schaer
f2af5ce7eb updated documentation on date formatting for gantt
Rearragend the existing information and added new context information on the date formating process for Gantt charts. The former documentation was not clear on the difference between input and output formatting.
2020-04-27 17:27:03 +02:00
Knut Sveidqvist
fa612b731c Renaming some tests to diffrentiate the old implementation from the impl via the new rendering engine 2020-04-26 17:48:07 +02:00
Knut Sveidqvist
0933268e61 Merge pull request #1371 from jgreywolf/1234-RefactorClassDiagramScaling
1234 refactor class diagram scaling
2020-04-26 17:23:14 +02:00
Knut Sveidqvist
3aa5fc0cc2 Merge pull request #1365 from dany74q/feature/sequence-diagrams-improvements
Feature/sequence diagrams improvements
2020-04-26 17:21:55 +02:00
Knut Sveidqvist
397f57accb Merge pull request #1334 from russellgeraghty/feature/user-journey
Feature/user journey
2020-04-26 17:17:33 +02:00
Knut Sveidqvist
e3b1944e31 Merge pull request #1370 from mermaid-js/feature/1295_generic_rendering_engine
Feature/1295 generic rendering engine
2020-04-26 16:55:11 +02:00
Knut Sveidqvist
507582f40b #1295 Bugfix for descriptions 2020-04-26 16:01:17 +02:00
Justin Greywolf
08e015a951 1234-RefactorDiagramScaling
Changed implementation to ensure that viewport is aligned correctly, rather than increasing size
2020-04-26 06:10:18 -07:00
Justin Greywolf
ef17f4eacb 1274-adjust diagram viewbox 2020-04-26 05:51:03 -07:00
Justin Greywolf
3d185dc622 Merge pull request #20 from mermaid-js/develop
ll
2020-04-26 05:38:45 -07:00
Knut Sveidqvist
76b4b88e4b #1295 Alternating graph directions for subgraphs 2020-04-26 12:57:45 +02:00
Knut Sveidqvist
fd37edc53f #1295 Adding support for forks and joins 2020-04-26 10:07:25 +02:00
Knut Sveidqvist
5662c06a33 #1295 Adding support for multiline descriptions for states 2020-04-26 09:47:47 +02:00
Knut Sveidqvist
0aede618ec #1295 Adding support for multiline descriptions for states 2020-04-25 17:01:20 +02:00
Knut Sveidqvist
e52d4ce033 #1295 Removing invalid title for concurrency clusters 2020-04-25 14:18:23 +02:00
Knut Sveidqvist
b646672d3e #1295 Fix for statediagram labels 2020-04-25 14:12:35 +02:00
Knut Sveidqvist
a1a7d44fd7 #1295 for Multi line labels separated with \n 2020-04-25 14:12:04 +02:00
Knut Sveidqvist
25ea221a6a #1295 Rendering tests for stateDiagram v2 2020-04-25 14:11:05 +02:00
Danny Shemesh
38ee4f556e Added (& pretty-printed) sequence diagram docs
This commit adds documentation to new config variables that were
introduced as part of this PR, namely, the font settings for actors,
messages and notes.

I've also linted the markdown document.
2020-04-23 18:39:23 +03:00
Danny Shemesh
862f20ef20 Added cypress e2e tests for suggested improvements
This commits adds e2e tests for the suggested improvements.
I've went over the generated screenshots and they look good to me.
2020-04-23 18:31:22 +03:00
Danny Shemesh
5c902001b9 Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-04-23 17:08:25 +03:00
Danny Shemesh
5f6887b316 Sequence diagram fixes & improvements
This commit fixes some bugs, and I believe, improves upon the current
implementation.

In no particular order, it adds:

1. Control over note font size, family and alignment (now defaults to
center)
2. Dynamic actor resizing - actor's width will now scale if its
description is bigger than the static configured width
3. Dynamic actor margins - the margin between actors will now be
dynamically calculated by taking into account the width of connecting
messages or notes
4. Fixed a small visual annoyance where a loop arrow would intersect
with the text it loops on
5. Fixed a bug where if global config -> fontFamily wasn't defined, it
would override the actorFontFamily with an undefined
6. Removed some stale / commented out code
7. Added missing config variables to the global config object in mermaidAPI.js
8. Added messageFontSize, messageFontFamily to control message (non-note)
font settings
9. Memoized the actor widths in a pre-calculation that takes notes and
signals lengths into account
10. Removed redundant console.log lines
11. Extracted out actor width & margin calculation to getMaxMessageWidthPerActor, and
calculateActorMargins
2020-04-23 16:50:00 +03:00
Knut Sveidqvist
45b96bd568 Merge pull request #1364 from dany74q/feature/extract-line-break-regex
Feature/Extracted out the commonly used line break regex
2020-04-23 07:13:57 +02:00
Danny Shemesh
197d006860 Extracted out the commonly used line break regex
This commit extract the commonly used /br\s*\/?>/gi regex to common.js,
in order to keep the code more DRY.
2020-04-23 07:55:28 +03:00
Danny Shemesh
49f8aac6a9 Fixed outdated doc strings
This commit fixes some outdated docstrings, replacing the description
and @params where necessary.
2020-04-23 07:55:09 +03:00
Danny Shemesh
22dd50a047 Extracted out the commonly used line break regex
This commit extract the commonly used /br\s*\/?>/gi regex to common.js,
in order to keep the code more DRY.
2020-04-23 07:20:47 +03:00
Knut Sveidqvist
81d9b5afd6 #1295 Linting 2020-04-22 20:05:36 +02:00
Knut Sveidqvist
59f3d2a11e #1295 Fix for edges in subgraphs and handling of concurrent states in statediagram-v2 2020-04-22 20:03:41 +02:00
Adrian Hall
134a170a61 Update docs to include ER diagram descriptions 2020-04-17 14:24:44 +01:00
Adrian Hall
681f006ae1 Tiny tweaks to docs for ER diagram 2020-04-17 14:24:44 +01:00
Adrian Hall
36abfcc79b Escape the pipes in the syntax table 2020-04-17 14:24:44 +01:00
Russell Geraghty
249a14f84a Merge remote-tracking branch 'upstream/develop' into feature/user-journey 2020-04-17 07:30:53 +01:00
Knut Sveidqvist
10fdc45dea Merge pull request #1356 from mermaid-js/feature/1295_generic_rendering_engine
Feature/1295 generic rendering engine
2020-04-16 20:16:37 +02:00
Knut Sveidqvist
e8e7b419b5 #1295 Lint fixes 2020-04-16 19:57:56 +02:00
Knut Sveidqvist
955fc58773 Merge pull request #1351 from adutton/patch-1
Show source code in later examples
2020-04-16 19:50:53 +02:00
Knut Sveidqvist
2da3d83420 Merge pull request #1355 from spopida/develop
Update docs to include ER diagram descriptions
2020-04-16 19:50:05 +02:00
Knut Sveidqvist
c3f2e8dde1 #1295 Render fix for flowchart, correct marker handling and some cleanup 2020-04-16 19:44:11 +02:00
Adrian Hall
4e4c80b7fa Update docs to include ER diagram descriptions 2020-04-16 12:19:04 +01:00
GDFaber
3e776c8c41 Merge pull request #1353 from TomWright/mermaid-server
Add HTTP Server implementation to related projects.
2020-04-15 22:10:52 +02:00
Tom Wright
7c82e4b6c1 Add mermaid-server to integrations.md 2020-04-15 21:00:47 +01:00
Tom Wright
12d26d5a3d Add HTTP Server implementation to related projects. 2020-04-15 19:29:17 +01:00
Aaron Dutton
d228769b1b Show source code in later examples
The first few examples on the page show source code but the later ones didn't
2020-04-14 15:15:10 -07:00
Russell Geraghty
433f88b459 Merge remote-tracking branch 'upstream/develop' into feature/user-journey 2020-04-13 20:08:20 +01:00
Knut Sveidqvist
704d56d193 #1295 Updates mermaid-graphlib 2020-04-13 16:25:10 +02:00
Knut Sveidqvist
5f4da6e0bc Merge branch 'develop' into feature/1295_generic_rendering_engine 2020-04-11 18:53:47 +02:00
Knut Sveidqvist
0ce89d53d7 Adding ERD diagram section to the docs 2020-04-11 18:50:57 +02:00
Knut Sveidqvist
5bdffd7d20 Merge branch 'master' into develop 2020-04-11 18:10:53 +02:00
Knut Sveidqvist
5996920249 Merge branch 'release/8.5.0' 2020-04-11 18:03:42 +02:00
Knut Sveidqvist
f0119085e4 Updating mermaid to version 8.5.0 2020-04-11 18:02:05 +02:00
Knut Sveidqvist
22e17172dd #1295 Recursive rendering, draft 2020-04-11 17:16:01 +02:00
Knut Sveidqvist
6ec731e263 Merge pull request #1345 from GDFaber/feature/1343_add_flowchart_subroutine_shape
Add flowchart subroutine node shape
2020-04-11 14:12:20 +02:00
Knut Sveidqvist
7cd8b6f938 Merge pull request #1336 from GDFaber/feature/1290_hide_or_style_gantt_today_marker
#1290 Hide/style today marker in gantt diagram
2020-04-11 14:04:31 +02:00
Knut Sveidqvist
a4a19845d4 Merge pull request #1335 from GDFaber/bug/1271_fix_autonumber_position_for_multiline_texts
#1271 Fix autonumber positioning in sequence diagrams with multiline texts
2020-04-11 14:01:24 +02:00
Knut Sveidqvist
fffb0eafde Merge pull request #1332 from Soptq/stateRenderer
Add useMaxWidth to stateRenderer
2020-04-11 11:58:22 +02:00
GDFaber
10f60e2807 Merge pull request #1346 from spopida/develop
Fix docs for ER diagrams
2020-04-10 16:18:49 +02:00
Adrian Hall
3db27e6017 Tiny tweaks to docs for ER diagram 2020-04-10 11:47:29 +01:00
Adrian Hall
91b64798bb Escape the pipes in the syntax table 2020-04-10 11:40:39 +01:00
Knut Sveidqvist
8455db6fae #1295 Moving graph operations into mermaid-graplib and adding tests 2020-04-10 07:27:04 +02:00
Marc Faber
530648e937 Trigger tests once more 2020-04-10 00:28:33 +02:00
Marc Faber
7f67435cb9 #1343 Add flowchart subroutine node shape 2020-04-10 00:14:41 +02:00
Marc Faber
d8eba411ec Trigger tests once more 2020-04-05 02:29:41 +02:00
Marc Faber
dcfa903176 #1290 Hide/style today marker in gantt diagram 2020-04-05 01:59:18 +02:00
Marc Faber
fc70a8e145 #1271 Fix autonumber positioning in sequence diagrams with multiline texts 2020-04-04 21:53:31 +02:00
Russell Geraghty
e4a2d7dfb7 Updated API 2020-04-04 17:50:02 +01:00
Russell Geraghty
f081527731 User journey handler 2020-04-04 16:38:30 +01:00
GDFaber
9f8a0234aa Merge pull request #1333 from spopida/bug/1327_flowchart_cutoff
Prevent un-labelled edges that are left of the left-most vertex from being cut off the diagram
2020-04-04 05:54:32 +02:00
Knut Sveidqvist
857c860952 #1295 Lint fix 2020-04-02 19:50:21 +02:00
Knut Sveidqvist
cff68fc062 #1295 Better way of finding suitable child in cluster to point to 2020-04-02 19:48:28 +02:00
Knut Sveidqvist
365c741864 #1295 Fix for intersection calculation for edges to clusters and adding concurrency in stateDiagrams as clusters 2020-04-02 19:35:12 +02:00
Justin Greywolf
366f9db8a8 Merge pull request #19 from mermaid-js/develop
Merge into fork
2020-04-02 09:49:20 -07:00
Adrian Hall
9d5303c59d Prevent un-labelled edges that are left of the left-most vertex from being cut off the diagram 2020-04-02 15:29:12 +01:00
Soptq
c527392e21 Add useMaxWidth to stateRenderer 2020-04-01 15:12:45 +08:00
Knut Sveidqvist
933cc333cc #1295 Backwards compatability 2020-03-30 22:08:48 +02:00
Knut Sveidqvist
e72c3b2c86 #1295 Re-enabling state diagram tests 2020-03-30 21:40:14 +02:00
Knut Sveidqvist
231c849451 Merge pull request #1326 from mermaid-js/feature/1295_generic_rendering_engine
Feature/1295 generic rendering engine
2020-03-30 21:14:20 +02:00
Knut Sveidqvist
a5af248715 Merge branch 'develop' into feature/1295_generic_rendering_engine 2020-03-30 19:15:17 +02:00
Knut Sveidqvist
8fede48e7b Merge pull request #1324 from spopida/feature/1309_erDiagram_PlantUML
Feature/1309 er diagram plant uml
2020-03-30 19:11:53 +02:00
Knut Sveidqvist
d0492ec7bd Merge pull request #1323 from Pepper-Wood/bug/1294_nonfunctioning_callback_in_docs
Docs workaround for failing callback() section
2020-03-30 19:09:14 +02:00
Knut Sveidqvist
b5399202b6 Merge pull request #1307 from mermaid-js/dependabot/npm_and_yarn/acorn-5.7.4
Bump acorn from 5.7.3 to 5.7.4
2020-03-30 19:07:22 +02:00
Knut Sveidqvist
240077ffe8 #1295 Adding note support to state diagrams 2020-03-29 14:20:49 +02:00
Adrian Hall
eee9a1661f Merge branch 'develop' into feature/1309_erDiagram_PlantUML 2020-03-29 08:55:19 +01:00
Adrian Hall
9199546dca Alter ERD syntax for compatibility with PlantUML 2020-03-29 08:42:20 +01:00
Kathryn DiPippo
e0d97d44aa Docs workaround for failing callback() section 2020-03-29 00:55:14 -04:00
Knut Sveidqvist
5fbb69e7c5 #1295 Styling of composite states 2020-03-28 17:34:23 +01:00
Knut Sveidqvist
3a6aa8f820 #1295 Lint fix 2020-03-28 14:03:22 +01:00
Knut Sveidqvist
44ae5c86a7 #1295 Lint fix 2020-03-28 14:02:01 +01:00
Knut Sveidqvist
85f47e1693 #1295 Styling of start/end nodes, arrows and regular states 2020-03-28 13:59:41 +01:00
Knut Sveidqvist
9a96f8b155 Merge pull request #1315 from rmedaer/feature/multiline-sequence-message-alignment
Feature/Multiline sequence message alignment
2020-03-25 20:31:37 +01:00
Knut Sveidqvist
391dc06013 Merge branch 'develop' into feature/1295_generic_rendering_engine 2020-03-25 20:28:10 +01:00
Knut Sveidqvist
598b392878 #1295 Lint fixes 2020-03-25 20:26:53 +01:00
Knut Sveidqvist
9e75993658 Merge pull request #1314 from rmedaer/feature/multiline-sequence-message
Feature/Multiline sequence message
2020-03-25 20:22:31 +01:00
Knut Sveidqvist
159a3a3706 #1295 Start shape and handling of setting a unique start id per cluster level 2020-03-25 20:16:27 +01:00
Raphael Medaer
cbdb2e6e6f Align left/center/right multiline messages 2020-03-24 22:17:11 +01:00
Raphael Medaer
d409da2201 Multiline sequence message
This commit allow user to write multiline messages in sequence diagram.
For instance:

```
sequenceDiagram
	Alice->>+John: Hello John<br>How are you?<br>I mean...<br>Are you OK today?
	Alice->>+John: John, can you hear me?
	John-->>-Alice: Hi Alice, I can hear you!<br>Keep calm!<br>I'm there.
	John-->>-Alice: And I feel great!
```
2020-03-24 18:26:56 +01:00
Knut Sveidqvist
c7aa67b07a #1295 Lint fix 2020-03-22 23:06:32 +01:00
Knut Sveidqvist
5b302ae2e6 #1295 Applying new rendering engine for stateDiagrams 2020-03-22 21:45:14 +01:00
Knut Sveidqvist
df2925e51c #1295 Fix for edges form clusters 2020-03-22 16:08:57 +01:00
Knut Sveidqvist
02b19fed27 Merge branch 'develop' into feature/1295_generic_rendering_engine 2020-03-22 14:44:43 +01:00
Knut Sveidqvist
17f06564a2 #1295 Added the flowchart shapes 2020-03-18 22:08:19 +01:00
Knut Sveidqvist
6ddd394e33 Merge pull request #1308 from spopida/feature/117_er_diagram
Feature/117 er diagram
2020-03-18 20:32:12 +01:00
Adrian Hall
d3f78299e7 Add integration tests, basic docs, and fix multi-diagram bug 2020-03-18 16:53:26 +00:00
Adrian Hall
3e76b2374c Initial documentation for ER diagrams 2020-03-18 09:31:10 +00:00
Adrian Hall
a3b97f7c24 Remove roleB - only roleA is labelled 2020-03-17 10:16:19 +00:00
Adrian Hall
4f50e36e5b Tidy up for lint 2020-03-17 09:48:32 +00:00
Adrian Hall
a0bbbe1404 Merge branch 'develop' into feature/117_er_diagram 2020-03-17 09:28:10 +00:00
Adrian Hall
50f983871b Add labels to relationships (needs further tidy up) 2020-03-17 09:25:16 +00:00
Adrian Hall
2d3b02df6a Minor tidy up 2020-03-16 10:08:43 +00:00
Knut Sveidqvist
4010c89899 #1295 'arrow' renamed to 'arrow_point' 2020-03-16 08:02:32 +01:00
Knut Sveidqvist
215e930da4 #1295 Markers implmented, the gereric pattern and diagram specific for flowcharts. 2020-03-16 07:55:02 +01:00
Knut Sveidqvist
5b74d75011 #1295 Arrow head start 2020-03-14 18:13:34 +01:00
Knut Sveidqvist
9266eaef16 #1295 Small fix for import 2020-03-14 17:49:02 +01:00
Knut Sveidqvist
963a0ce6ef #1295 Edges between subgraphs 2020-03-14 17:38:35 +01:00
Knut Sveidqvist
5f5e453fb3 Small for for merge issue 2020-03-14 08:56:47 +01:00
Knut Sveidqvist
0cacd111df Merge branch 'develop' into feature/1295_generic_rendering_engine 2020-03-14 08:51:11 +01:00
Knut Sveidqvist
d86a7ccf3e Restoring docs README 2020-03-14 08:49:30 +01:00
Knut Sveidqvist
35ea4d1a00 Merge branch 'develop' into feature/1295_generic_rendering_engine 2020-03-14 08:44:49 +01:00
Knut Sveidqvist
10583610bd Lint fixes 2020-03-14 08:36:49 +01:00
Knut Sveidqvist
55816a09fe Merge pull request #1303 from NeilCuzon/develop
Gantt Documentation expanded.
2020-03-14 08:35:31 +01:00
Knut Sveidqvist
ad288be2ee 1295 Lint fixes 2020-03-14 08:24:45 +01:00
dependabot[bot]
c9071ff724 Bump acorn from 5.7.3 to 5.7.4
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-13 23:07:17 +00:00
Neil Cuzon
96b8dce982 Update README.md 2020-03-11 18:59:06 -07:00
Adrian Hall
1e498eccb6 Change rendering algorithm 2020-03-11 22:17:11 +00:00
Knut Sveidqvist
da048cbc7b 1295 Handling labels of clusters 2020-03-11 20:25:55 +01:00
Knut Sveidqvist
7bd5529bb7 1295 Support for subgraphs with wide labels 2020-03-11 19:52:57 +01:00
Knut Sveidqvist
1b64af143e #1295 Drawing edges between nodes 2020-03-11 17:36:30 +01:00
Neil Cuzon
d2685f2544 Update README.md 2020-03-10 19:42:11 -07:00
Neil Cuzon
83c6aef078 Update README.md 2020-03-10 19:26:26 -07:00
Neil Cuzon
a9570f7298 Update README.md 2020-03-10 19:24:55 -07:00
Neil Cuzon
71e0a788d1 Update mermaidAPI.md 2020-03-10 19:16:24 -07:00
Neil Cuzon
e6910d3c52 Update SUMMARY.md 2020-03-10 19:15:44 -07:00
Neil Cuzon
9a6e4ba77f Update README.md 2020-03-10 19:14:46 -07:00
Adrian Hall
bab4649a1e Use markers with rounded crows feet 2020-03-10 13:48:53 +00:00
NeilCuzon
5a763230e5 Revert "Revert "Revert "Revert "Revert "Update README.md"""""
This reverts commit 09e6804761.
2020-03-09 23:26:00 -07:00
NeilCuzon
09e6804761 Revert "Revert "Revert "Revert "Update README.md""""
This reverts commit a414aa27b6.
2020-03-09 23:25:55 -07:00
NeilCuzon
a414aa27b6 Revert "Revert "Revert "Update README.md"""
This reverts commit c598fd9ec4.
2020-03-09 23:25:28 -07:00
NeilCuzon
c598fd9ec4 Revert "Revert "Update README.md""
This reverts commit d28e3374c7.
2020-03-09 23:25:24 -07:00
NeilCuzon
a8eeb7f76a Revert "Revert "Delete README.md""
This reverts commit c3e9ae0ca0.
2020-03-09 23:25:19 -07:00
NeilCuzon
d28e3374c7 Revert "Update README.md"
This reverts commit 71cfec91af.
2020-03-09 23:23:44 -07:00
NeilCuzon
c3e9ae0ca0 Revert "Delete README.md"
This reverts commit b085222253.
2020-03-09 23:23:27 -07:00
Neil Cuzon
71cfec91af Update README.md 2020-03-09 23:02:14 -07:00
Neil Cuzon
b085222253 Delete README.md 2020-03-09 22:55:03 -07:00
Adrian Hall
29b6e00071 clean up for eslint 2020-03-09 12:36:43 +00:00
Adrian Hall
9aacc85a16 Working experimental version using markers 2020-03-08 22:22:33 +00:00
Knut Sveidqvist
aa32d454c9 #1295 First draft of generic renderer applied to flowcharts. 2020-03-08 09:49:41 +01:00
Neil Cuzon
d3b69abd87 Update gantt.md 2020-03-07 16:54:49 -08:00
Neil Cuzon
df88300e6e Update README.md 2020-03-07 16:50:39 -08:00
Neil Cuzon
e90ed7a853 Update gantt.md 2020-03-07 16:46:59 -08:00
Neil Cuzon
fdaf13bdc4 Update gantt.md 2020-03-07 16:26:22 -08:00
Neil Cuzon
d96d40e0b0 Update gantt.md 2020-03-07 16:23:51 -08:00
Neil Cuzon
5dae0c14d9 Add files via upload 2020-03-07 16:22:55 -08:00
Neil Cuzon
5cd54c4831 Update gantt.md 2020-03-07 16:21:07 -08:00
Neil Cuzon
4caa02474c Update gantt.md 2020-03-07 16:17:11 -08:00
Neil Cuzon
005defbb5c Add files via upload 2020-03-07 16:17:03 -08:00
Adrian Hall
061045016f Minor tidy up of prototype code 2020-03-07 11:05:56 +00:00
Neil Cuzon
997353ab71 Update gantt.md 2020-03-07 00:59:39 -08:00
Neil Cuzon
1570ed4610 Update mermaidAPI.md 2020-03-05 17:34:06 -08:00
Knut Sveidqvist
25e2d78311 #1295 Start renderer 2020-03-04 20:35:59 +01:00
Adrian Hall
1e2d014ac9 Basic rendering for ER diagrams 2020-03-03 21:44:18 +00:00
Neil Cuzon
a0b1d16e79 Update SUMMARY.md 2020-03-02 16:47:08 -08:00
Adrian Hall
6985391437 Minor clean up for eslint 2020-03-02 11:46:07 +00:00
Adrian Hall
e90f58a0a7 Merge branch 'develop' into feature/117_er_diagram 2020-03-02 10:48:32 +00:00
Adrian Hall
0555fca5d8 Initial parsing logic for ER diagrams 2020-03-02 10:03:55 +00:00
GDFaber
2a55e74e11 Merge pull request #1287 from mermaid-js/revert-1281-feature/1249_BlockComments
Revert "Multiline comments" - accidentally merged
2020-02-29 21:40:55 +01:00
GDFaber
94ace2348f Revert "Multiline comments" 2020-02-29 21:32:20 +01:00
GDFaber
2b58a2a176 Merge pull request #1286 from woehrl01/patch-1
Update README.md (fix broken image link)
2020-02-29 21:29:51 +01:00
Lukas Wöhrl
7bc82365c6 Update README.md 2020-02-29 20:55:20 +01:00
Knut Sveidqvist
de11dc43ab Merge pull request #1285 from mermaid-js/bug/1269_fix_label_background_on_safari
Bug/1269 fix label background on safari
2020-02-29 15:49:23 +01:00
Knut Sveidqvist
756927b6f8 #1269 Fix for build issue - lint 2020-02-29 15:39:21 +01:00
Neil Cuzon
5693c69457 Update README.md 2020-02-29 00:07:47 -08:00
Neil Cuzon
cda41a1506 Update README.md 2020-02-29 00:04:38 -08:00
Neil Cuzon
890298457a Update README.md 2020-02-29 00:03:42 -08:00
Justin Greywolf
ccfc7351e7 Merge pull request #18 from mermaid-js/develop
Merge
2020-02-28 09:52:44 -08:00
GDFaber
df6c5dd22e Merge pull request #1282 from joebordes/patch-1
add crm/erp category with corebos in the docs
2020-02-27 18:23:29 +01:00
erelling
60f23c838b Merge pull request #1281 from mermaid-js/feature/1249_BlockComments
Multiline comments
2020-02-27 15:19:15 +01:00
Knut Sveidqvist
dcd807c49b Merge pull request #1270 from NeilCuzon/develop
Edited n00b-GettingStarted.md and smaller edits to README.md and n00b-overview.md
2020-02-27 15:06:31 +01:00
Joe Bordes
575b921a15 add crm/erp category with corebos 2020-02-27 12:59:30 +01:00
Neil Cuzon
67473f07b1 Update n00b-gettingStarted.md 2020-02-27 01:07:25 -08:00
Neil Cuzon
3aa368b630 Update n00b-gettingStarted.md 2020-02-27 01:06:38 -08:00
Neil Cuzon
4e044d66b4 Update n00b-gettingStarted.md 2020-02-27 01:05:23 -08:00
Neil Cuzon
065a5d2a47 Update n00b-overview.md 2020-02-27 00:53:20 -08:00
Neil Cuzon
5103da09c5 Update README.md 2020-02-27 00:37:24 -08:00
Neil Cuzon
33ea1d44fb Merge branch 'develop' into develop 2020-02-27 00:32:17 -08:00
Erik Ellingsen
e62027b73c Multiline comments 2020-02-27 00:02:25 +01:00
erelling
26c43667aa Suggestion in comment 2020-02-26 23:10:18 +01:00
erelling
92fbc26852 Suggestion in comment 2020-02-26 23:09:04 +01:00
erelling
a4e488a1eb Suggestion from comment 2020-02-26 23:07:11 +01:00
Knut Sveidqvist
0ee9c69ddf #1269 Work around for inaccurate bounding box results in Safari. Fix for multiple lines 2020-02-26 20:53:08 +01:00
Knut Sveidqvist
dd5e6c18d5 #1269 Work around for inaccurate bounding box results in Safari. 2020-02-26 20:01:53 +01:00
Knut Sveidqvist
737e95c3f9 Merge pull request #1278 from jgreywolf/1264-UpdatedDocumentationFoUsages
1264-Update documentation
2020-02-26 17:45:40 +01:00
Justin Greywolf
4b064dc19f 1264-Update documentation
Reorder main readme.md file, add link to integrations - and add list of areas where mermaid is used
2020-02-25 13:11:08 -08:00
Knut Sveidqvist
f2e5c913d6 Merge pull request #1275 from ginomempin/docs/add-section-parallel-blocks-for-sequence-diagrams
Add section on showing parallel blocks for sequence diagrams
2020-02-25 19:27:44 +01:00
Knut Sveidqvist
8758bd57ca Merge pull request #1274 from GDFaber/bug/apply_default_class_to_flowchart_nodes
Fix applying default class to flowchart nodes
2020-02-25 19:20:52 +01:00
Knut Sveidqvist
73e31373a8 Merge pull request #1273 from mvandermade/patch-1
Removed GitBook, add howto contribute docs.
2020-02-25 19:17:53 +01:00
GDFaber
990e620dc7 Merge pull request #1268 from jgreywolf/1169-RefactorGetRowsFunctionality
1169 refactor get rows functionality
2020-02-25 19:14:22 +01:00
Marc Faber
9103e58314 Trigger tests once more 2020-02-25 19:01:33 +01:00
Neil Cuzon
a26fe71171 Update README.md 2020-02-24 11:19:50 -08:00
Neil Cuzon
7a44e46d6d Update n00b-overview.md 2020-02-23 23:16:13 -08:00
gino
b376e4da1f docs: Fix typo "possiebl" 2020-02-24 13:51:15 +09:00
gino
f8481f8d4c docs: Fix markdown lint MD012 and MD022
MD012 Multiple Consecutive Blanks
https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md012---multiple-consecutive-blank-lines

MD022 Headings should be surrounded by blank lines
https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022---headings-should-be-surrounded-by-blank-lines
2020-02-24 13:49:18 +09:00
gino
54f55cc021 #425: Add documentation on using par for sequence diagrams
Support for `par` was already added here:
https://github.com/mermaid-js/mermaid/issues/425

But is not in the docs:
https://mermaid-js.github.io/mermaid/#/sequenceDiagram
2020-02-24 13:41:47 +09:00
Marc Faber
a7a4f38d58 Trigger tests again 2020-02-24 01:43:21 +01:00
Marc Faber
d67e49400f #684 Fix applying default class to flowchart nodes 2020-02-24 01:31:39 +01:00
mvandermade
6789f2c1e3 Removed GitBook, add howto contribute docs.
Also added the online submission step-by-step via github.com.
2020-02-23 10:47:51 +01:00
NeilCuzon
e8a3ffcb41 Merge pull request #2 from NeilCuzon/NeilCuzon-patch-2
Updated noob-gettingStarted.md
2020-02-22 23:24:05 -08:00
NeilCuzon
9607c743a0 Updated noob-gettingStarted.md
updated documentation for noob-gettingStarted.md. 
-added a new screenshot and edited directions for copying markdown code from live editor
-made some alterations with the instructions in effort to make it more n00b friendly.
-added link to Atom-mermaid plugin
2020-02-22 23:20:50 -08:00
NeilCuzon
553b964ab8 Update n00b-gettingStarted.md 2020-02-22 23:11:51 -08:00
NeilCuzon
72ac408429 Update n00b-gettingStarted.md 2020-02-22 23:10:42 -08:00
NeilCuzon
8456905960 Update n00b-gettingStarted.md 2020-02-22 23:10:08 -08:00
NeilCuzon
13261c974a Update n00b-gettingStarted.md 2020-02-22 23:09:06 -08:00
NeilCuzon
eafabdce36 Update n00b-gettingStarted.md 2020-02-22 23:07:45 -08:00
NeilCuzon
d02a57744c Add files via upload 2020-02-22 23:04:33 -08:00
NeilCuzon
58374add90 Update n00b-gettingStarted.md 2020-02-22 23:03:42 -08:00
NeilCuzon
a52d501ba2 Update n00b-gettingStarted.md 2020-02-22 23:03:11 -08:00
NeilCuzon
702abbad6d Add files via upload 2020-02-22 23:01:35 -08:00
NeilCuzon
2d0edb5270 Update n00b-gettingStarted.md 2020-02-22 22:24:39 -08:00
NeilCuzon
7aab34b540 Update n00b-gettingStarted.md 2020-02-22 22:16:26 -08:00
NeilCuzon
d637a13f59 Update n00b-gettingStarted.md 2020-02-22 22:16:00 -08:00
NeilCuzon
17f99aeed8 Updated n00b-gettingStarted.md
this section had some outdated info regarding the live editor and its capabilities. 
-replaced and outdated screenshot
-edited the documentation to make it a little more n00b friendly. 
-added a link to the Atom mermaid plugin

-Neil
2020-02-22 19:21:37 -08:00
NeilCuzon
8729414da9 Merge pull request #1 from NeilCuzon/NeilCuzon-patch-1
Update README.md
2020-02-21 22:00:50 -08:00
NeilCuzon
cd8b7e5528 Update README.md
Hi, I love your program and how it reimagines the whole dynamic of creating diagrams and graphs, I also like the wit of the documentation, but I had some small trouble in initially figuring out what the application was about. 

I propose a few line changes to clarify the purpose of the application and an additional a link to the syntax section of docs to  hopefully decrease the friction and increase the interest in using the product.  
I changed:
-"__mermaid is a Javascript based diagramming and charting tool. It generates diagrams flowcharts and more, using markdown-inspired text for ease and speed.__"
and I added:
-"__The following are some examples of the diagrams, charts and graphs that can be made using mermaid and the Markdown-inspired text specific to it. Click here jump into the [text syntax](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference).__"


More power to you and your team.
-Neil
2020-02-21 21:11:21 -08:00
Justin Greywolf
6d74c5663f 1169- break out getRows
Moved getRows function from `state/stateRenderer.js` and `state/shapes.js` into `common/common.js`. Broke out section into small one line functions for replacing line breaks, then moved the `sanitize` function from `utils.js` to this new module as there is shared functionality
2020-02-21 13:49:05 -08:00
Justin Greywolf
5ccca5e329 Merge pull request #17 from mermaid-js/develop
Merge
2020-02-21 12:35:38 -08:00
Knut Sveidqvist
6c7b7b796e Docs updated to new version 2020-02-21 10:49:52 +01:00
Knut Sveidqvist
4ee3cea6ce Setting version to 8.4.8 2020-02-21 10:31:11 +01:00
Knut Sveidqvist
1c07e550bb Merge pull request #1267 from mermaid-js/bug/1261_removal_of_cosole.log-calls
Bug/1261 removal of console.log calls
2020-02-21 10:23:37 +01:00
Knut Sveidqvist
50c71ebb01 #1261 Removal of emojis making rendering tests give false warnings from time to time 2020-02-21 10:08:52 +01:00
Knut Sveidqvist
348d086c11 #1261 Tmp reversal of build.yml to get make release possible 2020-02-21 10:00:36 +01:00
Knut Sveidqvist
89c1853977 #1261 Removed calls to console.log 2020-02-21 09:50:04 +01:00
Knut Sveidqvist
3acff54837 Merge pull request #1260 from mermaid-js/chris579-patch-1
Build action fix
2020-02-17 17:13:25 +01:00
Christian Klemm
c7466f7a1a adj 2020-02-16 19:54:29 +01:00
Christian Klemm
6420ad9f69 Merge remote-tracking branch 'origin/chris579-patch-1' into chris579-patch-1 2020-02-16 19:47:55 +01:00
Christian Klemm
b30823d5ac mermaid upgrade 2020-02-16 19:47:14 +01:00
Christian Klemm
864472d648 Update build.yml 2020-02-16 19:41:52 +01:00
Christian Klemm
36b02ec008 adj 2020-02-16 19:32:10 +01:00
Knut Sveidqvist
aad080aa1b Merge pull request #1259 from mermaid-js/bug/1257_autonumbering
#1257 Adding the autonumber keyword + tests and docs
2020-02-16 17:13:59 +01:00
Christian Klemm
7b7a6e10f8 adj 2020-02-16 17:11:13 +01:00
Christian Klemm
aeccf92375 Update build.yml 2020-02-16 16:52:15 +01:00
Christian Klemm
f90d271739 Update build.yml 2020-02-16 16:40:43 +01:00
Christian Klemm
9c2fde940d Update build.yml 2020-02-16 16:35:59 +01:00
Christian Klemm
2b57cc6be8 Update build.yml 2020-02-16 16:31:37 +01:00
Christian Klemm
b62819e3fb Update build.yml 2020-02-16 16:26:29 +01:00
Christian Klemm
3eb5f2c65b Update build.yml 2020-02-16 16:10:47 +01:00
Christian Klemm
41be7f951c Update build.yml 2020-02-16 16:04:20 +01:00
Christian Klemm
7812fdb6ed Merge pull request #1258 from mermaid-js/actions-fix
Actions fix
2020-02-16 15:54:55 +01:00
Christian Klemm
4eeb2a0583 lockfile update 2020-02-16 15:46:45 +01:00
Knut Sveidqvist
3dd0c537ee Font update for e2e tests 2020-02-16 15:39:52 +01:00
Christian Klemm
e0aa42f695 Update package.json 2020-02-16 15:39:20 +01:00
Christian Klemm
5dddf2f757 Update build.yml 2020-02-16 15:38:52 +01:00
Knut Sveidqvist
f8137ea7c1 #1257 Adding the autonumber keyword + tests and docs 2020-02-16 15:26:08 +01:00
Knut Sveidqvist
cf6f1a083e Upgarding version in docs 2020-02-16 14:19:27 +01:00
Knut Sveidqvist
f9cfeacc67 Version bump 2020-02-16 13:56:37 +01:00
Knut Sveidqvist
98229a47b2 Renabling build for node 10 2020-02-16 12:46:23 +01:00
Knut Sveidqvist
530ace1507 Disabling e2e tests in github actions 2020-02-16 12:39:05 +01:00
Knut Sveidqvist
792c657ff2 Modified build.yml 2020-02-16 09:42:57 +01:00
Knut Sveidqvist
5aa07439a8 Modified build.yml 2020-02-16 09:40:35 +01:00
Knut Sveidqvist
bf2862f164 Updated packages 2020-02-16 09:30:08 +01:00
Knut Sveidqvist
d9ef227435 Updated packages, trying to fix e2e tests in build 2020-02-16 09:17:17 +01:00
Knut Sveidqvist
324c845dc4 Disabling Static tests action due to issues with cypress 2020-02-16 09:06:05 +01:00
Knut Sveidqvist
5d0c44e84b Adding @babel/preset-env inorder to help build action 2020-02-16 08:54:17 +01:00
GDFaber
01a71c3dbb Merge pull request #1254 from xbojch/patch-1
Typos
2020-02-15 23:54:05 +01:00
Bojan Bedrac
b018f026e3 Typo
- fixes a typo
2020-02-13 15:51:00 +01:00
Knut Sveidqvist
0a38e3557d Merge pull request #1248 from DCsunset/bug/1247_ssr_error
Bug/1247 Fix "window is not defined" with ssr
2020-02-11 07:02:50 +01:00
DCsunset
6f450272b8 #1247 fix "window is not defined" with ssr 2020-02-06 20:26:09 -08:00
Knut Sveidqvist
7e01f9be6e Merge pull request #1245 from mermaid-js/feature/1224_styling_of_subgraphs
Feature/1224 styling of subgraphs
2020-02-05 20:06:22 +01:00
Knut Sveidqvist
00d2a1fe9f Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-02-05 19:42:13 +01:00
Knut Sveidqvist
18d0d435c6 Merge pull request #1241 from jgreywolf/1240-ClassDiagramRefactor
1240 class diagram refactor
2020-02-05 19:42:01 +01:00
Knut Sveidqvist
f298c154e2 Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-02-05 19:40:18 +01:00
Knut Sveidqvist
822df37f8c #1224 Possibility to style text color of nodes and subgraphs as well as apply classes to subgraphs 2020-02-05 19:39:50 +01:00
Knut Sveidqvist
73cac95255 Merge pull request #1238 from GDFaber/feature/962_flowchart_line_label_color_from_linkstyle
Set text color for flowchart link labels according to linkStyle definitions
2020-02-05 19:36:12 +01:00
Marc Faber
a0e7789d50 #962 added color setting for default link style 2020-02-04 22:07:10 +01:00
Justin Greywolf
c825b37cc6 1240-refactor for class renderer
prep for future functionality work
2020-02-03 16:04:59 -08:00
Marc Faber
2dd4aa31e5 #962 moved "style from array" function to utils.js, added unit test 2020-02-04 00:24:50 +01:00
Marc Faber
c95adfaf74 #962 Set text color for flowchart link labels according to linkStyle definitions 2020-02-02 22:59:59 +01:00
Justin Greywolf
9da8ea5967 Merge pull request #16 from mermaid-js/develop
Merge from parent
2020-01-30 10:20:14 -08:00
Knut Sveidqvist
4d5ecc5518 Merge pull request #1203 from jgreywolf/1179-SupportGenericTypesForMembers
1179 support generic types for members
2020-01-29 21:08:41 +01:00
Knut Sveidqvist
963a0fcd77 Merge branch 'develop' into 1179-SupportGenericTypesForMembers 2020-01-29 21:08:31 +01:00
Ashish Jain
fbd8dfa5be Merge pull request #1230 from mermaid-js/bug/1223_multiple_transitions_in_statediagram
Bug/1223 multiple transitions in statediagram
2020-01-29 21:02:14 +01:00
Knut Sveidqvist
c43f791b29 #1223 Removing/updating some logging, adding current.html to .gitignore 2020-01-29 20:44:15 +01:00
Ashish Jain
39b873cd5f Merge pull request #1229 from mermaid-js/bug/1217_fix_for_keyword_as_in_stateDiagram
#1217 Better matching of words beginning with as as matching token
2020-01-29 20:24:28 +01:00
Knut Sveidqvist
ec90537181 #1223 Adding support for multiple transitions to a node from another node 2020-01-29 20:01:21 +01:00
Knut Sveidqvist
4709195a1d #1223 Adding support for multiple transitions to a node from another node 2020-01-29 19:57:59 +01:00
Knut Sveidqvist
0082c23a90 #1217 Better matchingof words beginning with as as matching token AS in stateDiagram's state definition. 2020-01-29 19:05:51 +01:00
Knut Sveidqvist
c7b559f449 Update todo.md 2020-01-27 20:28:43 +01:00
Knut Sveidqvist
d571c7e08e Merge pull request #1225 from jgreywolf/1058-ClassDiagramScaling
1058 class diagram scaling
2020-01-27 20:14:39 +01:00
Knut Sveidqvist
b6f0b25f24 Merge pull request #1222 from GDFaber/bug/1218_fix_link_click_events
Fix anchor and script support in link click events
2020-01-27 20:13:07 +01:00
Knut Sveidqvist
5ea6bd5980 Merge branch 'develop' into bug/1218_fix_link_click_events 2020-01-27 20:06:00 +01:00
Knut Sveidqvist
ea29b67c5c Merge pull request #1221 from mermaid-js/bug/1216_dodging_huge_diagrams
#1216 Fix for issue when mermaid freezes the browser tab due to large…
2020-01-27 20:01:54 +01:00
Knut Sveidqvist
1f851bc04c Merge pull request #1219 from GDFaber/feature/487_flowchart_node_text_color_from_style
#487 Set text color for flowchart nodes according to style definitions
2020-01-27 20:01:19 +01:00
Justin Greywolf
0921007d92 1058-Set diagram dimensions appropriately
Make sure height and width are set so that all of the diagram is displayed
2020-01-27 10:27:05 -08:00
Justin Greywolf
4a2e0bfa00 Merge branch 'develop' into 1179-SupportGenericTypesForMembers 2020-01-27 09:44:12 -08:00
Justin Greywolf
8ebc587fb5 Merge pull request #15 from mermaid-js/develop
Merge from parent
2020-01-27 09:43:46 -08:00
Marc Faber
c7b46f4fba #1218 Fix anchor and script support in link click events 2020-01-26 16:56:42 +01:00
Knut Sveidqvist
4ad354a561 #1216 Fix for issue when mermaid freezes the browser tab due to large diagrams 2020-01-25 13:35:11 +01:00
Justin Greywolf
587592449a 1179 Add ability to use generics for members
Created new class to handle parsing of members with regex to handle determining type of member and the different elements within.  Also moved addTSpan in drawClass method to this new file.  Finally, I added a "catch all" section in case something fails in the regex to make sure everything gets formatted correctly.

Added more tests and documentation

updating gitignore

Tired of constantly having to ignore files and stash/pop when switching between branches
2020-01-24 16:01:04 -08:00
Justin Greywolf
425b071a50 Merge pull request #14 from mermaid-js/develop
merge from
2020-01-24 15:58:42 -08:00
Marc Faber
4dd72e6793 Trigger tests again 2020-01-24 01:42:46 +01:00
Marc Faber
d2d4a24229 #487 Set text color for flowchart nodes according to style definitions 2020-01-24 01:24:47 +01:00
Knut Sveidqvist
4805394e61 New version in the docs 2020-01-22 19:22:37 +01:00
Knut Sveidqvist
5cbd723f8d Merge branch 'release/8.4.6' 2020-01-22 19:07:20 +01:00
Knut Sveidqvist
28153656d7 Updated docs with info on chaining of nodes and using ::: to attach a class 2020-01-22 18:52:16 +01:00
Knut Sveidqvist
d2eaf16751 Updating version to 8.4.6 2020-01-22 18:33:33 +01:00
Knut Sveidqvist
e0d98b2e14 Merge pull request #1214 from GDFaber/bug/1212_apply_classDef_to_flowchart_nodes_with_links
Fix styling of flowchart nodes with links when class definitions are assigned
2020-01-22 17:59:53 +01:00
Marc Faber
c38f053294 #1212 Class definition is not applied to flowchart nodes with links 2020-01-19 18:10:14 +01:00
Knut Sveidqvist
921d274579 Merge pull request #1208 from mermaid-js/feature/Issue-1206_Parsing_Crashing_Browser_In_Class_Diagram
Feature/issue 1206 parsing crashing browser in class diagram
2020-01-15 20:55:21 +01:00
Ashish Jain
c9f95a1866 Merge pull request #1207 from mermaid-js/bug/1205_activations_error
#1205 Adding parsing exception for then an inactive participant is inactivated
2020-01-15 20:48:36 +01:00
Ashish Jain
99469f8404 #1206 Added test case to verify parsing fails to allow EOF until first '{' is closed 2020-01-15 20:34:41 +01:00
Ashish Jain
417d2c0336 #1206 Added test case to verify parsing fails to allow another '{' until first one is closed 2020-01-15 20:33:23 +01:00
Ashish Jain
2a3de1a090 #1206 Updated the classDiagram JISON to not allow EOF or another '{' until first one is closed 2020-01-15 20:29:13 +01:00
Knut Sveidqvist
d9318c5af3 #1205 Adding parsing exception for then an inactive participant is inactivated 2020-01-15 20:27:31 +01:00
Justin Greywolf
0e02cf5c86 Merge pull request #1195 from fgrandel/bug/1193_allow_multiple_relations
fix(#1193): render multiple relations
2020-01-15 09:29:02 -08:00
Knut Sveidqvist
45277affe8 Merge pull request #1204 from GDFaber/bug/1196_keep_flowchart_label_text_when_style_is_applied
Keep flowchart node label text (if already defined) when a style is applied
2020-01-15 18:27:48 +01:00
Knut Sveidqvist
c564a843fa Merge pull request #1202 from GDFaber/bug/1200_unify_regex_for_br_tags
Unify regex for finding <br> tags throughout mermaid
2020-01-15 16:53:06 +01:00
Knut Sveidqvist
efa810da91 Merge pull request #1199 from GDFaber/bug/fix_mermaidAPI_configuration_example_in_the_docs
Fix mermaidAPI configuration example in the docs
2020-01-15 16:50:11 +01:00
Knut Sveidqvist
c0e1c90497 Merge pull request #1198 from GDFaber/bug/add_docs_and_defaults_for_node_spacing
Add docs and default values for node spacing in mermaidAPI
2020-01-15 16:48:58 +01:00
Marc Faber
b1bfdec473 #1196 Keep flowchart node label text (if already defined) when a style is applied 2020-01-14 23:37:30 +01:00
Justin Greywolf
244f423baf Merge pull request #1194 from fgrandel/bug/1192_relation_cut_off
fix(#1192): relation got cut off
2020-01-14 09:35:00 -08:00
Justin Greywolf
8897b32cd3 Merge pull request #13 from mermaid-js/develop
sync
2020-01-13 16:01:40 -08:00
Marc Faber
5493fadc9e #1200 Unify regex for finding <br> tags throughout mermaid 2020-01-13 22:04:47 +01:00
Knut Sveidqvist
eade3d0a2d Merge pull request #1178 from jgreywolf/1119-SpecifyMethodReturnTypeInClassDiagram
1119 specify method return type in class diagram
2020-01-13 19:55:47 +01:00
Marc Faber
36f9eca33e Example 2 is not shown in mermaidAPI configuration section of the docs 2020-01-12 14:38:57 +01:00
Marc Faber
4dd90e56b1 Add docs and default values for node spacing in mermaidAPI 2020-01-12 14:09:24 +01:00
Knut Sveidqvist
5e7484a12d Update mermaidAPI.md 2020-01-12 01:04:15 -08:00
Knut Sveidqvist
fdbc44e41b Update mermaidAPI.md 2020-01-12 01:03:46 -08:00
Knut Sveidqvist
e0d16dcb22 Version 8.4.5 2020-01-11 10:07:41 +01:00
Knut Sveidqvist
0a5ee0634f Merge branch 'master' of github.com:mermaid-js/mermaid
# Conflicts:
#	docs/classDiagram.md
2020-01-11 09:47:51 +01:00
Justin Greywolf
fa1331ffd5 Fix after removing other code 2020-01-10 10:24:04 -08:00
Justin Greywolf
57b5b9a7a6 Added conditional to fallback to old style 2020-01-10 09:50:21 -08:00
Justin Greywolf
58fbfc3c38 1119 Support method return types
Small refactor to split out logic for determining method display text and style. Updated documentation
Used regex to parse method statements in class diagrams to extract discrete elements to set display appropriately. Added tests and updated docs
2020-01-10 09:50:21 -08:00
Justin Greywolf
0af5e0b795 Address code style issues 2020-01-10 09:50:21 -08:00
Justin Greywolf
d7771eb4b6 1119 Add ability to define return type for methods
Updated ClassRenderer to check for `[]` to indicate return type for method. Small refactor to split out logic for determining method display text and style. Updated documentation
2020-01-10 09:50:21 -08:00
Justin Greywolf
fc0902c290 Merge pull request #12 from mermaid-js/develop
sync
2020-01-10 09:47:16 -08:00
Florian Grandel
75890f88fa fix(#1193): render multiple relations 2020-01-09 17:00:34 +01:00
Florian Grandel
9a6b07e1e1 fix(#1192): relation got cut off 2020-01-09 16:24:47 +01:00
Knut Sveidqvist
ce02d1dc98 Merge pull request #1190 from mermaid-js/Issue-1092_Mangled_Multiple_Class_Diagrams
#1092 Fix for mangling of multiple classDiagrams
2020-01-08 21:05:42 +01:00
Knut Sveidqvist
7760e63b47 Merge pull request #1189 from GDFaber/maintenance/1182_flowchart_remove_newDagreD3
Maintenance/Remove "newDagreD3" switch from the flowchart renderer
2020-01-08 20:56:54 +01:00
Christian Klemm
a483f2466f added artifact to build action 2020-01-08 20:52:39 +01:00
Ashish Jain
48c345a403 #1092 Fix for mangling of multiple classDiagrams 2020-01-08 20:48:57 +01:00
Marc Faber
82b79aa332 Trigger tests once more 2020-01-08 20:42:58 +01:00
Marc Faber
ffbf9f265f #1182: remove "newDagreD3" switch from the flowchart renderer 2020-01-08 20:27:33 +01:00
Knut Sveidqvist
144f65c459 Merge pull request #1176 from GDFaber/feature/1152_flowchart_node_spacing
Feature/Add node spacing to flowchart configuration
2020-01-08 18:16:03 +01:00
Ashish Jain
18204586e1 Merge pull request #1188 from GDFaber/feature/743_gantt_multiline_section_titles
Feature/Handle multiline section titles in gantt diagrams
2020-01-08 18:06:29 +01:00
Marc Faber
1f3c970e7a Trigger tests once more 2020-01-08 14:03:16 +01:00
Marc Faber
1cfd93640c #743 handle multiline section titles in gantt diagrams 2020-01-08 13:50:58 +01:00
Marc Faber
553ea4971f Trigger tests one more time 2020-01-07 01:24:24 +01:00
Justin Greywolf
ac8b01a94c Merge pull request #11 from mermaid-js/develop
sync
2020-01-06 10:08:43 -08:00
Marc Faber
b3934c9788 #1152 add node spacing to flowchart configuration 2020-01-05 22:03:53 +01:00
Knut Sveidqvist
37ae863443 Merge pull request #1170 from jgreywolf/1064-ClickEventInClassDiagram
1064 click event in class diagram
2020-01-05 12:07:34 +01:00
Knut Sveidqvist
f57356006d Merge pull request #1171 from mermaid-js/feature/Issue-1146_Dashed_Line_For_Class_Diagram
Feature/issue 1146 dashed line for class diagram
2020-01-05 12:02:36 +01:00
Justin Greywolf
591a104c80 1064 Class diagram interactivity docs
Updated documentation for Class Diagram with details for interactivity
2020-01-03 10:14:07 -08:00
Justin Greywolf
38097c9095 code style 2020-01-02 11:27:56 -08:00
Justin Greywolf
7f31e624ca Addressing code style issues 2020-01-02 11:24:06 -08:00
Justin Greywolf
e6fbfcb1e8 1064 Adding tooltip and function calls to click evens in class diagrams 2020-01-02 11:06:29 -08:00
Justin Greywolf
00687f21cd Merge pull request #10 from mermaid-js/develop
sync fork
2020-01-02 11:05:54 -08:00
Ashish Jain
96fc0d043e #1146 Added cypress test for dash line (dependecy) rendering 2020-01-02 19:57:11 +01:00
Ashish Jain
190353785e #1146 Added jest test for dash line (dependecy) parsing 2020-01-02 19:51:25 +01:00
Ashish Jain
f54adb4a3e #1146 Updated classDiagram documentation with new relation types 2020-01-02 19:35:22 +01:00
Ashish Jain
f2a5d92398 #1146 Added stroke-dasharray style for Dependency relation 2020-01-02 19:29:17 +01:00
Ashish Jain
b14c768fa2 #1146 Fix for dashed line (Dependency) support for classDiagram 2020-01-02 19:25:31 +01:00
Ashish Jain
851d2f2d91 Merge pull request #1168 from mermaid-js/feature/834_linking_to_multiple_nodes
#834 Using & as a separator for the multiple nodes
2020-01-02 19:13:22 +01:00
Knut Sveidqvist
4e6aad5115 #834 Using & as a separator for the multiple nodes 2020-01-02 18:52:50 +01:00
Knut Sveidqvist
7bd1408de0 Merge pull request #1165 from jgreywolf/1064-ClickEventInClassDiagram
1064 click event in class diagram
2020-01-02 08:10:48 -08:00
Justin Greywolf
d63eb396e1 Fix code style issues 2020-01-02 07:59:36 -08:00
Knut Sveidqvist
465e99ab5d Merge pull request #1167 from mermaid-js/feature/921_adding_interaction_tests
Adding interaction tests for gantt callbacks with arguments
2020-01-01 03:41:14 -08:00
Knut Sveidqvist
33916cfbd3 Adding interaction tests for gantt callbacks with arguments 2020-01-01 12:03:29 -08:00
Knut Sveidqvist
a1626927cc Merge pull request #1136 from keenanjt33/feature/921_callback_params
Gantt: Add support for callback with parameters
2020-01-01 00:29:00 -08:00
Knut Sveidqvist
75e2abe242 Merge pull request #1166 from GDFaber/feature/flowchart_add_cylindric_shape
#1154 Flow diagram DB shape request
2020-01-01 00:24:56 -08:00
Knut Sveidqvist
2db8075e3f Merge pull request #1163 from GDFaber/bug/891_make_link_clickable_on_the_entire_node
Bug/Clicking on a link only works directly on the node text
2019-12-31 07:58:47 -08:00
Knut Sveidqvist
413876644c Merge pull request #1162 from sdankel/bug/1060_date_infinite_loop
Fix infinite loop caused by date iteration
2019-12-31 07:57:16 -08:00
Knut Sveidqvist
d5e9f2e23e Merge pull request #1156 from gene1wood/extend_br_tag_regex
Extend the `br` tag regex
2019-12-31 07:56:21 -08:00
Marc Faber
bc59d015e6 #1154 Flow diagram DB shape request 2019-12-31 16:30:03 +01:00
Justin Greywolf
2decf94ad0 1064- Add click functionality to class diagrams
modified interaction functionality from flowcharts to work with class diagrams
2019-12-30 17:27:20 -08:00
Justin Greywolf
b52744ae18 Merge pull request #9 from mermaid-js/develop
update fork
2019-12-30 17:26:40 -08:00
Knut Sveidqvist
6cbbf0af2f Merge pull request #1159 from DavertMik/develop
Check tests on PR
2019-12-29 08:47:08 +01:00
Christian Klemm
5d7ef149aa Merge pull request #1161 from wfnuser/fix/typos-in-flowDb
Error typos in flowDb
2019-12-26 16:26:02 +01:00
Marc Faber
7ce0974767 #891 Clicking on a link only works directly on the node text 2019-12-26 15:38:53 +01:00
Sophie Dankel
7b12c7a07d Fix infinite loop caused by date iteration 2019-12-24 19:01:29 -08:00
Christian Klemm
728e3fd2f0 Added task list to pull request template 2019-12-24 23:37:18 +01:00
wfnuser
4eedeebd46 other/typos in flowDb 2019-12-24 16:14:42 +08:00
Michael Bodnarchuk
85fb12155b Create checks.yml (#1)
* Create checks.yml

* Update checks.yml
2019-12-24 00:08:38 +02:00
Justin Greywolf
f99daa696e Merge pull request #8 from mermaid-js/develop
merge from base
2019-12-23 12:21:44 -08:00
Gene Wood
b4f9dd46a9 Add tests for <br \t> case
This adds tests for the case where
* multiple pieces of whitespace are used
* one of those whitespace characters is a tab
2019-12-23 08:52:15 -08:00
Nacho
ffe16f89bb Merge pull request #1157
Fix mispelling
2019-12-23 11:33:49 -05:00
Gene Wood
7604d92d5c Fix mispelling 2019-12-23 08:11:47 -08:00
Gene Wood
3abd77a1e6 Extend the br tag regex
This extends the `br` tag regex to accommodate an arbitrary amount of
any type of whitespace instead of a single space character, which holds
more closely to the HTML spec[1]

This extends the fix to #702 added in #1153

[1]: http://www.w3.org/TR/REC-xml/#sec-starttags
2019-12-23 08:02:11 -08:00
Knut Sveidqvist
d96b79a9ba Merge pull request #1153 from GDFaber/bug/702_br_tags_in_sequence_diagrams
Bug/702 br tags in sequence diagrams
2019-12-23 10:04:30 +01:00
Knut Sveidqvist
14bb888c21 Merge pull request #1151 from Progressive-Insurance/bug/git-graph-clear
Git graph not clearing
2019-12-23 10:03:16 +01:00
Knut Sveidqvist
c8f59ea1a7 Merge pull request #1140 from jdavis61/docs/1124_incorrect_include
Removed docs reference to mermaidAPI.js
2019-12-23 08:56:40 +01:00
Marc Faber
233520b797 #702 improve handling of different "br" tag notations for multiline texts in sequence diagrams 2019-12-21 20:39:32 +01:00
GDFaber
061d31af33 Merge pull request #6 from mermaid-js/develop
sync fork
2019-12-21 00:02:01 +01:00
Matthew Schott
ec742d3180 fix git graph not clearing 2019-12-20 14:48:36 -05:00
Nacho
1bc62cfba4 Merge pull request #1150 2019-12-19 13:45:21 -05:00
erinleck@gmail.com
028d9a2667 changes tick contrast for gantt chart 2019-12-19 09:52:46 -07:00
Knut Sveidqvist
d53e00ffe0 Change of broken docs 2019-12-18 19:43:35 +01:00
Knut Sveidqvist
b90fcc1b71 test commit 2019-12-18 19:40:50 +01:00
Knut Sveidqvist
a4e7305d52 #834 Adding unit tests and rendering tests 2019-12-18 19:13:56 +01:00
Knut Sveidqvist
a3378f8d03 Merge pull request #1149 from mermaid-js/other/1143_utilze_browser_console_object_better
#1143 Adding support in grammar for multiple nodes in dependency decl…
2019-12-18 18:41:45 +01:00
Knut Sveidqvist
5716d163ec Merge branch 'develop' into other/1143_utilze_browser_console_object_better 2019-12-18 18:41:14 +01:00
Knut Sveidqvist
42ef035241 #834 Using space as separator, simplfifying the grammar some more, reomving some logging 2019-12-18 18:36:34 +01:00
Knut Sveidqvist
b6157195b3 Merge pull request #1148 from mermaid-js/other/1142_simplify_flowshart_grammar
#1142 Simplified arrows/edges in the grammar
2019-12-18 18:12:55 +01:00
GDFaber
b8ee68034d Merge pull request #5 from mermaid-js/develop
fork sync
2019-12-16 17:18:15 +01:00
Knut Sveidqvist
6598b1b10d #1143 Adding support in grammar for multiple nodes in dependency declarations 2019-12-15 18:10:52 +01:00
Knut Sveidqvist
4ff4058244 #1142 Simplified arrows/edges in the grammar 2019-12-15 13:34:35 +01:00
Knut Sveidqvist
dddd5af830 Merge pull request #1144 from mermaid-js/other/1143_utilze_browser_console_object_better
#1143 Fixing up the color output of the logger
2019-12-15 10:09:27 +01:00
Knut Sveidqvist
26fac9507e #1143 Fixing up the color putput of the logger 2019-12-15 09:50:24 +01:00
GDFaber
1f1c9698ce Merge pull request #4 from mermaid-js/develop
sync my fork
2019-12-15 02:18:38 +01:00
GitHub actions
56f7459617 Release 8.4.4 2019-12-14 08:50:41 +00:00
GitHub actions
86604b5de1 Bump version 8.4.4 2019-12-14 08:50:41 +00:00
Knut Sveidqvist
0544dbe891 Merge branch 'master' into develop 2019-12-14 09:27:38 +01:00
Knut Sveidqvist
6365cea0b2 Upgrading docs to 8.4.4 2019-12-14 09:26:21 +01:00
Knut Sveidqvist
7fef13346e Bumping version to 8.4.4 2019-12-14 09:00:53 +01:00
Knut Sveidqvist
81216e6ece Merge branch 'release/8.4.4' 2019-12-14 08:52:40 +01:00
James Davis
1d0b305332 Readded call to mermaidAPI in docs 2019-12-12 22:25:07 -05:00
James Davis
c10ccc011f Removed reference to mermaidAPI.js 2019-12-12 07:47:36 -05:00
Christian Klemm
3fe7995060 Merge pull request #1137 from mermaid-js/master
Master sync
2019-12-12 01:30:51 +01:00
Knut Sveidqvist
c441d04e8a Merge branch 'itprdev-issue-552' into develop 2019-12-11 21:31:33 +01:00
Knut Sveidqvist
52d84a99ac #552 Adding docs 2019-12-11 21:28:07 +01:00
Knut Sveidqvist
fcf20215a6 #552 Adding rendering test 2019-12-11 21:12:48 +01:00
Knut Sveidqvist
aa2f9622f8 Merge branch 'issue-552' of https://github.com/itprdev/mermaid into itprdev-issue-552 2019-12-11 21:10:11 +01:00
Knut Sveidqvist
1811318dea #1088 Adding rendering tests 2019-12-11 20:17:51 +01:00
Knut Sveidqvist
5eb50cb2b6 Merge pull request #1132 from GDFaber/develop_Bugfixes_linkStyle_910_1088
Flow: Bugfixes for link style
2019-12-11 20:04:32 +01:00
Knut Sveidqvist
f6ef6ff7db Merge pull request #1130 from GDFaber/develop
Flow: Add stadium shape for nodes
2019-12-11 19:48:47 +01:00
Knut Sveidqvist
2f33a80e1e Merge pull request #1131 from jgreywolf/1104(b)-SupportForAbstractMethodInClassDiagram
Class: Support for abstract methods
2019-12-11 19:43:32 +01:00
Justin Greywolf
363d49b655 Renumber render tests 2019-12-11 10:34:51 -08:00
Justin Greywolf
de8c6d5572 Merge branch 'develop' into 1104(b)-SupportForAbstractMethodInClassDiagram 2019-12-11 10:31:27 -08:00
Justin Greywolf
9406bda93d Merge pull request #7 from mermaid-js/develop
update fork
2019-12-11 10:24:17 -08:00
Knut Sveidqvist
d17a447a5f Merge pull request #1128 from mermaid-js/bug/1123_Upgrade_serialize-javascript
#1127 Ugrading of webpack and adding newer terser-webpack-plugin
2019-12-11 19:18:45 +01:00
Knut Sveidqvist
5b4e95484e Merge pull request #1120 from jgreywolf/1063-GenericTypeSupportInClassDiagrams
Class: Generic type support
2019-12-11 19:09:19 +01:00
Knut Sveidqvist
bebea41e19 Merge pull request #1121 from mermaid-js/pr_template
Add pull request template
2019-12-11 19:04:29 +01:00
Keenan Tullis
442474fc44 Merge branch 'develop' of https://github.com/mermaid-js/mermaid into feature/921_callback_params 2019-12-10 19:13:02 -05:00
Keenan Tullis
0d9112a4c1 Adds basic documentation for interaction with gantt 2019-12-10 19:04:42 -05:00
Keenan Tullis
d504e00e18 Adds simple tests for parsing callbacks wrt args 2019-12-10 18:27:06 -05:00
Justin Greywolf
74c8e7fad9 another style fix 2019-12-10 15:21:25 -08:00
Justin Greywolf
4b781d3827 remove extra space 2019-12-10 15:18:26 -08:00
Justin Greywolf
9fbcc5c32d Code style fix 2019-12-10 15:12:37 -08:00
Keenan Tullis
c7ec8190fb Gantt callback: default to node id as callback arg 2019-12-10 15:25:28 -05:00
Christian Klemm
b73a6d84ee Set release drafter sorting direction 2019-12-10 20:52:00 +01:00
Justin Greywolf
2eaa7f1ab6 Generic Type support for classes
Fixed typos after refactor
2019-12-10 11:39:25 -08:00
Marc Faber
608445e64f #910 set correct position and style for edge labels when using linkStyle, #1088 handle multiline texts in edge labels when using linkStyle 2019-12-10 03:51:37 +01:00
Marc Faber
1f4be77662 Revert "#910 set correct position and style for edge labels when using linkStyle, #1088 handle multiline texts in edge labels when using linkStyle" - Sorry, forgot to push to a new branch.
This reverts commit 0deae4abf9.
2019-12-10 03:48:12 +01:00
Marc Faber
0deae4abf9 #910 set correct position and style for edge labels when using linkStyle, #1088 handle multiline texts in edge labels when using linkStyle 2019-12-10 03:34:40 +01:00
Justin Greywolf
5b2f9351c7 Add support for abstract methods
Added logic to allow rendering of a method name with italics or underline based on modifier at beginning of name to set css style
2019-12-09 18:13:06 -08:00
Justin Greywolf
6fdf30357c 1104-Add support to designate a method as abstract
Added logic to allow rendering of a method name with italics or underline based on modifier at beginning of name to set css style
2019-12-09 17:41:26 -08:00
Justin Greywolf
cf5d7478fc Merge pull request #6 from mermaid-js/develop
Merge
2019-12-09 11:42:26 -08:00
Marc Faber
9a0df5afb0 #723 Add stadium shape for flowchart nodes 2019-12-08 16:51:47 +01:00
GDFaber
813b2fcb38 Merge pull request #3 from mermaid-js/develop
sync develop branch
2019-12-08 16:43:28 +01:00
Christian Klemm
08cbc0f187 Merge pull request #1129 from mermaid-js/master
Master sync
2019-12-08 13:14:32 +01:00
Knut Sveidqvist
d8251c8f79 Merge pull request #1126 from mermaid-js/bug/935_styling_of_dotted_think_links
#935 Fix for stylink of links. Default theme colors are picked up and…
2019-12-08 10:51:28 +01:00
Knut Sveidqvist
5ea70baa6f #1127 Ugrading of webpack and adding newer terser-webpack-plugin 2019-12-08 10:42:41 +01:00
Knut Sveidqvist
d23ce9fb63 #935 Fix for stylink of links. Default theme colors are picked up and styling via themeCSS works 2019-12-08 10:10:03 +01:00
Knut Sveidqvist
ddf8016a0c Merge pull request #1125 from mermaid-js/bug/903_flochart_escaping_in_non_html_mode
Bug/903 flowchart escaping in non html mode
2019-12-08 09:57:48 +01:00
Knut Sveidqvist
ab191abd5a #903 Fix for broken build 2019-12-07 15:06:44 +01:00
Knut Sveidqvist
c2e5e94b37 #903 Allowing >,< and = characters in svg. Updating xss tests to handle both htmlLabels and non htmlLabels 2019-12-07 12:19:45 +01:00
Justin Greywolf
6a9b251be1 Fix code style errors 2019-12-06 20:35:22 -08:00
Christian Klemm
6b5185abfb Create pull_request_template.md 2019-12-06 21:41:16 +01:00
Justin Greywolf
2a41280076 Add support for Generic class definitions
Added support in parser to translate characters surrounded by `~` into generic type definition ie: `Class01~T~` would turn into `Class01<T>`
2019-12-05 12:59:22 -08:00
Justin Greywolf
91d986970b Merge pull request #5 from mermaid-js/develop
Develop
2019-12-05 12:58:48 -08:00
Christian Klemm
b4192bba7a Added skip changelog label to release drafter 2019-12-04 19:35:25 +01:00
Knut Sveidqvist
9fe0aa0604 Merge pull request #1116 from mermaid-js/bug/1110_state_diagram_rendering_composit_state
Bug/1110 state diagram rendering composit state
2019-12-04 19:15:06 +01:00
Knut Sveidqvist
fc528749f8 Merge pull request #1114 from mermaid-js/feature/1112_revert_offical_dagre_d3
Feature/1112 Revert to offical dagre d3
2019-12-04 19:14:35 +01:00
Knut Sveidqvist
5c71a3c85b #1110 Fix for transparent rect under edge title, was misaligned 2019-12-04 18:20:28 +01:00
Knut Sveidqvist
94e768dd01 #1110 Cleanup and removal of loggings 2019-12-04 18:04:56 +01:00
Knut Sveidqvist
0fb91d6bcc #1110 Fixing height issue 2019-12-03 23:38:51 +01:00
Knut Sveidqvist
02854881b4 #1110 Zoom in a bit 2019-12-03 22:48:55 +01:00
Christian Klemm
4254781391 Adjusted imports 2019-12-03 22:09:43 +01:00
Christian Klemm
31f4f4096e upgraded packages 2019-12-03 22:05:39 +01:00
Christian Klemm
e95e016378 switched to official dagre d3 2019-12-03 21:59:28 +01:00
Knut Sveidqvist
c337c9128c Merge branch 'master' into bug/1110_state_diagram_rendering_composit_state 2019-12-03 21:04:18 +01:00
Knut Sveidqvist
5a38562bfc #1110 Handling case with concurrency lines 2019-12-03 20:59:17 +01:00
Justin Greywolf
a3dd0e5f7d Merge pull request #4 from mermaid-js/develop
Merge from main
2019-12-02 16:00:32 -08:00
Knut Sveidqvist
fcd1e106a5 #1110 Handling case when title is less wide then subgraph 2019-12-02 21:22:22 +01:00
Knut Sveidqvist
346328156a #1110 Adding tests for this case and some calcuations for width 2019-12-02 21:10:37 +01:00
Christian Klemm
3239f99ea8 Set develop branch for release drafter 2019-12-02 14:48:16 +01:00
Christian Klemm
93c32d3f29 Set develop branch for release drafter 2019-12-02 14:47:34 +01:00
Christian Klemm
98449dac3f Set develop branch for release drafter 2019-12-02 14:43:55 +01:00
Knut Sveidqvist
32b60edda7 Merge branch 'develop' 2019-12-01 13:36:04 +01:00
Knut Sveidqvist
823c95bd9c Updated mermaid version 2019-12-01 13:34:43 +01:00
Knut Sveidqvist
e99d872f2b Create FUNDING.yml 2019-12-01 09:15:56 +01:00
Knut Sveidqvist
de8f8b02dc Merge branch 'master' into develop 2019-12-01 07:54:02 +01:00
Knut Sveidqvist
eec45dfff9 Merge branch 'release/8.4.3' 2019-12-01 07:52:44 +01:00
Knut Sveidqvist
cce86c8e96 Merge pull request #1107 from chris579/feature/1106_release_management
Feature/1106 Release management
2019-12-01 07:34:59 +01:00
Christian Klemm
aabdc47c38 small fixes 2019-12-01 01:06:00 +01:00
Knut Sveidqvist
cb07a729e5 Merge pull request #1098 from mermaid-js/feature/1053_documentation-update
Feature/1053 documentation update
2019-12-01 00:42:41 +01:00
Knut Sveidqvist
df10f7fbe7 Merge pull request #1103 from penenkel/patch-2
Bug/1030 Adjust babel config to account for IE11
2019-12-01 00:42:02 +01:00
Knut Sveidqvist
71c531240f Merge pull request #1089 from jgreywolf/1073-CommentsInClassDiagrams
Bug/1073 Comments in class diagrams
2019-12-01 00:39:33 +01:00
Christian Klemm
1e83207dac small fixes 2019-12-01 00:39:09 +01:00
Christian Klemm
3311fcdc8e Reenable yarn install 2019-12-01 00:21:12 +01:00
Christian Klemm
f368be925f Removed release branch deletion 2019-12-01 00:18:49 +01:00
Christian Klemm
075c57ca06 Check out branches 2019-12-01 00:03:06 +01:00
Christian Klemm
49fc80d506 Prepare git for push 2019-11-30 23:54:42 +01:00
Christian Klemm
74fc2fcfa9 Release tag fixes 2019-11-30 23:49:04 +01:00
Christian Klemm
7cc427e28d Disable yarn install 2019-11-30 23:36:13 +01:00
Christian Klemm
87c571412c version fix 2019-11-30 23:35:39 +01:00
Christian Klemm
ab093b2cde Remove v from release tag 2019-11-30 23:28:48 +01:00
Christian Klemm
bbc4ede768 Added first workflows 2019-11-30 23:23:09 +01:00
penenkel
64c20dc528 Bug/1030 Adjust babel config to account for IE11
An attempt at adding IE11 compatibility (`ie >= 11`) while preserving the current requirements (`current node`) and following browserlist [best practices](https://github.com/browserslist/browserslist#best-practices) (`defaults`).
2019-11-29 23:06:49 +01:00
Knut Sveidqvist
50ea9bda89 Removed loggin 2019-11-28 11:41:54 -05:00
Nacho
2cf8c4e37a Absolute URIs in readme images 2019-11-28 11:41:54 -05:00
Knut Sveidqvist
fe4719f656 Added analytics for docs 2019-11-28 11:41:54 -05:00
James A. Bednar
1d43b7b316 Fixed typos 2019-11-28 11:41:54 -05:00
Itprdev
78e4fead49 Feature request 552. Gnatt chart task with multiple dependencies 2019-11-28 16:53:33 +02:00
Nacho
02d5143ff2 Merge pull request #1095 from mermaid-js/fixes/readme-uris
Absolute URIs in readme images
2019-11-28 08:28:12 -05:00
Erik Ellingsen
d9c92b2c6d syntax error 2019-11-28 13:22:02 +01:00
Erik Ellingsen
27ac9bbaf3 polish 2019-11-28 13:14:29 +01:00
Erik Ellingsen
11cdd393f2 Knuts comments 2019-11-28 13:13:26 +01:00
Erik Ellingsen
1ca8578035 polish 2019-11-28 13:07:14 +01:00
Erik Ellingsen
2516718882 Clarification 2019-11-28 13:06:16 +01:00
Erik Ellingsen
5283314c4f Polish 2019-11-28 13:03:58 +01:00
Erik Ellingsen
dcae8da0d1 Better header 2019-11-28 13:01:24 +01:00
Erik Ellingsen
34f2a1a02f polish 2019-11-28 13:00:12 +01:00
Erik Ellingsen
ee5a68a23c Better intro 2019-11-28 12:59:34 +01:00
Erik Ellingsen
6c706ccd9f Diagram references 2019-11-28 12:57:55 +01:00
Erik Ellingsen
94106f5825 Added syntax reference link 2019-11-28 12:53:33 +01:00
Erik Ellingsen
72ab2b8011 Added coming soon 2019-11-28 12:44:37 +01:00
Erik Ellingsen
8978ab5917 Links added 2019-11-28 12:43:55 +01:00
Erik Ellingsen
94577316f9 Drafting advanced usage 2019-11-28 12:38:42 +01:00
Erik Ellingsen
91650fb052 Script bug and clarifications 2019-11-28 12:34:26 +01:00
Knut Sveidqvist
e9aa037230 Removed loggin 2019-11-27 20:15:21 +01:00
Nacho
871e6f691c Absolute URIs in readme images 2019-11-27 14:12:34 -05:00
Knut Sveidqvist
fe60836a89 Added analytics for docs 2019-11-27 20:08:54 +01:00
Knut Sveidqvist
bea2e73b82 #1065 Updated dependency of dagre-d3 to unofficial release 2019-11-27 19:09:14 +01:00
Nacho
481e55e8da Merge pull request #1090 from jgreywolf/1074-CommentsDocumentation
Bug/1074 Comments documentation
2019-11-27 11:23:50 -05:00
Justin Greywolf
d26a67297a Updated documentation with comment syntax 2019-11-26 15:34:52 -08:00
Justin Greywolf
753bd7e1d9 Update class diagrams to handle comments
updated regex in parser to correctly handle comments in class diagrams.  Also updated flowchart parser to remove unused elements for comments, as well as modifying the regex to match
2019-11-26 11:23:07 -08:00
Justin Greywolf
b57492c1c6 Initial checkin 2019-11-26 11:22:21 -08:00
Justin Greywolf
4ff5c3b455 Merge pull request #3 from mermaid-js/develop
Develop
2019-11-26 11:20:20 -08:00
Knut Sveidqvist
f62c47a757 Updating version to 8.4.3 2019-11-23 13:10:27 +01:00
Knut Sveidqvist
a85bb0d86f Merge pull request #1086 from chris579/bug/1085_coveralls_build_fix
Bug/1085 Coveralls not working for GitHub builds
2019-11-21 20:58:49 +01:00
Knut Sveidqvist
5736d523dd Merge pull request #1081 from jgreywolf/Bug1061-CannotMarkMembersAsProtectedInClassDiagram
Bug/1061 Cannot mark members as protected in class diagram
2019-11-21 20:54:15 +01:00
Justin Greywolf
5004b5723d Added separate render test 2019-11-21 11:17:53 -08:00
Knut Sveidqvist
ad2802d8e8 Merge pull request #1084 from mermaid-js/bug/1078_handling_of_arrowMarkerAbsolute
Bug/1078 handling of arrow marker absolute
2019-11-20 21:50:50 +01:00
Christian Klemm
3fedd452a5 added parallel build support 2019-11-20 21:18:19 +01:00
Christian Klemm
292bc3c4e5 Switched to coveralls action 2019-11-20 21:11:48 +01:00
Knut Sveidqvist
512ba8e733 Merge pull request #1077 from mermaid-js/bug/1076_remove_jest_packages
Bug/1076 Remove jest packages
2019-11-20 19:42:55 +01:00
Knut Sveidqvist
9a87ff684d Removed logging 2019-11-20 19:33:42 +01:00
Knut Sveidqvist
f79fc21bfc Merge branch 'develop' into bug/1078_handling_of_arrowMarkerAbsolute 2019-11-20 19:22:10 +01:00
Knut Sveidqvist
ffddd58b6b Merge branch 'develop' of github.com:knsv/mermaid into develop 2019-11-20 19:21:34 +01:00
Knut Sveidqvist
087e5eaa32 #1055 Fix for tests 2019-11-20 19:21:19 +01:00
Knut Sveidqvist
cbd27831df #1078 Lint fixes 2019-11-20 19:14:32 +01:00
Knut Sveidqvist
f6028b63b6 #1078 Using the configuration of the arrowMarkerAbsolute 2019-11-20 19:06:46 +01:00
Justin Greywolf
a60e01db97 Corrected typo in test 2019-11-19 13:02:08 -08:00
Justin Greywolf
68c2ea38c9 Bug1061-CannotMarkMembersAsProtectedInClassDiagram
Using # to indicate protected status of a member or method causing parser error when not used inside class declaration brackets {}.  Removed '#' from `LABEL` regex
2019-11-19 12:49:59 -08:00
Justin Greywolf
3469cfca2f Merge pull request #2 from mermaid-js/develop
Develop
2019-11-19 12:49:39 -08:00
Christian Klemm
afd189d24c removed packages 2019-11-19 21:02:56 +01:00
Knut Sveidqvist
06cb09c267 Merge pull request #1049 from mermaid-js/feature/1048_build_workflows
Feature/1048 Build workflows
2019-11-19 19:45:27 +01:00
Nacho
e461b57a48 Merge pull request #1075 from jbednar/master
Fixed typos
2019-11-19 08:33:22 -05:00
James A. Bednar
eca9d49575 Fixed typos 2019-11-18 09:32:39 -06:00
Nacho
15a37a5062 Merge pull request #1070 from GDFaber/develop
Bug/1062 Parallelogram shaped nodes are not in documentation
2019-11-18 08:41:24 -05:00
Christian Klemm
3f8f9eb92c remove debugging 2019-11-17 22:20:53 +01:00
Christian Klemm
33de2bda9e cypress cache folder fix 2019-11-17 22:13:02 +01:00
Christian Klemm
94d913fbab debug 2019-11-17 22:04:50 +01:00
Christian Klemm
beb1fcc176 debug 2019-11-17 21:58:53 +01:00
Christian Klemm
1e1a6e3a2d debug 2019-11-17 21:54:15 +01:00
Christian Klemm
6e7c21e439 debug 2019-11-17 21:47:05 +01:00
Christian Klemm
cfe9aaf639 adjusts 2019-11-17 21:41:55 +01:00
Christian Klemm
69e701befb adjusts 2019-11-17 21:27:30 +01:00
Christian Klemm
5174a085b7 test path pattern adjust 2019-11-17 21:21:25 +01:00
Christian Klemm
15fab69eca cache adjusts 2019-11-17 21:03:08 +01:00
Christian Klemm
20b103a0fb cache adjusts 2019-11-17 21:00:55 +01:00
Christian Klemm
8ebe7ee81a cache adjusts 2019-11-17 20:57:55 +01:00
Marc Faber
1d747f664b #1062 added parallelogram nodes to documentation 2019-11-17 17:37:30 +01:00
GDFaber
dbf5988c28 Merge pull request #2 from mermaid-js/develop
sync fork
2019-11-17 17:14:49 +01:00
Christian Klemm
31ab0e4b7d Clear cache 2019-11-12 22:15:49 +01:00
Christian Klemm
35ea7083bb fix cypress cache 2019-11-12 22:12:53 +01:00
Christian Klemm
bf90e8bf44 switched caching method 2019-11-12 22:10:16 +01:00
Christian Klemm
b1305644f4 fixed cypress cache folder 2019-11-12 22:04:47 +01:00
Christian Klemm
34707a057b temp delete cache 2019-11-12 21:58:05 +01:00
Christian Klemm
f5e90252f1 force reinstalling packages 2019-11-12 21:52:50 +01:00
Christian Klemm
e75acf69aa Adjusted cache location 2019-11-12 21:43:11 +01:00
Christian Klemm
3ad3fc2622 Cache adjusts 2019-11-12 21:24:35 +01:00
Christian Klemm
a59468d6c1 Caching adjusts 2019-11-12 21:20:05 +01:00
Christian Klemm
86e63b1614 Add caching 2019-11-12 21:14:42 +01:00
Knut Sveidqvist
3f8f9f6711 #1055 Better selectors 2019-11-08 20:15:48 +01:00
Knut Sveidqvist
d01f494277 Merge branch 'master' into develop 2019-11-08 19:32:54 +01:00
Knut Sveidqvist
4db525c6a9 #1050 Merge of PR 2019-11-08 11:42:26 +01:00
Erik Ellingsen
8b5f8b0cb4 grammar 2019-11-08 10:36:41 +01:00
Erik Ellingsen
d0c9b5e98f grammar 2019-11-08 10:35:38 +01:00
Knut Sveidqvist
e313625ccb Fixing the conflict 2019-11-08 08:54:48 +01:00
erelling
7dead548f3 Update n00b-gettingStarted.md 2019-11-08 01:59:44 +01:00
erelling
8db46ff762 Update n00b-overview.md 2019-11-08 01:57:18 +01:00
erelling
93f54a997a Update n00b-gettingStarted.md 2019-11-08 01:53:58 +01:00
erelling
1353491952 Update n00b-gettingStarted.md 2019-11-08 01:47:34 +01:00
erelling
00802ffe7a Update n00b-gettingStarted.md 2019-11-08 01:45:29 +01:00
erelling
78e556aaf7 Update n00b-gettingStarted.md 2019-11-08 01:44:12 +01:00
erelling
e34988d65a Update n00b-gettingStarted.md 2019-11-08 01:32:09 +01:00
erelling
07f5c7c89c Update n00b-gettingStarted.md 2019-11-08 01:31:21 +01:00
erelling
7319d8941a Update n00b-gettingStarted.md 2019-11-08 01:25:41 +01:00
erelling
3d7933135b Update n00b-gettingStarted.md 2019-11-08 01:23:33 +01:00
erelling
a778472461 Update n00b-gettingStarted.md 2019-11-08 01:21:50 +01:00
erelling
cbe2a7446d Update n00b-gettingStarted.md 2019-11-08 01:17:21 +01:00
erelling
8251dc5cd1 Update n00b-gettingStarted.md 2019-11-08 01:16:16 +01:00
erelling
5a4103a248 Update n00b-gettingStarted.md 2019-11-08 01:15:41 +01:00
erelling
d7996f5c1a Update n00b-gettingStarted.md 2019-11-08 01:14:38 +01:00
erelling
db4229f033 Update n00b-gettingStarted.md 2019-11-08 01:13:14 +01:00
erelling
e103664963 Update n00b-gettingStarted.md 2019-11-08 01:12:14 +01:00
erelling
fbf3936ddc Update n00b-overview.md 2019-11-08 01:11:07 +01:00
erelling
62d03f1976 Update n00b-overview.md 2019-11-08 01:10:24 +01:00
erelling
f3ea159c6b Update n00b-overview.md 2019-11-08 01:08:14 +01:00
erelling
3c99294a3a Update n00b-overview.md 2019-11-08 01:06:57 +01:00
erelling
7a2a8cffbb Update n00b-overview.md 2019-11-08 01:06:20 +01:00
erelling
6d90f87b2f Update n00b-overview.md 2019-11-08 01:04:21 +01:00
erelling
f506d24a82 Update n00b-overview.md 2019-11-08 01:01:37 +01:00
Erik Ellingsen
ddb0d23ca7 grammar 2019-11-08 00:04:53 +01:00
Erik Ellingsen
763be9bb95 better instruction 2019-11-07 23:52:47 +01:00
Erik Ellingsen
77109144e7 grammar 2019-11-07 23:47:34 +01:00
Erik Ellingsen
840e7bd985 clarification 2019-11-07 23:47:08 +01:00
Erik Ellingsen
a6c12f4b25 clarification 2019-11-07 23:46:30 +01:00
Erik Ellingsen
e8e9a4d07b simplification 2019-11-07 23:45:23 +01:00
Erik Ellingsen
ba00182ce4 Clarification 2019-11-07 23:44:47 +01:00
Erik Ellingsen
2ad78ee3b8 grammar 2019-11-07 23:42:56 +01:00
Erik Ellingsen
4995d59499 Knuts comments 2019-11-07 23:42:07 +01:00
Erik Ellingsen
d58ef7aa36 Removed redundant heading 2019-11-07 23:40:13 +01:00
Erik Ellingsen
dc59632fb3 Polishing 2019-11-07 23:37:46 +01:00
Erik Ellingsen
1542e15a1b Introduction and getting started howtos 2019-11-07 23:15:53 +01:00
Ashish Jain
5b5be40dd5 Fixing the binding function error 2019-11-07 22:09:34 +01:00
Knut Sveidqvist
1ecf0f4c23 Updated version 2019-11-07 21:16:43 +01:00
Knut Sveidqvist
fa7d1ac554 #1023 Fix for interaction tests 2019-11-07 19:42:09 +01:00
Knut Sveidqvist
48ce7a9b78 #1023 Fix for tests 2019-11-07 19:19:44 +01:00
Knut Sveidqvist
09bf54f9af #1038 Updated prefix for the internal dom id 2019-11-07 19:14:06 +01:00
Erik Ellingsen
43b9bcdb0b version update 2019-11-07 18:39:57 +01:00
knsv
a3017b8456 Merge branch 'release/8.4.1' 2019-11-06 10:52:10 -08:00
MATSUDA Takashi
aac915b285 #1044 fix: Multiple class diagrams are not rendered correctly 2019-11-05 18:00:52 +09:00
MATSUDA Takashi
7208f045c1 add test for multiple class diagram 2019-11-05 17:54:52 +09:00
MATSUDA Takashi
f7a3c42da1 e2e support multiple diagram 2019-11-05 17:54:52 +09:00
Christian Klemm
4d1c53eb1e added percy token 2019-11-03 19:40:15 +01:00
Christian Klemm
7bcc9b19ac fixed vars 2019-11-03 18:30:01 +01:00
Christian Klemm
7cfc729679 added coveralls vars 2019-11-03 18:28:27 +01:00
Christian Klemm
1f8480f0af Added npm badge (#1047) 2019-11-03 16:18:43 +01:00
Christian Klemm
ec3b68ad28 Added build workflow 2019-11-03 15:20:10 +01:00
Nacho
3674e27e0f Reworked readme (#1045) 2019-11-01 13:38:00 -04:00
Knut Sveidqvist
e4486420ce Update some path changes after repo move 2019-10-30 20:21:35 +01:00
Knut Sveidqvist
fe64cc697b Updated version 2019-10-30 20:01:54 +01:00
Knut Sveidqvist
97177dffd6 Updated coveralls badge 2019-10-30 19:54:47 +01:00
Knut Sveidqvist
061a02dddc Merge branch 'develop' of github.com:knsv/mermaid into develop 2019-10-30 19:48:43 +01:00
Knut Sveidqvist
1f72c3e720 Updating the repo path after migration to mermaid-js 2019-10-30 19:48:37 +01:00
Knut Sveidqvist
8270469652 Update README.md 2019-10-30 19:44:53 +01:00
Knut Sveidqvist
5e6590a0f7 Fix of travis badge for new org 2019-10-30 19:40:02 +01:00
Knut Sveidqvist
06dfd13927 Merge pull request #1041 from mermaid-js/maintainence_pie
Maintainance pie
2019-10-30 19:34:19 +01:00
ashishjain0512
486cc92f2e Merge pull request #1039 from lf-novelt/master
Support for underscore in classDiagrams class names
2019-10-30 19:01:11 +01:00
Ashish Jain
e8d649b152 Updated documentation for Pie Chart 2019-10-30 18:32:07 +01:00
Ashish Jain
e96bd14d21 Updated Examples for Pie Chart 2019-10-30 18:30:14 +01:00
Ashish Jain
e4a2d2a290 Updated Jest test cases for Pie diagram 2019-10-30 18:29:26 +01:00
Louis Frament
d8d5d0fa61 update classDiagram documentation:
fix typos and describe naming convention
2019-10-29 17:50:19 +01:00
Louis Frament
e010a03dd5 package-lock version update 2019-10-29 17:39:39 +01:00
Louis Frament
427aea73e7 test pass with underscore in a class name 2019-10-29 17:39:15 +01:00
Louis Frament
c4436b7a1e ALPHA pattern now include underscore 2019-10-29 17:20:25 +01:00
Knut Sveidqvist
d098051047 Merge pull request #1035 from knsv/bug/1033_state_diagram_new_lines_in_notes
Bug/1033 state diagram new lines in notes
2019-10-28 06:56:33 +01:00
Knut Sveidqvist
034a7c424d #1033 Better handling of multiline notes 2019-10-27 17:16:29 +01:00
Knut Sveidqvist
b113436055 #1033 Fix for diagram bounds and viewbox 2019-10-27 16:58:32 +01:00
Knut Sveidqvist
e550d974da Merge pull request #1032 from knsv/bug/1031_stricter_code_checks
Fix for Bug/1031 stricter code checks
2019-10-27 15:33:48 +01:00
Knut Sveidqvist
bc34ef4b66 Merge pull request #1028 from knsv/Issue-1027_Pie-Chart-Legends
#1027  Updated Pie chart to render percentages and labels separately …
2019-10-27 15:26:54 +01:00
Knut Sveidqvist
a5cc1e804b #1031 Adding stricter code checks 2019-10-27 15:24:56 +01:00
Knut Sveidqvist
aac51979cc Merge branch 'develop' of github.com:knsv/mermaid into develop 2019-10-24 19:47:14 +02:00
Knut Sveidqvist
8f8638fb7c #1029 Linting fixes 2019-10-24 19:46:42 +02:00
Knut Sveidqvist
d1c74070ab #1029 Fix for issues after switching to master branch of dagre-d3 2019-10-24 19:33:13 +02:00
Nacho
ee01d09af5 Merge pull request #1008
Added e2e tests to prepublish task
2019-10-24 08:52:05 -04:00
Nacho
caaf4e3e40 Merge pull request #1010
Delete package-lock.json
2019-10-24 08:49:41 -04:00
Nacho
34037e58e5 Added package-lock to gitignore 2019-10-24 08:48:55 -04:00
Knut Sveidqvist
66152b42ae #1023 New line in transition labels, basic support 2019-10-23 21:16:59 +02:00
Ashish Jain
76c8737485 #1027 Updated Pie chart to render percentages and labels separately as legends 2019-10-23 21:00:33 +02:00
Knut Sveidqvist
4a1eb55127 #1022 Fix for long names for state diagrams 2019-10-23 19:22:36 +02:00
Knut Sveidqvist
c87637c6f4 #1024 Removal of leftover loggings 2019-10-23 18:47:41 +02:00
Knut Sveidqvist
364b81a1b9 Merge pull request #1018 from pravi/switch-to-dagre-d3
Use dagre-d3 master branch (for d3v5)
2019-10-23 18:38:45 +02:00
Nacho
d4c8cf66ef Merge pull request #1025
Spelling, markdown lint cleanup
2019-10-23 09:21:30 -04:00
Doug Hill
08762bc066 Spelling, markdown lint cleanup
Fixed spelling errors. Applied some markdown lint standards.
2019-10-22 20:10:35 -10:00
Nacho
0add11a257 Merge pull request #1021 from knsv/master
Keeping development branch up to date
2019-10-21 13:45:47 -04:00
Pirate Praveen
ca5e60b38b Use dagre-d3 master branch (for d3v5) 2019-10-21 22:46:20 +05:30
Knut Sveidqvist
0e7876536d Highlighting state diagrams and class diagrams in the readme 2019-10-21 22:46:19 +05:30
Nacho
be61a03a98 Removed gitter and added slack badge 2019-10-21 22:46:19 +05:30
abeaton
50c707ba51 Fix typos in CONTRIBUTING.md 2019-10-21 22:46:18 +05:30
Sakis bal
2a2fd7a8b1 Small gramatical mistake 2019-10-21 22:46:18 +05:30
Kolja Markwardt
ad126c838e reference the CONTRIBUTING.md in README 2019-10-21 22:46:18 +05:30
Knut Sveidqvist
cafc18a78f Highlighting state diagrams and class diagrams in the readme 2019-10-21 12:38:01 -04:00
Nacho
ffca12a8b0 Removed gitter and added slack badge 2019-10-21 12:38:01 -04:00
abeaton
137f57ad9c Fix typos in CONTRIBUTING.md 2019-10-21 12:38:01 -04:00
Sakis bal
153b3322a6 Small gramatical mistake 2019-10-21 12:38:01 -04:00
Kolja Markwardt
575535bdbd reference the CONTRIBUTING.md in README 2019-10-21 12:38:01 -04:00
Knut Sveidqvist
61a3802494 Highlighting state diagrams and class diagrams in the readme 2019-10-19 17:45:56 +02:00
knsv
0157f665a3 Merge branch 'release/8.4.0' 2019-10-19 07:59:04 -07:00
Knut Sveidqvist
d366605d91 Merge branch 'release/8.4.0' of github.com:knsv/mermaid into release/8.4.0 2019-10-19 16:19:56 +02:00
Knut Sveidqvist
fd5bcad5d6 Fixes after verification, version upgrade 2019-10-19 14:44:54 +02:00
Knut Sveidqvist
7adb80b35b Fixes after verification, font-family set to label of transitions in statediagram 2019-10-19 14:43:26 +02:00
Knut Sveidqvist
dc88e7a2c2 Fixes after verification, documentation of stateDiagram 2019-10-19 14:42:34 +02:00
Nacho
dd68a7151f Removed gitter and added slack badge 2019-10-18 09:57:51 -04:00
Nacho
bf2497ea3e Merge pull request #1014
Fix typos in CONTRIBUTING.md
2019-10-18 09:46:36 -04:00
abeaton
202c889246 Fix typos in CONTRIBUTING.md 2019-10-18 09:41:51 -04:00
Knut Sveidqvist
ec0e93bd6f Merge pull request #1012 from knsv/develop
Moving resolution for #1001 to the release branch for proper prerelease publish
2019-10-17 19:43:31 +02:00
Knut Sveidqvist
def9bef988 Merge pull request #1002 from knsv/feature/1001_alpha_releases_for_release_branches
Feature/1001 preview releases for release branches
2019-10-17 19:31:56 +02:00
Christian Klemm
c3db9032f3 Delete package-lock.json 2019-10-16 23:53:19 +02:00
Christian Klemm
016dc17d94 clean up branch 2019-10-16 22:16:25 +02:00
Christian Klemm
8e1672568a added preview builds to readme 2019-10-16 22:09:33 +02:00
Christian Klemm
42b8ac1235 Added e2e tests to prepublish task 2019-10-16 22:00:57 +02:00
Christian Klemm
2348f9d785 finished ci 2019-10-16 21:57:35 +02:00
Christian Klemm
04f86ef130 testing 2019-10-16 21:50:06 +02:00
Nacho
f436086aae Merge pull request #1004
Small gramatical mistake
2019-10-16 08:32:08 -04:00
Sakis bal
1b813d371d Small gramatical mistake 2019-10-16 10:08:24 +03:00
Knut Sveidqvist
8f49d96c3a Merge pull request #1000 from edekadigital/doc-contributing
reference the CONTRIBUTING.md in README
2019-10-16 08:48:02 +02:00
Christian Klemm
49f5b8d150 testing 2019-10-16 03:42:37 +02:00
Christian Klemm
f0bbb063dd testing 2019-10-16 03:34:22 +02:00
Christian Klemm
d95a9469ac testing 2019-10-16 03:23:22 +02:00
Christian Klemm
6e088d17fd testing 2019-10-16 03:15:33 +02:00
Christian Klemm
42aeafc907 testing 2019-10-16 02:54:11 +02:00
Christian Klemm
3073b6559c testing 2019-10-16 02:44:22 +02:00
Christian Klemm
af57da8e6b testing 2019-10-16 02:40:09 +02:00
Christian Klemm
56e9abfc92 testing 2019-10-15 23:28:16 +02:00
Christian Klemm
61b4c6d3ac testing 2019-10-15 23:24:13 +02:00
Christian Klemm
7e6b43236a testing 2019-10-15 23:19:05 +02:00
Christian Klemm
6a33ac05a3 workflow adjusts 2019-10-15 23:18:26 +02:00
Christian Klemm
5f1246280c Added alpha release build ci 2019-10-15 22:43:36 +02:00
Kolja Markwardt
ecef0c78d2 reference the CONTRIBUTING.md in README 2019-10-15 22:22:01 +02:00
Knut Sveidqvist
0ce42e6185 Merge pull request #994 from edekadigital/bug-478
#478 API crashes on 2nd render() call
2019-10-15 19:40:29 +02:00
Knut Sveidqvist
3709d9d5c8 Merge pull request #996 from edekadigital/bug-783
#783 Hard to customize font-size for gantt charts
2019-10-15 19:38:20 +02:00
Knut Sveidqvist
e65f916ba5 Merge pull request #992 from edekadigital/enhancement-958
#958 Cannot center-justify text in nodes
2019-10-15 18:54:28 +02:00
Knut Sveidqvist
f9c8ce1ac7 Merge branch 'master' into develop 2019-10-15 18:50:11 +02:00
Knut Sveidqvist
b881e5c69c Merge pull request #991 from christopherkade/feature/divided-flow-tests
#906 Divided flow unit tests
2019-10-15 18:43:39 +02:00
Knut Sveidqvist
51a89c80aa Merge pull request #985 from knsv/bug/984_bracket_syntax_properties_reversed_order
bug/984 Class diagram: properties with bracket syntax are reversed in order
2019-10-15 18:39:20 +02:00
Knut Sveidqvist
97a5f408d2 Merge pull request #978 from aledileo/bugfix/node12
Updates node-sass to 4.12 and regenerates lockfiles
2019-10-15 18:38:47 +02:00
Knut Sveidqvist
2f00d7d145 Merge branch 'master' of github.com:knsv/mermaid 2019-10-15 18:36:55 +02:00
Kolja Markwardt
d743838716 #478 API crashes on 2nd render() call
- add e2e test for (re)rendering by api
2019-10-15 17:36:02 +02:00
Kolja Markwardt
069b4854f8 #478 API crashes on 2nd render() call
- remove element from DOM before rendering to avoid conflicts in case of rerendering
2019-10-15 17:36:02 +02:00
Kolja Markwardt
f089c45115 #958 Cannot center-justify text in nodes
- changed fit() to it() to reactivate test
2019-10-15 16:02:11 +02:00
Kolja Markwardt
90fe015d68 #958 Cannot center-justify text in nodes
- assign text-align style to text node to allow aligning of node text
2019-10-15 16:02:11 +02:00
Kolja Markwardt
96c86fd4b2 #783 Hard to customize font-size for gantt charts
- deselect theme style if font-size is set on the taskText element (e.g. via gantt-config)
2019-10-15 15:59:36 +02:00
Nacho
d921c36cd4 Merge pull request #998
Added missing code snippets for trapezoid nodes in flow chart documentation
2019-10-15 09:59:24 -04:00
Paweł Gajda
4a552069cf Added missing code snippets for trapezoid nodes in flow chart 2019-10-15 15:45:04 +02:00
Nacho
74c171b6d1 Merge pull request #997 from knsv/master 2019-10-15 09:17:46 -04:00
Ashish Jain
1ae1313edd #993 Added mermaid documentation for class diagram-minor fixes 2019-10-15 00:32:21 +02:00
Ashish Jain
5949d01821 #993 Added mermaid documentation for class diagram-minor fixes 2019-10-15 00:05:49 +02:00
Ashish Jain
3cdb0ae4c8 #993 Added mermaid documentation for class diagram 2019-10-14 22:59:26 +02:00
christopherkade
89b6ccf47d #906 Divided flow unit tests 2019-10-14 16:17:43 +02:00
Knut Sveidqvist
047ce2949a #989 Added font styling classes to diagrams lacking then 2019-10-13 19:16:35 +02:00
Knut Sveidqvist
53bdfee057 #989 Font configuration 2019-10-12 16:53:21 +02:00
Knut Sveidqvist
2da55993e0 Test of font-settings for correct image snapshots 2019-10-12 09:16:33 +02:00
Knut Sveidqvist
a258eda035 #945 Setting up stylesheet, classes and colors 2019-10-11 18:12:24 +02:00
Knut Sveidqvist
7c125cf9d6 #945 Moving hardcoded sizes etc to config 2019-10-11 15:39:50 +02:00
Nacho
2af76230f7 Merge pull request #987
Grammar/spelling changes to the "Usage" docs
2019-10-11 09:21:39 -04:00
Knut Sveidqvist
bdb530f831 Adding more info about documentation and moving the contributing file to its proper place 2019-10-11 08:17:47 +02:00
Knut Sveidqvist
7a7c09493c Adding more info about documentation and moving the contributing file to its proper place 2019-10-11 08:17:39 +02:00
Knut Sveidqvist
f3d588eca5 Adding contributing information 2019-10-11 08:10:54 +02:00
Knut Sveidqvist
031c0b7b21 #945 Increasing size, handling forks and joins in multiple directions 2019-10-10 20:55:27 +02:00
Knut Sveidqvist
ce017ecd40 Merge branch 'master' of github.com:knsv/mermaid 2019-10-10 17:57:39 +02:00
Knut Sveidqvist
85e58faa78 #945 White background and forks in composite mode 2019-10-10 17:57:29 +02:00
Steven Engler
808ed11e91 Grammar/spelling changes to the "Usage" docs 2019-10-09 15:43:54 -04:00
Ashish Jain
f8f52c4587 Fix for viewport in classDiagram and stateDiagram renndering 2019-10-09 21:15:17 +02:00
Knut Sveidqvist
54e6e2f66e #945 Some bug fixes and draft docs 2019-10-09 20:05:24 +02:00
Knut Sveidqvist
fe1e09f06b Merge branch 'feature/945_state_diagrams' 2019-10-09 18:16:32 +02:00
Knut Sveidqvist
cd646c0e42 Updated yarn.lockl 2019-10-09 18:16:23 +02:00
Knut Sveidqvist
f180510fbb Merge pull request #983 from knsv/feature/Issue-949_Add_cardinality_support
Feature/issue 949 add cardinality support
2019-10-08 23:06:17 +02:00
Christian Klemm
687e74de9b fixed members order 2019-10-08 22:59:59 +02:00
Knut Sveidqvist
65f91dd051 Merge branch 'master' of github.com:knsv/mermaid 2019-10-08 22:56:56 +02:00
Knut Sveidqvist
a8a4616cab #916 Docs for chaining of links 2019-10-08 22:56:50 +02:00
Ashish Jain
aaac86fd9d #949 Added cypress test case for class diagram cardinality support 2019-10-08 21:46:03 +02:00
Ashish Jain
35ddf9235f #949 Added rendering of cardinality for class diagrams 2019-10-08 21:43:58 +02:00
Knut Sveidqvist
554189908d Merge pull request #970 from mearns/issue-530-hexagon
Add hex shape for flow charts
2019-10-08 21:43:10 +02:00
Ashish Jain
54dbbd154c #949 Added utility function for calculating cardinality position 2019-10-08 21:42:49 +02:00
Knut Sveidqvist
a9224015e0 Merge pull request #964 from volkanunsal/master
Add useMaxWidth to flowRenderer
2019-10-08 21:33:50 +02:00
Eduardas Michelsonas
1cba50266e #755 Linting fixes + merge 2019-10-08 14:25:29 +02:00
edumicse
341456cc25 Merge pull request #981 from knsv/feature/755_handling_br_in_sequence_diagram
Feature/755 handling br in sequence diagram
2019-10-08 14:19:36 +02:00
edumicse
ae7852d9b9 Merge branch 'master' into feature/755_handling_br_in_sequence_diagram 2019-10-08 14:18:55 +02:00
ashishjain0512
4ce523f33b Merge pull request #973 from chris579/feature/963_class_annotations
Class diagram: annotations support
2019-10-08 12:56:49 +02:00
Ashish Jain
6b4a8325ae Merge branch 'feature/963_class_annotations' of https://github.com/chris579/mermaid into develop 2019-10-08 12:49:52 +02:00
Knut Sveidqvist
6d3044bddd Merge pull request #974 from vikyaiyer/Issue-893
added css path to styling in documentation
2019-10-07 10:13:15 +02:00
Alejandro Di Leo
0678f61ce9 Updates node-sass to 4.12 and regenerates lockfiles 2019-10-06 13:15:36 -03:00
Knut Sveidqvist
ebede9b910 #945 Log removal 2019-10-06 16:06:15 +02:00
Knut Sveidqvist
b12791d3e0 #945 Divider lines for concurrency, full width when in a composit state 2019-10-06 15:53:34 +02:00
Knut Sveidqvist
ce0b0fa0c8 #945 Divider lines for concurrency 2019-10-06 15:44:31 +02:00
Knut Sveidqvist
dce09586cd #945 Support for forks and joins 2019-10-06 14:11:17 +02:00
Knut Sveidqvist
4f1186a610 #945 Support for notes, better width and handling of +/- 2019-10-06 11:35:46 +02:00
Knut Sveidqvist
1cb52a602a #945 Support for notes 2019-10-06 10:52:37 +02:00
Knut Sveidqvist
c482083d82 Update README.md 2019-10-06 09:03:56 +02:00
Knut Sveidqvist
d9dda88164 Replaced info about linting 2019-10-06 09:02:07 +02:00
Brian Mearns
c9fe948b90 #530 Finished basic unit tests for flow shapes 2019-10-05 13:48:20 -04:00
Brian Mearns
cc731fe3c4 #530 Pull shape functions out to shorten functions 2019-10-05 09:38:03 -04:00
Christian Klemm
40b7262c19 exchanged class readme image 2019-10-05 12:46:28 +02:00
Christian Klemm
9da61ad562 added some documentation 2019-10-05 12:38:29 +02:00
Knut Sveidqvist
3b731282e3 #945Renabling support for descriptions 2019-10-05 12:15:14 +02:00
Knut Sveidqvist
cfc14ade2a #945 Some more cleanup focusing on stateDb 2019-10-05 10:02:58 +02:00
Knut Sveidqvist
d4306e61c2 #945 Some cleanup 2019-10-05 09:02:20 +02:00
Vignesh Aiyer
3afa6e2350 Update sequenceDiagram.md 2019-10-05 11:15:12 +05:30
Vignesh
8bbb0448dc added css path to styling in documentation 2019-10-05 10:52:23 +05:30
Brian Mearns
dcbcbf40a0 #530 Started adding some tests around how flowchart shapes are rendered in SVG 2019-10-04 22:38:27 -04:00
Brian Mearns
9a0a5ca804 #530 Add some unit tests for flowRenderer.addVertices 2019-10-04 22:03:20 -04:00
Brian Mearns
20b2866631 #530 Further encapsulation of common code 2019-10-04 21:21:00 -04:00
Christian Klemm
92eec664b1 test fix 2019-10-05 00:57:58 +02:00
Christian Klemm
723fe84383 added diagram escaping for e2e tests 2019-10-05 00:39:07 +02:00
Christian Klemm
3ca9347361 test fix 2019-10-05 00:05:47 +02:00
Christian Klemm
704d36a7eb adjusted integration test 2019-10-04 23:58:06 +02:00
Christian Klemm
612df99c34 added tests + alt syntax 2019-10-04 23:49:58 +02:00
Christian Klemm
912e850db4 added grammar 2019-10-04 21:49:02 +02:00
Christian Klemm
96735dd543 Added rendering for annotations 2019-10-04 21:09:49 +02:00
Knut Sveidqvist
65cbfbdb40 #945 Tweaking 2019-10-03 19:54:07 +02:00
Knut Sveidqvist
7865fd4f02 #945 Rendering of composite state in a box 2019-10-03 19:08:15 +02:00
Nacho
801f001098 Merge pull request #972
Removed reference to mermaid.min.css in usage docs #797
2019-10-03 10:18:25 -04:00
Rick Ulrich
7e92257c3c Removed reference to mermaid.min.css in usage docs #797 2019-10-03 09:13:12 -05:00
Nacho
7d4777a8bf Merge pull request #971
Revert "Removed reference to mermaid.min.css in usage docs #797"
2019-10-03 09:35:44 -04:00
Nacho
e7428afb3e Revert "Removed reference to mermaid.min.css in usage docs #797" 2019-10-03 09:35:22 -04:00
Nacho
51b7c90dae Merge pull request #969
Removed reference to mermaid.min.css in usage docs #797
2019-10-03 09:31:59 -04:00
Brian Mearns
c9f84ccae5 #530 Testing Coverage 2019-10-03 06:41:36 -04:00
Brian Mearns
01fd54dd6f #530 Encapsulate some redudant flow shape code 2019-10-02 22:51:12 -04:00
Brian Mearns
e1446ce38a #530 Add unit test for hex nodes 2019-10-02 22:44:56 -04:00
Brian Mearns
1920e9f758 #530 Add hexagon to flow docs 2019-10-02 22:38:41 -04:00
Brian Mearns
550f91aa68 #530 Better shaping of hexagon
The "corner" triangles are a fixed ratio to the height,
so the triangles will always be mathemtically similar.
2019-10-02 22:36:02 -04:00
Brian Mearns
57921e3f52 #530 Add Hex example to index.html 2019-10-02 22:31:41 -04:00
Brian Mearns
b300a4decb #530 Fit hexagon to width and height
The hexagon shape in flow chart now fits
the width and height independently, so it can better fit
large content without taking up too much space.
2019-10-02 22:23:30 -04:00
Brian Mearns
51e902cd36 Added the hex shape to the renderer, and support for it in the flow parser.
Need to work on properly sizing it.
2019-10-02 22:11:02 -04:00
Harrison Ulrich
ea359c0037 Removed reference to mermaid.min.css in usage docs #797 2019-10-02 15:04:58 -05:00
Knut Sveidqvist
f9f8785aef #945 Recursive object from parsing and stateDb 2019-10-02 19:32:13 +02:00
Knut Sveidqvist
0abeaa4dc2 Merge branch 'feature/945_state_diagrams' into develop 2019-10-02 19:17:38 +02:00
Nacho
18f35ac213 Merge pull request #968
Fixes #848
2019-10-02 09:54:34 -04:00
Brian Mearns
9ca077b3dc Add some test coverage for getBranchesAsObjArray 2019-10-01 22:29:07 -04:00
Brian Mearns
351dd3728e #848 - Add Unit Test 2019-10-01 22:03:43 -04:00
Brian Mearns
054901cb79 Fixes #848 - Use more secure PRNG
Math.random() is not cryptogaphically secure, but the crypto-random-string
package provides what is needed with a cryptographically secure pseudo-random
number generator.
2019-10-01 21:29:42 -04:00
Nacho
4f29f7c3a7 Automatically lock/unlock issues on close/reopen 2019-10-01 11:02:26 -04:00
Nacho
f149f090a6 Merge pull request #965
Corrected docs
2019-10-01 08:51:24 -04:00
Nacho
d113364f82 Merge pull request #966
Optimize images
2019-10-01 08:38:02 -04:00
Arnaud ZHENG
d499cce371 remove old files 2019-10-01 10:49:55 +02:00
Arnaud ZHENG
5d7dbd701f remove old files 2019-10-01 10:48:37 +02:00
Arnaud ZHENG
8345134d2a Merge branch 'master' of github.com:knsv/mermaid 2019-10-01 10:47:03 +02:00
Gianfrancø Palumbo
55f9cba0f9 docs: small improvement to flowchart.md 2019-09-30 21:59:10 +03:00
Knut Sveidqvist
94afcfb6f9 #945 Rendering of state descriptions 2019-09-29 15:50:43 +02:00
Volkan Unsal
682faa4f9d Add useMaxWidth to flowRenderer 2019-09-29 09:31:41 -04:00
Knut Sveidqvist
3cffd1e3ed #945 Rendering of labels and new label positioning algorithm 2019-09-28 13:31:10 +02:00
Nacho
0730f73f73 Merge pull request #960
Update gantt.md
2019-09-27 13:21:28 -04:00
lilisha100
dffe20b76c Update gantt.md 2019-09-27 10:15:03 -07:00
lilisha100
e7161fcca6 Update gantt.md 2019-09-27 09:52:22 -07:00
lilisha100
3bf873b99f Update gantt.md 2019-09-27 09:27:53 -07:00
Nacho
f49bae6622 Merge pull request #957 from GDFaber/master
Flowchart parsing issue with CRLF #894
2019-09-27 09:12:19 -04:00
Marc Faber
095233e6cf Flowchart parsing issue with CRLF #894 2019-09-27 01:05:25 +02:00
Nacho
490d42fce1 Merge pull request #956
Created issue template for questions
2019-09-26 11:44:50 -04:00
Nacho
11d2db08fa Created issue template for questions 2019-09-26 11:42:33 -04:00
Knut Sveidqvist
13baa43081 #945 Rendering from diagram data 2019-09-25 21:29:32 +02:00
Knut Sveidqvist
fad76ad534 #945 Rendering of start & end node 2019-09-25 21:01:21 +02:00
Nacho
1c3ddcd120 Merge pull request #954
Create github/action for triage labelling
2019-09-25 11:18:09 -04:00
Nacho
2ccdeec550 Create github/action for triage labelling 2019-09-25 11:14:52 -04:00
Nacho
3164f99b3b Merge pull request #953
Reverted to stalebot instead of github actions/stale
2019-09-25 11:01:23 -04:00
Nacho
1bceae12dd Added config for stalebot 2019-09-25 10:53:08 -04:00
Nacho
b2c60135f5 Deleted github action for stale 2019-09-25 10:52:30 -04:00
Nacho
0dddf3c50c Merge pull request #952
Updated issue templates
2019-09-25 10:06:46 -04:00
Nacho
b4badf6e7f Update issue templates 2019-09-25 09:55:18 -04:00
Nacho
9c69afeddd Merge pull request #951
Corrected typo in mermaidAPI.md
2019-09-24 12:53:16 -04:00
Nacho
e8835429fd Merge branch 'master' into master 2019-09-24 12:47:46 -04:00
0xflotus
029a84159e Update mermaidAPI.md 2019-09-24 18:47:38 +02:00
Knut Sveidqvist
ba01e3778a Tets change to see if it triggers 2019-09-24 09:38:16 +02:00
Nacho
6cfd4e6422 Switching stalebot to github/action (#950)
* Added configuration for github action stale
* Deleted stalebot configuration
2019-09-23 11:29:02 -04:00
Nacho
bb372751f7 Reverted test settings 2019-09-23 10:30:23 -04:00
Nacho
3fdf2c7e32 Updated cron expresion for test 2019-09-23 10:22:19 -04:00
Nacho
9f4ca63603 Deleted stalebot configuration 2019-09-23 10:21:04 -04:00
Nacho
4bdf772130 Added stale pr/issue workflow for test 2019-09-23 10:20:02 -04:00
Nacho
6110640fc2 Merge pull request #940
Use https in githu urls
2019-09-23 09:44:20 -04:00
nothingismagick
6c243488fa revert to http 2019-09-23 12:06:22 +02:00
nothingismagick
4f218435e3 revert to http 2019-09-23 12:05:13 +02:00
nothingismagick
7ca13fd163 revert to http 2019-09-23 12:04:39 +02:00
knsv
2306534248 #945 Handling of dimples state definitions 2019-09-22 03:30:36 -07:00
knsv
2f0248e6d5 #945 Handling of note statements 2019-09-22 02:38:04 -07:00
knsv
3a8564de92 #945 Handling of fork statements 2019-09-21 23:19:03 -07:00
knsv
1aa8b9b804 #945 Handling recursive logn descriptions for states with quotes 2019-09-21 11:31:09 -07:00
knsv
921d5464a1 #945 Handling recursive logn descriptions for states with quotes 2019-09-21 09:12:02 -07:00
knsv
9993b90a20 #945 Handling recursive state statements 2019-09-21 08:54:18 -07:00
knsv
6f054519e7 #945 Handling simple state statements 2019-09-21 08:50:32 -07:00
knsv
51bf4a4c5c #945 Parsing happy case and scale/hide statements 2019-09-21 08:19:55 -07:00
knsv
046b83582d Local docs to use 8.3.1 2019-09-19 15:10:49 -07:00
knsv
be2e467583 Release 8.3.1. Reseting the flow parser between parsings 2019-09-19 15:00:21 -07:00
Knut Sveidqvist
b1d137770c Merge pull request #942 from knsv/bugfix_941
Bugfix 941
2019-09-19 23:19:32 +02:00
knsv
40c7cab1da Merge branch 'master' into HEAD 2019-09-19 13:59:03 -07:00
knsv
f39e120952 #941 Fix for issue with directions iin flowchart 2019-09-19 13:56:41 -07:00
Daniel Thompson-Yvetot
f30f607b0c feat(https): use https in SVGs 2019-09-19 20:53:42 +02:00
Nacho
e40e1da292 Merge pull request #939
Fix accidental paste and code style in readme
2019-09-19 09:00:58 -04:00
Philipp A
1783ef501d Fix accidental paste and code style in readme 2019-09-19 09:45:13 +02:00
knsv
b4ec22ecea Local docs to use 8.3.0 2019-09-18 22:49:33 -07:00
knsv
0200fef389 Release 8.3.0 2019-09-18 22:19:48 -07:00
knsv
d8397f146b #937 Handling direction keywords in node ids 2019-09-18 12:56:24 -07:00
Knut Sveidqvist
244be86207 E2e test of interaction in graphs 2019-09-18 19:42:19 +02:00
Knut Sveidqvist
c26135780d Adding build to travis steps 2019-09-18 19:01:58 +02:00
Knut Sveidqvist
4411a26002 Cleanup, removed old e2e in favour of cypress 2019-09-18 18:37:53 +02:00
Knut Sveidqvist
21622f575b Updating cypress tests 2019-09-18 18:25:06 +02:00
Knut Sveidqvist
23e6df04d4 Merge pull request #929 from knsv/dependabot/npm_and_yarn/eslint-utils-1.4.2
chore(deps): bump eslint-utils from 1.3.1 to 1.4.2
2019-09-18 18:08:09 +02:00
Knut Sveidqvist
bf403dfc62 Merge pull request #933 from Dunning-Kruger/features/close-stale-issues
Close stale issues
2019-09-18 18:06:57 +02:00
Knut Sveidqvist
c3f48b5a13 Merge pull request #936 from janverb/fix-configuration-defaults-htmllabels-value
Correctly document htmlLabels as true by default
2019-09-18 13:51:16 +02:00
Jan Verbeek
e192454f54 Correctly document htmlLabels as true by default
The "mermaidAPI configuration defaults" section in the documentation
listed `htmlLabels` as `false`, but the real default is `true`, as
seen in the code and elsewhere in the documentation.
2019-09-18 13:05:08 +02:00
Ignacio Orlandoni
a55573be94 Update stale.yml
Stalebot now closes inactive stale issues.
2019-09-13 14:15:49 -04:00
dependabot[bot]
0e548f63f9 chore(deps): bump eslint-utils from 1.3.1 to 1.4.2
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-12 20:20:09 +00:00
Knut Sveidqvist
4d1a34661e Merge pull request #932 from knsv/i931_code_standard
I931 code standard
2019-09-12 22:18:46 +02:00
knsv
7e5802e799 #931 Last code standard fixes 2019-09-12 12:59:13 -07:00
knsv
0e8164d805 #931 Compliacne with code standard 2019-09-12 12:58:57 -07:00
knsv
f9b30bdb43 #931 Reformatting for compliacne with code standard 2019-09-12 12:58:32 -07:00
knsv
34de31195f #931 Aligning with code standard 2019-09-12 12:58:04 -07:00
knsv
cf05a8d8fa #931 Updating code to align witn new code standard 2019-09-12 12:57:36 -07:00
knsv
a2e3f3d900 #931 Reformatting code for gitGraph 2019-09-12 12:56:54 -07:00
knsv
0890ba0fdd #931 replacing linter 2019-09-12 12:56:20 -07:00
knsv
d2f082b2e2 #931 Replacing linter 2019-09-12 12:55:56 -07:00
knsv
e67b8c86d6 #931 Aligning code standard 2019-09-12 12:55:31 -07:00
knsv
e14922f15c #931 Aligning code standard 2019-09-12 12:55:20 -07:00
knsv
ad5669b523 #931 Aligning code standard 2019-09-12 12:55:10 -07:00
knsv
f2a6ba80b5 #931 Aligning code standard 2019-09-12 12:54:59 -07:00
knsv
b3dac15d57 Merge branch 'master' into i931_code_standard 2019-09-12 12:51:41 -07:00
Knut Sveidqvist
def4ca699a #931 added conf and libraries 2019-09-12 21:03:49 +02:00
knsv
f98fa82134 Adding percy badge 2019-09-11 13:57:53 -07:00
Knut Sveidqvist
ff44671ae5 Merge pull request #928 from knsv/feature/Issue-22_Pie-Chart-Feature
#22 Basic Pie Chart
2019-09-11 21:50:42 +02:00
Ashish Jain
398d66bda9 #22 Update SCSS for pie chart specific title class 2019-09-11 21:39:39 +02:00
Ashish Jain
eb9ac1bbe5 #22 Updated yarn.lock 2019-09-11 21:29:31 +02:00
Ashish Jain
42fc23cff2 #22 Basic Pie Chart 2019-09-11 21:20:28 +02:00
Knut Sveidqvist
78cae3dce7 Finding the missing cypress binary 2019-09-11 20:23:41 +02:00
Knut Sveidqvist
beed86ff37 Update for accessing missing binary 2019-09-11 20:20:15 +02:00
Knut Sveidqvist
ec7324e12e Restore documention written in autoigenerated file 2019-09-11 20:03:22 +02:00
Knut Sveidqvist
d097b673bb #927 enabling the e2e tests 2019-09-11 19:23:08 +02:00
Knut Sveidqvist
7eea957a3b #927 Upgrading node 2019-09-11 19:18:55 +02:00
Knut Sveidqvist
4dda6b8a81 #927 Updated yarn.lock 2019-09-11 19:16:15 +02:00
Knut Sveidqvist
5fd5a65283 #927 reverted changes 2019-09-11 19:04:30 +02:00
Knut Sveidqvist
ca0513396d Investigation of build issues 2019-09-11 18:59:44 +02:00
Knut Sveidqvist
9f87ab4941 #927 Adding support for cypress and Percy 2019-09-11 18:53:05 +02:00
knsv
e37f5a6eb2 #926 Applying the color styling on the label instead of the node 2019-09-08 02:56:06 -07:00
knsv
ece40cdc54 #926 E2e test for issue 2019-09-08 00:33:56 -07:00
knsv
65561b22c5 #926 Adding e2e tools for replicating issues 2019-09-08 00:33:38 -07:00
knsv
21aa8c5f15 #922 Fix for click binding on nodes with ids starting with a number 2019-09-03 11:31:47 -07:00
knsv
f4bafacc62 Release 8.2.6 2019-09-01 04:16:09 -07:00
knsv
2cb54293f8 Lint fixes 2019-09-01 02:18:00 -07:00
knsv
5610185050 #918 Removed som logging 2019-09-01 00:45:24 -07:00
knsv
699bd61045 #918 Fix for issue with nodes starting with a number in a subgraph 2019-09-01 00:44:48 -07:00
Knut Sveidqvist
27d0b934a1 Merge pull request #917 from knsv/dependabot/npm_and_yarn/mixin-deep-1.3.2
chore(deps): bump mixin-deep from 1.3.1 to 1.3.2
2019-08-29 17:16:43 +02:00
Knut Sveidqvist
0f1b704385 Merge pull request #912 from knsv/dependabot/npm_and_yarn/eslint-utils-1.4.2
chore(deps): bump eslint-utils from 1.3.1 to 1.4.2
2019-08-29 17:16:28 +02:00
Knut Sveidqvist
7d0c1d2594 Merge pull request #909 from davidpendraykalibrate/patch-1
Fix typos in README
2019-08-29 17:15:24 +02:00
dependabot[bot]
43cff9e1a3 chore(deps): bump mixin-deep from 1.3.1 to 1.3.2
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-29 02:30:07 +00:00
erelling
f5ddf869e4 Link and clarification 2019-08-28 22:01:19 +02:00
erelling
185db4c112 Update mermaidAPI.md 2019-08-28 21:57:10 +02:00
erelling
07e3815b74 Update mermaidAPI.md 2019-08-28 21:56:27 +02:00
erelling
187ddfd80c Clarification 2019-08-28 21:55:35 +02:00
erelling
d3f7923bc6 Formatting, defaults example 2019-08-28 21:50:44 +02:00
erelling
e52db94c1a Formatting 2019-08-28 21:26:38 +02:00
erelling
e50959c1fe Formatting 2019-08-28 21:14:07 +02:00
erelling
bab75625cb Configuration example 2 2019-08-28 21:13:38 +02:00
erelling
f0b039ad10 Security level, update for new syntax 2019-08-28 21:08:27 +02:00
erelling
5c8dc7ab07 Better formatting 2019-08-28 21:03:23 +02:00
erelling
de2b5390cb Syntax clarification and full example 2019-08-28 20:59:28 +02:00
Knut Sveidqvist
d89ceb2125 Merge branch 'master' of github.com:knsv/mermaid 2019-08-28 20:25:59 +02:00
Knut Sveidqvist
c43d58d3c9 #916 Allow chaining of vertice in flowcharts 2019-08-28 20:25:54 +02:00
Eduardas Michelsonas
c6efddee87 #755 lint fixes 2019-08-28 20:13:37 +02:00
Eduardas Michelsonas
f6377e6125 #755 2019-08-28 20:09:45 +02:00
Eduardas Michelsonas
357c47910a Test commit 2019-08-28 18:53:49 +02:00
Knut Sveidqvist
4ae48f4284 #915 Reviving the possibility to use underscore in text in vertices 2019-08-28 17:34:57 +02:00
knsv
a48a306fe8 #914 Fix for issue identifying node wehen the id of the node starts with a digit 2019-08-27 12:16:11 -07:00
dependabot[bot]
a3c1928fc0 chore(deps): bump eslint-utils from 1.3.1 to 1.4.2
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-26 18:25:33 +00:00
knsv
34d3b85227 Release 8.2.5 2019-08-26 11:23:54 -07:00
Knut Sveidqvist
06a91d8564 #835 Backwords compatible syntax for associating classes with nodes/vertices 2019-08-26 20:10:44 +02:00
knsv
e1f0367631 Release 8.2.4 2019-08-25 06:31:58 -07:00
David Pendray
dbcd4f635e Fix typos in README 2019-08-22 11:53:26 +01:00
Knut Sveidqvist
a3142aad69 Adding some test pages 2019-08-20 20:07:12 +02:00
Knut Sveidqvist
980749536b Fix for issue with bindFunctions being called when there are none. 2019-08-20 18:42:19 +02:00
Knut Sveidqvist
5dbddfb6a1 Merge pull request #908 from knsv/bug/subgraphs_number_in_id_and_space_in_titles_895_and_900
Bug/subgraphs number in id and space in titles 895 and 900
2019-08-16 13:02:30 +02:00
Knut Sveidqvist
c4d2be7a0d Merge branch 'master' into bug/subgraphs_number_in_id_and_space_in_titles_895_and_900 2019-08-16 12:52:17 +02:00
Knut Sveidqvist
ef51f543a3 Fix for test 2019-08-16 12:42:42 +02:00
Knut Sveidqvist
4eda2aa36d #900 Handling ids starting with a number and styling for other nodes as well 2019-08-16 12:38:34 +02:00
Knut Sveidqvist
a35892da4f Fix for issue #895 2019-08-15 08:57:49 +02:00
Knut Sveidqvist
23b567e11b #900 Fix for subgraph ids starting with a number 2019-08-14 20:00:06 +02:00
Ashish Jain
abdbf2cb8a Bug fix handling non-click graphs 2019-08-14 19:25:52 +02:00
Ashish Jain
ca97ac11e1 Fix for failing yarn dev on Standard syntax check for mermaidAPI.js 2019-08-14 18:33:10 +02:00
Nacho
8f0a7f56e2 Merge pull request #904 from lakario/master
Typo in Readme
2019-08-14 09:47:03 -04:00
Nacho
0a61971d29 Merge pull request #905 from i-am-the-slime/fix-typo
Fix typo
2019-08-14 09:45:08 -04:00
knsv
7b335fb62e #901 Fixed the issue with multiple calls to bind the click functions. Also sanitized the tooltips so that no tags are allowed in them for (#847). 2019-08-11 03:26:44 -07:00
knsv
a6f21c2b91 Re-enabling all tests 2019-08-08 01:19:14 -07:00
Mark Eibes
e74378a8ac Fix typo 2019-08-08 08:42:03 +02:00
Nathan Taylor
ec67ee946a Typo in Readme
Fixed a typo in readme
2019-08-07 12:07:23 -07:00
knsv
c5e8a52205 t push origin masterMerge branch 'sagea-sagea/jison-webpack' 2019-08-04 00:11:28 -07:00
Alexander Sage
78dd0e6ddc remove dev code 2019-08-03 15:10:53 -07:00
Alexander Sage
cfea52f570 chore: integrate jison into webpack build 2019-08-03 15:05:43 -07:00
Knut Sveidqvist
2d88982729 Merge pull request #898 from sagea/rect-documentation
chore: Documentation for rect
2019-08-01 22:32:57 -07:00
Alexander Sage
148a3c4cf7 chore: Documentation for rect 2019-07-30 22:24:48 -07:00
knsv
533b55bb68 Merge of feat: sequence diagram background rect #889 2019-07-25 12:04:01 -07:00
knsv
5b85fe9293 Merge branch 'sagea-sagea/sequencediagram-background-rect' 2019-07-25 12:00:57 -07:00
Knut Sveidqvist
1ac126fb7a Merge pull request #890 from knsv/feature/allow-class-directly-at-node-flow
#835 Feature/allow class directly at node flow
2019-07-25 01:12:05 -07:00
Alexander Sage
b5e3323a93 fix: workaround for function 25 line limit 2019-07-23 21:33:03 -07:00
Alexander Sage
8f6d148481 chore: added test for background rect dimensions 2019-07-23 21:28:48 -07:00
Alexander Sage
671a892b52 fix: removed it.only 2019-07-23 21:08:33 -07:00
Alexander Sage
5c25c5563a chore: Added e2e snapshot tests 2019-07-23 21:07:01 -07:00
Alexander Sage
8b05eeaa59 chore: Added unit tests around drawBackgroundRect and drawRect 2019-07-23 19:15:54 -07:00
Alexander Sage
1b001cf1e8 chore: Added unit tests around drawBackgroundRect and drawRect 2019-07-23 19:11:31 -07:00
ashishjain0512
855bad2f40 Added sequenceDiagram.js 2019-07-23 06:54:45 -07:00
ashishjain0512
b6d9407246 Added Jest test case for handling underscore in vertex name 2019-07-23 06:51:18 -07:00
ashishjain0512
957687ed39 Added Jest test for use-case A[text]-->B[test2].class 2019-07-23 06:49:44 -07:00
ashishjain0512
db86cfa7d9 Added Jest test case for use-case A[text].class-->B[test2] 2019-07-23 06:47:03 -07:00
ashishjain0512
afa95172b6 Added new Jest test case for usecase A[text].class 2019-07-23 06:45:35 -07:00
ashishjain0512
2e0843c226 Added Jest test case for 'should be possible to apply a class to a vertex directly' use-case 2019-07-23 06:41:45 -07:00
ashishjain0512
b312901705 Updated JISON for flow diagram to allow . class in vertex declaration 2019-07-23 06:37:28 -07:00
Ashish Jain
16028b51c7 Merge branch 'master' into feature/allow-class-directly-at-node-flow 2019-07-23 10:48:45 +02:00
Alexander Sage
c8091c61c0 feat: sequence diagram background rect 2019-07-22 22:47:49 -07:00
knsv
5d9018aeec Merge remote-tracking branch 'origin/master' 2019-07-22 05:23:17 -07:00
Knut Sveidqvist
9dc6668e8a Merge pull request #888 from stanhu/sh-fix-security-level-docs
Fix securityLevel documentation
2019-07-21 09:48:49 -07:00
Stan Hu
527aea9264 Fix securityLevel documentation
Instead of boolean values, only `strict` and `loose` should be
used.
2019-07-21 09:46:35 -07:00
Knut Sveidqvist
056f321ee6 Merge pull request #887 from stanhu/sh-fix-readme-typo
Fix typo: wich -> which
2019-07-21 09:29:07 -07:00
Knut Sveidqvist
e679556975 Merge pull request #886 from stanhu/sh-fix-flowchart-label
Fix text label colors for flow charts. Thanks for the fix!
2019-07-21 09:28:12 -07:00
Stan Hu
e9f4ac7425 Fix typo: wich -> which 2019-07-21 09:16:47 -07:00
Stan Hu
c6502fb03b Style the flow chart labels via SCSS 2019-07-21 08:51:44 -07:00
Stan Hu
83b7163844 Fix text label colors for flow charts
When htmlLabels is set to `false` and a background fill color is used
for a node, the text label will inherit the fill color, hiding the
actual text. To fix this, explicitly set the fill color to `#333`, the
same value used in `src/themes/flowchart.scss`.

Closes https://github.com/knsv/mermaid/issues/885
2019-07-21 08:25:33 -07:00
Ashish Jain
2c7f00bac1 Merge branch 'master' into feature/allow-class-directly-at-node-flow 2019-07-15 12:37:18 +02:00
Ashish Jain
04d55f60ea Test Commit 2019-07-10 17:46:08 +02:00
Arnaud Zheng
ec5627a44c Merge pull request #1 from arnaud-zg/imgbot
[ImgBot] Optimize images
2019-06-10 13:33:40 +02:00
ImgBotApp
5e52138861 [ImgBot] Optimize images
*Total -- 213.50kb -> 206.22kb (3.41%)

/dist/www/images/logo.png -- 3.29kb -> 1.21kb (63.29%)
/docs/site/images/logo.png -- 3.29kb -> 1.21kb (63.29%)
/docs/img/header.png -- 68.97kb -> 67.93kb (1.5%)
/docs/site/images/header.png -- 68.97kb -> 67.93kb (1.5%)
/dist/www/images/header.png -- 68.97kb -> 67.93kb (1.5%)
2019-06-08 15:55:06 +00:00
377 changed files with 149516 additions and 18993 deletions

1
.eslintignore Normal file
View File

@@ -0,0 +1 @@
**/*.spec.js

20
.eslintrc.json Normal file
View File

@@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"extends": ["prettier", "eslint:recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
}
}

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [knsv]
#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
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#otechie: # Replace with a single Otechie username
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'Status: Triage, Type: Bug / Error'
assignees: ''
---

View File

@@ -1,10 +0,0 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''
---

View File

@@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
labels: 'Status: Triage, Type: Enhancement'
assignees: ''
---

15
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@@ -0,0 +1,15 @@
---
name: Question
about: Get some help from the community.
title: ''
labels: 'Help wanted!, Type: Other'
assignees: ''
---
## Help us help you!
You want an answer. Here are some ways to get it quicker:
* Use a clear and concise title.
* Try to pose a clear and concise question.
* Include as much, or as little, code as necessary.
* Don't be shy to give us some screenshots, if it helps!

3
.github/pr-labeler.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
'Type: Bug / Error': 'bug/*'
'Type: Enhancement': 'feature/*'
'Type: Other': 'other/*'

13
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,13 @@
## :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

25
.github/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name-template: '$NEXT_PATCH_VERSION'
tag-template: '$NEXT_PATCH_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'Type: Enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'Type: Bug / Error'
- title: '🧰 Maintenance'
label: 'Type: Other'
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
sort-by: title
sort-direction: ascending
branches:
- develop
exclude-labels:
- 'Skip changelog'
no-changes-template: 'This release contains minor changes and bugfixes.'
template: |
# Release Notes
$CHANGES
🎉 **Thanks to all contributors helping with this release!** 🎉

12
.github/stale.yml vendored
View File

@@ -1,14 +1,12 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- Status: Pinned
- Area: Security
- pinned
- Retained
# Label to use when marking an issue as stale
staleLabel: Status: Wontfix
staleLabel: Inactive
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
@@ -16,4 +14,6 @@ markComment: >
for your contributions.
If you are still interested in this issue and it is still relevant you can comment to revive it.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
closeComment: >
This issue has been been automatically closed due to a lack of activity.
This is done to maintain a clean list of issues that the community is interested in developing.

64
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
steps:
- uses: actions/checkout@v1
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Yarn
run: npm i yarn --global
- name: Cache Node Modules
uses: actions/cache@v1
with:
path: .cache
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
- name: Install Packages
run: |
yarn config set cache-folder $GITHUB_WORKSPACE/.cache/yarn
yarn install --frozen-lockfile
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress
- name: Run Build
run: yarn build
- name: Upload Build as Artifact
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
- name: Run Unit Tests
run: |
yarn test --coverage
#- name: Upload Test Results
# uses: coverallsapp/github-action@v1.0.1
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel: true
# - name: Run E2E Tests
# run: yarn e2e
# env:
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
# CYPRESS_CACHE_FOLDER: .cache/Cypress
#- name: Post Upload Test Results
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true

19
.github/workflows/checks vendored Normal file
View File

@@ -0,0 +1,19 @@
on: [push]
name: Static analysis
jobs:
test:
runs-on: ubuntu-latest
name: check tests
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: testomatio/check-tests@stable
with:
framework: cypress
tests: "./cypress/integration/**/**.spec.js"
token: ${{ secrets.GITHUB_TOKEN }}
has-tests-label: true

14
.github/workflows/issue-triage.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: Apply triage label to new issue
on:
issues:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: andymckay/labeler@1.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
labels: "Status: Triage"

13
.github/workflows/lock-closed-issue.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Lock closed issue
on:
issues:
types: [closed]
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: Dunning-Kruger/lock-issues@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

13
.github/workflows/pr-labeler.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Apply labels to PR
on:
pull_request:
types: [opened]
jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- name: Label PR
uses: TimonVS/pr-labeler-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

15
.github/workflows/release-draft.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Draft Release
on:
push:
branches:
- develop
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- name: Draft Release
uses: toolmantim/release-drafter@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,37 @@
name: Publish release preview package
on:
push:
branches:
- 'release/**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10.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
- name: Publish
run: |
PREVIEW_VERSION=$(git rev-list --count --first-parent HEAD)
VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION
echo $VERSION
npm version --no-git-tag-version --allow-same-version $VERSION
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
npm set registry https://npm.pkg.github.com/mermaid-js
json -I -f package.json -e 'this.name="@mermaid-js/mermaid"' # Package name needs to be set to a scoped one because GitHub registry requires this
json -I -f package.json -e 'this.repository="git://github.com/mermaid-js/mermaid"' # Repo url needs to have a specific format too
npm publish

44
.github/workflows/release-publish.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Publish release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fregante/setup-git-user@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10.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
- name: Prepare release
run: |
VERSION=${GITHUB_REF:10}
echo "Preparing release $VERSION"
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 checkout -t origin/master
git merge -m "Release $VERSION" --no-ff release/$VERSION
git push --no-verify
- name: Publish
run: |
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -0,0 +1,13 @@
name: Unlock reopened issue
on:
issues:
types: [reopened]
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: Dunning-Kruger/unlock-issues@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

15
.gitignore vendored
View File

@@ -2,6 +2,7 @@
node_modules/
coverage/
.idea/
dist/*.js
dist/*.map
@@ -9,3 +10,17 @@ dist/*.map
yarn-error.log
.npmrc
token
package-lock.json
dist/classTest.html
dist/sequenceTest.html
.vscode/
cypress/platform/current.html
cypress/platform/experimental.html
local/
_site
Gemfile.lock

3
.percy.yml Normal file
View File

@@ -0,0 +1,3 @@
version: 1
snapshot:
widths: [1280]

4
.prettierrc Normal file
View File

@@ -0,0 +1,4 @@
{
"printWidth": 100,
"singleQuote": true
}

22
.tern-project Normal file
View File

@@ -0,0 +1,22 @@
{
"ecmaVersion": 6,
"libs": [
"browser"
],
"loadEagerly": [
"path/to/your/js/**/*.js"
],
"dontLoad": [
"node_modules/**",
"path/to/your/js/**/*.js"
],
"plugins": {
"modules": {},
"es_modules": {},
"node": {},
"doc_comment": {
"fullDocs": true,
"strong": true
}
}
}

View File

@@ -1,8 +1,12 @@
dist: trusty
language: node_js
node_js:
- "8"
- "10"
cache:
npm: false
script:
- yarn build
- yarn test --coverage
- yarn e2e
after_success:
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls

View File

@@ -1,7 +0,0 @@
{
"typescript.format.enable": false,
"typescript.reportStyleChecksAsWarnings": false,
"typescript.validate.enable": false,
"javascript.validate.enable": false,
"editor.formatOnSave": false
}

126
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,126 @@
# Contributing
So you want to help? That's great!
![Image of happy people jumping with excitement](https://media.giphy.com/media/BlVnrxJgTGsUw/giphy.gif)
Here are a few things to know to get you started on the right path.
## Committing code
We make all changes via pull requests. As we have many pull requests from developers new to mermaid, the current approach is to have *knsv, Knut Sveidqvist* as a main reviewer of changes and merging pull requests. More precisely like this:
* Large changes reviewed by knsv or other developer asked to review by knsv
* Smaller low-risk changes like dependecies, documentation etc can be merged by active collaborators
* documentation (updates to the docs folder is also allowed via direct commits)
To commit code, create a branch, let it start with the type like feature or bug followed by the issue number for reference and some describing text.
One example:
`feature/945_state_diagrams`
Another:
`bug/123_nasty_bug_branch`
## Committing documentation
Less strict here, it is OK to commit directly in the `develop` branch if you are a collaborator.
The documentation is located in the `docs` directory and published using GitHub Pages.
The documentation site is powered by [Docsify](https://docsify.js.org), a simple documentation site generator.
The documentation is written in Markdown, for more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
If you want to preview the documentation site on your machine, you need to install `docsify-cli`:
```
$ npm i docsify-cli -g
````
If you are more familiar with Yarn, you can use the following command:
```
$ yarn global add docsify-cli
```
The above command will install `docsify-cli` globally.
If the installation is successful, the command `docsify` will be available in your `PATH`.
You can now run the following command to serve the documentation site:
```
$ docsify serve docs
```
Once the local HTTP server is listening, you can point your browser at http://localhost:3000.
## Branching
Going forward we will use a git flow inspired approach to branching. So development is done in develop, to do the development in the develop.
Once development is done we branch a release branch from develop for testing.
Once the release happens we merge the release branch to master and kill the release branch.
This means... **branch off your pull request from develop**
## Content of a pull request
A new feature has been born. Great! But without the steps below it might just ... fade away ...
### **Add unit tests for the parsing part**
This is important so that, if someone else does a change to the grammar that does not know about this great feature, gets notified early on when that change breaks the parser. Another important aspect is that without proper parsing tests refactoring is pretty much impossible.
### **Add e2e tests**
This tests the rendering and visual apearance of the diagram. This ensures that the rendering of that feature in the e2e will be reviewed in the release process going forward. Less chance that it breaks!
To start working with the e2e tests, run `yarn dev` to start the dev server, after that start cypress by running `cypress open` in the mermaid folder. (Make sure you have path to cypress in order, the binary is located in node_modules/.bin).
The rendering tests are very straightforward to create. There is a function imgSnapshotTest. This function takes a diagram in text form, the mermaid options and renders that diagram in cypress.
When running in ci it will take a snapshot of the rendered diagram and compare it with the snapshot from last build and flag for review it if it differs.
This is what a rendering test looks like:
```
it('should render forks and joins', () => {
imgSnapshotTest(
`
stateDiagram
state fork_state &lt;&lt;fork&gt;&gt;
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state &lt;&lt;join&gt;&gt;
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
`,
{ logLevel: 0 }
);
cy.get('svg');
});
```
### **Add documentation for it**
Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?
The docs are located in the docs folder and are ofc written in markdown. Just pick the right section and start typing. If you want to add to the structure as in adding a new section and new file you do that via the _navbar.md.
The changes in master is reflected in http://mermaid-js.github.io/mermaid/ once released the updates are commited to https://mermaid-js.github.io/#/
## Last words
Don't get daunted if it is hard in the beginning. We have a great community with only encouraging words. So if you get stuck, ask for help and hints in the slack forum. If you want to show off something good, show it off there.
[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
![Image of superhero wishing you good luck](https://media.giphy.com/media/l49JHz7kJvl6MCj3G/giphy.gif)

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014 - 2018 Knut Sveidqvist
Copyright (c) 2014 - 2020 Knut Sveidqvist
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

380
README.md
View File

@@ -1,93 +1,108 @@
[![Build Status](https://travis-ci.org/knsv/mermaid.svg?branch=master)](https://travis-ci.org/knsv/mermaid)
[![Coverage Status](https://coveralls.io/repos/github/knsv/mermaid/badge.svg?branch=master)](https://coveralls.io/github/knsv/mermaid?branch=master)
[![Join the chat at https://gitter.im/knsv/mermaid](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/knsv/mermaid?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# mermaid
## Special note regarding version 8.2
In version 8.2 a security improvement was introduced. A securityLevel configuration was introduced wich sets the level of trust to be used on the parsed diagrams.
* **true**: (default) tags in text are encoded, click functionality is disabled
* false: tags in text are allowed, click functionality is enabledClosed issues:
⚠️ **Note** : This changes the default behaviour of mermaid so that after upgrade to 8.2, if the securityLevel is not configured, tags in flowcharts are encoded as tags and clicking is prohibited.
If your application is taking resposibility for the diagram source security you can set the securityLevel accordingly. By doing this clicks and tags are again allowed.
```javascript
mermaidAPI.initialize({
securityLevel: 'loose'
});
```
**🖖 Keep a steady pulse: mermaid needs more Collaborators [#866](https://github.com/knsv/mermaid/issues/866)**
# mermaid [![Build Status](https://travis-ci.org/mermaid-js/mermaid.svg?branch=master)](https://travis-ci.org/mermaid-js/mermaid) [![NPM](https://img.shields.io/npm/v/mermaid)](https://www.npmjs.com/package/mermaid) [![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Mermaid/mermaid)
![banner](./img/header.png)
Generation of diagrams and flowcharts from text in a similar manner as markdown.
:trophy: **Mermaid was nominated and won the [JS Open Source Awards (2019)](https://osawards.com/javascript/2019) in the category "The most exciting use of technology"!!!**
Ever wanted to simplify documentation and avoid heavy tools like Visio when explaining your code?
**Thanks to all involved, people committing pull requests, people answering questions and special thanks to Tyler Long who is helping me maintain the project 🙏**
This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript.
## About
**Mermaid was nomiated and won the JS Open Source Awards (2019) in the catory The most existing use of technology!!! Thanks to all involved, people committing pull requests, people answering questions and special thanks to Tyler Long who is helping me maintain the project.**
<!-- <Main description> -->
Mermaid is a Javascript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
### Flowchart
> Doc-Rot is a Catch-22 that Mermaid helps to solve.
```
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
![Flowchart](./img/flow.png)
Diagramming and documentation costs precious developer time and gets outdated quickly.
But not having diagrams or docs ruins productivity and hurts organizational learning. <br/>
Mermaid addresses this problem by cutting the time, effort and tooling that is required to create modifiable diagrams and charts, for smarter and more reusable content.
The text definitions for Mermaid diagrams allows for it to be updated easily, it can also be made part of production scripts (and other pieces of code).
So less time needs be spent on documenting, as a separate and laborious task. <br/>
Even non-programmers can create diagrams through the [Mermaid Live Editor](https://github.com/mermaid-js/mermaid-live-editor).<br/>
[Tutorials](./docs/Tutorials.md) has video tutorials.
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/integrations.md).
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/n00b-overview.md) and [Usage](./docs/usage.md).
### Sequence diagram
🌐 [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)
```
<!-- </Main description> -->
## Examples
__The following are some examples of the diagrams, charts and graphs that can be made using Mermaid and the Markdown-inspired text specific to it. Click here jump into the [text syntax](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference).__
<table>
<!-- <Flowchart> -->
<tr><td colspan=2 align="center">
<b>Flow</b></br>
[<a href="http://mermaid-js.github.io/mermaid/#/flowchart">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
</td></tr>
<tr>
<td><pre>
graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
</pre></td>
<td align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-flow.png" />
</td>
</tr>
<!-- </Flowchart> -->
<!-- <Sequence> -->
<tr><td colspan=2 align="center">
<b>Sequence</b><br />
[<a href="http://mermaid-js.github.io/mermaid/#/sequenceDiagram">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
</td></tr>
<tr>
<td><pre>
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
![Sequence diagram](./img/sequence.png)
### Gantt diagram
```
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
</pre></td>
<td align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-sequence.png" />
</td>
</tr>
<!-- </Sequence> -->
<!-- <Gantt> -->
<tr><td colspan=2 align="center">
<b>Gantt</b><br />
[<a href="http://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
</td></tr>
<tr>
<td><pre>
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
```
![Gantt diagram](./img/gantt.png)
### Class diagram - :exclamation: experimental
```
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
</pre></td>
<td align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-gantt.png" />
</td>
</tr>
<!-- </Gantt> -->
<!-- <Class> -->
<tr><td colspan=2 align="center">
<b>Class</b><br />
[<a href="http://mermaid-js.github.io/mermaid/#/classDiagram">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
</td></tr>
<tr>
<td><pre>
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class01 &lt;|-- AveryLongClass : Cool
&lt;&lt;interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
@@ -96,132 +111,109 @@ Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
```
![Class diagram](./img/class.png)
### Git graph - :exclamation: experimental
```
gitGraph:
options
{
"nodeSpacing": 150,
"nodeRadius": 10
class Class10 {
&lt;&lt;service>>
int id
size()
}
end
commit
branch newbranch
checkout newbranch
commit
commit
checkout master
commit
commit
merge newbranch
</pre></td>
<td align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-class.png" />
</td>
</tr>
<!-- </Class> -->
<!-- <State> -->
<tr><td colspan=2 align="center">
<b>State</b><br />
[<a href="http://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtLXYyXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoid2hpdGUiLCJwcmltYXJ5Q29sb3IiOiIjRUNFQ0ZGIiwic2Vjb25kYXJ5Q29sb3IiOiIjZmZmZmRlIiwidGVydGlhcnlDb2xvciI6ImhzbCg4MCwgMTAwJSwgOTYuMjc0NTA5ODAzOSUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDI0MCwgNjAlLCA4Ni4yNzQ1MDk4MDM5JSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xvciI6ImhzbCg2MCwgNjAlLCA4My41Mjk0MTE3NjQ3JSkiLCJ0ZXJ0aWFyeUJvcmRlckNvbG9yIjoiaHNsKDgwLCA2MCUsIDg2LjI3NDUwOTgwMzklKSIsInByaW1hcnlUZXh0Q29sb3IiOiIjMTMxMzAwIiwic2Vjb25kYXJ5VGV4dENvbG9yIjoiIzAwMDAyMSIsInRlcnRpYXJ5VGV4dENvbG9yIjoicmdiKDkuNTAwMDAwMDAwMSwgOS41MDAwMDAwMDAxLCA5LjUwMDAwMDAwMDEpIiwibGluZUNvbG9yIjoiIzMzMzMzMyIsInRleHRDb2xvciI6IiMzMzMiLCJtYWluQmtnIjoiI0VDRUNGRiIsInNlY29uZEJrZyI6IiNmZmZmZGUiLCJib3JkZXIxIjoiIzkzNzBEQiIsImJvcmRlcjIiOiIjYWFhYTMzIiwiYXJyb3doZWFkQ29sb3IiOiIjMzMzMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwibGFiZWxCYWNrZ3JvdW5kIjoiI2U4ZThlOCIsIm5vZGVCa2ciOiIjRUNFQ0ZGIiwibm9kZUJvcmRlciI6IiM5MzcwREIiLCJjbHVzdGVyQmtnIjoiI2ZmZmZkZSIsImNsdXN0ZXJCb3JkZXIiOiIjYWFhYTMzIiwiZGVmYXVsdExpbmtDb2xvciI6IiMzMzMzMzMiLCJ0aXRsZUNvbG9yIjoiIzMzMyIsImVkZ2VMYWJlbEJhY2tncm91bmQiOiIjZThlOGU4IiwiYWN0b3JCb3JkZXIiOiJoc2woMjU5LjYyNjE2ODIyNDMsIDU5Ljc3NjUzNjMxMjglLCA4Ny45MDE5NjA3ODQzJSkiLCJhY3RvckJrZyI6IiNFQ0VDRkYiLCJhY3RvclRleHRDb2xvciI6ImJsYWNrIiwiYWN0b3JMaW5lQ29sb3IiOiJncmV5Iiwic2lnbmFsQ29sb3IiOiIjMzMzIiwic2lnbmFsVGV4dENvbG9yIjoiIzMzMyIsImxhYmVsQm94QmtnQ29sb3IiOiIjRUNFQ0ZGIiwibGFiZWxCb3hCb3JkZXJDb2xvciI6ImhzbCgyNTkuNjI2MTY4MjI0MywgNTkuNzc2NTM2MzEyOCUsIDg3LjkwMTk2MDc4NDMlKSIsImxhYmVsVGV4dENvbG9yIjoiYmxhY2siLCJsb29wVGV4dENvbG9yIjoiYmxhY2siLCJub3RlQm9yZGVyQ29sb3IiOiIjYWFhYTMzIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiJibGFjayIsImFjdGl2YXRpb25Cb3JkZXJDb2xvciI6IiM2NjYiLCJhY3RpdmF0aW9uQmtnQ29sb3IiOiIjZjRmNGY0Iiwic2VxdWVuY2VOdW1iZXJDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yIjoicmdiYSgxMDIsIDEwMiwgMjU1LCAwLjQ5KSIsImFsdFNlY3Rpb25Ca2dDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yMiI6IiNmZmY0MDAiLCJ0YXNrQm9yZGVyQ29sb3IiOiIjNTM0ZmJjIiwidGFza0JrZ0NvbG9yIjoiIzhhOTBkZCIsInRhc2tUZXh0TGlnaHRDb2xvciI6IndoaXRlIiwidGFza1RleHRDb2xvciI6IndoaXRlIiwidGFza1RleHREYXJrQ29sb3IiOiJibGFjayIsInRhc2tUZXh0T3V0c2lkZUNvbG9yIjoiYmxhY2siLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImFjdGl2ZVRhc2tCb3JkZXJDb2xvciI6IiM1MzRmYmMiLCJhY3RpdmVUYXNrQmtnQ29sb3IiOiIjYmZjN2ZmIiwiZ3JpZENvbG9yIjoibGlnaHRncmV5IiwiZG9uZVRhc2tCa2dDb2xvciI6ImxpZ2h0Z3JleSIsImRvbmVUYXNrQm9yZGVyQ29sb3IiOiJncmV5IiwiY3JpdEJvcmRlckNvbG9yIjoiI2ZmODg4OCIsImNyaXRCa2dDb2xvciI6InJlZCIsInRvZGF5TGluZUNvbG9yIjoicmVkIiwibGFiZWxDb2xvciI6ImJsYWNrIiwiZXJyb3JCa2dDb2xvciI6IiM1NTIyMjIiLCJlcnJvclRleHRDb2xvciI6IiM1NTIyMjIiLCJjbGFzc1RleHQiOiIjMTMxMzAwIiwiZmlsbFR5cGUwIjoiI0VDRUNGRiIsImZpbGxUeXBlMSI6IiNmZmZmZGUiLCJmaWxsVHlwZTIiOiJoc2woMzA0LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTMiOiJoc2woMTI0LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkiLCJmaWxsVHlwZTQiOiJoc2woMTc2LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTUiOiJoc2woLTQsIDEwMCUsIDkzLjUyOTQxMTc2NDclKSIsImZpbGxUeXBlNiI6ImhzbCg4LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTciOiJoc2woMTg4LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9">live editor</a>]
</td></tr>
<tr>
<td><pre>
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
</pre></td>
<td align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-state.png" />
</td>
</tr>
<!-- </State> -->
<!-- <Pie> -->
<tr><td colspan=2 align="center">
<b>Pie</b><br />
[<a href="http://mermaid-js.github.io/mermaid/#/pie">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
</td></tr>
<tr>
<td><pre>
pie
"Dogs" : 386
"Cats" : 85
"Rats" : 15
</pre></td>
<td align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-pie.png" />
</td>
</tr>
<!-- </Pie> -->
<!-- <Git> -->
<tr><td colspan=2 align="center">
<b>Git</b><br />
[experimental - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
</td></tr>
<tr>
<td colspan="2" align="center"><i>Coming soon!</i></td>
</tr>
<!-- </Git> -->
<!-- <Journey> -->
<tr><td colspan=2 align="center">
<b>User Journey</b><br />
[<a href="http://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
</td></tr>
<tr>
<td>
<pre>
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
</pre></td>
<td align="center">
<img alt="User Journey Diagram" src="img/gray-user-journey.png" />
</td>
</tr>
<!-- </Journey> -->
```
</table>
![Git graph](./img/git.png)
## Related projects
- [Command Line Interface](https://github.com/mermaid-js/mermaid-cli)
- [Live Editor](https://github.com/mermaid-js/mermaid-live-editor)
- [HTTP Server](https://github.com/TomWright/mermaid-server)
## Installation
## Contributors [![Help wanted](https://img.shields.io/github/labels/mermaid-js/mermaid/Help%20wanted!)](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Help+wanted%21%22) [![Contributors](https://img.shields.io/github/contributors/mermaid-js/mermaid)](https://github.com/mermaid-js/mermaid/graphs/contributors) [![Commits](https://img.shields.io/github/commit-activity/m/mermaid-js/mermaid)](https://github.com/mermaid-js/mermaid/graphs/contributors)
### CDN
Mermaid is a growing community and is always accepting new contributors. There's a lot of different ways to help out and we're always looking for extra hands! Look at [this issue](https://github.com/mermaid-js/mermaid/issues/866) if you want to know where to start helping out.
```
https://unpkg.com/mermaid@<version>/dist/
```
Detailed information about how to contribute can be found in the [contribution guide](CONTRIBUTING.md)
Replace `<version>` with expected version number.
## Appreciation
A quick note from Knut Sveidqvist:
>*Many thanks to the [d3](http://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!*
>*Thanks also to the [js-sequence-diagram](http://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.*
>*Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017.*
>
>*Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!*
Example: https://unpkg.com/mermaid@7.1.0/dist/
### Node.js
```
yarn add mermaid
```
## Documentation
https://mermaidjs.github.io
## Sibling projects
- [mermaid CLI](https://github.com/mermaidjs/mermaid.cli)
- [mermaid live editor](https://github.com/mermaidjs/mermaid-live-editor)
- [mermaid webpack demo](https://github.com/mermaidjs/mermaid-webpack-demo)
- [mermaid Parcel demo](https://github.com/mermaidjs/mermaid-parcel-demo)
# Request for assistance
Things are piling up and I have hard time keeping up. To remedy this
it would be great if we could form a core team of developers to cooperate
with the future development mermaid.
As part of this team you would get write access to the repository and would
represent the project when answering questions and issues.
Together we could continue the work with things like:
* adding more types of diagrams like mindmaps, ert diagrams etc
* improving existing diagrams
Don't hesitate to contact me if you want to get involved.
# For contributors
## Setup
yarn install
## Build
yarn build:watch
## Lint
yarn lint
We use [JavaScript Standard Style](https://github.com/feross/standard).
We recommend you installing [editor plugins](https://github.com/feross/standard#are-there-text-editor-plugins) so you can get real time lint result.
## Test
yarn test
Manual test in browser:
open dist/index.html
## Release
For those who have the permission to do so:
Update version number in `package.json`.
npm publish
Command above generates files into the `dist` folder and publishes them to npmjs.org.
# Credits
Many thanks to the [d3](http://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!
Thanks also to the [js-sequence-diagram](http://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.
---
*Mermaid was created by Knut Sveidqvist for easier documentation.*
*[Tyler Long](https://github.com/tylerlong) has became a collaborator since April 2017.*
Here is the full list of the projects [contributors](https://github.com/knsv/mermaid/graphs/contributors).

36
__mocks__/d3.js vendored
View File

@@ -1,17 +1,16 @@
/* eslint-env jest */
let NewD3 = function () {
function returnThis () {
return this
}
return {
append: function () {
return NewD3()
},
attr: function () {
return this
},
style: function () {
return this
},
text: function () {
return this
},
lower: returnThis,
attr: returnThis,
style: returnThis,
text: returnThis,
0: {
0: {
getBBox: function () {
@@ -36,3 +35,22 @@ export const selectAll = function () {
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 }
}
elem.append = (name) => {
const mockElem = MockD3(name, elem)
children.push(mockElem)
return mockElem
}
elem.lower = jest.fn(() => elem)
elem.attr = jest.fn(() => elem)
elem.text = jest.fn(() => elem)
elem.style = jest.fn(() => elem)
return elem
}

View File

@@ -3,9 +3,7 @@ module.exports = {
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
targets: "defaults, ie >= 11, current node"
}
]
]

1
cypress.json Normal file
View File

@@ -0,0 +1 @@
{ "video": false }

View File

@@ -0,0 +1,272 @@
/// <reference types="Cypress" />
context('Actions', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/actions')
})
// https://on.cypress.io/interacting-with-elements
it('.type() - type into a DOM element', () => {
// https://on.cypress.io/type
cy.get('.action-email')
.type('fake@email.com').should('have.value', 'fake@email.com')
// .type() with special character sequences
.type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
.type('{del}{selectall}{backspace}')
// .type() with key modifiers
.type('{alt}{option}') //these are equivalent
.type('{ctrl}{control}') //these are equivalent
.type('{meta}{command}{cmd}') //these are equivalent
.type('{shift}')
// Delay each keypress by 0.1 sec
.type('slow.typing@email.com', { delay: 100 })
.should('have.value', 'slow.typing@email.com')
cy.get('.action-disabled')
// Ignore error checking prior to type
// like whether the input is visible or disabled
.type('disabled error checking', { force: true })
.should('have.value', 'disabled error checking')
})
it('.focus() - focus on a DOM element', () => {
// https://on.cypress.io/focus
cy.get('.action-focus').focus()
.should('have.class', 'focus')
.prev().should('have.attr', 'style', 'color: orange;')
})
it('.blur() - blur off a DOM element', () => {
// https://on.cypress.io/blur
cy.get('.action-blur').type('About to blur').blur()
.should('have.class', 'error')
.prev().should('have.attr', 'style', 'color: red;')
})
it('.clear() - clears an input or textarea element', () => {
// https://on.cypress.io/clear
cy.get('.action-clear').type('Clear this text')
.should('have.value', 'Clear this text')
.clear()
.should('have.value', '')
})
it('.submit() - submit a form', () => {
// https://on.cypress.io/submit
cy.get('.action-form')
.find('[type="text"]').type('HALFOFF')
cy.get('.action-form').submit()
.next().should('contain', 'Your form has been submitted!')
})
it('.click() - click on a DOM element', () => {
// https://on.cypress.io/click
cy.get('.action-btn').click()
// You can click on 9 specific positions of an element:
// -----------------------------------
// | topLeft top topRight |
// | |
// | |
// | |
// | left center right |
// | |
// | |
// | |
// | bottomLeft bottom bottomRight |
// -----------------------------------
// clicking in the center of the element is the default
cy.get('#action-canvas').click()
cy.get('#action-canvas').click('topLeft')
cy.get('#action-canvas').click('top')
cy.get('#action-canvas').click('topRight')
cy.get('#action-canvas').click('left')
cy.get('#action-canvas').click('right')
cy.get('#action-canvas').click('bottomLeft')
cy.get('#action-canvas').click('bottom')
cy.get('#action-canvas').click('bottomRight')
// .click() accepts an x and y coordinate
// that controls where the click occurs :)
cy.get('#action-canvas')
.click(80, 75) // click 80px on x coord and 75px on y coord
.click(170, 75)
.click(80, 165)
.click(100, 185)
.click(125, 190)
.click(150, 185)
.click(170, 165)
// click multiple elements by passing multiple: true
cy.get('.action-labels>.label').click({ multiple: true })
// Ignore error checking prior to clicking
cy.get('.action-opacity>.btn').click({ force: true })
})
it('.dblclick() - double click on a DOM element', () => {
// https://on.cypress.io/dblclick
// Our app has a listener on 'dblclick' event in our 'scripts.js'
// that hides the div and shows an input on double click
cy.get('.action-div').dblclick().should('not.be.visible')
cy.get('.action-input-hidden').should('be.visible')
})
it('.check() - check a checkbox or radio element', () => {
// https://on.cypress.io/check
// By default, .check() will check all
// matching checkbox or radio elements in succession, one after another
cy.get('.action-checkboxes [type="checkbox"]').not('[disabled]')
.check().should('be.checked')
cy.get('.action-radios [type="radio"]').not('[disabled]')
.check().should('be.checked')
// .check() accepts a value argument
cy.get('.action-radios [type="radio"]')
.check('radio1').should('be.checked')
// .check() accepts an array of values
cy.get('.action-multiple-checkboxes [type="checkbox"]')
.check(['checkbox1', 'checkbox2']).should('be.checked')
// Ignore error checking prior to checking
cy.get('.action-checkboxes [disabled]')
.check({ force: true }).should('be.checked')
cy.get('.action-radios [type="radio"]')
.check('radio3', { force: true }).should('be.checked')
})
it('.uncheck() - uncheck a checkbox element', () => {
// https://on.cypress.io/uncheck
// By default, .uncheck() will uncheck all matching
// checkbox elements in succession, one after another
cy.get('.action-check [type="checkbox"]')
.not('[disabled]')
.uncheck().should('not.be.checked')
// .uncheck() accepts a value argument
cy.get('.action-check [type="checkbox"]')
.check('checkbox1')
.uncheck('checkbox1').should('not.be.checked')
// .uncheck() accepts an array of values
cy.get('.action-check [type="checkbox"]')
.check(['checkbox1', 'checkbox3'])
.uncheck(['checkbox1', 'checkbox3']).should('not.be.checked')
// Ignore error checking prior to unchecking
cy.get('.action-check [disabled]')
.uncheck({ force: true }).should('not.be.checked')
})
it('.select() - select an option in a <select> element', () => {
// https://on.cypress.io/select
// Select option(s) with matching text content
cy.get('.action-select').select('apples')
cy.get('.action-select-multiple')
.select(['apples', 'oranges', 'bananas'])
// Select option(s) with matching value
cy.get('.action-select').select('fr-bananas')
cy.get('.action-select-multiple')
.select(['fr-apples', 'fr-oranges', 'fr-bananas'])
})
it('.scrollIntoView() - scroll an element into view', () => {
// https://on.cypress.io/scrollintoview
// normally all of these buttons are hidden,
// because they're not within
// the viewable area of their parent
// (we need to scroll to see them)
cy.get('#scroll-horizontal button')
.should('not.be.visible')
// scroll the button into view, as if the user had scrolled
cy.get('#scroll-horizontal button').scrollIntoView()
.should('be.visible')
cy.get('#scroll-vertical button')
.should('not.be.visible')
// Cypress handles the scroll direction needed
cy.get('#scroll-vertical button').scrollIntoView()
.should('be.visible')
cy.get('#scroll-both button')
.should('not.be.visible')
// Cypress knows to scroll to the right and down
cy.get('#scroll-both button').scrollIntoView()
.should('be.visible')
})
it('.trigger() - trigger an event on a DOM element', () => {
// https://on.cypress.io/trigger
// To interact with a range input (slider)
// we need to set its value & trigger the
// event to signal it changed
// Here, we invoke jQuery's val() method to set
// the value and trigger the 'change' event
cy.get('.trigger-input-range')
.invoke('val', 25)
.trigger('change')
.get('input[type=range]').siblings('p')
.should('have.text', '25')
})
it('cy.scrollTo() - scroll the window or element to a position', () => {
// https://on.cypress.io/scrollTo
// You can scroll to 9 specific positions of an element:
// -----------------------------------
// | topLeft top topRight |
// | |
// | |
// | |
// | left center right |
// | |
// | |
// | |
// | bottomLeft bottom bottomRight |
// -----------------------------------
// if you chain .scrollTo() off of cy, we will
// scroll the entire window
cy.scrollTo('bottom')
cy.get('#scrollable-horizontal').scrollTo('right')
// or you can scroll to a specific coordinate:
// (x axis, y axis) in pixels
cy.get('#scrollable-vertical').scrollTo(250, 250)
// or you can scroll to a specific percentage
// of the (width, height) of the element
cy.get('#scrollable-both').scrollTo('75%', '25%')
// control the easing of the scroll (default is 'swing')
cy.get('#scrollable-vertical').scrollTo('center', { easing: 'linear' })
// control the duration of the scroll (in ms)
cy.get('#scrollable-both').scrollTo('center', { duration: 2000 })
})
})

View File

@@ -0,0 +1,42 @@
/// <reference types="Cypress" />
context('Aliasing', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/aliasing')
})
it('.as() - alias a DOM element for later use', () => {
// https://on.cypress.io/as
// Alias a DOM element for use later
// We don't have to traverse to the element
// later in our code, we reference it with @
cy.get('.as-table').find('tbody>tr')
.first().find('td').first()
.find('button').as('firstBtn')
// when we reference the alias, we place an
// @ in front of its name
cy.get('@firstBtn').click()
cy.get('@firstBtn')
.should('have.class', 'btn-success')
.and('contain', 'Changed')
})
it('.as() - alias a route for later use', () => {
// Alias the route to wait for its response
cy.server()
cy.route('GET', 'comments/*').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.network-btn').click()
// https://on.cypress.io/wait
cy.wait('@getComment').its('status').should('eq', 200)
})
})

View File

@@ -0,0 +1,168 @@
/// <reference types="Cypress" />
context('Assertions', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/assertions')
})
describe('Implicit Assertions', () => {
it('.should() - make an assertion about the current subject', () => {
// https://on.cypress.io/should
cy.get('.assertion-table')
.find('tbody tr:last')
.should('have.class', 'success')
.find('td')
.first()
// checking the text of the <td> element in various ways
.should('have.text', 'Column content')
.should('contain', 'Column content')
.should('have.html', 'Column content')
// chai-jquery uses "is()" to check if element matches selector
.should('match', 'td')
// to match text content against a regular expression
// first need to invoke jQuery method text()
// and then match using regular expression
.invoke('text')
.should('match', /column content/i)
// a better way to check element's text content against a regular expression
// is to use "cy.contains"
// https://on.cypress.io/contains
cy.get('.assertion-table')
.find('tbody tr:last')
// finds first <td> element with text content matching regular expression
.contains('td', /column content/i)
.should('be.visible')
// for more information about asserting element's text
// see https://on.cypress.io/using-cypress-faq#How-do-I-get-an-elements-text-contents
})
it('.and() - chain multiple assertions together', () => {
// https://on.cypress.io/and
cy.get('.assertions-link')
.should('have.class', 'active')
.and('have.attr', 'href')
.and('include', 'cypress.io')
})
})
describe('Explicit Assertions', () => {
// https://on.cypress.io/assertions
it('expect - make an assertion about a specified subject', () => {
// We can use Chai's BDD style assertions
expect(true).to.be.true
const o = { foo: 'bar' }
expect(o).to.equal(o)
expect(o).to.deep.equal({ foo: 'bar' })
// matching text using regular expression
expect('FooBar').to.match(/bar$/i)
})
it('pass your own callback function to should()', () => {
// Pass a function to should that can have any number
// of explicit assertions within it.
// The ".should(cb)" function will be retried
// automatically until it passes all your explicit assertions or times out.
cy.get('.assertions-p')
.find('p')
.should(($p) => {
// https://on.cypress.io/$
// return an array of texts from all of the p's
// @ts-ignore TS6133 unused variable
const texts = $p.map((i, el) => Cypress.$(el).text())
// jquery map returns jquery object
// and .get() convert this to simple array
const paragraphs = texts.get()
// array should have length of 3
expect(paragraphs, 'has 3 paragraphs').to.have.length(3)
// use second argument to expect(...) to provide clear
// message with each assertion
expect(paragraphs, 'has expected text in each paragraph').to.deep.eq([
'Some text from first p',
'More text from second p',
'And even more text from third p',
])
})
})
it('finds element by class name regex', () => {
cy.get('.docs-header')
.find('div')
// .should(cb) callback function will be retried
.should(($div) => {
expect($div).to.have.length(1)
const className = $div[0].className
expect(className).to.match(/heading-/)
})
// .then(cb) callback is not retried,
// it either passes or fails
.then(($div) => {
expect($div, 'text content').to.have.text('Introduction')
})
})
it('can throw any error', () => {
cy.get('.docs-header')
.find('div')
.should(($div) => {
if ($div.length !== 1) {
// you can throw your own errors
throw new Error('Did not find 1 element')
}
const className = $div[0].className
if (!className.match(/heading-/)) {
throw new Error(`Could not find class "heading-" in ${className}`)
}
})
})
it('matches unknown text between two elements', () => {
/**
* Text from the first element.
* @type {string}
*/
let text
/**
* Normalizes passed text,
* useful before comparing text with spaces and different capitalization.
* @param {string} s Text to normalize
*/
const normalizeText = (s) => s.replace(/\s/g, '').toLowerCase()
cy.get('.two-elements')
.find('.first')
.then(($first) => {
// save text from the first element
text = normalizeText($first.text())
})
cy.get('.two-elements')
.find('.second')
.should(($div) => {
// we can massage text before comparing
const secondText = normalizeText($div.text())
expect(secondText, 'second text').to.equal(text)
})
})
it('assert - assert shape of an object', () => {
const person = {
name: 'Joe',
age: 20,
}
assert.isObject(person, 'value is object')
})
})
})

View File

@@ -0,0 +1,56 @@
/// <reference types="Cypress" />
context('Connectors', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/connectors')
})
it('.each() - iterate over an array of elements', () => {
// https://on.cypress.io/each
cy.get('.connectors-each-ul>li')
.each(($el, index, $list) => {
console.log($el, index, $list)
})
})
it('.its() - get properties on the current subject', () => {
// https://on.cypress.io/its
cy.get('.connectors-its-ul>li')
// calls the 'length' property yielding that value
.its('length')
.should('be.gt', 2)
})
it('.invoke() - invoke a function on the current subject', () => {
// our div is hidden in our script.js
// $('.connectors-div').hide()
// https://on.cypress.io/invoke
cy.get('.connectors-div').should('be.hidden')
// call the jquery method 'show' on the 'div.container'
.invoke('show')
.should('be.visible')
})
it('.spread() - spread an array as individual args to callback function', () => {
// https://on.cypress.io/spread
const arr = ['foo', 'bar', 'baz']
cy.wrap(arr).spread((foo, bar, baz) => {
expect(foo).to.eq('foo')
expect(bar).to.eq('bar')
expect(baz).to.eq('baz')
})
})
it('.then() - invoke a callback function with the current subject', () => {
// https://on.cypress.io/then
cy.get('.connectors-list > li')
.then(($lis) => {
expect($lis, '3 items').to.have.length(3)
expect($lis.eq(0), 'first item').to.contain('Walk the dog')
expect($lis.eq(1), 'second item').to.contain('Feed the cat')
expect($lis.eq(2), 'third item').to.contain('Write JavaScript')
})
})
})

View File

@@ -0,0 +1,78 @@
/// <reference types="Cypress" />
context('Cookies', () => {
beforeEach(() => {
Cypress.Cookies.debug(true)
cy.visit('https://example.cypress.io/commands/cookies')
// clear cookies again after visiting to remove
// any 3rd party cookies picked up such as cloudflare
cy.clearCookies()
})
it('cy.getCookie() - get a browser cookie', () => {
// https://on.cypress.io/getcookie
cy.get('#getCookie .set-a-cookie').click()
// cy.getCookie() yields a cookie object
cy.getCookie('token').should('have.property', 'value', '123ABC')
})
it('cy.getCookies() - get browser cookies', () => {
// https://on.cypress.io/getcookies
cy.getCookies().should('be.empty')
cy.get('#getCookies .set-a-cookie').click()
// cy.getCookies() yields an array of cookies
cy.getCookies().should('have.length', 1).should((cookies) => {
// each cookie has these properties
expect(cookies[0]).to.have.property('name', 'token')
expect(cookies[0]).to.have.property('value', '123ABC')
expect(cookies[0]).to.have.property('httpOnly', false)
expect(cookies[0]).to.have.property('secure', false)
expect(cookies[0]).to.have.property('domain')
expect(cookies[0]).to.have.property('path')
})
})
it('cy.setCookie() - set a browser cookie', () => {
// https://on.cypress.io/setcookie
cy.getCookies().should('be.empty')
cy.setCookie('foo', 'bar')
// cy.getCookie() yields a cookie object
cy.getCookie('foo').should('have.property', 'value', 'bar')
})
it('cy.clearCookie() - clear a browser cookie', () => {
// https://on.cypress.io/clearcookie
cy.getCookie('token').should('be.null')
cy.get('#clearCookie .set-a-cookie').click()
cy.getCookie('token').should('have.property', 'value', '123ABC')
// cy.clearCookies() yields null
cy.clearCookie('token').should('be.null')
cy.getCookie('token').should('be.null')
})
it('cy.clearCookies() - clear browser cookies', () => {
// https://on.cypress.io/clearcookies
cy.getCookies().should('be.empty')
cy.get('#clearCookies .set-a-cookie').click()
cy.getCookies().should('have.length', 1)
// cy.clearCookies() yields null
cy.clearCookies()
cy.getCookies().should('be.empty')
})
})

View File

@@ -0,0 +1,222 @@
/// <reference types="Cypress" />
context('Cypress.Commands', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// https://on.cypress.io/custom-commands
it('.add() - create a custom command', () => {
Cypress.Commands.add('console', {
prevSubject: true,
}, (subject, method) => {
// the previous subject is automatically received
// and the commands arguments are shifted
// allow us to change the console method used
method = method || 'log'
// log the subject to the console
// @ts-ignore TS7017
console[method]('The subject is', subject)
// whatever we return becomes the new subject
// we don't want to change the subject so
// we return whatever was passed in
return subject
})
// @ts-ignore TS2339
cy.get('button').console('info').then(($button) => {
// subject is still $button
})
})
})
context('Cypress.Cookies', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// https://on.cypress.io/cookies
it('.debug() - enable or disable debugging', () => {
Cypress.Cookies.debug(true)
// Cypress will now log in the console when
// cookies are set or cleared
cy.setCookie('fakeCookie', '123ABC')
cy.clearCookie('fakeCookie')
cy.setCookie('fakeCookie', '123ABC')
cy.clearCookie('fakeCookie')
cy.setCookie('fakeCookie', '123ABC')
})
it('.preserveOnce() - preserve cookies by key', () => {
// normally cookies are reset after each test
cy.getCookie('fakeCookie').should('not.be.ok')
// preserving a cookie will not clear it when
// the next test starts
cy.setCookie('lastCookie', '789XYZ')
Cypress.Cookies.preserveOnce('lastCookie')
})
it('.defaults() - set defaults for all cookies', () => {
// now any cookie with the name 'session_id' will
// not be cleared before each new test runs
Cypress.Cookies.defaults({
whitelist: 'session_id',
})
})
})
context('Cypress.Server', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// Permanently override server options for
// all instances of cy.server()
// https://on.cypress.io/cypress-server
it('.defaults() - change default config of server', () => {
Cypress.Server.defaults({
delay: 0,
force404: false,
})
})
})
context('Cypress.arch', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get CPU architecture name of underlying OS', () => {
// https://on.cypress.io/arch
expect(Cypress.arch).to.exist
})
})
context('Cypress.config()', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get and set configuration options', () => {
// https://on.cypress.io/config
let myConfig = Cypress.config()
expect(myConfig).to.have.property('animationDistanceThreshold', 5)
expect(myConfig).to.have.property('baseUrl', null)
expect(myConfig).to.have.property('defaultCommandTimeout', 4000)
expect(myConfig).to.have.property('requestTimeout', 5000)
expect(myConfig).to.have.property('responseTimeout', 30000)
expect(myConfig).to.have.property('viewportHeight', 660)
expect(myConfig).to.have.property('viewportWidth', 1000)
expect(myConfig).to.have.property('pageLoadTimeout', 60000)
expect(myConfig).to.have.property('waitForAnimations', true)
expect(Cypress.config('pageLoadTimeout')).to.eq(60000)
// this will change the config for the rest of your tests!
Cypress.config('pageLoadTimeout', 20000)
expect(Cypress.config('pageLoadTimeout')).to.eq(20000)
Cypress.config('pageLoadTimeout', 60000)
})
})
context('Cypress.dom', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// https://on.cypress.io/dom
it('.isHidden() - determine if a DOM element is hidden', () => {
let hiddenP = Cypress.$('.dom-p p.hidden').get(0)
let visibleP = Cypress.$('.dom-p p.visible').get(0)
// our first paragraph has css class 'hidden'
expect(Cypress.dom.isHidden(hiddenP)).to.be.true
expect(Cypress.dom.isHidden(visibleP)).to.be.false
})
})
context('Cypress.env()', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// We can set environment variables for highly dynamic values
// https://on.cypress.io/environment-variables
it('Get environment variables', () => {
// https://on.cypress.io/env
// set multiple environment variables
Cypress.env({
host: 'veronica.dev.local',
api_server: 'http://localhost:8888/v1/',
})
// get environment variable
expect(Cypress.env('host')).to.eq('veronica.dev.local')
// set environment variable
Cypress.env('api_server', 'http://localhost:8888/v2/')
expect(Cypress.env('api_server')).to.eq('http://localhost:8888/v2/')
// get all environment variable
expect(Cypress.env()).to.have.property('host', 'veronica.dev.local')
expect(Cypress.env()).to.have.property('api_server', 'http://localhost:8888/v2/')
})
})
context('Cypress.log', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Control what is printed to the Command Log', () => {
// https://on.cypress.io/cypress-log
})
})
context('Cypress.platform', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get underlying OS name', () => {
// https://on.cypress.io/platform
expect(Cypress.platform).to.be.exist
})
})
context('Cypress.version', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get current version of Cypress being run', () => {
// https://on.cypress.io/version
expect(Cypress.version).to.be.exist
})
})
context('Cypress.spec', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get current spec information', () => {
// https://on.cypress.io/spec
// wrap the object so we can inspect it easily by clicking in the command log
cy.wrap(Cypress.spec).should('have.keys', ['name', 'relative', 'absolute'])
})
})

View File

@@ -0,0 +1,114 @@
/// <reference types="Cypress" />
/// JSON fixture file can be loaded directly using
// the built-in JavaScript bundler
// @ts-ignore
const requiredExample = require('../../fixtures/example')
context('Files', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/files')
})
beforeEach(() => {
// load example.json fixture file and store
// in the test context object
cy.fixture('example.json').as('example')
})
it('cy.fixture() - load a fixture', () => {
// https://on.cypress.io/fixture
// Instead of writing a response inline you can
// use a fixture file's content.
cy.server()
cy.fixture('example.json').as('comment')
// when application makes an Ajax request matching "GET comments/*"
// Cypress will intercept it and reply with object
// from the "comment" alias
cy.route('GET', 'comments/*', '@comment').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.fixture-btn').click()
cy.wait('@getComment').its('responseBody')
.should('have.property', 'name')
.and('include', 'Using fixtures to represent data')
// you can also just write the fixture in the route
cy.route('GET', 'comments/*', 'fixture:example.json').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.fixture-btn').click()
cy.wait('@getComment').its('responseBody')
.should('have.property', 'name')
.and('include', 'Using fixtures to represent data')
// or write fx to represent fixture
// by default it assumes it's .json
cy.route('GET', 'comments/*', 'fx:example').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.fixture-btn').click()
cy.wait('@getComment').its('responseBody')
.should('have.property', 'name')
.and('include', 'Using fixtures to represent data')
})
it('cy.fixture() or require - load a fixture', function () {
// we are inside the "function () { ... }"
// callback and can use test context object "this"
// "this.example" was loaded in "beforeEach" function callback
expect(this.example, 'fixture in the test context')
.to.deep.equal(requiredExample)
// or use "cy.wrap" and "should('deep.equal', ...)" assertion
// @ts-ignore
cy.wrap(this.example, 'fixture vs require')
.should('deep.equal', requiredExample)
})
it('cy.readFile() - read a files contents', () => {
// https://on.cypress.io/readfile
// You can read a file and yield its contents
// The filePath is relative to your project's root.
cy.readFile('cypress.json').then((json) => {
expect(json).to.be.an('object')
})
})
it('cy.writeFile() - write to a file', () => {
// https://on.cypress.io/writefile
// You can write to a file
// Use a response from a request to automatically
// generate a fixture file for use later
cy.request('https://jsonplaceholder.cypress.io/users')
.then((response) => {
cy.writeFile('cypress/fixtures/users.json', response.body)
})
cy.fixture('users').should((users) => {
expect(users[0].name).to.exist
})
// JavaScript arrays and objects are stringified
// and formatted into text.
cy.writeFile('cypress/fixtures/profile.json', {
id: 8739,
name: 'Jane',
email: 'jane@example.com',
})
cy.fixture('profile').should((profile) => {
expect(profile.name).to.eq('Jane')
})
})
})

View File

@@ -0,0 +1,52 @@
/// <reference types="Cypress" />
context('Local Storage', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/local-storage')
})
// Although local storage is automatically cleared
// in between tests to maintain a clean state
// sometimes we need to clear the local storage manually
it('cy.clearLocalStorage() - clear all data in local storage', () => {
// https://on.cypress.io/clearlocalstorage
cy.get('.ls-btn').click().should(() => {
expect(localStorage.getItem('prop1')).to.eq('red')
expect(localStorage.getItem('prop2')).to.eq('blue')
expect(localStorage.getItem('prop3')).to.eq('magenta')
})
// clearLocalStorage() yields the localStorage object
cy.clearLocalStorage().should((ls) => {
expect(ls.getItem('prop1')).to.be.null
expect(ls.getItem('prop2')).to.be.null
expect(ls.getItem('prop3')).to.be.null
})
// Clear key matching string in Local Storage
cy.get('.ls-btn').click().should(() => {
expect(localStorage.getItem('prop1')).to.eq('red')
expect(localStorage.getItem('prop2')).to.eq('blue')
expect(localStorage.getItem('prop3')).to.eq('magenta')
})
cy.clearLocalStorage('prop1').should((ls) => {
expect(ls.getItem('prop1')).to.be.null
expect(ls.getItem('prop2')).to.eq('blue')
expect(ls.getItem('prop3')).to.eq('magenta')
})
// Clear keys matching regex in Local Storage
cy.get('.ls-btn').click().should(() => {
expect(localStorage.getItem('prop1')).to.eq('red')
expect(localStorage.getItem('prop2')).to.eq('blue')
expect(localStorage.getItem('prop3')).to.eq('magenta')
})
cy.clearLocalStorage(/prop1|2/).should((ls) => {
expect(ls.getItem('prop1')).to.be.null
expect(ls.getItem('prop2')).to.be.null
expect(ls.getItem('prop3')).to.eq('magenta')
})
})
})

View File

@@ -0,0 +1,32 @@
/// <reference types="Cypress" />
context('Location', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/location')
})
it('cy.hash() - get the current URL hash', () => {
// https://on.cypress.io/hash
cy.hash().should('be.empty')
})
it('cy.location() - get window.location', () => {
// https://on.cypress.io/location
cy.location().should((location) => {
expect(location.hash).to.be.empty
expect(location.href).to.eq('https://example.cypress.io/commands/location')
expect(location.host).to.eq('example.cypress.io')
expect(location.hostname).to.eq('example.cypress.io')
expect(location.origin).to.eq('https://example.cypress.io')
expect(location.pathname).to.eq('/commands/location')
expect(location.port).to.eq('')
expect(location.protocol).to.eq('https:')
expect(location.search).to.be.empty
})
})
it('cy.url() - get the current URL', () => {
// https://on.cypress.io/url
cy.url().should('eq', 'https://example.cypress.io/commands/location')
})
})

View File

@@ -0,0 +1,83 @@
/// <reference types="Cypress" />
context('Misc', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/misc')
})
it('.end() - end the command chain', () => {
// https://on.cypress.io/end
// cy.end is useful when you want to end a chain of commands
// and force Cypress to re-query from the root element
cy.get('.misc-table').within(() => {
// ends the current chain and yields null
cy.contains('Cheryl').click().end()
// queries the entire table again
cy.contains('Charles').click()
})
})
it('cy.exec() - execute a system command', () => {
// https://on.cypress.io/exec
// execute a system command.
// so you can take actions necessary for
// your test outside the scope of Cypress.
cy.exec('echo Jane Lane')
.its('stdout').should('contain', 'Jane Lane')
// we can use Cypress.platform string to
// select appropriate command
// https://on.cypress/io/platform
cy.log(`Platform ${Cypress.platform} architecture ${Cypress.arch}`)
if (Cypress.platform === 'win32') {
cy.exec('print cypress.json')
.its('stderr').should('be.empty')
} else {
cy.exec('cat cypress.json')
.its('stderr').should('be.empty')
cy.exec('pwd')
.its('code').should('eq', 0)
}
})
it('cy.focused() - get the DOM element that has focus', () => {
// https://on.cypress.io/focused
cy.get('.misc-form').find('#name').click()
cy.focused().should('have.id', 'name')
cy.get('.misc-form').find('#description').click()
cy.focused().should('have.id', 'description')
})
context('Cypress.Screenshot', function () {
it('cy.screenshot() - take a screenshot', () => {
// https://on.cypress.io/screenshot
cy.screenshot('my-image')
})
it('Cypress.Screenshot.defaults() - change default config of screenshots', function () {
Cypress.Screenshot.defaults({
blackout: ['.foo'],
capture: 'viewport',
clip: { x: 0, y: 0, width: 200, height: 200 },
scale: false,
disableTimersAndAnimations: true,
screenshotOnRunFailure: true,
beforeScreenshot () { },
afterScreenshot () { },
})
})
})
it('cy.wrap() - wrap an object', () => {
// https://on.cypress.io/wrap
cy.wrap({ foo: 'bar' })
.should('have.property', 'foo')
.and('include', 'bar')
})
})

View File

@@ -0,0 +1,56 @@
/// <reference types="Cypress" />
context('Navigation', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io')
cy.get('.navbar-nav').contains('Commands').click()
cy.get('.dropdown-menu').contains('Navigation').click()
})
it('cy.go() - go back or forward in the browser\'s history', () => {
// https://on.cypress.io/go
cy.location('pathname').should('include', 'navigation')
cy.go('back')
cy.location('pathname').should('not.include', 'navigation')
cy.go('forward')
cy.location('pathname').should('include', 'navigation')
// clicking back
cy.go(-1)
cy.location('pathname').should('not.include', 'navigation')
// clicking forward
cy.go(1)
cy.location('pathname').should('include', 'navigation')
})
it('cy.reload() - reload the page', () => {
// https://on.cypress.io/reload
cy.reload()
// reload the page without using the cache
cy.reload(true)
})
it('cy.visit() - visit a remote url', () => {
// https://on.cypress.io/visit
// Visit any sub-domain of your current domain
// Pass options to the visit
cy.visit('https://example.cypress.io/commands/navigation', {
timeout: 50000, // increase total time for the visit to resolve
onBeforeLoad (contentWindow) {
// contentWindow is the remote page's window object
expect(typeof contentWindow === 'object').to.be.true
},
onLoad (contentWindow) {
// contentWindow is the remote page's window object
expect(typeof contentWindow === 'object').to.be.true
},
})
})
})

View File

@@ -0,0 +1,194 @@
/// <reference types="Cypress" />
context('Network Requests', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/network-requests')
})
// Manage AJAX / XHR requests in your app
it('cy.server() - control behavior of network requests and responses', () => {
// https://on.cypress.io/server
cy.server().should((server) => {
// the default options on server
// you can override any of these options
expect(server.delay).to.eq(0)
expect(server.method).to.eq('GET')
expect(server.status).to.eq(200)
expect(server.headers).to.be.null
expect(server.response).to.be.null
expect(server.onRequest).to.be.undefined
expect(server.onResponse).to.be.undefined
expect(server.onAbort).to.be.undefined
// These options control the server behavior
// affecting all requests
// pass false to disable existing route stubs
expect(server.enable).to.be.true
// forces requests that don't match your routes to 404
expect(server.force404).to.be.false
// whitelists requests from ever being logged or stubbed
expect(server.whitelist).to.be.a('function')
})
cy.server({
method: 'POST',
delay: 1000,
status: 422,
response: {},
})
// any route commands will now inherit the above options
// from the server. anything we pass specifically
// to route will override the defaults though.
})
it('cy.request() - make an XHR request', () => {
// https://on.cypress.io/request
cy.request('https://jsonplaceholder.cypress.io/comments')
.should((response) => {
expect(response.status).to.eq(200)
expect(response.body).to.have.length(500)
expect(response).to.have.property('headers')
expect(response).to.have.property('duration')
})
})
it('cy.request() - verify response using BDD syntax', () => {
cy.request('https://jsonplaceholder.cypress.io/comments')
.then((response) => {
// https://on.cypress.io/assertions
expect(response).property('status').to.equal(200)
expect(response).property('body').to.have.length(500)
expect(response).to.include.keys('headers', 'duration')
})
})
it('cy.request() with query parameters', () => {
// will execute request
// https://jsonplaceholder.cypress.io/comments?postId=1&id=3
cy.request({
url: 'https://jsonplaceholder.cypress.io/comments',
qs: {
postId: 1,
id: 3,
},
})
.its('body')
.should('be.an', 'array')
.and('have.length', 1)
.its('0') // yields first element of the array
.should('contain', {
postId: 1,
id: 3,
})
})
it('cy.request() - pass result to the second request', () => {
// first, let's find out the userId of the first user we have
cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
.its('body.0') // yields the first element of the returned list
.then((user) => {
expect(user).property('id').to.be.a('number')
// make a new post on behalf of the user
cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
userId: user.id,
title: 'Cypress Test Runner',
body: 'Fast, easy and reliable testing for anything that runs in a browser.',
})
})
// note that the value here is the returned value of the 2nd request
// which is the new post object
.then((response) => {
expect(response).property('status').to.equal(201) // new entity created
expect(response).property('body').to.contain({
id: 101, // there are already 100 posts, so new entity gets id 101
title: 'Cypress Test Runner',
})
// we don't know the user id here - since it was in above closure
// so in this test just confirm that the property is there
expect(response.body).property('userId').to.be.a('number')
})
})
it('cy.request() - save response in the shared test context', () => {
// https://on.cypress.io/variables-and-aliases
cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
.its('body.0') // yields the first element of the returned list
.as('user') // saves the object in the test context
.then(function () {
// NOTE 👀
// By the time this callback runs the "as('user')" command
// has saved the user object in the test context.
// To access the test context we need to use
// the "function () { ... }" callback form,
// otherwise "this" points at a wrong or undefined object!
cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
userId: this.user.id,
title: 'Cypress Test Runner',
body: 'Fast, easy and reliable testing for anything that runs in a browser.',
})
.its('body').as('post') // save the new post from the response
})
.then(function () {
// When this callback runs, both "cy.request" API commands have finished
// and the test context has "user" and "post" objects set.
// Let's verify them.
expect(this.post, 'post has the right user id').property('userId').to.equal(this.user.id)
})
})
it('cy.route() - route responses to matching requests', () => {
// https://on.cypress.io/route
let message = 'whoa, this comment does not exist'
cy.server()
// Listen to GET to comments/1
cy.route('GET', 'comments/*').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.network-btn').click()
// https://on.cypress.io/wait
cy.wait('@getComment').its('status').should('eq', 200)
// Listen to POST to comments
cy.route('POST', '/comments').as('postComment')
// we have code that posts a comment when
// the button is clicked in scripts.js
cy.get('.network-post').click()
cy.wait('@postComment')
// get the route
cy.get('@postComment').should((xhr) => {
expect(xhr.requestBody).to.include('email')
expect(xhr.requestHeaders).to.have.property('Content-Type')
expect(xhr.responseBody).to.have.property('name', 'Using POST in cy.route()')
})
// Stub a response to PUT comments/ ****
cy.route({
method: 'PUT',
url: 'comments/*',
status: 404,
response: { error: message },
delay: 500,
}).as('putComment')
// we have code that puts a comment when
// the button is clicked in scripts.js
cy.get('.network-put').click()
cy.wait('@putComment')
// our 404 statusCode logic in scripts.js executed
cy.get('.network-put-comment').should('contain', message)
})
})

View File

@@ -0,0 +1,87 @@
/// <reference types="Cypress" />
context('Querying', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/querying')
})
// The most commonly used query is 'cy.get()', you can
// think of this like the '$' in jQuery
it('cy.get() - query DOM elements', () => {
// https://on.cypress.io/get
cy.get('#query-btn').should('contain', 'Button')
cy.get('.query-btn').should('contain', 'Button')
cy.get('#querying .well>button:first').should('contain', 'Button')
// ↲
// Use CSS selectors just like jQuery
cy.get('[data-test-id="test-example"]').should('have.class', 'example')
// 'cy.get()' yields jQuery object, you can get its attribute
// by invoking `.attr()` method
cy.get('[data-test-id="test-example"]')
.invoke('attr', 'data-test-id')
.should('equal', 'test-example')
// or you can get element's CSS property
cy.get('[data-test-id="test-example"]')
.invoke('css', 'position')
.should('equal', 'static')
// or use assertions directly during 'cy.get()'
// https://on.cypress.io/assertions
cy.get('[data-test-id="test-example"]')
.should('have.attr', 'data-test-id', 'test-example')
.and('have.css', 'position', 'static')
})
it('cy.contains() - query DOM elements with matching content', () => {
// https://on.cypress.io/contains
cy.get('.query-list')
.contains('bananas')
.should('have.class', 'third')
// we can pass a regexp to `.contains()`
cy.get('.query-list')
.contains(/^b\w+/)
.should('have.class', 'third')
cy.get('.query-list')
.contains('apples')
.should('have.class', 'first')
// passing a selector to contains will
// yield the selector containing the text
cy.get('#querying')
.contains('ul', 'oranges')
.should('have.class', 'query-list')
cy.get('.query-button')
.contains('Save Form')
.should('have.class', 'btn')
})
it('.within() - query DOM elements within a specific element', () => {
// https://on.cypress.io/within
cy.get('.query-form').within(() => {
cy.get('input:first').should('have.attr', 'placeholder', 'Email')
cy.get('input:last').should('have.attr', 'placeholder', 'Password')
})
})
it('cy.root() - query the root DOM element', () => {
// https://on.cypress.io/root
// By default, root is the document
cy.root().should('match', 'html')
cy.get('.query-ul').within(() => {
// In this within, the root is now the ul DOM element
cy.root().should('have.class', 'query-ul')
})
})
})

View File

@@ -0,0 +1,95 @@
/// <reference types="Cypress" />
context('Spies, Stubs, and Clock', () => {
it('cy.spy() - wrap a method in a spy', () => {
// https://on.cypress.io/spy
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
const obj = {
foo () {},
}
const spy = cy.spy(obj, 'foo').as('anyArgs')
obj.foo()
expect(spy).to.be.called
})
it('cy.spy() retries until assertions pass', () => {
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
const obj = {
/**
* Prints the argument passed
* @param x {any}
*/
foo (x) {
console.log('obj.foo called with', x)
},
}
cy.spy(obj, 'foo').as('foo')
setTimeout(() => {
obj.foo('first')
}, 500)
setTimeout(() => {
obj.foo('second')
}, 2500)
cy.get('@foo').should('have.been.calledTwice')
})
it('cy.stub() - create a stub and/or replace a function with stub', () => {
// https://on.cypress.io/stub
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
const obj = {
/**
* prints both arguments to the console
* @param a {string}
* @param b {string}
*/
foo (a, b) {
console.log('a', a, 'b', b)
},
}
const stub = cy.stub(obj, 'foo').as('foo')
obj.foo('foo', 'bar')
expect(stub).to.be.called
})
it('cy.clock() - control time in the browser', () => {
// https://on.cypress.io/clock
// create the date in UTC so its always the same
// no matter what local timezone the browser is running in
const now = new Date(Date.UTC(2017, 2, 14)).getTime()
cy.clock(now)
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
cy.get('#clock-div').click()
.should('have.text', '1489449600')
})
it('cy.tick() - move time in the browser', () => {
// https://on.cypress.io/tick
// create the date in UTC so its always the same
// no matter what local timezone the browser is running in
const now = new Date(Date.UTC(2017, 2, 14)).getTime()
cy.clock(now)
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
cy.get('#tick-div').click()
.should('have.text', '1489449600')
cy.tick(10000) // 10 seconds passed
cy.get('#tick-div').click()
.should('have.text', '1489449610')
})
})

View File

@@ -0,0 +1,121 @@
/// <reference types="Cypress" />
context('Traversal', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/traversal')
})
it('.children() - get child DOM elements', () => {
// https://on.cypress.io/children
cy.get('.traversal-breadcrumb')
.children('.active')
.should('contain', 'Data')
})
it('.closest() - get closest ancestor DOM element', () => {
// https://on.cypress.io/closest
cy.get('.traversal-badge')
.closest('ul')
.should('have.class', 'list-group')
})
it('.eq() - get a DOM element at a specific index', () => {
// https://on.cypress.io/eq
cy.get('.traversal-list>li')
.eq(1).should('contain', 'siamese')
})
it('.filter() - get DOM elements that match the selector', () => {
// https://on.cypress.io/filter
cy.get('.traversal-nav>li')
.filter('.active').should('contain', 'About')
})
it('.find() - get descendant DOM elements of the selector', () => {
// https://on.cypress.io/find
cy.get('.traversal-pagination')
.find('li').find('a')
.should('have.length', 7)
})
it('.first() - get first DOM element', () => {
// https://on.cypress.io/first
cy.get('.traversal-table td')
.first().should('contain', '1')
})
it('.last() - get last DOM element', () => {
// https://on.cypress.io/last
cy.get('.traversal-buttons .btn')
.last().should('contain', 'Submit')
})
it('.next() - get next sibling DOM element', () => {
// https://on.cypress.io/next
cy.get('.traversal-ul')
.contains('apples').next().should('contain', 'oranges')
})
it('.nextAll() - get all next sibling DOM elements', () => {
// https://on.cypress.io/nextall
cy.get('.traversal-next-all')
.contains('oranges')
.nextAll().should('have.length', 3)
})
it('.nextUntil() - get next sibling DOM elements until next el', () => {
// https://on.cypress.io/nextuntil
cy.get('#veggies')
.nextUntil('#nuts').should('have.length', 3)
})
it('.not() - remove DOM elements from set of DOM elements', () => {
// https://on.cypress.io/not
cy.get('.traversal-disabled .btn')
.not('[disabled]').should('not.contain', 'Disabled')
})
it('.parent() - get parent DOM element from DOM elements', () => {
// https://on.cypress.io/parent
cy.get('.traversal-mark')
.parent().should('contain', 'Morbi leo risus')
})
it('.parents() - get parent DOM elements from DOM elements', () => {
// https://on.cypress.io/parents
cy.get('.traversal-cite')
.parents().should('match', 'blockquote')
})
it('.parentsUntil() - get parent DOM elements from DOM elements until el', () => {
// https://on.cypress.io/parentsuntil
cy.get('.clothes-nav')
.find('.active')
.parentsUntil('.clothes-nav')
.should('have.length', 2)
})
it('.prev() - get previous sibling DOM element', () => {
// https://on.cypress.io/prev
cy.get('.birds').find('.active')
.prev().should('contain', 'Lorikeets')
})
it('.prevAll() - get all previous sibling DOM elements', () => {
// https://on.cypress.io/prevAll
cy.get('.fruits-list').find('.third')
.prevAll().should('have.length', 2)
})
it('.prevUntil() - get all previous sibling DOM elements until el', () => {
// https://on.cypress.io/prevUntil
cy.get('.foods-list').find('#nuts')
.prevUntil('#veggies').should('have.length', 3)
})
it('.siblings() - get all sibling DOM elements', () => {
// https://on.cypress.io/siblings
cy.get('.traversal-pills .active')
.siblings().should('have.length', 2)
})
})

View File

@@ -0,0 +1,133 @@
/// <reference types="Cypress" />
context('Utilities', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/utilities')
})
it('Cypress._ - call a lodash method', () => {
// https://on.cypress.io/_
cy.request('https://jsonplaceholder.cypress.io/users')
.then((response) => {
let ids = Cypress._.chain(response.body).map('id').take(3).value()
expect(ids).to.deep.eq([1, 2, 3])
})
})
it('Cypress.$ - call a jQuery method', () => {
// https://on.cypress.io/$
let $li = Cypress.$('.utility-jquery li:first')
cy.wrap($li)
.should('not.have.class', 'active')
.click()
.should('have.class', 'active')
})
it('Cypress.Blob - blob utilities and base64 string conversion', () => {
// https://on.cypress.io/blob
cy.get('.utility-blob').then(($div) =>
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL
// get the dataUrl string for the javascript-logo
Cypress.Blob.imgSrcToDataURL('https://example.cypress.io/assets/img/javascript-logo.png', undefined, 'anonymous')
.then((dataUrl) => {
// create an <img> element and set its src to the dataUrl
let img = Cypress.$('<img />', { src: dataUrl })
// need to explicitly return cy here since we are initially returning
// the Cypress.Blob.imgSrcToDataURL promise to our test
// append the image
$div.append(img)
cy.get('.utility-blob img').click()
.should('have.attr', 'src', dataUrl)
}))
})
it('Cypress.minimatch - test out glob patterns against strings', () => {
// https://on.cypress.io/minimatch
let matching = Cypress.minimatch('/users/1/comments', '/users/*/comments', {
matchBase: true,
})
expect(matching, 'matching wildcard').to.be.true
matching = Cypress.minimatch('/users/1/comments/2', '/users/*/comments', {
matchBase: true,
})
expect(matching, 'comments').to.be.false
// ** matches against all downstream path segments
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/**', {
matchBase: true,
})
expect(matching, 'comments').to.be.true
// whereas * matches only the next path segment
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/*', {
matchBase: false,
})
expect(matching, 'comments').to.be.false
})
it('Cypress.moment() - format or parse dates using a moment method', () => {
// https://on.cypress.io/moment
const time = Cypress.moment().utc('2014-04-25T19:38:53.196Z').format('h:mm A')
expect(time).to.be.a('string')
cy.get('.utility-moment').contains('3:38 PM')
.should('have.class', 'badge')
// the time in the element should be between 3pm and 5pm
const start = Cypress.moment('3:00 PM', 'LT')
const end = Cypress.moment('5:00 PM', 'LT')
cy.get('.utility-moment .badge')
.should(($el) => {
// parse American time like "3:38 PM"
const m = Cypress.moment($el.text().trim(), 'LT')
// display hours + minutes + AM|PM
const f = 'h:mm A'
expect(m.isBetween(start, end),
`${m.format(f)} should be between ${start.format(f)} and ${end.format(f)}`).to.be.true
})
})
it('Cypress.Promise - instantiate a bluebird promise', () => {
// https://on.cypress.io/promise
let waited = false
/**
* @return Bluebird<string>
*/
function waitOneSecond () {
// return a promise that resolves after 1 second
// @ts-ignore TS2351 (new Cypress.Promise)
return new Cypress.Promise((resolve, reject) => {
setTimeout(() => {
// set waited to true
waited = true
// resolve with 'foo' string
resolve('foo')
}, 1000)
})
}
cy.then(() =>
// return a promise to cy.then() that
// is awaited until it resolves
// @ts-ignore TS7006
waitOneSecond().then((str) => {
expect(str).to.eq('foo')
expect(waited).to.be.true
}))
})
})

View File

@@ -0,0 +1,59 @@
/// <reference types="Cypress" />
context('Viewport', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/viewport')
})
it('cy.viewport() - set the viewport size and dimension', () => {
// https://on.cypress.io/viewport
cy.get('#navbar').should('be.visible')
cy.viewport(320, 480)
// the navbar should have collapse since our screen is smaller
cy.get('#navbar').should('not.be.visible')
cy.get('.navbar-toggle').should('be.visible').click()
cy.get('.nav').find('a').should('be.visible')
// lets see what our app looks like on a super large screen
cy.viewport(2999, 2999)
// cy.viewport() accepts a set of preset sizes
// to easily set the screen to a device's width and height
// We added a cy.wait() between each viewport change so you can see
// the change otherwise it is a little too fast to see :)
cy.viewport('macbook-15')
cy.wait(200)
cy.viewport('macbook-13')
cy.wait(200)
cy.viewport('macbook-11')
cy.wait(200)
cy.viewport('ipad-2')
cy.wait(200)
cy.viewport('ipad-mini')
cy.wait(200)
cy.viewport('iphone-6+')
cy.wait(200)
cy.viewport('iphone-6')
cy.wait(200)
cy.viewport('iphone-5')
cy.wait(200)
cy.viewport('iphone-4')
cy.wait(200)
cy.viewport('iphone-3')
cy.wait(200)
// cy.viewport() accepts an orientation for all presets
// the default orientation is 'portrait'
cy.viewport('ipad-2', 'portrait')
cy.wait(200)
cy.viewport('iphone-4', 'landscape')
cy.wait(200)
// The viewport will be reset back to the default dimensions
// in between tests (the default can be set in cypress.json)
})
})

View File

@@ -0,0 +1,34 @@
/// <reference types="Cypress" />
context('Waiting', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/waiting')
})
// BE CAREFUL of adding unnecessary wait times.
// https://on.cypress.io/best-practices#Unnecessary-Waiting
// https://on.cypress.io/wait
it('cy.wait() - wait for a specific amount of time', () => {
cy.get('.wait-input1').type('Wait 1000ms after typing')
cy.wait(1000)
cy.get('.wait-input2').type('Wait 1000ms after typing')
cy.wait(1000)
cy.get('.wait-input3').type('Wait 1000ms after typing')
cy.wait(1000)
})
it('cy.wait() - wait for a specific route', () => {
cy.server()
// Listen to GET to comments/1
cy.route('GET', 'comments/*').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.network-btn').click()
// wait for GET comments/1
cy.wait('@getComment').its('status').should('eq', 200)
})
})

View File

@@ -0,0 +1,22 @@
/// <reference types="Cypress" />
context('Window', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/window')
})
it('cy.window() - get the global window object', () => {
// https://on.cypress.io/window
cy.window().should('have.property', 'top')
})
it('cy.document() - get the document object', () => {
// https://on.cypress.io/document
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
})
it('cy.title() - get the title', () => {
// https://on.cypress.io/title
cy.title().should('include', 'Kitchen Sink')
})
})

View File

@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

59
cypress/helpers/util.js Normal file
View File

@@ -0,0 +1,59 @@
/* eslint-env jest */
/* global cy */
import { Base64 } from 'js-base64';
export const mermaidUrl = (graphStr, options, api) => {
const obj = {
code: graphStr,
mermaid: options
};
const objStr = JSON.stringify(obj);
let url = 'http://localhost:9000/e2e.html?graph=' + Base64.encodeURI(objStr);
if (api) {
url = 'http://localhost:9000/xss.html?graph=' + graphStr;
}
if (options.listUrl) {
cy.log(options.listId, ' ', url);
}
return url;
};
export const imgSnapshotTest = (graphStr, _options, api) => {
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';
}
cy.log(options);
const url = mermaidUrl(graphStr, options, api);
cy.visit(url);
cy.get('svg');
cy.percySnapshot();
};
export const renderGraph = (graphStr, options, api) => {
const url = mermaidUrl(graphStr, options, api);
cy.visit(url);
};

View File

@@ -0,0 +1,100 @@
import { renderGraph } from '../../helpers/util';
/* eslint-env jest */
describe('Configuration', () => {
describe('arrowMarkerAbsolute', () => {
it('should handle default value false of arrowMarkerAbsolute', () => {
renderGraph(
`graph 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]
`,
{ }
);
// Check the marker-end property to make sure it is properly set to
// start with #
cy.get('.edgePath path').first().should('have.attr', 'marker-end')
.should('exist')
.and('include', 'url(#');
});
it('should handle default value false of arrowMarkerAbsolute', () => {
renderGraph(
`graph 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]
`,
{ }
);
// Check the marker-end property to make sure it is properly set to
// start with #
cy.get('.edgePath path').first().should('have.attr', 'marker-end')
.should('exist')
.and('include', 'url(#');
});
it('should handle arrowMarkerAbsolute excplicitly set to false', () => {
renderGraph(
`graph 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]
`,
{
arrowMarkerAbsolute: false
}
);
// Check the marker-end property to make sure it is properly set to
// start with #
cy.get('.edgePath path').first().should('have.attr', 'marker-end')
.should('exist')
.and('include', 'url(#');
});
it('should handle arrowMarkerAbsolute excplicitly set to "false" as false', () => {
renderGraph(
`graph 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]
`,
{
arrowMarkerAbsolute: "false"
}
);
// Check the marker-end property to make sure it is properly set to
// start with #
cy.get('.edgePath path').first().should('have.attr', 'marker-end')
.should('exist')
.and('include', 'url(#');
});
it('should handle arrowMarkerAbsolute set to true', () => {
renderGraph(
`graph 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]
`,
{
arrowMarkerAbsolute: true
}
);
cy.get('.edgePath path').first().should('have.attr', 'marker-end')
.should('exist')
.and('include', 'url(http://localhost');
});
});
});

View File

@@ -0,0 +1,309 @@
/* eslint-env jest */
describe('Interaction', () => {
describe('Interaction - security level loose', () => {
it('Graph: should handle a click on a node with a bound function', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g#flowchart-Function-2')
.click();
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
});
it('Graph: should handle a click on a node with a bound function where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-1Function-6"]')
.click();
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
});
it('Graph: should handle a click on a node with a bound url', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('#flowchart-URL-3')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('Graph: should handle a click on a node with a bound url where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-2URL-7"]')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('Flowchart-v2: should handle a click on a node with a bound function', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g#flowchart-Function-10')
.click();
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
});
it('Flowchart-v2: should handle a click on a node with a bound function where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-1Function-14"]')
.click();
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
});
it('Flowchart-v2: should handle a click on a node with a bound url', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('#flowchart-URL-11')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('Flowchart-v2: should handle a click on a node with a bound url where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-2URL-15"]')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound URL clicking on the rect', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('rect#cl1')
.click({ force: true });
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound URL clicking on the text', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('text#cl1-text')
.click({ force: true });
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound function without args', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('rect#cl2')
.click({ force: true });
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
});
it('should handle a click on a task with a bound function with args', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('rect#cl3')
.click({ force: true });
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
});
it('should handle a click on a task with a bound function without args', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('text#cl2-text')
.click({ force: true });
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
});
it('should handle a click on a task with a bound function with args ', () => {
const url = 'http://localhost:9000/click_security_loose.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('text#cl3-text')
.click({ force: true });
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
});
});
describe('Interaction - security level tight', () => {
it('should handle a click on a node without a bound function', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g#flowchart-Function-2')
.click();
cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
});
it('should handle a click on a node with a bound function where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-1Function-6"]')
.click();
cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
});
it('should handle a click on a node with a bound url', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g#flowchart-URL-3')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a node with a bound url where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-2URL-7"]')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound URL clicking on the rect', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('rect#cl1')
.click({ force: true });
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound URL clicking on the text', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('text#cl1-text')
.click({ force: true });
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound function', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('rect#cl2')
.click({ force: true });
cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
});
it('should handle a click on a task with a bound function', () => {
const url = 'http://localhost:9000/click_security_strict.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('text#cl2-text')
.click({ force: true });
cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
});
});
describe('Interaction - security level other, missspelling', () => {
it('should handle a click on a node with a bound function', () => {
const url = 'http://localhost:9000/click_security_other.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g#flowchart-Function-2')
.click();
cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
});
it('should handle a click on a node with a bound function where the node starts with a number', () => {
const url = 'http://localhost:9000/click_security_other.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g[id="flowchart-1Function-6"]')
.click();
cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
});
it('should handle a click on a node with a bound url', () => {
const url = 'http://localhost:9000/click_security_other.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('g#flowchart-URL-3')
.click();
cy.location().should(location => {
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
});
});
it('should handle a click on a task with a bound function', () => {
const url = 'http://localhost:9000/click_security_other.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('rect#cl2')
.click({ force: true });
cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
});
it('should handle a click on a task with a bound function', () => {
const url = 'http://localhost:9000/click_security_other.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('body')
.find('text#cl2-text')
.click({ force: true });
cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
});
});
});

View File

@@ -0,0 +1,22 @@
/* eslint-env jest */
describe('Rerendering', () => {
it('should be able to render after an error has occured', () => {
const url = 'http://localhost:9000/render-after-error.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('#graphDiv').should('exist');
});
it('should be able to render and rerender a graph via API', () => {
const url = 'http://localhost:9000/rerender.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('#graph [id^=flowchart-A]').should('have.text', 'XMas');
cy.get('body')
.find('#rerender')
.click({ force: true });
cy.get('#graph [id^=flowchart-A]').should('have.text', 'Saturday');
});
});

View File

@@ -0,0 +1,21 @@
/* eslint-env jest */
describe('Sequencediagram', () => {
it('should render a simple sequence diagrams', () => {
const url = 'http://localhost:9000/webpackUsage.html';
cy.visit(url);
cy.get('body')
.find('svg')
.should('have.length', 1);
});
it('should handle html escapings properly', () => {
const url = 'http://localhost:9000/webpackUsage.html?test-html-escaping=true';
cy.visit(url);
cy.get('body')
.find('svg')
.should('have.length', 1);
cy.get('.label > g > foreignobject > div').should('not.contain.text', '<b>');
});
});

View File

@@ -0,0 +1,35 @@
/* eslint-env jest */
import { mermaidUrl } from '../../helpers/util.js';
/* eslint-disable */
describe('XSS', () => {
it('should handle xss in tags', () => {
const str = 'eyJjb2RlIjoiXG5ncmFwaCBMUlxuICAgICAgQi0tPkQoPGltZyBvbmVycm9yPWxvY2F0aW9uPWBqYXZhc2NyaXB0XFx1MDAzYXhzc0F0dGFja1xcdTAwMjhkb2N1bWVudC5kb21haW5cXHUwMDI5YCBzcmM9eD4pOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In19';
const url = mermaidUrl(str,{}, true);
cy.visit(url);
cy.wait(1000).then(()=>{
cy.get('.mermaid').should('exist');
});
cy.get('svg')
// cy.percySnapshot()
})
it('should handle xss in tags in non-html mode', () => {
const str = 'eyJjb2RlIjoiXG5ncmFwaCBMUlxuICAgICAgQi0tPkQoPGltZyBvbmVycm9yPWxvY2F0aW9uPWBqYXZhc2NyaXB0XFx1MDAzYXhzc0F0dGFja1xcdTAwMjhkb2N1bWVudC5kb21haW5cXHUwMDI5YCBzcmM9eD4pOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0IiwiZmxvd2NoYXJ0Ijp7Imh0bWxMYWJlbHMiOmZhbHNlfX19';
const url = mermaidUrl(str,{
"theme": "default",
"flowchart": {
"htmlMode": false
}
}, true);
cy.visit(url);
// cy.get('svg')
// cy.percySnapshot()
cy.get('.malware').should('not.exist');
})
})

View File

@@ -0,0 +1,373 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util';
describe('Class diagram V2', () => {
it('0: should render a simple class diagram', () => {
imgSnapshotTest(
`
classDiagram-v2
classA -- classB : Inheritance
classA -- classC : link
classC -- classD : link
classB -- classD
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('1: should render a simple class diagram', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01 <|-- AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; 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 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('2: should render a simple class diagrams with cardinality', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01 "1" <|--|> "*" AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 "1" *-- "*" Class04
Class05 "1" o-- "many" Class06
Class07 "1" .. "*" Class08
Class09 "1" --> "*" C2 : Where am i?
Class09 "*" --* "*" C3
Class09 "1" --|> "1" Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 "1" <--> "*" C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('should render a simple class diagram with different visibilities', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01 <|-- AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class01 : -privateMethod()
Class01 : +publicMethod()
Class01 : #protectedMethod()
Class01 : -int privateChimp
Class01 : +int publicGorilla
Class01 : #int protectedMarmoset
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('should render multiple class diagrams', () => {
imgSnapshotTest(
[
`
classDiagram-v2
Class01 "1" <|--|> "*" AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 "1" *-- "*" Class04
Class05 "1" o-- "many" Class06
Class07 "1" .. "*" Class08
Class09 "1" --> "*" C2 : Where am i?
Class09 "*" --* "*" C3
Class09 "1" --|> "1" Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 "1" <--> "*" C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
`
classDiagram-v2
Class01 "1" <|--|> "*" AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 "1" *-- "*" Class04
Class05 "1" o-- "many" Class06
Class07 "1" .. "*" Class08
Class09 "1" --> "*" C2 : Where am i?
Class09 "*" --* "*" C3
Class09 "1" --|> "1" Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 "1" <--> "*" C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
],
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('4: should render a simple class diagram with comments', () => {
imgSnapshotTest(
`
classDiagram-v2
%% this is a comment
Class01 <|-- AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('5: should render a simple class diagram with abstract method', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01 <|-- AveryLongClass : Cool
Class01 : someMethod()*
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('6: should render a simple class diagram with static method', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01 <|-- AveryLongClass : Cool
Class01 : someMethod()$
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('7: should render a simple class diagram with Generic class', () => {
imgSnapshotTest(
`
classDiagram-v2
class Class01~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('8: should render a simple class diagram with Generic class and relations', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('9: should render a simple class diagram with clickable link', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
link Class01 "google.com" "A Tooltip"
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('10: should render a simple class diagram with clickable callback', () => {
imgSnapshotTest(
`
classDiagram-v2
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
callback Class01 "functionCall" "A Tooltip"
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('11: should render a simple class diagram with return type on method', () => {
imgSnapshotTest(
`
classDiagram-v2
class Class10~T~ {
int[] id
test(int[] ids) bool
testArray() bool[]
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('12: should render a simple class diagram with generic types', () => {
imgSnapshotTest(
`
classDiagram-v2
class Class10~T~ {
int[] id
List~int~ ids
test(List~int~ ids) List~bool~
testArray() bool[]
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('13: should render a simple class diagram with css classes applied', () => {
imgSnapshotTest(
`
classDiagram-v2
class Class10 {
int[] id
List~int~ ids
test(List~int~ ids) List~bool~
testArray() bool[]
}
cssClass "Class10" exClass2
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('14: should render a simple class diagram with css classes applied directly', () => {
imgSnapshotTest(
`
classDiagram-v2
class Class10:::exClass2 {
int[] id
List~int~ ids
test(List~int~ ids) List~bool~
testArray() bool[]
}
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
imgSnapshotTest(
`
classDiagram-v2
class Class10
class Class20
cssClass "Class10, class20" exClass2
`,
{logLevel : 1, flowchart: { "htmlLabels": false },}
);
cy.get('svg');
});
});

View File

@@ -0,0 +1,406 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
describe('Class diagram', () => {
it('1: should render a simple class diagram', () => {
imgSnapshotTest(
`
classDiagram
Class01 <|-- AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; 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 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{logLevel : 1}
);
cy.get('svg');
});
it('2: should render a simple class diagrams with cardinality', () => {
imgSnapshotTest(
`
classDiagram
Class01 "1" <|--|> "*" AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 "1" *-- "*" Class04
Class05 "1" o-- "many" Class06
Class07 "1" .. "*" Class08
Class09 "1" --> "*" C2 : Where am i?
Class09 "*" --* "*" C3
Class09 "1" --|> "1" Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 "1" <--> "*" C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{}
);
cy.get('svg');
});
it('3: should render a simple class diagram with different visibilities', () => {
imgSnapshotTest(
`
classDiagram
Class01 <|-- AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class01 : -privateMethod()
Class01 : +publicMethod()
Class01 : #protectedMethod()
Class01 : -int privateChimp
Class01 : +int publicGorilla
Class01 : #int protectedMarmoset
`,
{}
);
cy.get('svg');
});
it('4: should render a simple class diagram with comments', () => {
imgSnapshotTest(
`
classDiagram
%% this is a comment
Class01 <|-- AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{}
);
cy.get('svg');
});
it('5: should render a simple class diagram with abstract method', () => {
imgSnapshotTest(
`
classDiagram
Class01 <|-- AveryLongClass : Cool
Class01 : someMethod()*
`,
{}
);
cy.get('svg');
});
it('6: should render a simple class diagram with static method', () => {
imgSnapshotTest(
`
classDiagram
Class01 <|-- AveryLongClass : Cool
Class01 : someMethod()$
`,
{}
);
cy.get('svg');
});
it('7: should render a simple class diagram with Generic class', () => {
imgSnapshotTest(
`
classDiagram
class Class01~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{}
);
cy.get('svg');
});
it('8: should render a simple class diagram with Generic class and relations', () => {
imgSnapshotTest(
`
classDiagram
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
{}
);
cy.get('svg');
});
it('9: should render a simple class diagram with clickable link', () => {
imgSnapshotTest(
`
classDiagram
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
link Class01 "google.com" "A Tooltip"
`,
{}
);
cy.get('svg');
});
it('10: should render a simple class diagram with clickable callback', () => {
imgSnapshotTest(
`
classDiagram
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
callback Class01 "functionCall" "A Tooltip"
`,
{}
);
cy.get('svg');
});
it('11: should render a simple class diagram with return type on method', () => {
imgSnapshotTest(
`
classDiagram
class Class10~T~ {
int[] id
test(int[] ids) bool
testArray() bool[]
}
`,
{}
);
cy.get('svg');
});
it('12: should render a simple class diagram with generic types', () => {
imgSnapshotTest(
`
classDiagram
class Class10~T~ {
int[] id
List~int~ ids
test(List~int~ ids) List~bool~
testArray() bool[]
}
`,
{}
);
cy.get('svg');
});
it('13: should render a simple class diagram with css classes applied', () => {
imgSnapshotTest(
`
classDiagram
class Class10 {
int[] id
List~int~ ids
test(List~int~ ids) List~bool~
testArray() bool[]
}
cssClass "Class10" exClass
`,
{}
);
cy.get('svg');
});
it('14: should render a simple class diagram with css classes applied directly', () => {
imgSnapshotTest(
`
classDiagram
class Class10:::exClass {
int[] id
List~int~ ids
test(List~int~ ids) List~bool~
testArray() bool[]
}
`,
{}
);
cy.get('svg');
});
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
imgSnapshotTest(
`
classDiagram
class Class10
class Class20
cssClass "Class10, class20" exClass
`,
{}
);
cy.get('svg');
});
it('16: should render multiple class diagrams', () => {
imgSnapshotTest(
[
`
classDiagram
Class01 "1" <|--|> "*" AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 "1" *-- "*" Class04
Class05 "1" o-- "many" Class06
Class07 "1" .. "*" Class08
Class09 "1" --> "*" C2 : Where am i?
Class09 "*" --* "*" C3
Class09 "1" --|> "1" Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 "1" <--> "*" C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
`
classDiagram
Class01 "1" <|--|> "*" AveryLongClass : Cool
&lt;&lt;interface&gt;&gt; Class01
Class03 "1" *-- "*" Class04
Class05 "1" o-- "many" Class06
Class07 "1" .. "*" Class08
Class09 "1" --> "*" C2 : Where am i?
Class09 "*" --* "*" C3
Class09 "1" --|> "1" Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 "1" <--> "*" C2: Cool label
class Class10 {
&lt;&lt;service&gt;&gt;
int id
test()
}
`,
],
{}
);
cy.get('svg');
});
it('17: should render a class diagram when useMaxWidth is true (default)', () => {
renderGraph(
`
classDiagram
Class01 <|-- AveryLongClass : Cool
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class01 : -int privateChimp
Class01 : +int publicGorilla
Class01 : #int protectedMarmoset
`,
{ class: { useMaxWidth: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height', '218');
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseInt(style.match(/[\d.]+/g).join(''));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(maxWidthValue).to.be.within(160 * .95, 160 * 1.05);
});
});
it('18: should render a class diagram when useMaxWidth is false', () => {
renderGraph(
`
classDiagram
Class01 <|-- AveryLongClass : Cool
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class01 : -int privateChimp
Class01 : +int publicGorilla
Class01 : #int protectedMarmoset
`,
{ class: { useMaxWidth: false } }
);
cy.get('svg')
.should((svg) => {
const width = parseFloat(svg.attr('width'));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(width).to.be.within(160 * .95, 160 * 1.05);
expect(svg).to.have.attr('height', '218');
expect(svg).to.not.have.attr('style');
});
});
});

View File

@@ -0,0 +1,141 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Configuration and directives - nodes should be light blue', () => {
it('No config - use default', () => {
imgSnapshotTest(
`
graph TD
A(Default) --> B[/Another/]
A --> C[End]
subgraph section
B
C
end
`,
{}
);
cy.get('svg');
});
it('Settigns from intitialize - nodes should be green', () => {
imgSnapshotTest(
`
graph TD
A(Forest) --> B[/Another/]
A --> C[End]
subgraph section
B
C
end `,
{theme:'forest'}
);
cy.get('svg');
});
it('Settings from initialize overriding themeVariable - nodes shold be red', () => {
imgSnapshotTest(
`
%%{init: { 'theme': 'base', 'themeVariables':{ 'primaryColor': '#ff0000'}}}%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
`,
{theme:'base', themeVariables:{ primaryColor: '#ff0000'}, logLevel: 0}
);
cy.get('svg');
});
it('Settings from directive - nodes should be grey', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': 'neutral'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
`,
{}
);
cy.get('svg');
});
it('Settings from directive overriding theme variable - nodes should be red', () => {
imgSnapshotTest(
`
%%{init: {'theme': 'base', 'themeVariables':{ 'primaryColor': '#ff0000'}}}%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
`,
{}
);
cy.get('svg');
});
it('Settings from initialize and directive - nodes should be grey', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': 'neutral'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
`,
{theme:'forest'}
);
cy.get('svg');
});
it('Theme from initialize, directive overriding theme variable - nodes should be red', () => {
imgSnapshotTest(
`
%%{init: {'theme': 'base', 'themeVariables':{ 'primaryColor': '#ff0000'}}}%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
`,
{theme:'base'}
);
cy.get('svg');
});
it('Theme variable from initialize, theme from directive - nodes should be red', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': 'base'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
`,
{themeVariables:{primaryColor: '#ff0000'}}
);
cy.get('svg');
});
describe('when rendering several diagrams', () => {
it('diagrams should not taint later diagrams', () => {
const url = 'http://localhost:9000/theme-directives.html';
cy.visit(url);
cy.get('svg');
cy.percySnapshot();
});
});
});

View File

@@ -0,0 +1,21 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util';
describe('State diagram', () => {
it('should render a state with states in it', () => {
imgSnapshotTest(
`
stateDiagram
state PersonalizedCockpit {
Other
state Parent {
C
}
}
`,
{
logLevel: 0,
}
);
});
});

View File

@@ -0,0 +1,14 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util';
describe('Flowchart', () => {
it('34: testing the label width in percy', () => {
imgSnapshotTest(
`graph TD
A[Christmas]
`,
{ theme: 'forest' , fontFamily: '"Noto Sans SC", sans-serif' }
);
});
});

View File

@@ -0,0 +1,189 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
describe('Entity Relationship Diagram', () => {
it('should render a simple ER diagram', () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
{logLevel : 1}
);
cy.get('svg');
});
it('should render an ER diagram with a recursive relationship', () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||..o{ CUSTOMER : refers
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
{logLevel : 1}
);
cy.get('svg');
});
it('should render an ER diagram with multiple relationships between the same two entities', () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER ||--|{ ADDRESS : "invoiced at"
CUSTOMER ||--|{ ADDRESS : "receives goods at"
`,
{logLevel : 1}
);
cy.get('svg');
});
it('should render a cyclical ER diagram', () => {
imgSnapshotTest(
`
erDiagram
A ||--|{ B : likes
B ||--|{ C : likes
C ||--|{ A : likes
`,
{logLevel : 1}
);
cy.get('svg');
});
it('should render a not-so-simple ER diagram', () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
`,
{logLevel : 1}
);
cy.get('svg');
});
it('should render multiple ER diagrams', () => {
imgSnapshotTest(
[
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`
],
{logLevel : 1}
);
cy.get('svg');
});
it('should render an ER diagram with blank or empty labels', () => {
imgSnapshotTest(
`
erDiagram
BOOK }|..|{ AUTHOR : ""
BOOK }|..|{ GENRE : " "
AUTHOR }|..|{ GENRE : " "
`,
{logLevel : 1}
);
cy.get('svg');
});
it('should render an ER diagrams when useMaxWidth is true (default)', () => {
renderGraph(
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
{ er: { useMaxWidth: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height', '465');
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(maxWidthValue).to.be.within(140 * .95, 140 * 1.05);
});
});
it('should render an ER when useMaxWidth is false', () => {
renderGraph(
`
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
`,
{ er: { useMaxWidth: false } }
);
cy.get('svg')
.should((svg) => {
const width = parseFloat(svg.attr('width'));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(width).to.be.within(140 * .95, 140 * 1.05);
expect(svg).to.have.attr('height', '465');
expect(svg).to.not.have.attr('style');
});
});
it('should render entities that have no relationships', () => {
renderGraph(
`
erDiagram
DEAD_PARROT
HERMIT
RECLUSE
SOCIALITE }o--o{ SOCIALITE : "interacts with"
RECLUSE }o--o{ SOCIALITE : avoids
`,
{ er: { useMaxWidth: false } }
);
cy.get('svg');
});
it('should render entities with and without attributes', () => {
renderGraph(
`
erDiagram
BOOK { string title }
AUTHOR }|..|{ BOOK : writes
BOOK { float price }
`,
{ logLevel : 1 }
);
cy.get('svg');
});
it('should render entities and attributes with big and small entity names', () => {
renderGraph(
`
erDiagram
PRIVATE_FINANCIAL_INSTITUTION {
string name
int turnover
}
PRIVATE_FINANCIAL_INSTITUTION ||..|{ EMPLOYEE : employs
EMPLOYEE { bool officer_of_firm }
`,
{ logLevel : 1 }
);
cy.get('svg');
});
});

View File

@@ -0,0 +1,408 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
describe('Flowchart v2', () => {
it('1: should render a simple flowchart', () => {
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]
`,
{}
);
});
it('2: should render a simple flowchart with diagramPadding set to 0', () => {
imgSnapshotTest(
`flowchart 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: a link with correct arrowhead to a subgraph', () => {
imgSnapshotTest(
`flowchart TD
P1
P1 -->P1.5
subgraph P1.5
P2
P2.5(( A ))
P3
end
P2 --> P4
P3 --> P6
P1.5 --> P5
`,
{ flowchart: { diagramPadding: 0 } }
);
});
it('4: Length of edges', () => {
imgSnapshotTest(
`flowchart 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
`,
{ flowchart: { diagramPadding: 0 } }
);
});
it('5: should render escaped without html labels', () => {
imgSnapshotTest(
`flowchart TD
a["<strong>Haiya</strong>"]---->b
`,
{htmlLabels: false, flowchart: {htmlLabels: false}}
);
});
it('6: should render non-escaped with html labels', () => {
imgSnapshotTest(
`flowchart TD
a["<strong>Haiya</strong>"]===>b
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('7: should render a flowchart when useMaxWidth is true (default)', () => {
renderGraph(
`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: { 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 * .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(300 * .95-1, 300 * 1.05);
});
});
it('8: should render a flowchart when useMaxWidth is false', () => {
renderGraph(
`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: { 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 * .95, 446 * 1.05);
expect(width).to.be.within(300 * .95-1, 300 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
it('V2 - 16: Render Stadium shape', () => {
imgSnapshotTest(
` flowchart TD
A([stadium shape test])
A -->|Get money| B([Go shopping])
B --> C([Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?])
C -->|One| D([Laptop])
C -->|Two| E([iPhone])
C -->|Three| F([Car<br/>wroom wroom])
click A "index.html#link-clicked" "link test"
click B testClick "click test"
classDef someclass fill:#f96;
class A someclass;
class C someclass;
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('50: handle nested subgraphs in reverse order', () => {
imgSnapshotTest(
`flowchart LR
a -->b
subgraph A
B
end
subgraph B
b
end
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('51: handle nested subgraphs in reverse order', () => {
imgSnapshotTest(
`flowchart LR
a -->b
subgraph A
B
end
subgraph B
b
end
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('52: handle nested subgraphs in several levels', () => {
imgSnapshotTest(
`flowchart 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: handle nested subgraphs with edges in and out', () => {
imgSnapshotTest(
`flowchart TB
internet
nat
routeur
lb1
lb2
compute1
compute2
subgraph project
routeur
nat
subgraph subnet1
compute1
lb1
end
subgraph subnet2
compute2
lb2
end
end
internet --> routeur
routeur --> subnet1 & subnet2
subnet1 & subnet2 --> nat --> internet
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('54: handle nested subgraphs with outgoing links', () => {
imgSnapshotTest(
`flowchart TD
subgraph main
subgraph subcontainer
subcontainer-child
end
subcontainer-child--> subcontainer-sibling
end
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('55: handle nested subgraphs with outgoing links 2', () => {
imgSnapshotTest(
`flowchart 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: handle nested subgraphs with outgoing links 3', () => {
imgSnapshotTest(
`flowchart 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: handle nested subgraphs with outgoing links 4', () => {
imgSnapshotTest(
`flowchart LR
subgraph A
a -->b
end
subgraph B
b
end
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('57: handle nested subgraphs with outgoing links 2', () => {
imgSnapshotTest(
`flowchart 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 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: handle styling with style expressions', () => {
imgSnapshotTest(
`
flowchart LR
id1(Start)-->id2(Stop)
style id1 fill:#f9f,stroke:#333,stroke-width:4px
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('59: handle styling of subgraphs and links', () => {
imgSnapshotTest(
`
flowchart 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('61: fontawesome icons in edge labels', () => {
imgSnapshotTest(
`
flowchart TD
C -->|fa:fa-car Car| F[fa:fa-car Car]
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('62: should render styled subgraphs', () => {
imgSnapshotTest(
`
flowchart 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'}
);
});
});

View File

@@ -0,0 +1,800 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
describe('Flowchart', () => {
it('1: should render a simple flowchart no htmlLabels', () => {
imgSnapshotTest(
`graph 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: { htmlLabels: false }, fontFamily: 'courier' }
);
});
it('2: should render a simple flowchart with htmlLabels', () => {
imgSnapshotTest(
`graph 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: { htmlLabels: true }, fontFamily: 'courier' }
);
});
it('3: should render a simple flowchart with line breaks', () => {
imgSnapshotTest(
`
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me thinksssss<br/>ssssssssssssssssssssss<br/>sssssssssssssssssssssssssss}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[Car]
`,
{fontFamily: 'courier'}
);
});
it('4: should render a simple flowchart with trapezoid and inverse trapezoid vertex options.', () => {
imgSnapshotTest(
`
graph TD
A[/Christmas\\]
A -->|Get money| B[\\Go shopping/]
B --> C{Let me thinksssss<br/>ssssssssssssssssssssss<br/>sssssssssssssssssssssssssss}
C -->|One| D[/Laptop/]
C -->|Two| E[\\iPhone\\]
C -->|Three| F[Car]
`,
{ fontFamily: 'courier'}
);
});
it('5: should style nodes via a class.', () => {
imgSnapshotTest(
`
graph TD
1A --> 1B
1B --> 1C
1C --> D
1C --> E
classDef processHead fill:#888888,color:white,font-weight:bold,stroke-width:3px,stroke:#001f3f
class 1A,1B,D,E processHead
`,
{fontFamily: 'courier'}
);
});
it('6: should render a flowchart full of circles', () => {
imgSnapshotTest(
`
graph LR
47(SAM.CommonFA.FMESummary)-->48(SAM.CommonFA.CommonFAFinanceBudget)
37(SAM.CommonFA.BudgetSubserviceLineVolume)-->48(SAM.CommonFA.CommonFAFinanceBudget)
35(SAM.CommonFA.PopulationFME)-->47(SAM.CommonFA.FMESummary)
41(SAM.CommonFA.MetricCost)-->47(SAM.CommonFA.FMESummary)
44(SAM.CommonFA.MetricOutliers)-->47(SAM.CommonFA.FMESummary)
46(SAM.CommonFA.MetricOpportunity)-->47(SAM.CommonFA.FMESummary)
40(SAM.CommonFA.OPVisits)-->47(SAM.CommonFA.FMESummary)
38(SAM.CommonFA.CommonFAFinanceRefund)-->47(SAM.CommonFA.FMESummary)
43(SAM.CommonFA.CommonFAFinancePicuDays)-->47(SAM.CommonFA.FMESummary)
42(SAM.CommonFA.CommonFAFinanceNurseryDays)-->47(SAM.CommonFA.FMESummary)
45(SAM.CommonFA.MetricPreOpportunity)-->46(SAM.CommonFA.MetricOpportunity)
35(SAM.CommonFA.PopulationFME)-->45(SAM.CommonFA.MetricPreOpportunity)
41(SAM.CommonFA.MetricCost)-->45(SAM.CommonFA.MetricPreOpportunity)
41(SAM.CommonFA.MetricCost)-->44(SAM.CommonFA.MetricOutliers)
39(SAM.CommonFA.ChargeDetails)-->43(SAM.CommonFA.CommonFAFinancePicuDays)
39(SAM.CommonFA.ChargeDetails)-->42(SAM.CommonFA.CommonFAFinanceNurseryDays)
39(SAM.CommonFA.ChargeDetails)-->41(SAM.CommonFA.MetricCost)
39(SAM.CommonFA.ChargeDetails)-->40(SAM.CommonFA.OPVisits)
35(SAM.CommonFA.PopulationFME)-->39(SAM.CommonFA.ChargeDetails)
36(SAM.CommonFA.PremetricCost)-->39(SAM.CommonFA.ChargeDetails)
`,
{ fontFamily: 'courier' }
);
});
it('7: should render a flowchart full of icons', () => {
imgSnapshotTest(
`
graph TD
9e122290_1ec3_e711_8c5a_005056ad0002("fa:fa-creative-commons My System | Test Environment")
82072290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs Shared Business Logic Server:Service 1")
db052290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs Shared Business Logic Server:Service 2")
4e112290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs Shared Report Server:Service 1")
30122290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs Shared Report Server:Service 2")
5e112290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs Dedicated Test Business Logic Server:Service 1")
c1112290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs Dedicated Test Business Logic Server:Service 2")
b7042290_1ec3_e711_8c5a_005056ad0002("fa:fa-circle [DBServer\\SharedDbInstance].[SupportDb]")
8f102290_1ec3_e711_8c5a_005056ad0002("fa:fa-circle [DBServer\\SharedDbInstance].[DevelopmentDb]")
0e102290_1ec3_e711_8c5a_005056ad0002("fa:fa-circle [DBServer\\SharedDbInstance].[TestDb]")
07132290_1ec3_e711_8c5a_005056ad0002("fa:fa-circle [DBServer\\SharedDbInstance].[SharedReportingDb]")
c7072290_1ec3_e711_8c5a_005056ad0002("fa:fa-server Shared Business Logic Server")
ca122290_1ec3_e711_8c5a_005056ad0002("fa:fa-server Shared Report Server")
68102290_1ec3_e711_8c5a_005056ad0002("fa:fa-server Dedicated Test Business Logic Server")
f4112290_1ec3_e711_8c5a_005056ad0002("fa:fa-database [DBServer\\SharedDbInstance]")
d6072290_1ec3_e711_8c5a_005056ad0002("fa:fa-server DBServer")
71082290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs DBServer\\:MSSQLSERVER")
c0102290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs DBServer\\:SQLAgent")
9a072290_1ec3_e711_8c5a_005056ad0002("fa:fa-cogs DBServer\\:SQLBrowser")
1d0a2290_1ec3_e711_8c5a_005056ad0002("fa:fa-server VmHost1")
200a2290_1ec3_e711_8c5a_005056ad0002("fa:fa-server VmHost2")
1c0a2290_1ec3_e711_8c5a_005056ad0002("fa:fa-server VmHost3")
9e122290_1ec3_e711_8c5a_005056ad0002-->82072290_1ec3_e711_8c5a_005056ad0002
9e122290_1ec3_e711_8c5a_005056ad0002-->db052290_1ec3_e711_8c5a_005056ad0002
9e122290_1ec3_e711_8c5a_005056ad0002-->4e112290_1ec3_e711_8c5a_005056ad0002
9e122290_1ec3_e711_8c5a_005056ad0002-->30122290_1ec3_e711_8c5a_005056ad0002
9e122290_1ec3_e711_8c5a_005056ad0002-->5e112290_1ec3_e711_8c5a_005056ad0002
9e122290_1ec3_e711_8c5a_005056ad0002-->c1112290_1ec3_e711_8c5a_005056ad0002
82072290_1ec3_e711_8c5a_005056ad0002-->b7042290_1ec3_e711_8c5a_005056ad0002
82072290_1ec3_e711_8c5a_005056ad0002-->8f102290_1ec3_e711_8c5a_005056ad0002
82072290_1ec3_e711_8c5a_005056ad0002-->0e102290_1ec3_e711_8c5a_005056ad0002
82072290_1ec3_e711_8c5a_005056ad0002-->c7072290_1ec3_e711_8c5a_005056ad0002
db052290_1ec3_e711_8c5a_005056ad0002-->c7072290_1ec3_e711_8c5a_005056ad0002
db052290_1ec3_e711_8c5a_005056ad0002-->82072290_1ec3_e711_8c5a_005056ad0002
4e112290_1ec3_e711_8c5a_005056ad0002-->b7042290_1ec3_e711_8c5a_005056ad0002
4e112290_1ec3_e711_8c5a_005056ad0002-->8f102290_1ec3_e711_8c5a_005056ad0002
4e112290_1ec3_e711_8c5a_005056ad0002-->0e102290_1ec3_e711_8c5a_005056ad0002
4e112290_1ec3_e711_8c5a_005056ad0002-->07132290_1ec3_e711_8c5a_005056ad0002
4e112290_1ec3_e711_8c5a_005056ad0002-->ca122290_1ec3_e711_8c5a_005056ad0002
30122290_1ec3_e711_8c5a_005056ad0002-->ca122290_1ec3_e711_8c5a_005056ad0002
30122290_1ec3_e711_8c5a_005056ad0002-->4e112290_1ec3_e711_8c5a_005056ad0002
5e112290_1ec3_e711_8c5a_005056ad0002-->8f102290_1ec3_e711_8c5a_005056ad0002
5e112290_1ec3_e711_8c5a_005056ad0002-->68102290_1ec3_e711_8c5a_005056ad0002
c1112290_1ec3_e711_8c5a_005056ad0002-->68102290_1ec3_e711_8c5a_005056ad0002
c1112290_1ec3_e711_8c5a_005056ad0002-->5e112290_1ec3_e711_8c5a_005056ad0002
b7042290_1ec3_e711_8c5a_005056ad0002-->f4112290_1ec3_e711_8c5a_005056ad0002
8f102290_1ec3_e711_8c5a_005056ad0002-->f4112290_1ec3_e711_8c5a_005056ad0002
0e102290_1ec3_e711_8c5a_005056ad0002-->f4112290_1ec3_e711_8c5a_005056ad0002
07132290_1ec3_e711_8c5a_005056ad0002-->f4112290_1ec3_e711_8c5a_005056ad0002
c7072290_1ec3_e711_8c5a_005056ad0002-->1d0a2290_1ec3_e711_8c5a_005056ad0002
ca122290_1ec3_e711_8c5a_005056ad0002-->200a2290_1ec3_e711_8c5a_005056ad0002
68102290_1ec3_e711_8c5a_005056ad0002-->1c0a2290_1ec3_e711_8c5a_005056ad0002
f4112290_1ec3_e711_8c5a_005056ad0002-->d6072290_1ec3_e711_8c5a_005056ad0002
f4112290_1ec3_e711_8c5a_005056ad0002-->71082290_1ec3_e711_8c5a_005056ad0002
f4112290_1ec3_e711_8c5a_005056ad0002-->c0102290_1ec3_e711_8c5a_005056ad0002
f4112290_1ec3_e711_8c5a_005056ad0002-->9a072290_1ec3_e711_8c5a_005056ad0002
d6072290_1ec3_e711_8c5a_005056ad0002-->1c0a2290_1ec3_e711_8c5a_005056ad0002
71082290_1ec3_e711_8c5a_005056ad0002-->d6072290_1ec3_e711_8c5a_005056ad0002
c0102290_1ec3_e711_8c5a_005056ad0002-->d6072290_1ec3_e711_8c5a_005056ad0002
c0102290_1ec3_e711_8c5a_005056ad0002-->71082290_1ec3_e711_8c5a_005056ad0002
9a072290_1ec3_e711_8c5a_005056ad0002-->d6072290_1ec3_e711_8c5a_005056ad0002
9a072290_1ec3_e711_8c5a_005056ad0002-->71082290_1ec3_e711_8c5a_005056ad0002
`,
{ fontFamily: 'courier' }
);
});
it('8: should render labels with numbers at the start', () => {
imgSnapshotTest(
`
graph TB;subgraph "number as labels";1;end;
`,
{ fontFamily: 'courier' }
);
});
it('9: should render subgraphs', () => {
imgSnapshotTest(
`
graph TB
subgraph One
a1-->a2
end
`,
{ fontFamily: 'courier' }
);
});
it('10: should render subgraphs with a title starting with a digit', () => {
imgSnapshotTest(
`
graph TB
subgraph 2Two
a1-->a2
end
`,
{ fontFamily: 'courier' }
);
});
it('11: should render styled subgraphs', () => {
imgSnapshotTest(
`
graph 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
`,
{ fontFamily: 'courier' }
);
});
it('12: should render a flowchart with long names and class definitions', () => {
imgSnapshotTest(
`graph LR
sid-B3655226-6C29-4D00-B685-3D5C734DC7E1["
提交申请
熊大
"];
class sid-B3655226-6C29-4D00-B685-3D5C734DC7E1 node-executed;
sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A["
负责人审批
强子
"];
class sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A node-executed;
sid-E27C0367-E6D6-497F-9736-3CDC21FDE221["
DBA审批
强子
"];
class sid-E27C0367-E6D6-497F-9736-3CDC21FDE221 node-executed;
sid-BED98281-9585-4D1B-934E-BD1AC6AC0EFD["
SA审批
阿美
"];
class sid-BED98281-9585-4D1B-934E-BD1AC6AC0EFD node-executed;
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7["
主管审批
光头强
"];
class sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7 node-executed;
sid-A1B3CD96-7697-4D7C-BEAA-73D187B1BE89["
DBA确认
强子
"];
class sid-A1B3CD96-7697-4D7C-BEAA-73D187B1BE89 node-executed;
sid-3E35A7FF-A2F4-4E07-9247-DBF884C81937["
SA确认
阿美
"];
class sid-3E35A7FF-A2F4-4E07-9247-DBF884C81937 node-executed;
sid-4FC27B48-A6F9-460A-A675-021F5854FE22["
结束
"];
class sid-4FC27B48-A6F9-460A-A675-021F5854FE22 node-executed;
sid-19DD9E9F-98C1-44EE-B604-842AFEE76F1E["
SA执行1
强子
"];
class sid-19DD9E9F-98C1-44EE-B604-842AFEE76F1E node-executed;
sid-6C2120F3-D940-4958-A067-0903DCE879C4["
SA执行2
强子
"];
class sid-6C2120F3-D940-4958-A067-0903DCE879C4 node-executed;
sid-9180E2A0-5C4B-435F-B42F-0D152470A338["
DBA执行1
强子
"];
class sid-9180E2A0-5C4B-435F-B42F-0D152470A338 node-executed;
sid-03A2C3AC-5337-48A5-B154-BB3FD0EC8DAD["
DBA执行3
强子
"];
class sid-03A2C3AC-5337-48A5-B154-BB3FD0EC8DAD node-executed;
sid-D5E1F2F4-306C-47A2-BF74-F66E3D769756["
DBA执行2
强子
"];
class sid-D5E1F2F4-306C-47A2-BF74-F66E3D769756 node-executed;
sid-8C3F2F1D-F014-4F99-B966-095DC1A2BD93["
DBA执行4
强子
"];
class sid-8C3F2F1D-F014-4F99-B966-095DC1A2BD93 node-executed;
sid-1897B30A-9C5C-4D5B-B80B-76A038785070["
负责人确认
梁静茹
"];
class sid-1897B30A-9C5C-4D5B-B80B-76A038785070 node-executed;
sid-B3655226-6C29-4D00-B685-3D5C734DC7E1-->sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7;
sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A-->sid-1897B30A-9C5C-4D5B-B80B-76A038785070;
sid-E27C0367-E6D6-497F-9736-3CDC21FDE221-->sid-A1B3CD96-7697-4D7C-BEAA-73D187B1BE89;
sid-BED98281-9585-4D1B-934E-BD1AC6AC0EFD-->sid-3E35A7FF-A2F4-4E07-9247-DBF884C81937;
sid-19DD9E9F-98C1-44EE-B604-842AFEE76F1E-->sid-6C2120F3-D940-4958-A067-0903DCE879C4;
sid-9180E2A0-5C4B-435F-B42F-0D152470A338-->sid-D5E1F2F4-306C-47A2-BF74-F66E3D769756;
sid-03A2C3AC-5337-48A5-B154-BB3FD0EC8DAD-->sid-8C3F2F1D-F014-4F99-B966-095DC1A2BD93;
sid-6C2120F3-D940-4958-A067-0903DCE879C4-->sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A;
sid-1897B30A-9C5C-4D5B-B80B-76A038785070-->sid-4FC27B48-A6F9-460A-A675-021F5854FE22;
sid-3E35A7FF-A2F4-4E07-9247-DBF884C81937-->sid-19DD9E9F-98C1-44EE-B604-842AFEE76F1E;
sid-A1B3CD96-7697-4D7C-BEAA-73D187B1BE89-->sid-9180E2A0-5C4B-435F-B42F-0D152470A338;
sid-A1B3CD96-7697-4D7C-BEAA-73D187B1BE89-->sid-03A2C3AC-5337-48A5-B154-BB3FD0EC8DAD;
sid-D5E1F2F4-306C-47A2-BF74-F66E3D769756-->sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A;
sid-8C3F2F1D-F014-4F99-B966-095DC1A2BD93-->sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A;
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-BED98281-9585-4D1B-934E-BD1AC6AC0EFD;
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-E27C0367-E6D6-497F-9736-3CDC21FDE221;
sid-3E35A7FF-A2F4-4E07-9247-DBF884C81937-->sid-6C2120F3-D940-4958-A067-0903DCE879C4;
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A;
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-4FC27B48-A6F9-460A-A675-021F5854FE22;
`,
{ fontFamily: 'courier' }
);
});
it('13: should render color of styled nodes', () => {
imgSnapshotTest(
`
graph LR
foo-->bar
classDef foo fill:lightblue,color:green,stroke:#FF9E2C,font-weight:bold
style foo fill:#F99,stroke-width:2px,stroke:#F0F
style bar fill:#999,color: #00ff00, stroke-width:10px,stroke:#0F0
`,
{
listUrl: false,
listId: 'color styling',
fontFamily: 'courier',
logLevel: 0
}
);
});
it('14: should render hexagons', () => {
imgSnapshotTest(
`
graph TD
A[Christmas] -->|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]
click A "index.html#link-clicked" "link test"
click B testClick "click test"
classDef someclass fill:#f96;
class A someclass;
class C someclass;
`,
{
listUrl: false,
listId: 'color styling', fontFamily: 'courier',
logLevel: 0
}
);
});
it('15: should render a simple flowchart with comments', () => {
imgSnapshotTest(
`graph 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: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('16: Render Stadium shape', () => {
imgSnapshotTest(
` graph 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('17: Render multiline texts', () => {
imgSnapshotTest(
`graph LR
A1[Multi<br>Line] -->|Multi<br>Line| B1(Multi<br>Line)
C1[Multi<br/>Line] -->|Multi<br/>Line| D1(Multi<br/>Line)
E1[Multi<br />Line] -->|Multi<br />Line| F1(Multi<br />Line)
A2[Multi<br>Line] -->|Multi<br>Line| B2(Multi<br>Line)
C2[Multi<br/>Line] -->|Multi<br/>Line| D2(Multi<br/>Line)
E2[Multi<br />Line] -->|Multi<br />Line| F2(Multi<br />Line)
linkStyle 0 stroke:DarkGray,stroke-width:2px
linkStyle 1 stroke:DarkGray,stroke-width:2px
linkStyle 2 stroke:DarkGray,stroke-width:2px
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('18: Chaining of nodes', () => {
imgSnapshotTest(
`graph LR
a --> b --> c
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('19: Multiple nodes and chaining in one statement', () => {
imgSnapshotTest(
`graph LR
a --> b & c--> d
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('20: Multiple nodes and chaining in one statement', () => {
imgSnapshotTest(
`graph TD
A[ h ] -- hello --> B[" test "]:::exClass & C --> D;
classDef exClass background:#bbb,border:1px solid red;
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('21: Render cylindrical shape', () => {
imgSnapshotTest(
`graph LR
A[(cylindrical<br />shape<br />test)]
A -->|Get money| B1[(Go shopping 1)]
A -->|Get money| B2[(Go shopping 2)]
A -->|Get money| B3[(Go shopping 3)]
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?)]
B1 --> C
B2 --> C
B3 --> C
C -->|One| D[(Laptop)]
C -->|Two| E[(iPhone)]
C -->|Three| F[(Car)]
click A "index.html#link-clicked" "link test"
click B testClick "click test"
classDef someclass fill:#f96;
class A someclass;`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('22: Render a simple flowchart with nodeSpacing set to 100', () => {
imgSnapshotTest(
`graph 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: { nodeSpacing: 50 }, fontFamily: 'courier' }
);
});
it('23: Render a simple flowchart with rankSpacing set to 100', () => {
imgSnapshotTest(
`graph 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: { rankSpacing: '100' }, fontFamily: 'courier' }
);
});
it('24: Keep node label text (if already defined) when a style is applied', () => {
imgSnapshotTest(
`graph LR
A(( )) -->|step 1| B(( ))
B(( )) -->|step 2| C(( ))
C(( )) -->|step 3| D(( ))
linkStyle 1 stroke:greenyellow,stroke-width:2px
style C fill:greenyellow,stroke:green,stroke-width:4px
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('25: Handle link click events (link, anchor, mailto, other protocol, script)', () => {
imgSnapshotTest(
`graph TB
TITLE["Link Click Events<br>(click the nodes below)"]
A["link test (open in same tab)"]
B["link test (open in new tab)"]
C[anchor test]
D[mailto test]
E[other protocol test]
F[script test]
TITLE --> A & B & C & D & E & F
click A "https://mermaid-js.github.io/mermaid/#/" "link test (open in same tab)"
click B "https://mermaid-js.github.io/mermaid/#/" "link test (open in new tab)" _blank
click C "#link-clicked"
click D "mailto:user@user.user" "mailto test"
click E "notes://do-your-thing/id" "other protocol test"
click F "javascript:alert('test')" "script test"
`,
{ securityLevel: 'loose', fontFamily: 'courier' }
);
});
it('26: Set text color of nodes and links according to styles when html labels are enabled', () => {
imgSnapshotTest(
`graph LR
A[red<br>text] -->|red<br>text| B(blue<br>text)
C[/red<br/>text/] -->|blue<br/>text| D{blue<br/>text}
E{{default<br />style}} -->|default<br />style| F([default<br />style])
linkStyle default color:Sienna;
linkStyle 0 color:red;
linkStyle 1 stroke:DarkGray,stroke-width:2px,color:#0000ff
style A color:red;
style B color:blue;
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000
style D stroke:#0000ff,fill:#ccccff,color:#0000ff
click B "index.html#link-clicked" "link test"
click D testClick "click test"
`,
{ flowchart: { htmlLabels: true } }
);
});
it('27: Set text color of nodes and links according to styles when html labels are disabled', () => {
imgSnapshotTest(
`graph LR
A[red<br>text] -->|red<br>text| B(blue<br>text)
C[/red<br/>text/] -->|blue<br/>text| D{blue<br/>text}
E{{default<br />style}} -->|default<br />style| F([default<br />style])
linkStyle default color:Sienna;
linkStyle 0 color:red;
linkStyle 1 stroke:DarkGray,stroke-width:2px,color:#0000ff
style A color:red;
style B color:blue;
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000
style D stroke:#0000ff,fill:#ccccff,color:#0000ff
click B "index.html#link-clicked" "link test"
click D testClick "click test"
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('28: Apply default class to all nodes which do not have another class assigned (htmlLabels enabled)', () => {
imgSnapshotTest(
`graph TD
A[myClass1] --> B[default] & C[default]
B[default] & C[default] --> D[myClass2]
classDef default stroke-width:2px,fill:none,stroke:silver
classDef node color:red
classDef myClass1 color:#0000ff
classDef myClass2 stroke:#0000ff,fill:#ccccff
class A myClass1
class D myClass2
`,
{ flowchart: { htmlLabels: true } }
);
});
it('29: Apply default class to all nodes which do not have another class assigned (htmlLabels disabled)', () => {
imgSnapshotTest(
`graph TD
A[myClass1] --> B[default] & C[default]
B[default] & C[default] --> D[myClass2]
classDef default stroke-width:2px,fill:none,stroke:silver
classDef node color:red
classDef myClass1 color:#0000ff
classDef myClass2 stroke:#0000ff,fill:#ccccff
class A myClass1
class D myClass2
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('30: Possibility to style text color of nodes and subgraphs as well as apply classes to subgraphs', () => {
imgSnapshotTest(
`graph LR
subgraph id1 [title is set]
A-->B
end
subgraph id2 [title]
E
end
B-->C
subgraph id3
C-->D
end
class id3,id2,A redBg;
class id3,A whiteTxt;
classDef redBg fill:#622;
classDef whiteTxt color: white;
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('31: should not slice off edges that are to the left of the left-most vertex', () => {
imgSnapshotTest(
`graph TD
work --> sleep
sleep --> work
eat --> sleep
work --> eat
`,
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
it('32: Render Subroutine shape', () => {
imgSnapshotTest(
`graph LR
A[[subroutine 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('33: should render a simple flowchart with diagramPadding set to 0', () => {
imgSnapshotTest(
`graph 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('34: testing the label width in percy', () => {
imgSnapshotTest(
`graph TD
A[Christmas]
`,
{ }
);
});
it('35: should honor minimum edge length as specified by the user', () => {
imgSnapshotTest(
`graph 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('36: should render escaped without html labels', () => {
imgSnapshotTest(
`graph TD
a["<strong>Haiya</strong>"]-->b
`,
{htmlLabels: false, flowchart: {htmlLabels: false}}
);
});
it('37: should render non-escaped with html labels', () => {
imgSnapshotTest(
`graph TD
a["<strong>Haiya</strong>"]-->b
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
it('38: should render a flowchart when useMaxWidth is true (default)', () => {
renderGraph(
`graph 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 * .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(300 * .95, 300 * 1.05);
});
});
it('39: should render a flowchart when useMaxWidth is false', () => {
renderGraph(
`graph 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 * .95, 446 * 1.05);
expect(width).to.be.within(300 * .95, 300 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
it('58: handle styling with style expressions', () => {
imgSnapshotTest(
`
graph 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('61: fontawesome icons in edge labels', () => {
imgSnapshotTest(
`
graph TD
C -->|fa:fa-car Car| F[fa:fa-car Car]
`,
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
);
});
});

View File

@@ -0,0 +1,261 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Gantt diagram', () => {
beforeEach(()=>{
cy.clock((new Date('1010-10-10')).getTime())
})
it('should render a gantt chart', () => {
imgSnapshotTest(
`
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
`,
{}
);
});
it('Handle multiline section titles with different line breaks', () => {
imgSnapshotTest(
`
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title GANTT diagram with multiline section titles
excludes weekdays 2014-01-10
section A section<br>multiline
Completed task : done, des1, 2014-01-06,2014-01-08
Active task : active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks<br/>multiline
Completed task in the critical line : crit, done, 2014-01-06, 24h
Implement parser and jison : crit, done, after des1, 2d
Create tests for parser : crit, active, 3d
Future task in critical line : crit, 5d
Create tests for renderer : 2d
Add to mermaid : 1d
section Documentation<br />multiline
Describe gantt syntax : active, a1, after des1, 3d
Add gantt diagram to demo page : after a1, 20h
Add another diagram to demo page : doc1, after a1, 48h
section Last section<br />multiline
Describe gantt syntax : after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
`,
{}
);
});
it('Multiple dependencies syntax', () => {
imgSnapshotTest(
`
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
apple :a, 2017-07-20, 1w
banana :crit, b, 2017-07-23, 1d
cherry :active, c, after b a, 1d
`,
{}
);
});
it('should render a gantt chart for issue #1060', () => {
imgSnapshotTest(
`
gantt
excludes weekdays 2017-01-10
title Projects Timeline
section asdf
specs :done, :ps, 2019-05-10, 50d
Plasma :pc, 2019-06-20, 60d
Rollup :or, 2019-08-20, 50d
section CEL
plasma-chamber :done, :pc, 2019-05-20, 60d
Plasma Implementation (Rust) :por, 2019-06-20, 120d
Predicates (Atomic Swap) :pred, 2019-07-20, 60d
section DEX
History zkSNARK :hs, 2019-08-10, 40d
Exit :vs, after hs, 60d
PredicateSpec :ps, 2019-09-1, 20d
PlasmaIntegration :pi, after ps,40d
section Events
ETHBoston :done, :eb, 2019-09-08, 3d
DevCon :active, :dc, 2019-10-08, 3d
section Plasma Calls & updates
OVM :ovm, 2019-07-12, 120d
Plasma call 26 :pc26, 2019-08-21, 1d
Plasma call 27 :pc27, 2019-09-03, 1d
Plasma call 28 :pc28, 2019-09-17, 1d
`,
{}
);
});
it('should hide today marker', () => {
imgSnapshotTest(
`
gantt
title Hide today marker (vertical line should not be visible)
dateFormat YYYY-MM-DD
axisFormat %d
todayMarker off
section Section1
Today: 1, -1h
`,
{}
);
});
it('should style today marker', () => {
imgSnapshotTest(
`
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
`,
{}
);
});
it('should render a gantt diagram when useMaxWidth is true (default)', () => {
renderGraph(
`
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
`,
{ gantt: { 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(484 * .95, 484 * 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(984 * .95, 984 * 1.05);
});
});
it('should render a gantt diagram when useMaxWidth is false', () => {
renderGraph(
`
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
`,
{ gantt: { 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(484 * .95, 484 * 1.05);
expect(width).to.be.within(984 * .95, 984 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
});

View File

@@ -0,0 +1,21 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Sequencediagram', () => {
// it('should render a simple git graph', () => {
// imgSnapshotTest(
// `
// gitGraph:
// commit
// branch newbranch
// checkout newbranch
// commit
// commit
// checkout master
// commit
// commit
// merge newbranch`,
// { logLevel: 0 }
// );
// });
});

View File

@@ -0,0 +1,14 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Sequencediagram', () => {
it('should render a simple info diagrams', () => {
imgSnapshotTest(
`
info
showInfo
`,
{}
);
});
});

View File

@@ -0,0 +1,70 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('User journey diagram', () => {
it('Simple test', () => {
imgSnapshotTest(
`journey
title Adding journey diagram functionality to mermaid
section Order from website
`,
{}
);
});
it('should render a user journey chart', () => {
imgSnapshotTest(
`
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
`,
{}
);
});
it('should render a user journey diagram when useMaxWidth is true (default)', () => {
renderGraph(
`journey
title Adding journey diagram functionality to mermaid
section Order from website
`,
{ journey: { useMaxWidth: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height');
const height = parseFloat(svg.attr('height'));
expect(height).to.eq(20);
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
expect(maxWidthValue).to.eq(400);
});
});
it('should render a user journey diagram when useMaxWidth is false', () => {
renderGraph(
`journey
title Adding journey diagram functionality to mermaid
section Order from website
`,
{ journey: { useMaxWidth: false } }
);
cy.get('svg')
.should((svg) => {
const height = parseFloat(svg.attr('height'));
const width = parseFloat(svg.attr('width'));
expect(height).to.eq(20);
expect(width).to.eq(400);
expect(svg).to.not.have.attr('style');
});
});
});

View File

@@ -0,0 +1,81 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Pie Chart', () => {
it('should render a simple pie diagram', () => {
imgSnapshotTest(
`
pie title Sports in Sweden
"Bandy" : 40
"Ice-Hockey" : 80
"Football" : 90
`,
{}
);
cy.get('svg');
});
it('should render a simple pie diagram with long labels', () => {
imgSnapshotTest(
`
pie title NETFLIX
"Time spent looking for movie" : 90
"Time spent watching it" : 10
`,
{}
);
cy.get('svg');
});
it('should render a simple pie diagram with capital letters for labels', () => {
imgSnapshotTest(
`
pie title What Voldemort doesn't have?
"FRIENDS" : 2
"FAMILY" : 3
"NOSE" : 45
`,
{}
);
cy.get('svg');
});
it('should render a pie diagram when useMaxWidth is true (default)', () => {
renderGraph(
`
pie title Sports in Sweden
"Bandy" : 40
"Ice-Hockey" : 80
"Football" : 90
`,
{ pie: { useMaxWidth: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height');
const height = parseFloat(svg.attr('height'));
expect(height).to.eq(450);
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
expect(maxWidthValue).to.eq(984);
});
});
it('should render a pie diagram when useMaxWidth is false', () => {
renderGraph(
`
pie title Sports in Sweden
"Bandy" : 40
"Ice-Hockey" : 80
"Football" : 90
`,
{ pie: { useMaxWidth: false } }
);
cy.get('svg')
.should((svg) => {
const height = parseFloat(svg.attr('height'));
const width = parseFloat(svg.attr('width'));
expect(height).to.eq(450);
expect(width).to.eq(984);
expect(svg).to.not.have.attr('style');
});
});
});

View File

@@ -0,0 +1,614 @@
/// <reference types="Cypress" />
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
context('Sequence diagram', () => {
it('should render a simple sequence diagram', () => {
imgSnapshotTest(
`
sequenceDiagram
participant Alice
participant Bob
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:{actorFontFamily:'courier'}}
);
});
it('should handle different line breaks', () => {
imgSnapshotTest(
`
sequenceDiagram
participant 1 as multiline<br>using #lt;br#gt;
participant 2 as multiline<br/>using #lt;br/#gt;
participant 3 as multiline<br />using #lt;br /#gt;
participant 4 as multiline<br \t/>using #lt;br \t/#gt;
1->>2: multiline<br>using #lt;br#gt;
note right of 2: multiline<br>using #lt;br#gt;
2->>3: multiline<br/>using #lt;br/#gt;
note right of 3: multiline<br/>using #lt;br/#gt;
3->>4: multiline<br />using #lt;br /#gt;
note right of 4: multiline<br />using #lt;br /#gt;
4->>1: multiline<br />using #lt;br /#gt;
note right of 1: multiline<br \t/>using #lt;br \t/#gt;
`,
{}
);
});
it('should render loops with a slight margin', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
loop Loopy
Bob->>Alice: Pasten
end `,
{}
);
});
context('font settings', () => {
it('should render different note fonts when configured', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
note left of Alice: I should have bigger fonts
Bob->>Alice: Short as well
`,
{ sequence: { noteFontSize: 18, noteFontFamily: 'Arial' } }
);
});
it('should render different message fonts when configured', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
Bob->>Alice: Short as well
`,
{ sequence: { messageFontSize: 18, messageFontFamily: 'Arial' } }
);
});
it('should render different actor fonts when configured', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
Bob->>Alice: Short as well
`,
{ sequence: { actorFontSize: 18, actorFontFamily: 'times' } }
);
});
it('should render notes aligned to the left when configured', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
note left of Alice: I am left aligned
Bob->>Alice: Short as well
`,
{ sequence: { noteAlign: 'left' } }
);
});
it('should render notes aligned to the right when configured', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
note left of Alice: I am right aligned
Bob->>Alice: Short as well
`,
{ sequence: { noteAlign: 'right' } }
);
});
});
context('auth width scaling', () => {
it('should render long actor descriptions', () => {
imgSnapshotTest(
`
sequenceDiagram
participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
A->>Bob: Hola
Bob-->A: Pasten !
`,
{logLevel: 0}
);
});
it('should wrap (inline) long actor descriptions', () => {
imgSnapshotTest(
`
sequenceDiagram
participant A as wrap:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
A->>Bob: Hola
Bob-->A: Pasten !
`,
{logLevel: 0}
);
});
it('should wrap (directive) long actor descriptions', () => {
imgSnapshotTest(
`
%%{init: {'config': {'wrap': true }}}%%
sequenceDiagram
participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
A->>Bob: Hola
Bob-->A: Pasten !
`,
{}
);
});
it('should render long notes left of actor', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Hola
Note left of Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long notes wrapped (inline) left of actor', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Hola
Note left of Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long notes right of actor', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Hola
Note right of Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long notes wrapped (inline) right of actor', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Hola
Note right of Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long notes over actor', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Hola
Note over Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long notes wrapped (inline) over actor', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Hola
Note over Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long messages from an actor to the left to one to the right', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long messages wrapped (inline) from an actor to the left to one to the right', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob:wrap:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
`,
{}
);
});
it('should render long messages from an actor to the right to one to the left', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
Bob->>Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
`,
{}
);
});
it('should render long messages wrapped (inline) from an actor to the right to one to the left', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>Bob: I'm short
Bob->>Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
`,
{}
);
});
});
context('background rects', () => {
it('should render a single and nested rects', () => {
imgSnapshotTest(
`
sequenceDiagram
participant A
participant B
participant C
participant D
participant E
participant G
A ->>+ B: Task 1
rect rgb(178, 102, 255)
B ->>+ C: Task 2
C -->>- B: Return
end
A ->> D: Task 3
rect rgb(0, 128, 255)
D ->>+ E: Task 4
rect rgb(0, 204, 0)
E ->>+ G: Task 5
G -->>- E: Return
end
E ->> E: Task 6
end
D -->> A: Complete
`,
{}
);
});
it('should render a single and nested opt with long test overflowing', () => {
imgSnapshotTest(
`
sequenceDiagram
participant A
participant B
participant C
participant D
participant E
participant G
A ->>+ B: Task 1
opt this is an opt with a long title that will overflow
B ->>+ C: Task 2
C -->>- B: Return
end
A ->> D: Task 3
opt this is another opt with a long title that will overflow
D ->>+ E: Task 4
opt this is a nested opt with a long title that will overflow
E ->>+ G: Task 5
G -->>- E: Return
end
E ->> E: Task 6
end
D -->> A: Complete
`,
{}
);
});
it('should render a single and nested opt with long test wrapping', () => {
imgSnapshotTest(
`
%%{init: { 'config': { 'wrap': true } } }%%
sequenceDiagram
participant A
participant B
participant C
participant D
participant E
participant G
A ->>+ B: Task 1
opt this is an opt with a long title that will overflow
B ->>+ C: Task 2
C -->>- B: Return
end
A ->> D: Task 3
opt this is another opt with a long title that will overflow
D ->>+ E: Task 4
opt this is a nested opt with a long title that will overflow
E ->>+ G: Task 5
G -->>- E: Return
end
E ->> E: Task 6
end
D -->> A: Complete
`,
{}
);
});
it('should render rect around and inside loops', () => {
imgSnapshotTest(
`
sequenceDiagram
A ->> B: 1
rect rgb(204, 0, 102)
loop check C
C ->> C: Every 10 seconds
end
end
A ->> B: 2
loop check D
C ->> D: 3
rect rgb(153, 153, 255)
D -->> D: 5
D --> C: 4
end
end
`,
{}
);
});
it('should render rect around and inside alts', () => {
imgSnapshotTest(
`
sequenceDiagram
A ->> B: 1
rect rgb(204, 0, 102)
alt yes
C ->> C: 1
else no
rect rgb(0, 204, 204)
C ->> C: 0
end
end
end
B ->> A: Return
`,
{}
);
});
it('should render rect around and inside opts', () => {
imgSnapshotTest(
`
sequenceDiagram
A ->> B: 1
rect rgb(204, 0, 102)
opt maybe
C -->> D: Do something
rect rgb(0, 204, 204)
C ->> C: 0
end
end
end
opt possibly
rect rgb(0, 204, 204)
C ->> C: 0
end
end
B ->> A: Return
`,
{}
);
});
it('should render autonumber when configured with such', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
`,
{ sequence: { actorMargin: 50, showSequenceNumbers: true } }
);
});
it('should render autonumber when autonumber keyword is used', () => {
imgSnapshotTest(
`
sequenceDiagram
autonumber
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
`,
{}
);
});
it('should render autonumber with different line breaks', () => {
imgSnapshotTest(
`
sequenceDiagram
autonumber
Alice->>John: Hello John,<br>how are you?
Alice->>John: John,<br/>can you hear me?
John-->>Alice: Hi Alice,<br />I can hear you!
John-->>Alice: I feel great!
`,
{}
);
});
it('should render dark theme from init directive and configure font size 24 font', () => {
imgSnapshotTest(
`
%%{init: {'theme': 'dark', 'config': {'fontSize': 24}}}%%
sequenceDiagram
Alice->>John: Hello John, how are you?
Alice->>John: John, can you hear me?
John-->>Alice: Hi Alice, I can hear you!
John-->>Alice: I feel great!
`,
{}
);
});
it('should render with wrapping enabled', () => {
imgSnapshotTest(
`
%%{init: { 'config': { 'wrap': true }}}%%
sequenceDiagram
participant A as Alice, the talkative one
A->>John: Hello John, how are you today? I'm feeling quite verbose today.
A->>John: John, can you hear me? If you are not available, we can talk later.
John-->>A: Hi Alice, I can hear you! I was finishing up an important meeting.
John-->>A: I feel great! I was not ignoring you. I am sorry you had to wait for a response.
`,
{}
);
});
it('should render with an init directive', () => {
imgSnapshotTest(
`%%{init: { "theme": "dark", 'config': { "fontFamily": "Menlo", "fontSize": 18, "fontWeight": 400, "wrap": true }}}%%
sequenceDiagram
Alice->>Bob: Hello Bob, how are you? If you are not available right now, I can leave you a message. Please get back to me as soon as you can!
Note left of Alice: Bob thinks
Bob->>Alice: Fine!`,
{}
)
});
});
context('directives', () => {
it('should override config with directive settings', () => {
imgSnapshotTest(
`
%%{init: { "config": { "mirrorActors": true }}}%%
sequenceDiagram
Alice->>Bob: I'm short
note left of Alice: config set to mirrorActors: false<br/>directive set to mirrorActors: true
Bob->>Alice: Short as well
`,
{ logLevel:0, sequence: { mirrorActors: false, noteFontSize: 18, noteFontFamily: 'Arial' } }
);
});
it('should override config with directive settings', () => {
imgSnapshotTest(
`
%%{init: { "config": { "mirrorActors": false, "wrap": true }}}%%
sequenceDiagram
Alice->>Bob: I'm short
note left of Alice: config: mirrorActors=true<br/>directive: mirrorActors=false
Bob->>Alice: Short as well
`,
{ logLevel:0, sequence: { mirrorActors: true, noteFontSize: 18, noteFontFamily: 'Arial' } }
);
});
});
context('svg size', () => {
it('should render a sequence diagram when useMaxWidth is true (default)', () => {
renderGraph(
`
sequenceDiagram
participant Alice
participant Bob
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: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height');
const height = parseFloat(svg.attr('height'));
expect(height).to.eq(920);
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(maxWidthValue).to.be.within(820 * .95, 820 * 1.05);
});
});
it('should render a sequence diagram when useMaxWidth is false', () => {
renderGraph(
`
sequenceDiagram
participant Alice
participant Bob
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 height = parseFloat(svg.attr('height'));
const width = parseFloat(svg.attr('width'));
expect(height).to.eq(920);
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(width).to.be.within(820 * .95, 820 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
});
});

View File

@@ -0,0 +1,400 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
describe('State diagram', () => {
it('v2 should render a simple info', () => {
imgSnapshotTest(
`
info
`,
{ logLevel: 1, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a simple state diagrams', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> State1
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a long descriptions instead of id when available', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> S1
state "Some long name" as S1
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a long descriptions with additional descriptions', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> S1
state "Some long name" as S1: The description
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a single state with short descriptions', () => {
imgSnapshotTest(
`
stateDiagram-v2
state "A long long name" as long1
state "A" as longlonglongid
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a transition descriptions with new lines', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> S1
S1 --> S2: long line using<br/>should work
S1 --> S3: long line using <br>should work
S1 --> S4: long line using \\nshould work
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a state with a note', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a state with on the left side when so specified', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1: The state with a note with minus - and plus + in it
note left of State1
Important information! You can write
notes with . and in them.
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a state with a note together with another state', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1: The state with a note +,-
note right of State1
Important information! You can write +,-
notes.
end note
State1 --> State2 : With +,-
note left of State2 : This is the note +,-<br/>
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a note with multiple lines in it', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You\ncan write
notes with multiple lines...
Here is another line...
And another line...
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should handle multiline notes with different line breaks', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1
note right of State1
Line1<br>Line2<br/>Line3<br />Line4<br />Line5
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should render a states with descriptions including multi-line descriptions', () => {
imgSnapshotTest(
`
stateDiagram-v2
State1: This a a single line description
State2: This a a multi line description
State2: here comes the multi part
[*] --> State1
State1 --> State2
State2 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a simple state diagrams', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> State1
State1 --> State2
State1 --> State3
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a simple state diagrams with labels', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> State1
State1 --> State2 : Transition 1
State1 --> State3 : Transition 2
State1 --> State4 : Transition 3
State1 --> State5 : Transition 4
State2 --> State3 : Transition 5
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render state descriptions', () => {
imgSnapshotTest(
`
stateDiagram-v2
state "Long state description" as XState1
state "Another Long state description" as XState2
XState2 : New line
XState1 --> XState2
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render composite states', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> NotShooting: Pacifist
NotShooting --> A
NotShooting --> B
NotShooting --> C
state NotShooting {
[*] --> Idle: Yet another long long öong öong öong label
Idle --> Configuring : EvConfig
Configuring --> Idle : EvConfig EvConfig EvConfig EvConfig EvConfig
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render multiple composite states', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*]-->TV
state TV {
[*] --> Off: Off to start with
On --> Off : Turn off
Off --> On : Turn on
}
TV--> Console
state Console {
[*] --> Off2: Off to start with
On2--> Off2 : Turn off
Off2 --> On2 : Turn on
On2-->Playing
state Playing {
Alive --> Dead
Dead-->Alive
}
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should render forks in composite states', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*]-->TV
state TV {
state fork_state &lt;&lt;fork&gt;&gt;
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state &lt;&lt;join&gt;&gt;
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should render forks and joins', () => {
imgSnapshotTest(
`
stateDiagram-v2
state fork_state &lt;&lt;fork&gt;&gt;
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state &lt;&lt;join&gt;&gt;
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render concurrency states', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('v2 should render a state with states in it', () => {
imgSnapshotTest(
`
stateDiagram-v2
state PilotCockpit {
state Parent {
C
}
}
`,
{
logLevel: 0,
}
);
});
it('v2 Simplest composite state', () => {
imgSnapshotTest(
`
stateDiagram-v2
state Parent {
C
}
`,
{
logLevel: 0, fontFamily: 'courier'
}
);
});
it('v2 should handle multiple arrows from one node to another', () => {
imgSnapshotTest(
`
stateDiagram-v2
a --> b: Start
a --> b: Stop
`,
{
logLevel: 0, fontFamily: 'courier',
}
);
});
it('v2 should render a state diagram when useMaxWidth is true (default)', () => {
renderGraph(
`
stateDiagram-v2
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height');
const height = parseFloat(svg.attr('height'));
expect(height).to.eq(177);
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(maxWidthValue).to.be.within(135 * .95, 135 * 1.05);
});
});
it('v2 should render a state diagram when useMaxWidth is false', () => {
renderGraph(
`
stateDiagram-v2
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: false } }
);
cy.get('svg')
.should((svg) => {
const height = parseFloat(svg.attr('height'));
const width = parseFloat(svg.attr('width'));
expect(height).to.eq(177);
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(width).to.be.within(135 * .95, 135 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
});

View File

@@ -0,0 +1,388 @@
/* eslint-env jest */
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
describe('State diagram', () => {
it('should render a simple state diagrams', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> State1
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a long descriptions instead of id when available', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> S1
state "Some long name" as S1
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a long descriptions with additional descriptions', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> S1
state "Some long name" as S1: The description
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a single state with short descriptions', () => {
imgSnapshotTest(
`
stateDiagram
state "A long long name" as long1
state "A" as longlonglongid
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a transition descriptions with new lines', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> S1
S1 --> S2: long line using<br/>should work
S1 --> S3: long line using <br>should work
S1 --> S4: long line using \\nshould work
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a state with a note', () => {
imgSnapshotTest(
`
stateDiagram
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a state with on the left side when so specified', () => {
imgSnapshotTest(
`
stateDiagram
State1: The state with a note with minus - and plus + in it
note left of State1
Important information! You can write
notes with . and in them.
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a state with a note together with another state', () => {
imgSnapshotTest(
`
stateDiagram
State1: The state with a note +,-
note right of State1
Important information! You can write +,-
notes.
end note
State1 --> State2 : With +,-
note left of State2 : This is the note +,-<br/>
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a note with multiple lines in it', () => {
imgSnapshotTest(
`
stateDiagram
State1: The state with a note
note right of State1
Important information! You\ncan write
notes with multiple lines...
Here is another line...
And another line...
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should handle multiline notes with different line breaks', () => {
imgSnapshotTest(
`
stateDiagram
State1
note right of State1
Line1<br>Line2<br/>Line3<br />Line4<br />Line5
end note
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should render a states with descriptions including multi-line descriptions', () => {
imgSnapshotTest(
`
stateDiagram
State1: This a a single line description
State2: This a a multi line description
State2: here comes the multi part
[*] --> State1
State1 --> State2
State2 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a simple state diagrams', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> State1
State1 --> State2
State1 --> State3
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a simple state diagrams with labels', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> State1
State1 --> State2 : Transition 1
State1 --> State3 : Transition 2
State1 --> State4 : Transition 3
State1 --> State5 : Transition 4
State2 --> State3 : Transition 5
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render state descriptions', () => {
imgSnapshotTest(
`
stateDiagram
state "Long state description" as XState1
state "Another Long state description" as XState2
XState2 : New line
XState1 --> XState2
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render composite states', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> NotShooting: Pacifist
NotShooting --> A
NotShooting --> B
NotShooting --> C
state NotShooting {
[*] --> Idle: Yet another long long öong öong öong label
Idle --> Configuring : EvConfig
Configuring --> Idle : EvConfig EvConfig EvConfig EvConfig EvConfig
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render multiple composit states', () => {
imgSnapshotTest(
`
stateDiagram
[*]-->TV
state TV {
[*] --> Off: Off to start with
On --> Off : Turn off
Off --> On : Turn on
}
TV--> Console
state Console {
[*] --> Off2: Off to start with
On2--> Off2 : Turn off
Off2 --> On2 : Turn on
On2-->Playing
state Playing {
Alive --> Dead
Dead-->Alive
}
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should render forks in composit states', () => {
imgSnapshotTest(
`
stateDiagram
[*]-->TV
state TV {
state fork_state &lt;&lt;fork&gt;&gt;
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state &lt;&lt;join&gt;&gt;
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should render forks and joins', () => {
imgSnapshotTest(
`
stateDiagram
state fork_state &lt;&lt;fork&gt;&gt;
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state &lt;&lt;join&gt;&gt;
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render concurrency states', () => {
imgSnapshotTest(
`
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
`,
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
it('should render a state with states in it', () => {
imgSnapshotTest(
`
stateDiagram
state PilotCockpit {
state Parent {
C
}
}
`,
{
logLevel: 0, fontFamily: 'courier'
}
);
});
it('Simplest composite state', () => {
imgSnapshotTest(
`
stateDiagram
state Parent {
C
}
`,
{
logLevel: 0, fontFamily: 'courier'
}
);
});
it('should handle multiple arrows from one node to another', () => {
imgSnapshotTest(
`
stateDiagram
a --> b: Start
a --> b: Stop
`,
{
logLevel: 0, fontFamily: 'courier'
}
);
});
it('should render a state diagram when useMaxWidth is true (default)', () => {
renderGraph(
`
stateDiagram
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: true } }
);
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height');
const height = parseFloat(svg.attr('height'));
expect(height).to.eq(139);
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(maxWidthValue).to.be.within(112 * .95, 112 * 1.05);
});
});
it('should render a state diagram when useMaxWidth is false', () => {
renderGraph(
`
stateDiagram
[*] --> State1
State1 --> [*]
`,
{ state: { useMaxWidth: false } }
);
cy.get('svg')
.should((svg) => {
const height = parseFloat(svg.attr('height'));
const width = parseFloat(svg.attr('width'));
expect(height).to.eq(139);
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(width).to.be.within(112 * .95, 112 * 1.05);
expect(svg).to.not.have.attr('style');
});
});
});

View File

@@ -0,0 +1,280 @@
/* eslint-env jest */
import { imgSnapshotTest } from '../../helpers/util.js';
describe('Pie Chart', () => {
// beforeEach(()=>{
// cy.clock((new Date('2014-06-09')).getTime());
// });
['default', 'forest', 'dark', 'neutral'].forEach(theme=>{
describe(theme, () => {
it('should render a pie diagram', () => {
imgSnapshotTest(
`
pie title Sports in Sweden
"Bandy" : 40
"Ice-Hockey" : 80
"Football" : 90
`,
{theme}
);
cy.get('svg');
});
it('should render a flowchart diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0} }%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
`,
{theme}
);
cy.get('svg');
});
it('should render a new flowchart diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
`,
{theme}
);
cy.get('svg');
});
it('should render a sequence diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
`,
{theme}
);
cy.get('svg');
});
it('should render a class diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
classDiagram
Animal "*" <|-- "1" Duck
Animal "1" <|-- "10" Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
classA <|-- classB
classC *-- classD
classE o-- classF
classG <-- classH
classI -- classJ
classK <.. classL
classM <|.. classN
classO .. classP
classA --|> classB : Inheritance
classC --* classD : Composition
classE --o classF : Aggregation
classG --> classH : Association
classI -- classJ : Link(Solid)
classK ..> classL : Dependency
classM ..|> classN : Realization
classO .. classP : Link(Dashed)
`,
{theme}
);
cy.get('svg');
});
it('should render a state diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
note right of SomethingElse : This is the note to the right.
`,
{theme}
);
cy.get('svg');
});
it('should render a state diagram (v2)', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
note right of SomethingElse2 : This is the note to the right.
`,
{theme}
);
cy.get('svg');
});
it('should render a er diagram', () => {
imgSnapshotTest(
`
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
`,
{theme}
);
cy.get('svg');
});
it('should render a user journey diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
`,
{theme}
);
cy.get('svg');
});
it('should render a gantt diagram', () => {
cy.clock((new Date('2014-01-06')).getTime());
imgSnapshotTest(
`
gantt
dateFormat :YYYY-MM-DD
title :Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
`,
{theme}
);
cy.get('svg');
});
});
});
});

View File

@@ -0,0 +1,61 @@
import mermaid from '../../dist/mermaid.core';
let code = `flowchart LR
Power_Supply --> Transmitter_A
Power_Supply --> Transmitter_B
Transmitter_A --> D
Transmitter_B --> D`;
let code2 = `gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d`;
const code3 = `flowchart TD
A(<img scr='https://iconscout.com/ms-icon-310x310.png' width='20' height='20' />)
B(<b>Bold text!</b>)`;
if (location.href.match('test-html-escaping')) {
code = code3;
}
mermaid.initialize({
theme: 'default',
// fontFamily: '"Lucida Console", Monaco, monospace',
startOnLoad: false,
securityLevel: 'loose',
flowchart: {
htmlLabels: true
},
gantt: {
axisFormatter: [
[
'%Y-%m-%d',
d => {
return d.getDay() === 1;
}
]
]
}
});
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')
);

139
cypress/platform/class.html Normal file
View File

@@ -0,0 +1,139 @@
<html>
<head>
<link
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/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';
}
h1 { color: white;}
.mermaid2 {
display: none;
}
.customCss > rect, .customCss{
fill:#FF0000 !important;
stroke:#FFFF00 !important;
stroke-width:4px !important;
}
</style>
</head>
<body>
<h1>info below</h1>
<div class="mermaid" style="width: 100%; height: 20%;">
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
classDiagram
class BankAccount{
+String owner
+BigDecimal balance
+deposit(amount) bool
+withdrawl(amount) int
}
cssClass "BankAccount" customCss
</div>
<div 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
</div>
<div class="mermaid2" style="width: 100%; height: 20%;">
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
classDiagram
class BankAccount{
+String owner
+BigDecimal balance
+deposit(amount) bool
+withdrawl(amount) int
}
Class01~T~ <|-- AveryLongClass : Cool
Class03~T~ *-- Class04~T~
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
class Class10~T~ {
&lt;&lt;service&gt;&gt;
int id
test()
}
callback Class01 "callback" "A Tooltip"
</div>
<div class="mermaid2" style="width: 100%; height: 20%;">
flowchart 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"
</div>
<div class="mermaid2" style="width: 100%; height: 20%;">
classDiagram-v2
classA -- classB : Inheritance
classA -- classC : link
classC -- classD : link
classB -- classD
classA --|> classB : Inheritance
classC --* classD : Composition
classE --o classF : Aggregation
classG --> classH : Association
classI -- classJ : Link(Solid)
classK ..> classL : Dependency
classM ..|> classN : Realization
classO .. classP : Link(Dashed)
classA : +attr1
classA : attr2
classA : method1()
&lt;&lt;interface&gt;&gt; classB
classB : method2() int
Customer "1" --> "*" Ticket
Student "1" --> "1..*" Course
Galaxy --> "many" Star : Contains
&lt;&lt;interface&gt;&gt; Customer
class Shape
callback Shape "callbackFunction" "This is a tooltip for a callback"
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'default',
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'linear', "htmlLabels": true },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
// fontFamily: '"arial", sans-serif',
// themeVariables: {
// fontFamily: '"arial", sans-serif',
// },
curve: 'linear',
securityLevel: 'loose'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<style>
.mermaid2 {
display: none;
}
</style>
</head>
<body>
<div style="display: flex">
<div id="FirstLine" class="mermaid">
graph TB
Function-->URL
click Function clickByFlow "Add a div"
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div id="FirstLine" class="mermaid">
graph TB
1Function--->2URL
click 1Function clickByFlow "Add a div"
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div id="FirstLine" class="mermaid">
flowchart TB
Function-->URL
click Function clickByFlow "Add a div"
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
</div>
<div id="FirstLine" class="mermaid">
flowchart TB
1Function--->2URL
click 1Function clickByFlow "Add a div"
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
</div>
<div id="FirstLine" class="mermaid">
classDiagram
class ShapeLink
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
class ShapeCallback
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
</div>
<div id="FirstLine" class="mermaid">
classDiagram-v2
class ShapeLink2
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
class ShapeCallback2
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
</div>
</div>
<div class="mermaid">
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Clickable
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
Calling a Callback (look at the console log) :cl2, after cl1, 3d
Calling a Callback with args :cl3, after cl1, 3d
click cl1 href "http://localhost:9000/webpackUsage.html"
click cl2 call clickByGantt()
click cl3 call clickByGantt("test1", test2, test3)
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
</div>
<script src="./mermaid.js"></script>
<script>
function clickByFlow(elemName) {
const div = document.createElement('div')
div.className = 'created-by-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Flow'
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByGantt(arg1, arg2, arg3) {
const div = document.createElement('div')
div.className = 'created-by-gant-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Gant'
if (arg1) div.innerText += ' ' + arg1;
if (arg2) div.innerText += ' ' + arg2;
if (arg3) div.innerText += ' ' + arg3;
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByClass() {
const div = document.createElement('div')
div.className = 'created-by-class-click'
div.style = 'padding: 20px; background: purple; color: white;'
div.innerText = 'Clicked By Class'
document.getElementsByTagName('body')[0].appendChild(div)
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
</script>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
</head>
<body>
<div id="FirstLine" class="mermaid">
graph TB
Function-->URL
click Function clickByFlow "Add a div"
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div id="FirstLine" class="mermaid">
graph TB
1Function-->2URL
click 1Function clickByFlow "Add a div"
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div class="mermaid">
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Clickable
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
Calling a Callback (look at the console log) :cl2, after cl1, 3d
click cl1 href "http://localhost:9000/webpackUsage.html"
click cl2 call clickByGantt("test", test, test)
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
</div>
<script src="./mermaid.js"></script>
<script>
function clickByFlow(elemName) {
const div = document.createElement('div')
div.className = 'created-by-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Flow'
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByGantt(elemName) {
const div = document.createElement('div')
div.className = 'created-by-gant-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Gant'
document.getElementsByTagName('body')[0].appendChild(div)
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'strct', logLevel: 1 });
</script>
</body>
</html>

View File

@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
</head>
<body>
<div id="FirstLine" class="mermaid">
graph TB
Function-->URL
click Function clickByFlow "Add a div"
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div id="FirstLine" class="mermaid">
graph TB
1Function-->2URL
click 1Function clickByFlow "Add a div"
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div class="mermaid">
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Clickable
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
Calling a Callback (look at the console log) :cl2, after cl1, 3d
Calling a Callback with args :cl3, after cl1, 3d
click cl1 href "http://localhost:9000/webpackUsage.html"
click cl2 call clickByGantt()
click cl3 call clickByGantt("test1", test2, test3)
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
</div>
<script src="./mermaid.js"></script>
<script>
function clickByFlow(elemName) {
const div = document.createElement('div')
div.className = 'created-by-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Flow'
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByGantt(arg1, arg2, arg3) {
const div = document.createElement('div')
div.className = 'created-by-gant-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Gant'
if (arg1) div.innerText += ' ' + arg1;
if (arg2) div.innerText += ' ' + arg2;
if (arg3) div.innerText += ' ' + arg3;
document.getElementsByTagName('body')[0].appendChild(div)
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'strict', logLevel: 1 });
</script>
</body>
</html>

View File

@@ -0,0 +1,188 @@
<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';
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
</style>
</head>
<body>
<h1>info below</h1>
<div class="flex">
<div class="mermaid2" style="width: 50%; height: 20%;">
flowchart BT
subgraph two
b1
end
subgraph three
c1-->c2
end
c1 --apa apa apa--> b1
two --> c2
</div>
<div class="mermaid2" style="width: 50%; height: 200px;">
sequenceDiagram
Alice->>Bob:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
</div>
<div class="mermaid2" style="width: 50%; height: 200px;">
%%{init: {'securityLevel': 'loose'}}%%
graph TD
A[Christmas] -->|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]
click A "index.html#link-clicked" "link test"
click B callback "click test"
classDef someclass fill:#f96;
class A someclass;
class C someclass;
</div>
<div class="mermaid2" style="width: 50%; height: 200px;">
flowchart BT
subgraph a
b1 -- ok --> b2
end
a -- sert --> c
c --> d
b1 --> d
a --asd123 --> d
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
stateDiagram-v2
state A {
B1 --> B2: ok
}
A --> C: sert
C --> D
B1 --> D
A --> D: asd123
</div>
</div>
<div class="mermaid" style="width: 50%; height: 40%;">
%% this does not produce the desired result
flowchart 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
</div>
<div class="mermaid" style="width: 50%; height: 40%;">
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ff0000'}}}%%
flowchart TB
b-->B
a-->c
subgraph O
A
end
subgraph B
c
end
subgraph A
a
b
B
end
</div>
<div class="mermaid" style="width: 50%; height: 50%;">
flowchart TB
internet
nat
routeur
lb1
lb2
compute1
compute2
subgraph project
routeur
nat
subgraph subnet1
compute1
lb1
end
subgraph subnet2
compute2
lb2
end
end
internet --> routeur
routeur --> subnet1 & subnet2
subnet1 & subnet2 --> nat --> internet
</div>
<div class="mermaid" style="width: 50%; height: 50%;">
flowchart TD
subgraph one[One]
subgraph sub_one[Sub One]
_sub_one
end
end
subgraph two[Two]
_two
end
sub_one --> two
</div>
<div class="mermaid" style="width: 50%; height: 50%;">
flowchart 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
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
// theme: 'forest',
// themeVariables:{primaryColor: '#ff0000'},
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,129 @@
<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';
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
</style>
</head>
<body>
<h1>info below</h1>
<div class="flex">
<div class="mermaid2" style="width: 50%; height: 20%;">
flowchart BT
subgraph two
b1
end
subgraph three
c1-->c2
end
c1 --apa apa apa--> b1
two --> c2
</div>
<div class="mermaid2" style="width: 50%; height: 200px;">
sequenceDiagram
Alice->>Bob:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though
</div>
<div class="mermaid2" style="width: 50%; height: 200px;">
%%{init: {'securityLevel': 'loose'}}%%
graph TD
A[Christmas] -->|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]
click A "index.html#link-clicked" "link test"
click B callback "click test"
classDef someclass fill:#f96;
class A someclass;
class C someclass;
</div>
<div class="mermaid2" style="width: 50%; height: 200px;">
flowchart BT
subgraph a
b1 -- ok --> b2
end
a -- sert --> c
c --> d
b1 --> d
a --asd123 --> d
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
stateDiagram-v2
state A {
B1 --> B2: ok
}
A --> C: sert
C --> D
B1 --> D
A --> D: asd123
</div>
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ff0000'}}}%%
flowchart LR
a -->b
subgraph A
B
end
subgraph B
b
end
</div>
<div class="mermaid" style="width: 50%; height: 20%;">
flowchart TB
subgraph A
b-->B
a-->c
end
subgraph B
c
end
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
sequenceDiagram
Alice->Bob: Hello Bob, how are you?
Note over Alice,Bob: Looks
Note over Bob,Alice: Looks back
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
// theme: 'forest',
// themeVariables:{primaryColor: '#ff0000'},
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

52
cypress/platform/e2e.html Normal file
View File

@@ -0,0 +1,52 @@
<html>
<head>
<meta charset="utf-8"/>
<!-- <meta charset="iso-8859-15"/> -->
<script src="/e2e.js"></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;
}
.exClass2 > rect, .exClass {
fill: greenyellow !important;
}
</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>
</html>

View 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>
<div class="mermaid">
graph TB
subgraph One
a1-->a2-->a3
end
</div>
<div 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;
</div>
<div 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"
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.initialize({
theme: 'forest',
// themeCSS: '.node rect { fill: red; }',
logLevel: 3,
flowchart: { curve: 'linear' },
gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50 },
// sequenceDiagram: { actorMargin: 300 } // deprecated
});
</script>
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
<html>
<head>
<link
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>info below</h1>
<div class="mermaid">info</div>
<script src="./mermaid.js"></script>
<script>
mermaid.initialize({
theme: 'forest',
// themeCSS: '.node rect { fill: red; }',
logLevel: 3,
flowchart: { curve: 'linear' },
gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50 },
// sequenceDiagram: { actorMargin: 300 } // deprecated
});
</script>
</script>
</body>
</html>

View File

@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<style>
.mermaid2 {
display: none;
}
</style>
</head>
<body>
<div style="display: flex">
<div id="FirstLine" class="mermaid">
graph TB
Function-->URL
click Function clickByFlow "Add a div"
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div id="FirstLine" class="mermaid2">
graph TB
1Function-->2URL
click 1Function clickByFlow "Add a div"
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
</div>
<div id="FirstLine" class="mermaid2">
classDiagram
class Test
class ShapeLink
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
class ShapeCallback
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
</div>
<div id="FirstLine" class="mermaid">
classDiagram-v2
class ShapeCallback
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
</div>
<div id="FirstLine" class="mermaid">
classDiagram-v2
class ShapeLink
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
</div>
</div>
<div class="mermaid2">
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Clickable
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
Calling a Callback (look at the console log) :cl2, after cl1, 3d
Calling a Callback with args :cl3, after cl1, 3d
click cl1 href "http://localhost:9000/webpackUsage.html"
click cl2 call clickByGantt()
click cl3 call clickByGantt("test1", test2, test3)
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
</div>
<script src="./mermaid.js"></script>
<script>
function clickByFlow(elemName) {
const div = document.createElement('div')
div.className = 'created-by-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Flow'
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByGantt(arg1, arg2, arg3) {
const div = document.createElement('div')
div.className = 'created-by-gant-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Gant'
if (arg1) div.innerText += ' ' + arg1;
if (arg2) div.innerText += ' ' + arg2;
if (arg3) div.innerText += ' ' + arg3;
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByClass() {
const div = document.createElement('div')
div.className = 'created-by-class-click'
div.style = 'padding: 20px; background: purple; color: white;'
div.innerText = 'Clicked By Class'
document.getElementsByTagName('body')[0].appendChild(div)
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
</script>
</body>
</html>

123
cypress/platform/knsv.html Normal file
View File

@@ -0,0 +1,123 @@
<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';
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
</style>
</head>
<body>
<h1>info below</h1>
<div class="flex">
<div class="mermaid2" style="width: 50%; height: 400px;">
graph 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;
</div>
<div class="mermaid2" style="width: 50%; height: 400px;">
flowchart 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;
</div>
<div class="mermaid" style="width: 50%; height: 20%;">
graph TD
C -->|fa:fa-car Car| F[fa:fa-car Car]
</div>
<div class="mermaid" style="width: 50%; height: 20%;">
flowchart TD
C -->|fa:fa-car Car| F[fa:fa-car Car]
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
%%{init: {"fontFamily": "arial2"}}%%
graph TD
A[Christmas]
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
flowchart 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
</div>
<div class="mermaid2" style="width: 50%; height: 20%;">
graph 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
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
// theme: 'forest',
// themeVariables:{primaryColor: '#ff0000'},
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', htmlLabels: true },
htmlLabels: true,
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
// fontFamily: '"arial", sans-serif',
fontFamily: 'courier',
curve: 'cardinal',
securityLevel: 'loose'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
</head>
<body>
<div id="graph">
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.init({ startOnLoad: false });
mermaid.mermaidAPI.initialize();
try{
mermaid.mermaidAPI.render("graphDiv",
`>`);
} catch(e){}
mermaid.mermaidAPI.render("graphDiv",
`graph LR\n a --> b`, html => {
document.getElementById('graph').innerHTML=html;
});
</script>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
</head>
<body>
<div id="graph">
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.init({ startOnLoad: false });
mermaid.mermaidAPI.initialize();
rerender('XMas');
function rerender(text) {
var graphText = `graph TD
A[${text}] -->|Get money| B(Go shopping)`
var graph = mermaid.mermaidAPI.render('id', graphText);
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph)
document.getElementById('graph').innerHTML=graph;
}
</script>
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
</body>
</html>

View File

@@ -0,0 +1,251 @@
<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: #f4f4f4;
font-family: 'Arial';
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
.height {
min-height: 600px;
height: 600px;
}
.height2 {
min-height: 600px;
height: 1300px;
}
.width {
width: 33%;
border: 1px solid blue;
padding: 10px;
}
</style>
</head>
<body>
<h1>Showcases of diagrams</h1>
<div class="flex flex-wrap">
<div class="mermaid width height">
%%{init2: {'securityLevel': 'loose', 'theme':'base'}}%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height">
%%{init2: {'securityLevel': 'loose', 'theme':'base'}}%%
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height" >
%%{init2: {'securityLevel': 'loose', 'theme':'base'}}%%
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid width height" >
%%{init: {'securityLevel': 'loose', 'theme':'base'}}%%
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</div>
<div class="mermaid width height">
gantt
dateFormat :YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</div>
<div class="mermaid width height2">
%%{init2: {'securityLevel': 'loose', 'theme':'base'}}%%
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
note right of SomethingElse : This is the note to the right.
SomethingElse --> [*]
</div>
<div class="mermaid width height2">
%%{init: {'securityLevel': 'loose', 'theme':'base'}}%%
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
note right of SomethingElse2 : This is the note to the right.
SomethingElse2 --> [*]
</div>
<div class="mermaid width height2">
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
</div>
<div class="mermaid width height">
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'base',
// themeVariables:
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,245 @@
<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: #f4f4f4;
background: #222;
font-family: 'Arial';
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
.height {
min-height: 600px;
height: 600px;
}
.height2 {
min-height: 600px;
height: 1300px;
}
.width {
width: 33%;
border: 1px solid blue;
padding: 10px;
}
</style>
</head>
<body>
<h1>Showcases of diagrams</h1>
<div class="flex flex-wrap">
<div class="mermaid width height">
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height">
%%{init2: {'securityLevel': 'loose', 'theme':'base'}}%%
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height" >
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid width height" >
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</div>
<div class="mermaid width height">
gantt
dateFormat :YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</div>
<div class="mermaid width height2">
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
note right of SomethingElse : This is the note to the right.
SomethingElse --> [*]
</div>
<div class="mermaid width height2">
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
note right of SomethingElse2 : This is the note to the right.
SomethingElse2 --> [*]
</div>
<div class="mermaid width height2">
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
</div>
<div class="mermaid width height">
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'base',
themeVariables: { primaryColor: '#9400D3', darkMode: true, background: '#222', textColor:'white', primaryTextColor: '#f4f4f4', nodeBkg: '#ff0000', mainBkg:'#0000ff', tertiaryColor:'#ffffcc' },
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
// securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,242 @@
<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';
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
.height {
min-height: 600px;
height: 600px;
}
.height2 {
min-height: 600px;
height: 1300px;
}
.width {
width: 33%;
border: 1px solid blue;
padding: 10px;
}
</style>
</head>
<body>
<h1>Showcases of diagrams</h1>
<div class="flex flex-wrap">
<div class="mermaid width height">
%%{init: {'theme': 'base', 'themeVariables':{'primaryColor': '#ff0000'}}%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height" >
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid width height" >
%%{init: {'theme':'dark'}}%%
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</div>
<div class="mermaid width height">
gantt
dateFormat :YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</div>
<div class="mermaid width height2">
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
SomethingElse --> [*]
note right of SomethingElse : This is the note to the right.
</div>
<div class="mermaid width height2">
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
SomethingElse2 --> [*]
note right of SomethingElse2 : This is the note to the right.
</div>
<div class="mermaid width height2">
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
</div>
<div class="mermaid width height">
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'dark',
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": true },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,237 @@
<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';
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
.height {
min-height: 600px;
height: 600px;
}
.height2 {
min-height: 600px;
height: 1300px;
}
.width {
width: 33%;
border: 1px solid blue;
padding: 10px;
}
</style>
</head>
<body>
<h1>Showcases of diagrams</h1>
<div class="flex flex-wrap">
<div class="mermaid width height">
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height" >
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid width height" >
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</div>
<div class="mermaid width height">
gantt
dateFormat :YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</div>
<div class="mermaid width height2">
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
note right of SomethingElse : This is the note to the right.
</div>
<div class="mermaid width height2">
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
note right of SomethingElse2 : This is the note to the right.
</div>
<div class="mermaid width height2">
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
</div>
<div class="mermaid width height">
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
// theme: 'dark',
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,241 @@
<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';
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
.height {
min-height: 600px;
height: 600px;
}
.height2 {
min-height: 600px;
height: 1300px;
}
.width {
width: 33%;
border: 1px solid blue;
padding: 10px;
}
</style>
</head>
<body>
<h1>Showcases of diagrams</h1>
<div class="flex flex-wrap">
<div class="mermaid width height">
%%{init: {'theme': 'forest'}}%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height" >
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid width height" >
%%{init: {'theme':'forest'}}%%
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</div>
<div class="mermaid width height">
gantt
dateFormat :YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</div>
<div class="mermaid width height2">
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
note right of SomethingElse : This is the note to the right.
SomethingElse --> [*]
</div>
<div class="mermaid width height2">
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
note right of SomethingElse2 : This is the note to the right.
</div>
<div class="mermaid width height2">
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
</div>
<div class="mermaid width height">
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</div>
<script src="./mermaid.js"></script>
<script>
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,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,240 @@
<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';
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
h1 { color: grey;}
.mermaid2 {
display: none;
}
.height {
min-height: 600px;
height: 600px;
}
.height2 {
min-height: 600px;
height: 1300px;
}
.width {
width: 33%;
border: 1px solid blue;
padding: 10px;
}
</style>
</head>
<body>
<h1>Showcases of diagrams</h1>
<div class="flex flex-wrap">
<div class="mermaid width height">
%%{init: {'theme': 'neutral'}}%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[Another]
C ==>|One| D[Laptop]
C x--x|Two| E[iPhone]
C o--o|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
</div>
<div class="mermaid width height" >
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid width height" >
%%{init: {'theme':'neutral'}}%%
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
Animal <--o Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
</div>
<div class="mermaid width height">
gantt
dateFormat :YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes :excludes the named dates/days from being included in a charted task..
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</div>
<div class="mermaid width height2">
stateDiagram
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse
note right of SomethingElse : This is the note to the right.
</div>
<div class="mermaid width height2">
stateDiagram-v2
[*] --> Active
state Active {
[*] --> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] --> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
state SomethingElse {
A --> B
B --> A
}
Active --> SomethingElse2
note right of SomethingElse2 : This is the note to the right.
</div>
<div class="mermaid width height2">
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
</div>
<div class="mermaid width height">
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
theme: 'neutral',
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
flowchart: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict'
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<style>
body {
font-family: 'trebuchet ms', verdana, arial;
}
</style>
</head>
<body>
<div class="mermaid">
graph TD
A[Christmas] -->|Get money| B(Go shopping)
subgraph 1test["id starting with number"]
A
end
style 1test fill:#F99,stroke-width:2px,stroke:#F0F
</div>
<div class="mermaid">
graph TD
A.a[Christmas]:::someclass -->|Get money| B(Go shopping):::someclass
subgraph test["id starting with number"]
A.a
end
style test fill:#F99,stroke-width:2px,stroke:#F0F
classDef someclass fill:#f96;
</div>
<div class="mermaid">
graph TD
9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
</div>
<script src="./mermaid.js"></script>
<script>
function showFullFirstSquad(elemName) {
console.log('show ' + elemName);
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
</script>
</body>
</html>

View File

@@ -0,0 +1,143 @@
<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';
}
h1 {
color: #333;
font-size: 20px;
text-decoration: underline;
}
.mermaid2 {
display: none;
}
.dark {
background: #333;
}
.dark h1 {
color: #f4f4f4;
}
.size {
width: 33%;
height: 250px;
}
</style>
</head>
<body>
<div class="flex flex-wrap">
<div class="size">
<h1>Default</h1>
<div class="mermaid" >
%%{init: { 'logLevel': 0, 'theme': 'default'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
</div>
</div>
<div class="size">
<h1>Forest</h1>
<div class="mermaid" >
%%{init: { 'logLevel': 1, 'theme': 'forest'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
</div>
</div>
<div class="size">
<h1>Neutral</h1>
<div class="mermaid" >
%%{init: { 'logLevel': 1, 'theme': 'neutral'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
</div>
</div>
<div class="size dark">
<h1>Dark</h1>
<div class="mermaid">
%%{init: { 'logLevel': 1, 'theme': 'dark'} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
</div>
</div>
<div class="size">
<h1>Base with overriding themeVariable</h1>
<div class="mermaid">
%%{init: { 'theme': 'base', 'themeVariables':{ 'primaryColor': '#ff0000'}}}%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
</div>
</div>
<div class="size">
<h1>Nothing set, should be Default</h1>
<div class="mermaid">
%%{init: { 'logLevel': 1} }%%
graph TD
A(Start) --> B[/Another/]
A[/Another/] --> C[End]
subgraph section
B
C
end
</div>
</div>
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err);
};
mermaid.initialize({
// theme: 'dark',
// theme: 'dark',
// arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
logLevel: 0,
// flowchart: { useMaxWidth: true },
graph: { curve: 'cardinal', "htmlLabels": false },
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorMargin: 50, showSequenceNumbers: true },
// sequenceDiagram: { actorMargin: 300 } // deprecated
fontFamily: '"arial", sans-serif',
curve: 'cardinal',
securityLevel: 'strict',
});
function callback(){alert('It worked');}
</script>
</body>
</html>

View File

@@ -0,0 +1,41 @@
<html>
<head>
<link
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>User Journey</h1>
<div class="mermaid">
journey
title Go shopping
section Get to the shops
Get car keys:5: Dad
Get into car:5: Dad, Mum, Child 1, Child 2
Really drive to supermarket:3: Dad
section Do shopping
Do actual shop:3: Mum
Get in the way:2: Dad, Child 1, Child 2
Pay: 2: Dad
section Go home
Lose keys:3: Dad
Get cross:1: Dad, Child 1
Find keys:4: Mum
Get into car:4: Dad, Mum, Child 1, Child 2
Drive home:3: Dad
</div>
<script src="./mermaid.js"></script>
<script>
mermaid.initialize({
theme: 'forest',
logLevel: 3,
journey: { taskMargin: 30 },
});
</script>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mermaid Quick Test Page</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<style>
body {
font-family: 'trebuchet ms', verdana, arial;
}
</style>
</head>
<body>
<div class="mermaid">
info
</div>
<div class="mermaid">
graph TD
subgraph one
1
end
</div>
<!-- <div class="mermaid">
graph TD
A --> B --> C
</div> -->
<script src="./mermaid.js"></script>
<script>
function showFullFirstSquad(elemName) {
console.log('show ' + elemName);
}
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
</script>
</body>
</html>

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