From 1db6939cce50ccc3ffa2c5eccaaa2a770e985c81 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 28 Nov 2022 21:01:42 -0800 Subject: [PATCH 01/11] 2022-11-28 09:01:42PM --- d2compiler/compile_test.go | 8 ++ d2graph/d2graph.go | 5 + .../TestCompile/basic_icon.exp.json | 6 ++ .../TestCompile/basic_sequence.exp.json | 6 ++ .../TestCompile/basic_shape.exp.json | 6 ++ .../TestCompile/basic_style.exp.json | 6 ++ .../TestCompile/class_paren.exp.json | 6 ++ .../TestCompile/class_style.exp.json | 6 ++ .../TestCompile/default_orientation.exp.json | 100 ++++++++++++++++++ testdata/d2compiler/TestCompile/edge.exp.json | 12 +++ .../edge_arrowhead_fields.exp.json | 18 ++++ .../TestCompile/edge_chain.exp.json | 18 ++++ .../TestCompile/edge_chain_map.exp.json | 18 ++++ .../TestCompile/edge_column_index.exp.json | 12 +++ .../TestCompile/edge_exclusive_style.exp.json | 12 +++ .../TestCompile/edge_flat_arrowhead.exp.json | 15 +++ .../edge_flat_label_arrowhead.exp.json | 15 +++ .../TestCompile/edge_in_column.exp.json | 6 ++ .../TestCompile/edge_index.exp.json | 12 +++ .../TestCompile/edge_index_map.exp.json | 12 +++ .../TestCompile/edge_index_nested.exp.json | 15 +++ .../edge_index_nested_cross_scope.exp.json | 15 +++ .../edge_key_group_flat_nested.exp.json | 15 +++ ..._key_group_flat_nested_underscore.exp.json | 15 +++ ..._group_map_flat_nested_underscore.exp.json | 15 +++ ...e_key_group_map_nested_underscore.exp.json | 15 +++ .../TestCompile/edge_label_map.exp.json | 12 +++ .../d2compiler/TestCompile/edge_map.exp.json | 12 +++ .../TestCompile/edge_map_arrowhead.exp.json | 15 +++ .../TestCompile/edge_map_group_flat.exp.json | 12 +++ .../edge_map_group_semiflat.exp.json | 12 +++ .../TestCompile/edge_map_nested.exp.json | 12 +++ .../TestCompile/edge_map_nested_flat.exp.json | 12 +++ .../TestCompile/edge_mixed_arrowhead.exp.json | 18 ++++ .../edge_non_shape_arrowhead.exp.json | 15 +++ .../edge_semiflat_arrowhead.exp.json | 15 +++ .../TestCompile/escaped_id.exp.json | 6 ++ .../TestCompile/image_style.exp.json | 6 ++ .../TestCompile/nested_sql.exp.json | 9 ++ .../d2compiler/TestCompile/path_link.exp.json | 6 ++ .../reserved_icon_near_style.exp.json | 9 ++ .../TestCompile/root_sequence.exp.json | 3 + .../d2compiler/TestCompile/sql_paren.exp.json | 6 ++ .../TestCompile/stroke-width.exp.json | 6 ++ .../TestCompile/table_style.exp.json | 6 ++ .../TestCompile/table_style_map.exp.json | 6 ++ .../TestCompile/underscore_edge.exp.json | 12 +++ .../underscore_edge_chain.exp.json | 18 ++++ .../underscore_edge_existing.exp.json | 18 ++++ .../underscore_edge_index.exp.json | 15 +++ .../underscore_edge_nested.exp.json | 15 +++ .../underscore_parent_create.exp.json | 9 ++ .../underscore_parent_not_root.exp.json | 12 +++ .../underscore_parent_preference_1.exp.json | 9 ++ .../underscore_parent_preference_2.exp.json | 9 ++ .../underscore_parent_squared.exp.json | 12 +++ .../d2compiler/TestCompile/url_link.exp.json | 6 ++ 57 files changed, 722 insertions(+) create mode 100644 testdata/d2compiler/TestCompile/default_orientation.exp.json diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index dbcc86071..9da6c3c14 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1521,6 +1521,14 @@ dst.id <-> src.dst_id diff.AssertStringEq(t, "sequence_diagram", g.Root.Attributes.Shape.Value) }, }, + { + name: "default_orientation", + + text: `x`, + assertions: func(t *testing.T, g *d2graph.Graph) { + diff.AssertStringEq(t, "vertical", g.Objects[0].Attributes.Orientation.Value) + }, + }, } for _, tc := range testCases { diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 1fe88fba4..376c59177 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -97,6 +97,8 @@ type Attributes struct { Language string `json:"language,omitempty"` // TODO: default to ShapeRectangle instead of empty string Shape Scalar `json:"shape"` + + Orientation Scalar `json:"orientation"` } // TODO references at the root scope should have their Scope set to root graph AST @@ -442,6 +444,9 @@ func (obj *Object) newObject(id string) *Object { Label: Scalar{ Value: idval, }, + Orientation: Scalar{ + Value: "vertical", + }, }, Graph: obj.Graph, diff --git a/testdata/d2compiler/TestCompile/basic_icon.exp.json b/testdata/d2compiler/TestCompile/basic_icon.exp.json index 400adef99..170f485c7 100644 --- a/testdata/d2compiler/TestCompile/basic_icon.exp.json +++ b/testdata/d2compiler/TestCompile/basic_icon.exp.json @@ -87,6 +87,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -141,6 +144,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/basic_sequence.exp.json b/testdata/d2compiler/TestCompile/basic_sequence.exp.json index 91a49f9f6..5d0cdb027 100644 --- a/testdata/d2compiler/TestCompile/basic_sequence.exp.json +++ b/testdata/d2compiler/TestCompile/basic_sequence.exp.json @@ -82,6 +82,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -124,6 +127,9 @@ "near_key": null, "shape": { "value": "sequence_diagram" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/basic_shape.exp.json b/testdata/d2compiler/TestCompile/basic_shape.exp.json index c7e4a0ac6..d115f84a4 100644 --- a/testdata/d2compiler/TestCompile/basic_shape.exp.json +++ b/testdata/d2compiler/TestCompile/basic_shape.exp.json @@ -82,6 +82,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -124,6 +127,9 @@ "near_key": null, "shape": { "value": "circle" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/basic_style.exp.json b/testdata/d2compiler/TestCompile/basic_style.exp.json index d2a35e1a6..c07d66429 100644 --- a/testdata/d2compiler/TestCompile/basic_style.exp.json +++ b/testdata/d2compiler/TestCompile/basic_style.exp.json @@ -89,6 +89,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -135,6 +138,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/class_paren.exp.json b/testdata/d2compiler/TestCompile/class_paren.exp.json index aede137ff..7af924f6f 100644 --- a/testdata/d2compiler/TestCompile/class_paren.exp.json +++ b/testdata/d2compiler/TestCompile/class_paren.exp.json @@ -181,6 +181,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -244,6 +247,9 @@ "near_key": null, "shape": { "value": "class" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/class_style.exp.json b/testdata/d2compiler/TestCompile/class_style.exp.json index 070d91c08..3a13a01e4 100644 --- a/testdata/d2compiler/TestCompile/class_style.exp.json +++ b/testdata/d2compiler/TestCompile/class_style.exp.json @@ -155,6 +155,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -211,6 +214,9 @@ "near_key": null, "shape": { "value": "class" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/default_orientation.exp.json b/testdata/d2compiler/TestCompile/default_orientation.exp.json new file mode 100644 index 000000000..3b04ce12b --- /dev/null +++ b/testdata/d2compiler/TestCompile/default_orientation.exp.json @@ -0,0 +1,100 @@ +{ + "graph": { + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/default_orientation.d2,0:0:0-0:1:1", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/default_orientation.d2,0:0:0-0:1:1", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/default_orientation.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/default_orientation.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "orientation": { + "value": "" + } + } + }, + "edges": null, + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/default_orientation.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/default_orientation.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "orientation": { + "value": "vertical" + } + } + } + ] + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/edge.exp.json b/testdata/d2compiler/TestCompile/edge.exp.json index 9ca4f6511..d96d3a40b 100644 --- a/testdata/d2compiler/TestCompile/edge.exp.json +++ b/testdata/d2compiler/TestCompile/edge.exp.json @@ -66,6 +66,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -94,6 +97,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -136,6 +142,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -176,6 +185,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json b/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json index 3110298fc..c2017c38a 100644 --- a/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json +++ b/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json @@ -245,6 +245,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -267,6 +270,9 @@ "near_key": null, "shape": { "value": "diamond" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -282,6 +288,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } }, "references": [ @@ -297,6 +306,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -339,6 +351,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -379,6 +394,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_chain.exp.json b/testdata/d2compiler/TestCompile/edge_chain.exp.json index fad3904ac..6d0eddc10 100644 --- a/testdata/d2compiler/TestCompile/edge_chain.exp.json +++ b/testdata/d2compiler/TestCompile/edge_chain.exp.json @@ -113,6 +113,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -141,6 +144,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -168,6 +174,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -210,6 +219,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -270,6 +282,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -310,6 +325,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_chain_map.exp.json b/testdata/d2compiler/TestCompile/edge_chain_map.exp.json index df003d462..22dad3d61 100644 --- a/testdata/d2compiler/TestCompile/edge_chain_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_chain_map.exp.json @@ -142,6 +142,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -170,6 +173,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -197,6 +203,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -239,6 +248,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -299,6 +311,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -339,6 +354,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_column_index.exp.json b/testdata/d2compiler/TestCompile/edge_column_index.exp.json index 8a9fde6d3..5d2786fb9 100644 --- a/testdata/d2compiler/TestCompile/edge_column_index.exp.json +++ b/testdata/d2compiler/TestCompile/edge_column_index.exp.json @@ -344,6 +344,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -374,6 +377,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -463,6 +469,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } }, @@ -550,6 +559,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json b/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json index 47a51ab19..1c93e5f5b 100644 --- a/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json +++ b/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json @@ -111,6 +111,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -143,6 +146,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -185,6 +191,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -225,6 +234,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json index 5655158a5..da5fbf56a 100644 --- a/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json @@ -154,6 +154,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -176,6 +179,9 @@ "near_key": null, "shape": { "value": "diamond" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -195,6 +201,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -257,6 +266,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -317,6 +329,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json index cb91401f8..373d9ea13 100644 --- a/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json @@ -122,6 +122,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -144,6 +147,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -160,6 +166,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -202,6 +211,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -242,6 +254,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_in_column.exp.json b/testdata/d2compiler/TestCompile/edge_in_column.exp.json index 76b269f31..2bd593b35 100644 --- a/testdata/d2compiler/TestCompile/edge_in_column.exp.json +++ b/testdata/d2compiler/TestCompile/edge_in_column.exp.json @@ -157,6 +157,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -209,6 +212,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_index.exp.json b/testdata/d2compiler/TestCompile/edge_index.exp.json index 4ac3a630e..7942263db 100644 --- a/testdata/d2compiler/TestCompile/edge_index.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index.exp.json @@ -137,6 +137,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -168,6 +171,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -230,6 +236,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -290,6 +299,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_index_map.exp.json b/testdata/d2compiler/TestCompile/edge_index_map.exp.json index 35a310c17..600254fdb 100644 --- a/testdata/d2compiler/TestCompile/edge_index_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_map.exp.json @@ -156,6 +156,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -187,6 +190,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -249,6 +255,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -309,6 +318,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_index_nested.exp.json b/testdata/d2compiler/TestCompile/edge_index_nested.exp.json index b27801d49..e8c64cc88 100644 --- a/testdata/d2compiler/TestCompile/edge_index_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_nested.exp.json @@ -166,6 +166,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -197,6 +200,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -239,6 +245,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -299,6 +308,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -359,6 +371,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json b/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json index 87518a63e..f4dc0346e 100644 --- a/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json @@ -182,6 +182,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -213,6 +216,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -275,6 +281,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -335,6 +344,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -395,6 +407,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json index 169522086..8c4b7a3b0 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json @@ -195,6 +195,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -230,6 +233,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -292,6 +298,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -352,6 +361,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -412,6 +424,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json index 6db8f6429..cdb035c7a 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json @@ -201,6 +201,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -236,6 +239,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -278,6 +284,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -349,6 +358,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -420,6 +432,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json index c85eccedc..bb8dff5ab 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json @@ -214,6 +214,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -249,6 +252,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -291,6 +297,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -362,6 +371,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -433,6 +445,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json index f689762ad..3adcb13cd 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json @@ -232,6 +232,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -267,6 +270,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -309,6 +315,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -380,6 +389,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -451,6 +463,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_label_map.exp.json b/testdata/d2compiler/TestCompile/edge_label_map.exp.json index e91142b98..4c7710a2c 100644 --- a/testdata/d2compiler/TestCompile/edge_label_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_label_map.exp.json @@ -122,6 +122,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -154,6 +157,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -196,6 +202,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -236,6 +245,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_map.exp.json b/testdata/d2compiler/TestCompile/edge_map.exp.json index e1d436a20..b113797eb 100644 --- a/testdata/d2compiler/TestCompile/edge_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map.exp.json @@ -105,6 +105,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -133,6 +136,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -175,6 +181,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -215,6 +224,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json index 9abaa0abc..be019a02e 100644 --- a/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json @@ -134,6 +134,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -156,6 +159,9 @@ "near_key": null, "shape": { "value": "diamond" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -172,6 +178,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -214,6 +223,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -254,6 +266,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json b/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json index 77788e717..f784f9f80 100644 --- a/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json @@ -150,6 +150,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -185,6 +188,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -247,6 +253,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -307,6 +316,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json b/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json index 67b44e188..c786c3268 100644 --- a/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json @@ -168,6 +168,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -203,6 +206,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -265,6 +271,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -325,6 +334,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_map_nested.exp.json b/testdata/d2compiler/TestCompile/edge_map_nested.exp.json index 44d73ca4d..83af61916 100644 --- a/testdata/d2compiler/TestCompile/edge_map_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_nested.exp.json @@ -130,6 +130,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -162,6 +165,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -204,6 +210,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -244,6 +253,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json b/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json index 18161ea9f..eaa7028dd 100644 --- a/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json @@ -112,6 +112,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -144,6 +147,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -186,6 +192,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -226,6 +235,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json index 40af4edf1..be0220793 100644 --- a/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json @@ -222,6 +222,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -244,6 +247,9 @@ "near_key": null, "shape": { "value": "diamond" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -255,6 +261,9 @@ "near_key": null, "shape": { "value": "diamond" + }, + "orientation": { + "value": "" } }, "references": [ @@ -273,6 +282,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -335,6 +347,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -395,6 +410,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json index 0298cbd45..5565fad95 100644 --- a/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json @@ -116,6 +116,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -138,6 +141,9 @@ "near_key": null, "shape": { "value": "triangle" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -154,6 +160,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -196,6 +205,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -236,6 +248,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json index d55583d16..0ac2ac3e8 100644 --- a/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json @@ -172,6 +172,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -194,6 +197,9 @@ "near_key": null, "shape": { "value": "diamond" + }, + "orientation": { + "value": "" } }, "dst_arrow": true, @@ -213,6 +219,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -275,6 +284,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -335,6 +347,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/escaped_id.exp.json b/testdata/d2compiler/TestCompile/escaped_id.exp.json index 66ab3db4b..18df30816 100644 --- a/testdata/d2compiler/TestCompile/escaped_id.exp.json +++ b/testdata/d2compiler/TestCompile/escaped_id.exp.json @@ -43,6 +43,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -85,6 +88,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/image_style.exp.json b/testdata/d2compiler/TestCompile/image_style.exp.json index 560a8afd4..466e46944 100644 --- a/testdata/d2compiler/TestCompile/image_style.exp.json +++ b/testdata/d2compiler/TestCompile/image_style.exp.json @@ -164,6 +164,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -222,6 +225,9 @@ "near_key": null, "shape": { "value": "image" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/nested_sql.exp.json b/testdata/d2compiler/TestCompile/nested_sql.exp.json index 20e9543c7..7de6092fa 100644 --- a/testdata/d2compiler/TestCompile/nested_sql.exp.json +++ b/testdata/d2compiler/TestCompile/nested_sql.exp.json @@ -177,6 +177,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -219,6 +222,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -275,6 +281,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/path_link.exp.json b/testdata/d2compiler/TestCompile/path_link.exp.json index 3c3090156..5e3e1c2ce 100644 --- a/testdata/d2compiler/TestCompile/path_link.exp.json +++ b/testdata/d2compiler/TestCompile/path_link.exp.json @@ -82,6 +82,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -125,6 +128,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json b/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json index f68047661..81d98affb 100644 --- a/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json +++ b/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json @@ -277,6 +277,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -387,6 +390,9 @@ }, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -427,6 +433,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/root_sequence.exp.json b/testdata/d2compiler/TestCompile/root_sequence.exp.json index c7697577a..cb3b7e599 100644 --- a/testdata/d2compiler/TestCompile/root_sequence.exp.json +++ b/testdata/d2compiler/TestCompile/root_sequence.exp.json @@ -53,6 +53,9 @@ "near_key": null, "shape": { "value": "sequence_diagram" + }, + "orientation": { + "value": "" } } }, diff --git a/testdata/d2compiler/TestCompile/sql_paren.exp.json b/testdata/d2compiler/TestCompile/sql_paren.exp.json index 9af237e20..e4e9783f1 100644 --- a/testdata/d2compiler/TestCompile/sql_paren.exp.json +++ b/testdata/d2compiler/TestCompile/sql_paren.exp.json @@ -158,6 +158,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -216,6 +219,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/stroke-width.exp.json b/testdata/d2compiler/TestCompile/stroke-width.exp.json index 09fcdd941..a276be175 100644 --- a/testdata/d2compiler/TestCompile/stroke-width.exp.json +++ b/testdata/d2compiler/TestCompile/stroke-width.exp.json @@ -89,6 +89,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -135,6 +138,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/table_style.exp.json b/testdata/d2compiler/TestCompile/table_style.exp.json index 112aa3a40..0e9baf10f 100644 --- a/testdata/d2compiler/TestCompile/table_style.exp.json +++ b/testdata/d2compiler/TestCompile/table_style.exp.json @@ -155,6 +155,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -211,6 +214,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/table_style_map.exp.json b/testdata/d2compiler/TestCompile/table_style_map.exp.json index 12baf6065..cfa3bd760 100644 --- a/testdata/d2compiler/TestCompile/table_style_map.exp.json +++ b/testdata/d2compiler/TestCompile/table_style_map.exp.json @@ -206,6 +206,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -262,6 +265,9 @@ "near_key": null, "shape": { "value": "sql_table" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_edge.exp.json b/testdata/d2compiler/TestCompile/underscore_edge.exp.json index eb8834c51..f2209a434 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge.exp.json @@ -117,6 +117,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -145,6 +148,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -218,6 +224,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -269,6 +278,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json index 6d20bf30c..7bb4d8162 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json @@ -176,6 +176,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -204,6 +207,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -231,6 +237,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -335,6 +344,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -386,6 +398,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -437,6 +452,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json index cdbb0e417..45935ba7a 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json @@ -183,6 +183,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -211,6 +214,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -238,6 +244,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -280,6 +289,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -351,6 +363,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -422,6 +437,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json index 9dc877365..d2e3c7efd 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json @@ -188,6 +188,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -219,6 +222,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -261,6 +267,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -332,6 +341,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -403,6 +415,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json index f69c79872..5469d878f 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json @@ -157,6 +157,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -185,6 +188,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } } @@ -227,6 +233,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -298,6 +307,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -360,6 +372,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json index aca48bc91..706b5c5a7 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json @@ -83,6 +83,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -125,6 +128,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -176,6 +182,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json index 28f0903f3..c46f425ae 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json @@ -112,6 +112,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -154,6 +157,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -194,6 +200,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -245,6 +254,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json index db0e2f7dd..2970baaae 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json @@ -126,6 +126,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -168,6 +171,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -239,6 +245,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json index 18754b590..5de8bc701 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json @@ -126,6 +126,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -199,6 +202,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -239,6 +245,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json index e45990c65..4cc238109 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json @@ -123,6 +123,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -165,6 +168,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -205,6 +211,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } }, @@ -267,6 +276,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } diff --git a/testdata/d2compiler/TestCompile/url_link.exp.json b/testdata/d2compiler/TestCompile/url_link.exp.json index 8b73b1ff3..cffd8a386 100644 --- a/testdata/d2compiler/TestCompile/url_link.exp.json +++ b/testdata/d2compiler/TestCompile/url_link.exp.json @@ -82,6 +82,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "" } } }, @@ -125,6 +128,9 @@ "near_key": null, "shape": { "value": "" + }, + "orientation": { + "value": "vertical" } } } From b1cfeb19e63430d2e915b6e0dad53dd47ea4ec51 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 28 Nov 2022 21:39:36 -0800 Subject: [PATCH 02/11] 2022-11-28 09:39:36PM --- d2compiler/compile.go | 7 + d2compiler/compile_test.go | 27 + d2graph/d2graph.go | 21 +- d2layouts/d2dagrelayout/layout.go | 10 +- d2layouts/d2elklayout/layout.go | 5 + e2etests/stable_test.go | 14 + .../child_parent_edges/dagre/board.exp.json | 80 +- .../child_parent_edges/dagre/sketch.exp.svg | 4 +- .../stable/orientation/dagre/board.exp.json | 1141 +++++++++++++++++ .../stable/orientation/dagre/sketch.exp.svg | 24 + .../stable/orientation/elk/board.exp.json | 1033 +++++++++++++++ .../stable/orientation/elk/sketch.exp.svg | 24 + .../TestCompile/invalid_orientation.exp.json | 12 + .../TestCompile/root_orientation.exp.json | 66 + .../TestCompile/set_orientation.exp.json | 139 ++ 15 files changed, 2552 insertions(+), 55 deletions(-) create mode 100644 e2etests/testdata/stable/orientation/dagre/board.exp.json create mode 100644 e2etests/testdata/stable/orientation/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/stable/orientation/elk/board.exp.json create mode 100644 e2etests/testdata/stable/orientation/elk/sketch.exp.svg create mode 100644 testdata/d2compiler/TestCompile/invalid_orientation.exp.json create mode 100644 testdata/d2compiler/TestCompile/root_orientation.exp.json create mode 100644 testdata/d2compiler/TestCompile/set_orientation.exp.json diff --git a/d2compiler/compile.go b/d2compiler/compile.go index f865bfb9b..7516fa9fe 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -356,6 +356,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()) + return + } + attrs.Orientation.Value = scalar.ScalarString() + return } if _, ok := d2graph.StyleKeywords[reserved]; ok { diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 9da6c3c14..294503a56 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1521,6 +1521,14 @@ dst.id <-> src.dst_id diff.AssertStringEq(t, "sequence_diagram", g.Root.Attributes.Shape.Value) }, }, + { + name: "root_orientation", + + text: `orientation: horizontal`, + assertions: func(t *testing.T, g *d2graph.Graph) { + diff.AssertStringEq(t, "horizontal", g.Root.Attributes.Orientation.Value) + }, + }, { name: "default_orientation", @@ -1529,6 +1537,25 @@ dst.id <-> src.dst_id diff.AssertStringEq(t, "vertical", g.Objects[0].Attributes.Orientation.Value) }, }, + { + name: "set_orientation", + + text: `x: { + orientation: horizontal +}`, + assertions: func(t *testing.T, g *d2graph.Graph) { + diff.AssertStringEq(t, "horizontal", g.Objects[0].Attributes.Orientation.Value) + }, + }, + { + name: "invalid_orientation", + + text: `x: { + orientation: diagonal +}`, + expErr: `d2/testdata/d2compiler/TestCompile/invalid_orientation.d2:2:16: expected "horizontal" or "vertical" orientation, got "diagonal" +`, + }, } for _, tc := range testCases { diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 376c59177..a2261686e 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -1052,16 +1052,17 @@ func Key(k *d2ast.KeyPath) []string { } var ReservedKeywords = map[string]struct{}{ - "label": {}, - "desc": {}, - "shape": {}, - "icon": {}, - "constraint": {}, - "tooltip": {}, - "link": {}, - "near": {}, - "width": {}, - "height": {}, + "label": {}, + "desc": {}, + "shape": {}, + "icon": {}, + "constraint": {}, + "tooltip": {}, + "link": {}, + "near": {}, + "width": {}, + "height": {}, + "orientation": {}, } // 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 51f30bf09..1edc17f1e 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -60,12 +60,16 @@ func Layout(ctx context.Context, d2graph *d2graph.Graph) (err error) { return err } - configJS := setGraphAttrs(dagreGraphAttrs{ + rootAttrs := dagreGraphAttrs{ ranksep: 100, edgesep: 40, nodesep: 60, - rankdir: "tb", - }) + rankdir: "TB", + } + if d2graph.Root.Attributes.Orientation.Value == "horizontal" { + rootAttrs.rankdir = "LR" + } + configJS := setGraphAttrs(rootAttrs) if _, err := v8ctx.RunScript(configJS, "config.js"); err != nil { return err } diff --git a/d2layouts/d2elklayout/layout.go b/d2layouts/d2elklayout/layout.go index 47904d6cc..209a73856 100644 --- a/d2layouts/d2elklayout/layout.go +++ b/d2layouts/d2elklayout/layout.go @@ -80,6 +80,7 @@ type ELKLayoutOptions struct { NodeSpacing float64 `json:"spacing.nodeNodeBetweenLayers,omitempty"` Padding string `json:"elk.padding,omitempty"` EdgeNodeSpacing float64 `json:"spacing.edgeNodeBetweenLayers,omitempty"` + Direction string `json:"elk.direction"` } func Layout(ctx context.Context, g *d2graph.Graph) (err error) { @@ -119,8 +120,12 @@ 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" { + elkGraph.LayoutOptions.Direction = "RIGHT" + } elkNodes := make(map[*d2graph.Object]*ELKNode) elkEdges := make(map[*d2graph.Edge]*ELKEdge) diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index d72801cd4..16c43f434 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -986,6 +986,20 @@ sugar -> c c: mixed together c -> solution: we get +`, + }, + { + name: "orientation", + script: `a -> b -> c -> d -> e +b: { + orientation: horizontal + 1 -> 2 -> 3 -> 4 -> 5 + + 2: { + orientation: vertical + a -> b -> c -> d -> e + } +} `, }, } diff --git a/e2etests/testdata/stable/child_parent_edges/dagre/board.exp.json b/e2etests/testdata/stable/child_parent_edges/dagre/board.exp.json index 031c791b9..8c3d30dfc 100644 --- a/e2etests/testdata/stable/child_parent_edges/dagre/board.exp.json +++ b/e2etests/testdata/stable/child_parent_edges/dagre/board.exp.json @@ -8,7 +8,7 @@ "x": 0, "y": 0 }, - "width": 494, + "width": 524, "height": 426, "level": 1, "opacity": 1, @@ -46,7 +46,7 @@ "x": 40, "y": 50 }, - "width": 414, + "width": 444, "height": 326, "level": 2, "opacity": 1, @@ -84,7 +84,7 @@ "x": 80, "y": 100 }, - "width": 334, + "width": 364, "height": 226, "level": 3, "opacity": 1, @@ -182,55 +182,55 @@ "route": [ { "x": 244, - "y": 173.24723247232473 + "y": 174.66192170818505 }, { - "x": 270.66666666666663, - "y": 154.64944649446494 + "x": 273.33333333333337, + "y": 154.932384341637 }, { - "x": 279, + "x": 282.5, "y": 150 }, { - "x": 281.5, + "x": 285.25, "y": 150 }, { - "x": 284, + "x": 288, "y": 150 }, { - "x": 287.33333333333337, + "x": 291.66666666666663, "y": 162.6 }, { - "x": 289.83333333333337, + "x": 294.41666666666663, "y": 181.5 }, { - "x": 292.3333333333333, + "x": 297.1666666666667, "y": 200.4 }, { - "x": 292.3333333333333, + "x": 297.1666666666667, "y": 225.6 }, { - "x": 289.83333333333337, + "x": 294.41666666666663, "y": 244.5 }, { - "x": 287.33333333333337, + "x": 291.66666666666663, "y": 263.4 }, { - "x": 270.66666666666663, - "y": 271.35055350553506 + "x": 273.33333333333337, + "y": 271.06761565836297 }, { "x": 244, - "y": 252.75276752767527 + "y": 251.33807829181495 } ], "isCurve": true, @@ -265,55 +265,55 @@ "route": [ { "x": 244, - "y": 182.30769230769232 + "y": 184.7244094488189 }, { - "x": 292, - "y": 156.46153846153845 + "x": 300, + "y": 156.9448818897638 }, { - "x": 307, + "x": 317.5, "y": 150 }, { - "x": 311.5, + "x": 322.75, "y": 150 }, { - "x": 316, + "x": 328, "y": 150 }, { - "x": 322, + "x": 335, "y": 162.6 }, { - "x": 326.5, + "x": 340.25, "y": 181.5 }, { - "x": 331, + "x": 345.5, "y": 200.4 }, { - "x": 331, + "x": 345.5, "y": 225.6 }, { - "x": 326.5, + "x": 340.25, "y": 244.5 }, { - "x": 322, + "x": 335, "y": 263.4 }, { - "x": 292, - "y": 269.53846153846155 + "x": 300, + "y": 269.0551181102362 }, { "x": 244, - "y": 243.69230769230768 + "y": 241.2755905511811 } ], "isCurve": true, @@ -347,20 +347,20 @@ "labelPercentage": 0, "route": [ { - "x": 243.66666666666669, - "y": 238 + "x": 244.33333333333331, + "y": 235 }, { - "x": 243.93333333333334, - "y": 237.99628770301624 + "x": 244.06666666666666, + "y": 235.3176715176715 }, { - "x": 243.73333333333335, - "y": 237.99907192575407 + "x": 244.26666666666665, + "y": 235.0794178794179 }, { "x": 244, - "y": 237.9953596287703 + "y": 235.3970893970894 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/child_parent_edges/dagre/sketch.exp.svg b/e2etests/testdata/stable/child_parent_edges/dagre/sketch.exp.svg index 1ea56dd9d..54341ea30 100644 --- a/e2etests/testdata/stable/child_parent_edges/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/child_parent_edges/dagre/sketch.exp.svg @@ -2,7 +2,7 @@ \ No newline at end of file diff --git a/e2etests/testdata/stable/orientation/elk/board.exp.json b/e2etests/testdata/stable/orientation/elk/board.exp.json new file mode 100644 index 000000000..a6a3230e0 --- /dev/null +++ b/e2etests/testdata/stable/orientation/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/orientation/elk/sketch.exp.svg b/e2etests/testdata/stable/orientation/elk/sketch.exp.svg new file mode 100644 index 000000000..49447fa1b --- /dev/null +++ b/e2etests/testdata/stable/orientation/elk/sketch.exp.svg @@ -0,0 +1,24 @@ + +bacde21345abcde \ No newline at end of file diff --git a/testdata/d2compiler/TestCompile/invalid_orientation.exp.json b/testdata/d2compiler/TestCompile/invalid_orientation.exp.json new file mode 100644 index 000000000..07a7adc83 --- /dev/null +++ b/testdata/d2compiler/TestCompile/invalid_orientation.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/invalid_orientation.d2,1:15:20-1:23:28", + "errmsg": "d2/testdata/d2compiler/TestCompile/invalid_orientation.d2:2:16: expected \"horizontal\" or \"vertical\" orientation, got \"diagonal\"" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/root_orientation.exp.json b/testdata/d2compiler/TestCompile/root_orientation.exp.json new file mode 100644 index 000000000..61ef8d9b2 --- /dev/null +++ b/testdata/d2compiler/TestCompile/root_orientation.exp.json @@ -0,0 +1,66 @@ +{ + "graph": { + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/root_orientation.d2,0:0:0-0:23:23", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/root_orientation.d2,0:0:0-0:23:23", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/root_orientation.d2,0:0:0-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/root_orientation.d2,0:0:0-0:11:11", + "value": [ + { + "string": "orientation", + "raw_string": "orientation" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/root_orientation.d2,0:13:13-0:23:23", + "value": [ + { + "string": "horizontal", + "raw_string": "horizontal" + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "orientation": { + "value": "horizontal" + } + } + }, + "edges": null, + "objects": null + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/set_orientation.exp.json b/testdata/d2compiler/TestCompile/set_orientation.exp.json new file mode 100644 index 000000000..c25958113 --- /dev/null +++ b/testdata/d2compiler/TestCompile/set_orientation.exp.json @@ -0,0 +1,139 @@ +{ + "graph": { + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:0:0-2:1:32", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:0:0-2:1:32", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:3:3-2:0:31", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,1:2:7-1:25:30", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,1:2:7-1:13:18", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,1:2:7-1:13:18", + "value": [ + { + "string": "orientation", + "raw_string": "orientation" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,1:15:20-1:25:30", + "value": [ + { + "string": "horizontal", + "raw_string": "horizontal" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "orientation": { + "value": "" + } + } + }, + "edges": null, + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/set_orientation.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "orientation": { + "value": "horizontal" + } + } + } + ] + }, + "err": null +} From 5489733e2d3b2d3a5a9f66ccda45ef70b8361896 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 28 Nov 2022 21:42:55 -0800 Subject: [PATCH 03/11] 2022-11-28 09:42:55PM --- .../testdata/sanity/1_to_2/elk/board.exp.json | 36 +- .../testdata/sanity/1_to_2/elk/sketch.exp.svg | 4 +- .../testdata/sanity/basic/elk/board.exp.json | 12 +- .../testdata/sanity/basic/elk/sketch.exp.svg | 4 +- .../sanity/child_to_child/elk/board.exp.json | 20 +- .../sanity/child_to_child/elk/sketch.exp.svg | 4 +- .../connection_label/elk/board.exp.json | 12 +- .../connection_label/elk/sketch.exp.svg | 10 +- .../stable/all_shapes/elk/board.exp.json | 154 +- .../stable/all_shapes/elk/sketch.exp.svg | 4 +- .../all_shapes_multiple/elk/board.exp.json | 154 +- .../all_shapes_multiple/elk/sketch.exp.svg | 4 +- .../all_shapes_shadow/elk/board.exp.json | 154 +- .../all_shapes_shadow/elk/sketch.exp.svg | 4 +- .../arrowhead_adjustment/elk/board.exp.json | 88 +- .../arrowhead_adjustment/elk/sketch.exp.svg | 4 +- .../arrowhead_labels/elk/board.exp.json | 14 +- .../arrowhead_labels/elk/sketch.exp.svg | 10 +- .../stable/binary_tree/elk/board.exp.json | 228 +-- .../stable/binary_tree/elk/sketch.exp.svg | 4 +- .../testdata/stable/chaos1/elk/board.exp.json | 40 +- .../testdata/stable/chaos1/elk/sketch.exp.svg | 16 +- .../testdata/stable/chaos2/elk/board.exp.json | 288 ++- .../testdata/stable/chaos2/elk/sketch.exp.svg | 58 +- .../child_parent_edges/elk/board.exp.json | 40 +- .../child_parent_edges/elk/sketch.exp.svg | 4 +- .../circular_dependency/elk/board.exp.json | 40 +- .../circular_dependency/elk/sketch.exp.svg | 4 +- .../stable/code_snippet/elk/board.exp.json | 28 +- .../stable/code_snippet/elk/sketch.exp.svg | 6 +- .../connected_container/elk/board.exp.json | 48 +- .../connected_container/elk/sketch.exp.svg | 4 +- .../stable/container_edges/elk/board.exp.json | 120 +- .../stable/container_edges/elk/sketch.exp.svg | 4 +- .../testdata/stable/dense/elk/board.exp.json | 404 ++-- .../testdata/stable/dense/elk/sketch.exp.svg | 4 +- .../different_subgraphs/elk/board.exp.json | 284 +-- .../different_subgraphs/elk/sketch.exp.svg | 4 +- .../stable/font_colors/elk/board.exp.json | 12 +- .../stable/font_colors/elk/sketch.exp.svg | 10 +- .../giant_markdown_test/elk/board.exp.json | 28 +- .../giant_markdown_test/elk/sketch.exp.svg | 6 +- .../testdata/stable/hr/elk/board.exp.json | 28 +- .../testdata/stable/hr/elk/sketch.exp.svg | 6 +- .../testdata/stable/images/elk/board.exp.json | 12 +- .../testdata/stable/images/elk/sketch.exp.svg | 4 +- .../stable/investigate/elk/board.exp.json | 434 ++-- .../stable/investigate/elk/sketch.exp.svg | 40 +- .../stable/large_arch/elk/board.exp.json | 396 ++-- .../stable/large_arch/elk/sketch.exp.svg | 4 +- .../testdata/stable/latex/elk/board.exp.json | 96 +- .../testdata/stable/latex/elk/sketch.exp.svg | 10 +- .../testdata/stable/li1/elk/board.exp.json | 26 +- .../testdata/stable/li1/elk/sketch.exp.svg | 6 +- .../testdata/stable/li2/elk/board.exp.json | 26 +- .../testdata/stable/li2/elk/sketch.exp.svg | 6 +- .../testdata/stable/li3/elk/board.exp.json | 28 +- .../testdata/stable/li3/elk/sketch.exp.svg | 6 +- .../testdata/stable/li4/elk/board.exp.json | 28 +- .../testdata/stable/li4/elk/sketch.exp.svg | 6 +- .../stable/lone_h1/elk/board.exp.json | 26 +- .../stable/lone_h1/elk/sketch.exp.svg | 6 +- .../stable/markdown/elk/board.exp.json | 28 +- .../stable/markdown/elk/sketch.exp.svg | 6 +- .../md_code_block_fenced/elk/board.exp.json | 26 +- .../md_code_block_fenced/elk/sketch.exp.svg | 6 +- .../md_code_block_indented/elk/board.exp.json | 28 +- .../md_code_block_indented/elk/sketch.exp.svg | 6 +- .../stable/md_code_inline/elk/board.exp.json | 24 +- .../stable/md_code_inline/elk/sketch.exp.svg | 6 +- .../stable/multiple_trees/elk/board.exp.json | 364 ++-- .../stable/multiple_trees/elk/sketch.exp.svg | 4 +- .../stable/n22_e32/elk/board.exp.json | 540 ++--- .../stable/n22_e32/elk/sketch.exp.svg | 4 +- .../one_container_loop/elk/board.exp.json | 116 +- .../one_container_loop/elk/sketch.exp.svg | 4 +- .../elk/board.exp.json | 120 +- .../elk/sketch.exp.svg | 4 +- .../stable/orientation/elk/board.exp.json | 164 +- .../stable/orientation/elk/sketch.exp.svg | 4 +- e2etests/testdata/stable/p/elk/board.exp.json | 26 +- e2etests/testdata/stable/p/elk/sketch.exp.svg | 6 +- .../testdata/stable/pre/elk/board.exp.json | 28 +- .../testdata/stable/pre/elk/sketch.exp.svg | 6 +- .../stable/sql_tables/elk/board.exp.json | 54 +- .../stable/sql_tables/elk/sketch.exp.svg | 64 +- .../stable/square_3d/elk/board.exp.json | 14 +- .../stable/square_3d/elk/sketch.exp.svg | 4 +- .../elk/board.exp.json | 240 +-- .../elk/sketch.exp.svg | 4 +- .../stable/stylish/elk/board.exp.json | 14 +- .../stable/stylish/elk/sketch.exp.svg | 4 +- .../testdata/stable/us_map/elk/board.exp.json | 1808 +++++++++-------- .../testdata/stable/us_map/elk/sketch.exp.svg | 4 +- .../container_child_edge/elk/board.exp.json | 36 +- .../container_child_edge/elk/sketch.exp.svg | 16 +- 96 files changed, 3692 insertions(+), 3660 deletions(-) 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 c1d27b8de..6c709942a 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": 12, - "y": 33 + "x": 31, + "y": 12 }, "width": 113, "height": 126, @@ -43,8 +43,8 @@ "id": "b", "type": "", "pos": { - "x": 225, - "y": 12 + "x": 12, + "y": 238 }, "width": 113, "height": 126, @@ -81,8 +81,8 @@ "id": "c", "type": "", "pos": { - "x": 225, - "y": 158 + "x": 145, + "y": 238 }, "width": 113, "height": 126, @@ -143,12 +143,12 @@ "labelPercentage": 0, "route": [ { - "x": 125, - "y": 75 + "x": 68.5, + "y": 138 }, { - "x": 225, - "y": 75 + "x": 68.5, + "y": 238 } ], "animated": false, @@ -181,20 +181,20 @@ "labelPercentage": 0, "route": [ { - "x": 125, - "y": 117 + "x": 106.16666666666667, + "y": 138 }, { - "x": 175, - "y": 117 + "x": 106.16666666666667, + "y": 188 }, { - "x": 175, - "y": 221 + "x": 201.5, + "y": 188 }, { - "x": 225, - "y": 221 + "x": 201.5, + "y": 238 } ], "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 76640f7f2..c6a7e3671 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="1382" height="366" viewBox="-88 -88 1382 366">        panic("crypto: RegisterHash of unknown hash function")     }     hashes[h] = f -}xy acfbdhg agdfbhec abcdefghijklmnopq finallyatreeandnodessomemoremanythenhereyouhavehierarchyanotherofnestingtreesatreeinsidehierarchyroot alphabeta - - -gammaab aabbccddllffwwyynniijjkkssuurmeemmmmgghhzzooppqqrrttvvxxabac - - -1 - - -2 - - -3 - - -4 - - -5 - - -6abcdefghiqrjmnoszaabbeeffggklptuwxyccddv abcdefghijklmnopqrstuvw abcdefghijklmnopqrstu acdefgbh topabcbottomstartend bacde21345abcde 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 +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 -tracking_number -string -status +order_id +int +tracking_number string - rectanglesquare acbl1l2c1l2c3l2c2l3c1l3c2l4bacacbabcc1c2c3abc AKHIALFLGAMSTNAZCANVNMUTARLAMOOKTXORCOKSNEWYCTMANYRIDEMDNJPANCSCIDMTWAILINIAMIKYWIOHMNSDVAWVMENHVTNDcontainerfirstsecond - - -1->2 - - -c->2abc ab acbd ab - - -hellorectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud cba * ab - - -To err is human, to moo bovine1*abcdefghijklmno aaadddeeebbbccc - - -111 - - -222abcd abcd abc // RegisterHash registers a function that returns a new instance of the given +// 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->2bacde21345abcde \ No newline at end of file diff --git a/e2etests/testdata/stable/orientation/elk/board.exp.json b/e2etests/testdata/stable/orientation/elk/board.exp.json deleted file mode 100644 index 37051403b..000000000 --- a/e2etests/testdata/stable/orientation/elk/board.exp.json +++ /dev/null @@ -1,1033 +0,0 @@ -{ - "name": "", - "shapes": [ - { - "id": "b", - "type": "", - "pos": { - "x": 12, - "y": 238 - }, - "width": 414, - "height": 1594, - "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": 87, - "y": 459 - }, - "width": 264, - "height": 860, - "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": 163, - "y": 12 - }, - "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": 163, - "y": 1932 - }, - "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": 162, - "y": 2158 - }, - "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": 163, - "y": 2384 - }, - "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": 163, - "y": 313 - }, - "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": 163, - "y": 1339 - }, - "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": 162, - "y": 1485 - }, - "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": 163, - "y": 1631 - }, - "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": 163, - "y": 534 - }, - "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": 163, - "y": 680 - }, - "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": 163, - "y": 826 - }, - "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": 162, - "y": 972 - }, - "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": 163, - "y": 1118 - }, - "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": 219, - "y": 138 - }, - { - "x": 219, - "y": 238 - } - ], - "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": 219, - "y": 1832 - }, - { - "x": 219, - "y": 1932 - } - ], - "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": 219, - "y": 2058 - }, - { - "x": 219, - "y": 2158 - } - ], - "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": 219, - "y": 2284 - }, - { - "x": 219, - "y": 2384 - } - ], - "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": 219, - "y": 439 - }, - { - "x": 219, - "y": 459 - } - ], - "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": 219, - "y": 1319 - }, - { - "x": 219, - "y": 1339 - } - ], - "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": 219, - "y": 1465 - }, - { - "x": 219, - "y": 1485 - } - ], - "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": 219, - "y": 1611 - }, - { - "x": 219, - "y": 1631 - } - ], - "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": 219, - "y": 660 - }, - { - "x": 219, - "y": 680 - } - ], - "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": 219, - "y": 806 - }, - { - "x": 219, - "y": 826 - } - ], - "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": 219, - "y": 952 - }, - { - "x": 219, - "y": 972 - } - ], - "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": 219, - "y": 1098 - }, - { - "x": 219, - "y": 1118 - } - ], - "animated": false, - "tooltip": "", - "icon": null - } - ] -} diff --git a/e2etests/testdata/stable/orientation/elk/sketch.exp.svg b/e2etests/testdata/stable/orientation/elk/sketch.exp.svg deleted file mode 100644 index 1733e1ad8..000000000 --- a/e2etests/testdata/stable/orientation/elk/sketch.exp.svg +++ /dev/null @@ -1,24 +0,0 @@ - -bacde21345abcde \ No newline at end of file From bc219658928d7d074a876f294b5d923f2f315f16 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Tue, 29 Nov 2022 16:12:23 -0800 Subject: [PATCH 08/11] 2022-11-29 04:12:23PM --- d2graph/d2graph.go | 1 + .../testdata/sanity/1_to_2/elk/board.exp.json | 36 +- .../testdata/sanity/1_to_2/elk/sketch.exp.svg | 4 +- .../testdata/sanity/basic/elk/board.exp.json | 12 +- .../testdata/sanity/basic/elk/sketch.exp.svg | 4 +- .../sanity/child_to_child/elk/board.exp.json | 20 +- .../sanity/child_to_child/elk/sketch.exp.svg | 4 +- .../connection_label/elk/board.exp.json | 12 +- .../connection_label/elk/sketch.exp.svg | 10 +- .../stable/all_shapes/elk/board.exp.json | 154 +- .../stable/all_shapes/elk/sketch.exp.svg | 4 +- .../all_shapes_multiple/elk/board.exp.json | 154 +- .../all_shapes_multiple/elk/sketch.exp.svg | 4 +- .../all_shapes_shadow/elk/board.exp.json | 154 +- .../all_shapes_shadow/elk/sketch.exp.svg | 4 +- .../arrowhead_adjustment/elk/board.exp.json | 88 +- .../arrowhead_adjustment/elk/sketch.exp.svg | 4 +- .../arrowhead_labels/elk/board.exp.json | 14 +- .../arrowhead_labels/elk/sketch.exp.svg | 10 +- .../stable/binary_tree/elk/board.exp.json | 228 +-- .../stable/binary_tree/elk/sketch.exp.svg | 4 +- .../testdata/stable/chaos1/elk/board.exp.json | 40 +- .../testdata/stable/chaos1/elk/sketch.exp.svg | 16 +- .../testdata/stable/chaos2/elk/board.exp.json | 288 ++- .../testdata/stable/chaos2/elk/sketch.exp.svg | 58 +- .../child_parent_edges/dagre/board.exp.json | 80 +- .../child_parent_edges/dagre/sketch.exp.svg | 4 +- .../child_parent_edges/elk/board.exp.json | 40 +- .../child_parent_edges/elk/sketch.exp.svg | 4 +- .../circular_dependency/elk/board.exp.json | 40 +- .../circular_dependency/elk/sketch.exp.svg | 4 +- .../stable/code_snippet/elk/board.exp.json | 28 +- .../stable/code_snippet/elk/sketch.exp.svg | 6 +- .../connected_container/elk/board.exp.json | 48 +- .../connected_container/elk/sketch.exp.svg | 4 +- .../stable/container_edges/elk/board.exp.json | 120 +- .../stable/container_edges/elk/sketch.exp.svg | 4 +- .../testdata/stable/dense/elk/board.exp.json | 404 ++-- .../testdata/stable/dense/elk/sketch.exp.svg | 4 +- .../different_subgraphs/elk/board.exp.json | 284 +-- .../different_subgraphs/elk/sketch.exp.svg | 4 +- .../stable/direction/elk/board.exp.json | 164 +- .../stable/direction/elk/sketch.exp.svg | 4 +- .../stable/font_colors/elk/board.exp.json | 12 +- .../stable/font_colors/elk/sketch.exp.svg | 10 +- .../giant_markdown_test/elk/board.exp.json | 28 +- .../giant_markdown_test/elk/sketch.exp.svg | 6 +- .../testdata/stable/hr/elk/board.exp.json | 28 +- .../testdata/stable/hr/elk/sketch.exp.svg | 6 +- .../testdata/stable/images/elk/board.exp.json | 12 +- .../testdata/stable/images/elk/sketch.exp.svg | 4 +- .../stable/investigate/elk/board.exp.json | 434 ++-- .../stable/investigate/elk/sketch.exp.svg | 40 +- .../stable/large_arch/elk/board.exp.json | 396 ++-- .../stable/large_arch/elk/sketch.exp.svg | 4 +- .../testdata/stable/latex/elk/board.exp.json | 96 +- .../testdata/stable/latex/elk/sketch.exp.svg | 10 +- .../testdata/stable/li1/elk/board.exp.json | 26 +- .../testdata/stable/li1/elk/sketch.exp.svg | 6 +- .../testdata/stable/li2/elk/board.exp.json | 26 +- .../testdata/stable/li2/elk/sketch.exp.svg | 6 +- .../testdata/stable/li3/elk/board.exp.json | 28 +- .../testdata/stable/li3/elk/sketch.exp.svg | 6 +- .../testdata/stable/li4/elk/board.exp.json | 28 +- .../testdata/stable/li4/elk/sketch.exp.svg | 6 +- .../stable/lone_h1/elk/board.exp.json | 26 +- .../stable/lone_h1/elk/sketch.exp.svg | 6 +- .../stable/markdown/elk/board.exp.json | 28 +- .../stable/markdown/elk/sketch.exp.svg | 6 +- .../md_code_block_fenced/elk/board.exp.json | 26 +- .../md_code_block_fenced/elk/sketch.exp.svg | 6 +- .../md_code_block_indented/elk/board.exp.json | 28 +- .../md_code_block_indented/elk/sketch.exp.svg | 6 +- .../stable/md_code_inline/elk/board.exp.json | 24 +- .../stable/md_code_inline/elk/sketch.exp.svg | 6 +- .../stable/multiple_trees/elk/board.exp.json | 364 ++-- .../stable/multiple_trees/elk/sketch.exp.svg | 4 +- .../stable/n22_e32/elk/board.exp.json | 540 ++--- .../stable/n22_e32/elk/sketch.exp.svg | 4 +- .../one_container_loop/elk/board.exp.json | 116 +- .../one_container_loop/elk/sketch.exp.svg | 4 +- .../elk/board.exp.json | 120 +- .../elk/sketch.exp.svg | 4 +- e2etests/testdata/stable/p/elk/board.exp.json | 26 +- e2etests/testdata/stable/p/elk/sketch.exp.svg | 6 +- .../testdata/stable/pre/elk/board.exp.json | 28 +- .../testdata/stable/pre/elk/sketch.exp.svg | 6 +- .../stable/sql_tables/elk/board.exp.json | 54 +- .../stable/sql_tables/elk/sketch.exp.svg | 64 +- .../stable/square_3d/elk/board.exp.json | 14 +- .../stable/square_3d/elk/sketch.exp.svg | 4 +- .../elk/board.exp.json | 240 +-- .../elk/sketch.exp.svg | 4 +- .../stable/stylish/elk/board.exp.json | 14 +- .../stable/stylish/elk/sketch.exp.svg | 4 +- .../testdata/stable/us_map/elk/board.exp.json | 1808 +++++++++-------- .../testdata/stable/us_map/elk/sketch.exp.svg | 4 +- .../container_child_edge/elk/board.exp.json | 36 +- .../container_child_edge/elk/sketch.exp.svg | 16 +- 99 files changed, 3735 insertions(+), 3702 deletions(-) diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 8aabce71b..69d8d918d 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -39,6 +39,7 @@ func NewGraph(ast *d2ast.Map) *Graph { Parent: nil, Children: make(map[string]*Object), } + d.Root.Attributes.Direction.Value = "down" return d } 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 c1d27b8de..6c709942a 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": 12, - "y": 33 + "x": 31, + "y": 12 }, "width": 113, "height": 126, @@ -43,8 +43,8 @@ "id": "b", "type": "", "pos": { - "x": 225, - "y": 12 + "x": 12, + "y": 238 }, "width": 113, "height": 126, @@ -81,8 +81,8 @@ "id": "c", "type": "", "pos": { - "x": 225, - "y": 158 + "x": 145, + "y": 238 }, "width": 113, "height": 126, @@ -143,12 +143,12 @@ "labelPercentage": 0, "route": [ { - "x": 125, - "y": 75 + "x": 68.5, + "y": 138 }, { - "x": 225, - "y": 75 + "x": 68.5, + "y": 238 } ], "animated": false, @@ -181,20 +181,20 @@ "labelPercentage": 0, "route": [ { - "x": 125, - "y": 117 + "x": 106.16666666666667, + "y": 138 }, { - "x": 175, - "y": 117 + "x": 106.16666666666667, + "y": 188 }, { - "x": 175, - "y": 221 + "x": 201.5, + "y": 188 }, { - "x": 225, - "y": 221 + "x": 201.5, + "y": 238 } ], "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 76640f7f2..c6a7e3671 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="1382" height="366" viewBox="-88 -88 1382 366">        panic("crypto: RegisterHash of unknown hash function")     }     hashes[h] = f -}xy acfbdhg agdfbhec abcdefghijklmnopq finallyatreeandnodessomemoremanythenhereyouhavehierarchyanotherofnestingtreesatreeinsidehierarchyroot bacde21345abcde alphabeta - - -gammaab aabbccddllffwwyynniijjkkssuurmeemmmmgghhzzooppqqrrttvvxxabac - - -1 - - -2 - - -3 - - -4 - - -5 - - -6abcdefghiqrjmnoszaabbeeffggklptuwxyccddv abcdefghijklmnopqrstuvw abcdefghijklmnopqrstu acdefgbh topabcbottomstartend 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 +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 -tracking_number -string -status +order_id +int +tracking_number string - rectanglesquare acbl1l2c1l2c3l2c2l3c1l3c2l4bacacbabcc1c2c3abc AKHIALFLGAMSTNAZCANVNMUTARLAMOOKTXORCOKSNEWYCTMANYRIDEMDNJPANCSCIDMTWAILINIAMIKYWIOHMNSDVAWVMENHVTNDcontainerfirstsecond - - -1->2 - - -c->2