diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 54aa17b86..4e381a2cf 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -2,7 +2,7 @@ - Latex is now supported. See [docs](https://d2lang.com/tour/text) for more. [#229](https://github.com/terrastruct/d2/pull/229) -- `orientation` keyword is now supported to specify horizontal or vertical layouts. See +- `direction` keyword is now supported to specify `up`, `down`, `right`, `left` layouts. See [docs](https://d2lang.com/tour/layouts) for more. [#251](https://github.com/terrastruct/d2/pull/251) - Arrowhead labels are now supported. [#182](https://github.com/terrastruct/d2/pull/182) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 7516fa9fe..b5de7915b 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -13,6 +13,7 @@ import ( "oss.terrastruct.com/d2/d2graph" "oss.terrastruct.com/d2/d2parser" "oss.terrastruct.com/d2/d2target" + "oss.terrastruct.com/d2/lib/go2" ) // TODO: should Parse even be exported? guess not. IR should contain list of files and @@ -356,12 +357,13 @@ func (c *compiler) applyScalar(attrs *d2graph.Attributes, reserved string, box d case "link": attrs.Link = scalar.ScalarString() return - case "orientation": - if scalar.ScalarString() != "horizontal" && scalar.ScalarString() != "vertical" { - c.errorf(scalar.GetRange().Start, scalar.GetRange().End, `expected "horizontal" or "vertical" orientation, got %q`, scalar.ScalarString()) + case "direction": + dirs := []string{"up", "down", "right", "left"} + if !go2.Contains(dirs, scalar.ScalarString()) { + c.errorf(scalar.GetRange().Start, scalar.GetRange().End, `direction must be one of %v, got %q`, strings.Join(dirs, ", "), scalar.ScalarString()) return } - attrs.Orientation.Value = scalar.ScalarString() + attrs.Direction.Value = scalar.ScalarString() return } diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 294503a56..07dee8f17 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1522,38 +1522,38 @@ dst.id <-> src.dst_id }, }, { - name: "root_orientation", + name: "root_direction", - text: `orientation: horizontal`, + text: `direction: right`, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "horizontal", g.Root.Attributes.Orientation.Value) + diff.AssertStringEq(t, "right", g.Root.Attributes.Direction.Value) }, }, { - name: "default_orientation", + name: "default_direction", text: `x`, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "vertical", g.Objects[0].Attributes.Orientation.Value) + diff.AssertStringEq(t, "down", g.Objects[0].Attributes.Direction.Value) }, }, { - name: "set_orientation", + name: "set_direction", text: `x: { - orientation: horizontal + direction: left }`, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "horizontal", g.Objects[0].Attributes.Orientation.Value) + diff.AssertStringEq(t, "left", g.Objects[0].Attributes.Direction.Value) }, }, { - name: "invalid_orientation", + name: "invalid_direction", text: `x: { - orientation: diagonal + direction: diagonal }`, - expErr: `d2/testdata/d2compiler/TestCompile/invalid_orientation.d2:2:16: expected "horizontal" or "vertical" orientation, got "diagonal" + expErr: `d2/testdata/d2compiler/TestCompile/invalid_direction.d2:2:14: direction must be one of up, down, right, left, got "diagonal" `, }, } diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index a2261686e..8aabce71b 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -98,7 +98,7 @@ type Attributes struct { // TODO: default to ShapeRectangle instead of empty string Shape Scalar `json:"shape"` - Orientation Scalar `json:"orientation"` + Direction Scalar `json:"direction"` } // TODO references at the root scope should have their Scope set to root graph AST @@ -444,8 +444,8 @@ func (obj *Object) newObject(id string) *Object { Label: Scalar{ Value: idval, }, - Orientation: Scalar{ - Value: "vertical", + Direction: Scalar{ + Value: "down", }, }, @@ -1052,17 +1052,17 @@ func Key(k *d2ast.KeyPath) []string { } var ReservedKeywords = map[string]struct{}{ - "label": {}, - "desc": {}, - "shape": {}, - "icon": {}, - "constraint": {}, - "tooltip": {}, - "link": {}, - "near": {}, - "width": {}, - "height": {}, - "orientation": {}, + "label": {}, + "desc": {}, + "shape": {}, + "icon": {}, + "constraint": {}, + "tooltip": {}, + "link": {}, + "near": {}, + "width": {}, + "height": {}, + "direction": {}, } // ReservedKeywordHolders are reserved keywords that are meaningless on its own and exist solely to hold a set of reserved keywords diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 1edc17f1e..9fa88ccc3 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -64,10 +64,16 @@ func Layout(ctx context.Context, d2graph *d2graph.Graph) (err error) { ranksep: 100, edgesep: 40, nodesep: 60, - rankdir: "TB", } - if d2graph.Root.Attributes.Orientation.Value == "horizontal" { + switch d2graph.Root.Attributes.Direction.Value { + case "down": + rootAttrs.rankdir = "TB" + case "right": rootAttrs.rankdir = "LR" + case "left": + rootAttrs.rankdir = "RL" + case "up": + rootAttrs.rankdir = "BT" } configJS := setGraphAttrs(rootAttrs) if _, err := v8ctx.RunScript(configJS, "config.js"); err != nil { diff --git a/d2layouts/d2elklayout/layout.go b/d2layouts/d2elklayout/layout.go index 209a73856..984531314 100644 --- a/d2layouts/d2elklayout/layout.go +++ b/d2layouts/d2elklayout/layout.go @@ -120,11 +120,17 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { HierarchyHandling: "INCLUDE_CHILDREN", NodeSpacing: 100.0, EdgeNodeSpacing: 50.0, - Direction: "DOWN", }, } - if g.Root.Attributes.Orientation.Value == "horizontal" { + switch g.Root.Attributes.Direction.Value { + case "down": + elkGraph.LayoutOptions.Direction = "DOWN" + case "up": + elkGraph.LayoutOptions.Direction = "UP" + case "right": elkGraph.LayoutOptions.Direction = "RIGHT" + case "left": + elkGraph.LayoutOptions.Direction = "LEFT" } elkNodes := make(map[*d2graph.Object]*ELKNode) diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 16c43f434..bbacc94b4 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -989,14 +989,14 @@ c -> solution: we get `, }, { - name: "orientation", + name: "direction", script: `a -> b -> c -> d -> e b: { - orientation: horizontal + direction: right 1 -> 2 -> 3 -> 4 -> 5 2: { - orientation: vertical + direction: up a -> b -> c -> d -> e } } diff --git a/e2etests/testdata/sanity/1_to_2/elk/board.exp.json b/e2etests/testdata/sanity/1_to_2/elk/board.exp.json index 6c709942a..c1d27b8de 100644 --- a/e2etests/testdata/sanity/1_to_2/elk/board.exp.json +++ b/e2etests/testdata/sanity/1_to_2/elk/board.exp.json @@ -5,8 +5,8 @@ "id": "a", "type": "", "pos": { - "x": 31, - "y": 12 + "x": 12, + "y": 33 }, "width": 113, "height": 126, @@ -43,8 +43,8 @@ "id": "b", "type": "", "pos": { - "x": 12, - "y": 238 + "x": 225, + "y": 12 }, "width": 113, "height": 126, @@ -81,8 +81,8 @@ "id": "c", "type": "", "pos": { - "x": 145, - "y": 238 + "x": 225, + "y": 158 }, "width": 113, "height": 126, @@ -143,12 +143,12 @@ "labelPercentage": 0, "route": [ { - "x": 68.5, - "y": 138 + "x": 125, + "y": 75 }, { - "x": 68.5, - "y": 238 + "x": 225, + "y": 75 } ], "animated": false, @@ -181,20 +181,20 @@ "labelPercentage": 0, "route": [ { - "x": 106.16666666666667, - "y": 138 + "x": 125, + "y": 117 }, { - "x": 106.16666666666667, - "y": 188 + "x": 175, + "y": 117 }, { - "x": 201.5, - "y": 188 + "x": 175, + "y": 221 }, { - "x": 201.5, - "y": 238 + "x": 225, + "y": 221 } ], "animated": false, diff --git a/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg b/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg index c6a7e3671..76640f7f2 100644 --- a/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg +++ b/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg @@ -2,7 +2,7 @@ // RegisterHash registers a function that returns a new instance of the given // hash function. This is intended to be called from the init function in // packages that implement hash functions. func RegisterHash(h Hash, f func() hash.Hash) { @@ -22,7 +22,7 @@ width="955" height="818" viewBox="-88 -88 955 818">        panic("crypto: RegisterHash of unknown hash function")     }     hashes[h] = f -}xy acfbdhg agdfbhec abcdefghijklmnopq finallyatreeandnodessomemoremanythenhereyouhavehierarchyanotherofnestingtreesatreeinsidehierarchyroot bacde21345abcde \ No newline at end of file diff --git a/e2etests/testdata/stable/direction/elk/board.exp.json b/e2etests/testdata/stable/direction/elk/board.exp.json new file mode 100644 index 000000000..a6a3230e0 --- /dev/null +++ b/e2etests/testdata/stable/direction/elk/board.exp.json @@ -0,0 +1,1033 @@ +{ + "name": "", + "shapes": [ + { + "id": "b", + "type": "", + "pos": { + "x": 225, + "y": 12 + }, + "width": 1478, + "height": 426, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 18, + "labelHeight": 41, + "labelPosition": "INSIDE_TOP_CENTER" + }, + { + "id": "b.2", + "type": "", + "pos": { + "x": 432, + "y": 87 + }, + "width": 796, + "height": 276, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "2", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 16, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER" + }, + { + "id": "a", + "type": "", + "pos": { + "x": 12, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "c", + "type": "", + "pos": { + "x": 1803, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "d", + "type": "", + "pos": { + "x": 2016, + "y": 162 + }, + "width": 114, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 14, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "e", + "type": "", + "pos": { + "x": 2230, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.1", + "type": "", + "pos": { + "x": 300, + "y": 162 + }, + "width": 112, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "1", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 12, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.3", + "type": "", + "pos": { + "x": 1248, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "3", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.4", + "type": "", + "pos": { + "x": 1381, + "y": 162 + }, + "width": 114, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "4", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 14, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.5", + "type": "", + "pos": { + "x": 1515, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "5", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.a", + "type": "", + "pos": { + "x": 507, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.b", + "type": "", + "pos": { + "x": 640, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.c", + "type": "", + "pos": { + "x": 773, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.d", + "type": "", + "pos": { + "x": 906, + "y": 162 + }, + "width": 114, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 14, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.e", + "type": "", + "pos": { + "x": 1040, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 125, + "y": 225 + }, + { + "x": 225, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1703, + "y": 225 + }, + { + "x": 1803, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1916, + "y": 225 + }, + { + "x": 2016, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(d -> e)[0]", + "src": "d", + "srcArrow": "none", + "srcLabel": "", + "dst": "e", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 2130, + "y": 225 + }, + { + "x": 2230, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(1 -> 2)[0]", + "src": "b.1", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 412, + "y": 225 + }, + { + "x": 432, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(2 -> 3)[0]", + "src": "b.2", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.3", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1228, + "y": 225 + }, + { + "x": 1248, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(3 -> 4)[0]", + "src": "b.3", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.4", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1361, + "y": 225 + }, + { + "x": 1381, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(4 -> 5)[0]", + "src": "b.4", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.5", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1495, + "y": 225 + }, + { + "x": 1515, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(a -> b)[0]", + "src": "b.2.a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 620, + "y": 225 + }, + { + "x": 640, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(b -> c)[0]", + "src": "b.2.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 753, + "y": 225 + }, + { + "x": 773, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(c -> d)[0]", + "src": "b.2.c", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 886, + "y": 225 + }, + { + "x": 906, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(d -> e)[0]", + "src": "b.2.d", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.e", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1020, + "y": 225 + }, + { + "x": 1040, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + } + ] +} diff --git a/e2etests/testdata/stable/direction/elk/sketch.exp.svg b/e2etests/testdata/stable/direction/elk/sketch.exp.svg new file mode 100644 index 000000000..49447fa1b --- /dev/null +++ b/e2etests/testdata/stable/direction/elk/sketch.exp.svg @@ -0,0 +1,24 @@ + +bacde21345abcde \ No newline at end of file diff --git a/e2etests/testdata/stable/font_colors/elk/board.exp.json b/e2etests/testdata/stable/font_colors/elk/board.exp.json index 41a5119ca..0c8ebea65 100644 --- a/e2etests/testdata/stable/font_colors/elk/board.exp.json +++ b/e2etests/testdata/stable/font_colors/elk/board.exp.json @@ -43,8 +43,8 @@ "id": "beta", "type": "", "pos": { - "x": 17, - "y": 359 + "x": 409, + "y": 12 }, "width": 136, "height": 126, @@ -105,12 +105,12 @@ "labelPercentage": 0, "route": [ { - "x": 84.5, - "y": 138 + "x": 157, + "y": 75 }, { - "x": 84.5, - "y": 359 + "x": 409, + "y": 75 } ], "animated": false, diff --git a/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg b/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg index d851b1a03..a69bb2a09 100644 --- a/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg @@ -2,7 +2,7 @@ usersid +int +name +string +email +string +password +string +last_login +datetime +productsid +int +price +decimal +sku +string +name +string +ordersid +int +user_id +int +product_id +int +shipmentsid +int +order_id int -order_id -int -tracking_number +tracking_number +string +status string -status -string - rectanglesquare acbl1l2c1l2c3l2c2l3c1l3c2l4bacacbabcc1c2c3abc AKHIALFLGAMSTNAZCANVNMUTARLAMOOKTXORCOKSNEWYCTMANYRIDEMDNJPANCSCIDMTWAILINIAMIKYWIOHMNSDVAWVMENHVTNDcontainerfirstsecond - - -1->2 - - -c->2