Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Flowchart Shapes (with new syntax) #5825

Merged
merged 256 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
809fc1c
fix: added triangle placeholder
ashishjain0512 Jul 26, 2024
e51077c
fix: added triangle shape
omkarht Jul 31, 2024
1d3f214
Merge branch '5237-unified-layout-common-renderer' into knsv/new-shapes
knsv Aug 1, 2024
3d789a0
fix: centrally align text in cylinder shape
omkarht Aug 1, 2024
d0942d4
feat: added half Rounded Rectangle Shape
omkarht Aug 1, 2024
9cd44eb
feat: added new curvedTrapezoid shape
omkarht Aug 1, 2024
cfb5b88
feat: added new sloped-rectangle shape
omkarht Aug 2, 2024
933f3f3
feat: added new Bowtie Rectangle shape
omkarht Aug 2, 2024
575c39e
feat: added new Divided Rectangle shape
omkarht Aug 7, 2024
04b15e7
added crossed circle
saurabhg772244 Aug 7, 2024
b807e33
added new Wave Rectangle shape
omkarht Aug 8, 2024
4c48b8c
added cypress test file for new flowchart shapes
omkarht Aug 8, 2024
ac48f01
Updated crossed circle
saurabhg772244 Aug 9, 2024
89e4de1
added tilted cylinder
saurabhg772244 Aug 9, 2024
f140d1a
Add test case for tiltedCylinder
saurabhg772244 Aug 9, 2024
efe6aff
added new Trapezoidal Pentagon shape
omkarht Aug 9, 2024
0f635ed
Add shape flippedTriangle
saurabhg772244 Aug 9, 2024
4aeb2ae
added new Hourglass shape
omkarht Aug 12, 2024
251b946
Added tagged rect
saurabhg772244 Aug 12, 2024
bc546ef
Less picky syntax
knsv Aug 12, 2024
e1c8eb8
merge develop and other linting fixes
ashishjain0512 Aug 12, 2024
a0893b8
Added multi rect
saurabhg772244 Aug 12, 2024
31b8707
add test case for shapes
saurabhg772244 Aug 12, 2024
3cd5244
multi rect text center
saurabhg772244 Aug 12, 2024
303a160
added new Lined Cylinder shape
omkarht Aug 13, 2024
3c119e4
added new Wave Edged Rectangle shape
omkarht Aug 13, 2024
4d401c1
Merge branches 'knsv/new-shapes' and 'knsv/new-shapes' of github.com:…
knsv Aug 13, 2024
c673cf2
Less picky syntax, fix for multiline strings
knsv Aug 13, 2024
8f5f7fc
Added new shape testing suite
ashishjain0512 Aug 13, 2024
ef895a3
Merge from develop
ashishjain0512 Aug 13, 2024
3febd7d
add lightningBolt shape
saurabhg772244 Aug 13, 2024
394c6ae
Fix shapes for multirect and taggerRect
saurabhg772244 Aug 13, 2024
5550753
fixed multi rect
saurabhg772244 Aug 13, 2024
9e5c3ec
Add shape filledCircle
saurabhg772244 Aug 14, 2024
b7acf94
added new Multi Wave Edged Rectangle shape
omkarht Aug 14, 2024
b3a4e3f
Added windowPane
saurabhg772244 Aug 14, 2024
a17e7d9
adjusted intersection points for half rounded rectangle shape
omkarht Aug 14, 2024
6c1ae90
adjusted intersection points logic for Curved Trapezoid shape
omkarht Aug 14, 2024
2fa03ea
Updated shapes in test
saurabhg772244 Aug 16, 2024
c983c06
Updated half rounded rect
saurabhg772244 Aug 16, 2024
d30444d
Updated triangle and slopedRect
saurabhg772244 Aug 16, 2024
763a0c0
Updated taggedRect
saurabhg772244 Aug 16, 2024
f813870
Updated flippedTriangle
saurabhg772244 Aug 16, 2024
98754b9
updated bowTieRect shape
omkarht Aug 16, 2024
eceae9b
Updated shapes
saurabhg772244 Aug 19, 2024
4f20857
Updated waveEdge and wave rectangle
saurabhg772244 Aug 19, 2024
06dd350
added new Lined Wave Edged Rectangle shape
omkarht Aug 19, 2024
7b51327
updated halfRoundedRect
saurabhg772244 Aug 19, 2024
58463b5
fixed half rounded rect
saurabhg772244 Aug 19, 2024
9926ae4
updated taggedRect
saurabhg772244 Aug 19, 2024
e2f3041
added new shape: Tagged Wave Edged Rectangle
omkarht Aug 19, 2024
9c5a8f7
fixed some label transform for htmlLabels false
saurabhg772244 Aug 19, 2024
99956b4
Updated change for label transform
saurabhg772244 Aug 20, 2024
36f2989
Updated test case
saurabhg772244 Aug 20, 2024
0fbe5f2
updated multi wave edge rect
saurabhg772244 Aug 20, 2024
90b7a3b
Updated labels
saurabhg772244 Aug 20, 2024
4c3db65
updated bowtie rect shape
omkarht Aug 20, 2024
3cfcb2d
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
saurabhg772244 Aug 21, 2024
de875c9
Update multiwaveEdgeRect styles
saurabhg772244 Aug 21, 2024
a4007ff
update names for the shapes
saurabhg772244 Aug 21, 2024
777522e
update change
saurabhg772244 Aug 21, 2024
6e8ea14
Added multi-edge test
ashishjain0512 Aug 21, 2024
4298a57
Merge from develop
ashishjain0512 Aug 21, 2024
f233bfd
Updated reference to import layout elk
ashishjain0512 Aug 21, 2024
0152ed7
create missing type
ashishjain0512 Aug 21, 2024
121e27e
Merge from develop
ashishjain0512 Aug 21, 2024
4e8a7e0
updated tilted cylinder
saurabhg772244 Aug 21, 2024
262790b
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
saurabhg772244 Aug 22, 2024
8d8b6c1
updated triangle shape
omkarht Aug 22, 2024
abf7ecd
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
omkarht Aug 22, 2024
3dc0af3
Merge from release
ashishjain0512 Aug 22, 2024
a857d38
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
omkarht Aug 22, 2024
8e72611
updated lined cylinder shape
omkarht Aug 22, 2024
1654a4b
add curlyBrace shape
saurabhg772244 Aug 22, 2024
98cb8b9
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Aug 22, 2024
439dcb1
Created README.md for new shape addition guide
omkarht Aug 22, 2024
19cce07
updated halfRoundedRectangle shape
omkarht Aug 22, 2024
46b8fad
fix for handDrawn subgraph styling
omkarht Aug 23, 2024
f424a51
updated tiltedCylinder shape
omkarht Aug 23, 2024
a2fba02
updated tiltedCylinder shape
omkarht Aug 23, 2024
cec2846
updated tiltedCylinder shape
omkarht Aug 23, 2024
db1db1a
updated shape name in newShapes.spec file
omkarht Aug 23, 2024
99f7d65
updated shadedProcess shape
omkarht Aug 23, 2024
7d6a97e
updated shadedProcess shape
omkarht Aug 23, 2024
7c26148
fixed padding for flippedTriangle shape
omkarht Aug 23, 2024
e842b72
Merge branch 'develop' into knsv/new-shapes
knsv Aug 26, 2024
23329f1
Updated Note Shape
omkarht Aug 26, 2024
c08fad6
updated shapes
saurabhg772244 Aug 26, 2024
cb91c3f
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Aug 26, 2024
9d9109a
updated inverted trapezoid
omkarht Aug 26, 2024
13719aa
updated Cylinder Shape
omkarht Aug 26, 2024
5e5265c
updated fork Join Shape
omkarht Aug 27, 2024
5c6f3e6
updated choice shape
omkarht Aug 27, 2024
ab44053
Updated newShapes spec file with previous shapes
omkarht Aug 27, 2024
3715254
updated odd shape
saurabhg772244 Aug 27, 2024
4cf7c97
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Aug 27, 2024
1cfe987
updated Odd shape
omkarht Aug 27, 2024
75f755b
Merge from develop
ashishjain0512 Aug 27, 2024
9b7f5ed
Lint fix
ashishjain0512 Aug 27, 2024
c2c65b4
Update filledCircle shape
saurabhg772244 Aug 27, 2024
c9c821d
updated crossced Circle Shape
omkarht Aug 28, 2024
06310fa
Removing default config overriding default value from schema
knsv Aug 28, 2024
63e9194
Add BRANDES_KOEPF node placement strategy default value
knsv Aug 28, 2024
8fa1fed
added padding in waveRectangle Shape
omkarht Aug 28, 2024
600247d
Merge from develop
ashishjain0512 Aug 28, 2024
f29f5eb
Prettier lint fixes
ashishjain0512 Aug 28, 2024
882a2cc
created spec file for old shapes
omkarht Aug 28, 2024
9746497
updated oldShapes.spec.ts file
omkarht Aug 28, 2024
7175367
moved old shapes from newShapes.spec.ts file to separate file
omkarht Aug 28, 2024
b349521
updated taggedRect Shape
omkarht Aug 28, 2024
56e9095
updated labelRect shape
omkarht Aug 29, 2024
f27feb2
updated waveEdgedRectangle shape
omkarht Aug 29, 2024
ee84ed4
updated stateEnd Shape
omkarht Aug 29, 2024
eb341bd
fixes issue for withoutlabel shapes
omkarht Aug 29, 2024
f4d4c78
fixed issue for without label shapes
omkarht Aug 29, 2024
336c312
updated rough js hachureGap and shapes
saurabhg772244 Sep 2, 2024
8e0bb99
Merge from develop
ashishjain0512 Sep 3, 2024
f7e4ee6
Updated lock file
ashishjain0512 Sep 3, 2024
69bec16
update curlyBraces shape to new curlyBraceLeft shape
saurabhg772244 Sep 4, 2024
5d3a175
Fixed issue with intersection calculations for linedCylinder
knsv Sep 4, 2024
8462f21
udated shapes
omkarht Sep 4, 2024
a259aeb
Added curly brace shapes
saurabhg772244 Sep 4, 2024
105b11f
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Sep 4, 2024
3d4c5d1
Adding new shapes to flowchart documentation
knsv Sep 4, 2024
0eec892
Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into …
knsv Sep 4, 2024
8883008
Added basic for image shape
saurabhg772244 Sep 5, 2024
3a5fef3
adjusted padding for triangle shape
omkarht Sep 5, 2024
5a92216
Add aliases for shapes
saurabhg772244 Sep 5, 2024
52d6035
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Sep 5, 2024
d75661e
updated Traingle shape
omkarht Sep 5, 2024
525dcd4
Updated filled circle
saurabhg772244 Sep 5, 2024
9774c08
name change for braces on both sides
knsv Sep 5, 2024
adedb5f
Updated docs for braces
knsv Sep 5, 2024
1d5f7ce
Additional shape key for lean_left and lean_right
knsv Sep 5, 2024
e337331
add squre and circle icon shape
saurabhg772244 Sep 5, 2024
6507624
Fix for issues with self loops
knsv Sep 5, 2024
2f24f62
Updated cypress test for self-loops
knsv Sep 5, 2024
b7fd21e
Added basic for forms
saurabhg772244 Sep 6, 2024
443c886
fixed icon square edges
saurabhg772244 Sep 6, 2024
5f0160c
fixed icon shape edges
saurabhg772244 Sep 6, 2024
30e4ab9
Added image shape icon
omkarht Sep 6, 2024
352194c
refactored code
omkarht Sep 6, 2024
54ecd7d
updated circle icon
saurabhg772244 Sep 6, 2024
41a7500
Added test cases for icon shape
saurabhg772244 Sep 6, 2024
89fb659
minor adjustments in imageShape
omkarht Sep 6, 2024
14bb09a
Adjustments for icon shape
saurabhg772244 Sep 6, 2024
9a953f7
adjusted imageSqaure for html labels
omkarht Sep 6, 2024
78346cb
Adjustment for icon in the radius
saurabhg772244 Sep 6, 2024
e6ce370
Merge branch 'saurabh/image-shape' of https://github.com/mermaid-js/m…
saurabhg772244 Sep 6, 2024
95bd5df
Adjustment for icon shape
saurabhg772244 Sep 6, 2024
9e3aa70
Add changeset
ashishjain0512 Sep 6, 2024
9467735
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 6, 2024
ec29f74
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
saurabhg772244 Sep 9, 2024
d8d56df
Updated Image Shape Icon for image width and height
omkarht Sep 9, 2024
2259a59
Add support for custom height and width
saurabhg772244 Sep 9, 2024
2aa5089
created test spec file for Image Shape
omkarht Sep 9, 2024
0ade03c
Merge from develop
ashishjain0512 Sep 9, 2024
1d1766b
Adjustements to support height and width
saurabhg772244 Sep 9, 2024
4d04d1a
Merge branch 'saurabh/image-shape' of https://github.com/mermaid-js/m…
saurabhg772244 Sep 9, 2024
edb99c2
updated test for icon shape
saurabhg772244 Sep 9, 2024
a881d46
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 9, 2024
e5532c3
Updated all shape names to use kebab-case
saurabhg772244 Sep 9, 2024
41cf126
Revert "Updated all shape names to use kebab-case"
ashishjain0512 Sep 9, 2024
e111965
Added more tests, updated documentation, kebab-case changes
ashishjain0512 Sep 9, 2024
82cc473
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
saurabhg772244 Sep 9, 2024
f46a135
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
saurabhg772244 Sep 9, 2024
a601d3b
Update .changeset/rude-meals-invite.md
ashishjain0512 Sep 9, 2024
06aa72e
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Sep 9, 2024
30eb025
Merge branch 'saurabh/image-shape' of https://github.com/mermaid-js/m…
saurabhg772244 Sep 9, 2024
3d9e919
Updated test cases
saurabhg772244 Sep 9, 2024
dbe9653
Updated logic for vertex label
saurabhg772244 Sep 10, 2024
ee17e02
updated icon square and icon
saurabhg772244 Sep 10, 2024
194684e
Updated labels for shapes
saurabhg772244 Sep 10, 2024
1cc2f32
updated image shape
omkarht Sep 10, 2024
3d1af09
Updated circle icon
saurabhg772244 Sep 10, 2024
5e34810
Added rounded icon shape
saurabhg772244 Sep 11, 2024
7963ad9
updated test cases
saurabhg772244 Sep 11, 2024
a2c262f
fixed html labels for icon shape
saurabhg772244 Sep 11, 2024
4754ed0
updated pos changes
saurabhg772244 Sep 11, 2024
01bf7af
updated styles
saurabhg772244 Sep 11, 2024
9421f63
updated ImageSqaure shape
omkarht Sep 11, 2024
67bcd3e
Merge pull request #5844 from mermaid-js/saurabh/image-shape
ashishjain0512 Sep 11, 2024
3359d87
updated styles, testcases and fixed html labels for image shape
omkarht Sep 11, 2024
8bb70ea
Removing the ending @ sign in the shape data
knsv Sep 12, 2024
83ea81d
Merge from develop
ashishjain0512 Sep 12, 2024
8b6fb94
WIP
knsv Sep 12, 2024
355e218
Merge branch 'knsv/new-shapes' into knsv-new-shapes-amp-n-at
knsv Sep 12, 2024
4162a25
Fix for amp and adjusted tests
knsv Sep 12, 2024
2fa044d
Merge branch 'knsv-new-shapes-amp-n-at' into knsv/new-shapes
knsv Sep 12, 2024
8456d7b
Updated insertNode to pass optional config
saurabhg772244 Sep 13, 2024
d8c340d
Throwing error for invalid shape
knsv Sep 13, 2024
38bcbcd
Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into …
knsv Sep 13, 2024
9f2f3bd
Updated type
saurabhg772244 Sep 13, 2024
61af746
Updated shape aliases
ashishjain0512 Sep 13, 2024
4c26fe2
Adding case check
knsv Sep 13, 2024
44561f5
Moving case check to parsing
knsv Sep 13, 2024
e83a95d
Updated icon shape for background colour and icon colour
saurabhg772244 Sep 13, 2024
52e1a36
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Sep 13, 2024
7f20440
Updated readme for renderOptions parameter and renamed to use kabab case
saurabhg772244 Sep 16, 2024
5ca4fcc
fixed build error
saurabhg772244 Sep 16, 2024
78f9238
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 16, 2024
aa0836a
update type check for getTypeFromVertex
saurabhg772244 Sep 16, 2024
38c6ad5
updated readme url t use kabab case
saurabhg772244 Sep 17, 2024
775a638
updated type and function signature
saurabhg772244 Sep 17, 2024
89e82e4
Merge from develop
ashishjain0512 Sep 17, 2024
233e36c
chore: changeset
sidharthv96 Sep 17, 2024
02851fd
Merge remote-tracking branch 'upstream/develop' into knsv/new-shapes
sidharthv96 Sep 17, 2024
4740be6
Merge branch 'develop' into knsv/new-shapes
sidharthv96 Sep 17, 2024
d37d77c
chore: Remove maps in pkg.pr.new
sidharthv96 Sep 17, 2024
522de3a
Revert "chore: Remove maps in pkg.pr.new"
sidharthv96 Sep 17, 2024
3f5afe8
code refactor
saurabhg772244 Sep 17, 2024
be9123e
Updated renderOptions to add direction property
saurabhg772244 Sep 18, 2024
741072a
Fix new shapes tests with new syntax
ashishjain0512 Sep 18, 2024
c8b9c4c
Adjusted styling for fork/note and stateEnd
knsv Sep 18, 2024
d807466
Merge branch 'knsv/new-shapes' of github.com:mermaid-js/mermaid into …
knsv Sep 18, 2024
c641047
Import fix
knsv Sep 18, 2024
f035db2
fixed icon shape padding
saurabhg772244 Sep 18, 2024
dd261a5
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Sep 18, 2024
a529493
updated icon shapes
saurabhg772244 Sep 18, 2024
cb85d50
updated imageSquare Shape
omkarht Sep 18, 2024
eeeb5fc
updated icon shape label
saurabhg772244 Sep 20, 2024
c83fc75
implemented additional Image-node shape properties
omkarht Sep 20, 2024
f849c36
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 20, 2024
4c40096
updated curved trapezoid shape
omkarht Sep 21, 2024
d01e180
Updated shapes
saurabhg772244 Sep 21, 2024
11da07b
Merge branch 'knsv/new-shapes' of https://github.com/mermaid-js/merma…
saurabhg772244 Sep 21, 2024
f052a3f
updated halfRoundedRectangle shape
omkarht Sep 21, 2024
ed7d41a
updated shapes
omkarht Sep 21, 2024
1c10515
Updated icon shape positions
saurabhg772244 Sep 23, 2024
02cadd8
Updated shaded process
saurabhg772244 Sep 23, 2024
bb3b95f
updated lined cylinder shape
omkarht Sep 23, 2024
b3dfc60
updated tiltedCylinder shape
omkarht Sep 23, 2024
1c8c953
updated check to avoid _ in shape syntax. updated readme path
saurabhg772244 Sep 24, 2024
fd37294
updated constraint property for node shape
omkarht Sep 24, 2024
6a649d3
updated imageSquare shape
omkarht Sep 24, 2024
e2e2caa
fixed icon shape for large icon size
saurabhg772244 Sep 25, 2024
90b6df2
Merge branch 'develop' into knsv/new-shapes
sidharthv96 Oct 1, 2024
6d916fb
updated icon and image shape for htmlLabels center alignment
omkarht Oct 1, 2024
3860a99
limit the test cases for only two direction
ashishjain0512 Oct 2, 2024
1e8cd63
fix broken e2e for new & old shapes
ashishjain0512 Oct 2, 2024
4cb0f87
Merge branch 'develop' into knsv/new-shapes
sidharthv96 Oct 2, 2024
a75665c
chore: Rename RenderOptions interface to avoid duplication.
sidharthv96 Oct 2, 2024
7441be0
Update packages/mermaid/src/docs/syntax/flowchart.md
sidharthv96 Oct 2, 2024
5c67e42
[autofix.ci] apply automated fixes
autofix-ci[bot] Oct 2, 2024
dfcb4af
chore: Remove unused function
sidharthv96 Oct 2, 2024
f9818b8
fix: Patch roughjs type
sidharthv96 Oct 2, 2024
bb521f7
chore: Remove unnecessary ts-ignores
sidharthv96 Oct 2, 2024
df1fba7
chore: Ignore broken types
sidharthv96 Oct 2, 2024
760ea1e
chore: Remove unused default exports
sidharthv96 Oct 2, 2024
43e8f83
fix: Shape aliases in docs
sidharthv96 Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/popular-hounds-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mermaid-js/layout-elk': patch
---

chore: Update render options
5 changes: 5 additions & 0 deletions .changeset/rude-meals-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': minor
---

New Flowchart Shapes (with new syntax)
1 change: 1 addition & 0 deletions .cspell/code-terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ concat
controlx
controly
CSSCLASS
curv
CYLINDEREND
CYLINDERSTART
DAGA
Expand Down
3 changes: 3 additions & 0 deletions .cspell/cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ dictionaryDefinitions:
- name: suggestions
words:
- none
- disp
- subproc
- tria
suggestWords:
- seperator:separator
- vertice:vertex
Expand Down
2 changes: 2 additions & 0 deletions .cspell/mermaid-terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bmatrix
braintree
catmull
compositTitleSize
curv
doublecircle
elems
gantt
Expand All @@ -24,6 +25,7 @@ multigraph
nodesep
NOTEGROUP
Pinterest
procs
rankdir
ranksep
rect
Expand Down
142 changes: 142 additions & 0 deletions cypress/integration/rendering/flowchart-shape-alias.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import { imgSnapshotTest } from '../../helpers/util.ts';

const aliasSet1 = ['process', 'rect', 'proc', 'rectangle'] as const;

const aliasSet2 = ['event', 'rounded'] as const;

const aliasSet3 = ['stadium', 'pill', 'terminal'] as const;

const aliasSet4 = ['fr-rect', 'subproc', 'subprocess', 'framed-rectangle', 'subroutine'] as const;

const aliasSet5 = ['db', 'database', 'cylinder', 'cyl'] as const;

const aliasSet6 = ['diam', 'decision', 'diamond'] as const;

const aliasSet7 = ['hex', 'hexagon', 'prepare'] as const;

const aliasSet8 = ['lean-r', 'lean-right', 'in-out'] as const;

const aliasSet9 = ['lean-l', 'lean-left', 'out-in'] as const;

const aliasSet10 = ['trap-b', 'trapezoid-bottom', 'priority'] as const;

const aliasSet11 = ['trap-t', 'trapezoid-top', 'manual'] as const;

const aliasSet12 = ['dbl-circ', 'double-circle'] as const;

const aliasSet13 = ['notched-rectangle', 'card', 'notch-rect'] as const;

const aliasSet14 = [
'lin-rect',
'lined-rectangle',
'lin-proc',
'lined-process',
'shaded-process',
] as const;

const aliasSet15 = ['sm-circ', 'small-circle', 'start'] as const;

const aliasSet16 = ['fr-circ', 'framed-circle', 'stop'] as const;

const aliasSet17 = ['fork', 'join'] as const;
// brace-r', 'braces'
const aliasSet18 = ['comment', 'brace-l'] as const;

const aliasSet19 = ['bolt', 'com-link', 'lightning-bolt'] as const;

const aliasSet20 = ['doc', 'document'] as const;

const aliasSet21 = ['delay', 'half-rounded-rectangle'] as const;

const aliasSet22 = ['h-cyl', 'das', 'horizontal-cylinder'] as const;

const aliasSet23 = ['lin-cyl', 'disk', 'lined-cylinder'] as const;

const aliasSet24 = ['curv-trap', 'display', 'curved-trapezoid'] as const;

const aliasSet25 = ['div-rect', 'div-proc', 'divided-rectangle', 'divided-process'] as const;

const aliasSet26 = ['extract', 'tri', 'triangle'] as const;

const aliasSet27 = ['win-pane', 'internal-storage', 'window-pane'] as const;

const aliasSet28 = ['f-circ', 'junction', 'filled-circle'] as const;

const aliasSet29 = ['lin-doc', 'lined-document'] as const;

const aliasSet30 = ['notch-pent', 'loop-limit', 'notched-pentagon'] as const;

const aliasSet31 = ['flip-tri', 'manual-file', 'flipped-triangle'] as const;

const aliasSet32 = ['sl-rect', 'manual-input', 'sloped-rectangle'] as const;

const aliasSet33 = ['docs', 'documents', 'st-doc', 'stacked-document'] as const;

const aliasSet34 = ['procs', 'processes', 'st-rect', 'stacked-rectangle'] as const;

const aliasSet35 = ['flag', 'paper-tape'] as const;

const aliasSet36 = ['bow-rect', 'stored-data', 'bow-tie-rectangle'] as const;

const aliasSet37 = ['cross-circ', 'summary', 'crossed-circle'] as const;

const aliasSet38 = ['tag-doc', 'tagged-document'] as const;

const aliasSet39 = ['tag-rect', 'tag-proc', 'tagged-rectangle', 'tagged-process'] as const;

const aliasSet40 = ['collate', 'hourglass'] as const;

// Aggregate all alias sets into a single array
const aliasSets = [
aliasSet1,
aliasSet2,
aliasSet3,
aliasSet4,
aliasSet5,
aliasSet6,
aliasSet7,
aliasSet8,
aliasSet9,
aliasSet10,
aliasSet11,
aliasSet12,
aliasSet13,
aliasSet14,
aliasSet15,
aliasSet16,
aliasSet17,
aliasSet18,
aliasSet19,
aliasSet20,
aliasSet21,
aliasSet22,
aliasSet23,
aliasSet24,
aliasSet25,
aliasSet26,
aliasSet27,
aliasSet28,
aliasSet29,
aliasSet30,
aliasSet31,
aliasSet32,
aliasSet33,
aliasSet34,
aliasSet35,
aliasSet36,
aliasSet37,
aliasSet38,
aliasSet39,
] as const;

aliasSets.forEach((aliasSet) => {
describe(`Test ${aliasSet.join(',')} `, () => {
it(`All ${aliasSet.join(',')} should render same shape`, () => {
let flowchartCode = `flowchart \n`;
aliasSet.forEach((alias, index) => {
flowchartCode += ` n${index}@{ shape: ${alias}, label: "${alias}" }\n`;
});
imgSnapshotTest(flowchartCode);
});
});
});
126 changes: 126 additions & 0 deletions cypress/integration/rendering/iconShape.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { imgSnapshotTest } from '../../helpers/util';

const looks = ['classic', 'handDrawn'] as const;
const directions = [
'TB',
//'BT',
'LR',
// 'RL'
] as const;
const forms = [undefined, 'square', 'circle', 'rounded'] as const;
const labelPos = [undefined, 't', 'b'] as const;

looks.forEach((look) => {
directions.forEach((direction) => {
forms.forEach((form) => {
labelPos.forEach((pos) => {
describe(`Test iconShape in ${form ? `${form} form,` : ''} ${look} look and dir ${direction} with label position ${pos ? pos : 'not defined'}`, () => {
it(`without label`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
flowchartCode += ` }\n`;
imgSnapshotTest(flowchartCode, { look });
});

it(`with label`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell', label: 'This is a label for icon shape'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
if (pos) {
flowchartCode += `, pos: '${pos}'`;
}
flowchartCode += ` }\n`;
imgSnapshotTest(flowchartCode, { look });
});

it(`with very long label`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell', label: 'This is a very very very very very long long long label for icon shape'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
if (pos) {
flowchartCode += `, pos: '${pos}'`;
}
flowchartCode += ` }\n`;
imgSnapshotTest(flowchartCode, { look });
});

it(`with markdown htmlLabels:true`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell', label: 'This is **bold** </br>and <strong>strong</strong> for icon shape'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
if (pos) {
flowchartCode += `, pos: '${pos}'`;
}
flowchartCode += ` }\n`;
imgSnapshotTest(flowchartCode, { look });
});

it(`with markdown htmlLabels:false`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell', label: 'This is **bold** </br>and <strong>strong</strong> for icon shape'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
if (pos) {
flowchartCode += `, pos: '${pos}'`;
}
flowchartCode += ` }\n`;
imgSnapshotTest(flowchartCode, {
look,
htmlLabels: false,
flowchart: { htmlLabels: false },
});
});

it(`with styles`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell', label: 'new icon shape'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
if (pos) {
flowchartCode += `, pos: '${pos}'`;
}
flowchartCode += ` }\n`;
flowchartCode += ` style nAA fill:#f9f,stroke:#333,stroke-width:4px \n`;
imgSnapshotTest(flowchartCode, { look });
});

it(`with classDef`, () => {
let flowchartCode = `flowchart ${direction}\n`;
flowchartCode += ` classDef customClazz fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5\n`;
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell', label: 'new icon shape'`;
if (form) {
flowchartCode += `, form: '${form}'`;
}
if (pos) {
flowchartCode += `, pos: '${pos}'`;
}
flowchartCode += ` }\n`;
flowchartCode += ` nAA:::customClazz\n`;
imgSnapshotTest(flowchartCode, { look });
});
});
});
});
});
});

describe('Test iconShape with different h', () => {
it('with different h', () => {
let flowchartCode = `flowchart TB\n`;
const icon = 'fa:bell';
const iconHeight = 64;
flowchartCode += ` nA --> nAA@{ icon: '${icon}', label: 'icon with different h', h: ${iconHeight} }\n`;
imgSnapshotTest(flowchartCode);
});
});
Loading
Loading