From 15a22000a7504cb38c4948871dd7f967dcc0e12c Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 15:19:08 -0700 Subject: [PATCH 01/15] remove compile error for nested grid edge --- d2compiler/compile.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 9a9337585..fab6d579f 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1110,10 +1110,13 @@ func (c *compiler) validateEdges(g *d2graph.Graph) { c.errorf(edge.GetAstEdge(), "edges into grid diagrams are not supported yet") continue } + + // TODO cleanup if srcGrid != edge.Src.Parent || dstGrid != edge.Dst.Parent { // valid: grid.child1 -> grid.child2 // invalid: grid.child1 -> grid.child2.child1 - c.errorf(edge.GetAstEdge(), "grid diagrams can only have edges between children right now") + + // c.errorf(edge.GetAstEdge(), "grid diagrams can only have edges between children right now") continue } } From 5ddfdd42a19076959698ffd5b541969a86910ca8 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 15:21:30 -0700 Subject: [PATCH 02/15] cleanup --- d2layouts/d2layouts.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/d2layouts/d2layouts.go b/d2layouts/d2layouts.go index dddba2d44..866944389 100644 --- a/d2layouts/d2layouts.go +++ b/d2layouts/d2layouts.go @@ -122,8 +122,9 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co } curr = obj - dx := -curr.TopLeft.X - dy := -curr.TopLeft.Y + // position nested graph relative to curr + dx := 0 - curr.TopLeft.X + dy := 0 - curr.TopLeft.Y for _, o := range nestedGraph.Objects { o.TopLeft.X += dx o.TopLeft.Y += dy @@ -358,6 +359,9 @@ func PositionNested(container *d2graph.Object, nestedGraph *d2graph.Graph) { // Note: assumes nestedGraph's layout has contents positioned relative to 0,0 dx := container.TopLeft.X //- tl.X dy := container.TopLeft.Y //- tl.Y + if dx == 0 && dy == 0 { + return + } for _, o := range nestedGraph.Objects { o.TopLeft.X += dx o.TopLeft.Y += dy From 3b53bc5ff1b81ef8f935674e94b96472034769ba Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 15:30:40 -0700 Subject: [PATCH 03/15] simpler testing --- e2etests/e2e_test.go | 2 +- .../files/grid_nested_simple_edges.d2 | 70 ++++++++++--------- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/e2etests/e2e_test.go b/e2etests/e2e_test.go index 7d8a45c5d..15fb4361d 100644 --- a/e2etests/e2e_test.go +++ b/e2etests/e2e_test.go @@ -137,7 +137,7 @@ func run(t *testing.T, tc testCase) { } layoutsTested := []string{"dagre"} - if !tc.justDagre { + if !tc.justDagre && false { layoutsTested = append(layoutsTested, "elk") } diff --git a/e2etests/testdata/files/grid_nested_simple_edges.d2 b/e2etests/testdata/files/grid_nested_simple_edges.d2 index 8148fffed..06e713f5c 100644 --- a/e2etests/testdata/files/grid_nested_simple_edges.d2 +++ b/e2etests/testdata/files/grid_nested_simple_edges.d2 @@ -1,43 +1,45 @@ direction: right -outer-grid -> outer-container +# outer-grid -> outer-container -outer-grid: { - grid-columns: 1 +# outer-grid: { +grid-columns: 1 - inner-grid -> container -> etc +# okok # -> container # -> etc - container: { - label.near: top-left - # edges not yet supported here since they must be direct grid children - a - b - c - } +container: { + label.near: top-left + # edges not yet supported here since they must be direct grid children + a + b + # c - inner-grid: { - grid-rows: 1 - 1 - 2 - 3 - # edges here are not supported yet since this is inside another grid - } + a -> b } -outer-container: { - grid -> container +# inner-grid: { +# # grid-rows: 1 +# # 1 +# # 2 +# # 3 +# # edges here are not supported yet since this is inside another grid +# } +# } - grid: { - grid-rows: 1 - # direct child edges ok in least nested grid - 1 -> 2 -> 3 - } +# outer-container: { +# grid -> container - container: { - # non grid edges ok - 4 -> 5 -> 6 - nested container: { - # nested non grid edges ok - 7 -> 8 - } - } -} +# grid: { +# grid-rows: 1 +# # direct child edges ok in least nested grid +# 1 -> 2 -> 3 +# } + +# container: { +# # non grid edges ok +# 4 -> 5 -> 6 +# nested container: { +# # nested non grid edges ok +# 7 -> 8 +# } +# } +# } From c9d50033430ccefbd168fd96b7a6da5c53e6383a Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 15:31:45 -0700 Subject: [PATCH 04/15] fix --- d2layouts/d2layouts.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/d2layouts/d2layouts.go b/d2layouts/d2layouts.go index 866944389..58851c8aa 100644 --- a/d2layouts/d2layouts.go +++ b/d2layouts/d2layouts.go @@ -122,10 +122,13 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co } curr = obj - // position nested graph relative to curr + // position nested graph (excluding curr) relative to curr dx := 0 - curr.TopLeft.X dy := 0 - curr.TopLeft.Y for _, o := range nestedGraph.Objects { + if o.AbsID() == curr.AbsID() { + continue + } o.TopLeft.X += dx o.TopLeft.Y += dy } From 7b28c9290c851ed4231823e9effff91f1f6cced8 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 16:54:15 -0700 Subject: [PATCH 05/15] update strategy for nested grid cell layout --- d2layouts/d2layouts.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/d2layouts/d2layouts.go b/d2layouts/d2layouts.go index 58851c8aa..8464146ce 100644 --- a/d2layouts/d2layouts.go +++ b/d2layouts/d2layouts.go @@ -106,6 +106,7 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co if err != nil { return err } + InjectNested(g.Root, nestedGraph, false) restoreOrder() @@ -135,6 +136,12 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co for _, e := range nestedGraph.Edges { e.Move(dx, dy) } + + // now we keep the descendants out until after grid layout + nestedGraph = ExtractSubgraph(curr, false) + + extracted[id] = nestedGraph + extractedOrder = append(extractedOrder, id) continue } @@ -330,7 +337,6 @@ func ExtractSubgraph(container *d2graph.Object, includeSelf bool) *d2graph.Graph } func InjectNested(container *d2graph.Object, nestedGraph *d2graph.Graph, isRoot bool) { - // TODO restore order of objects g := container.Graph for _, obj := range nestedGraph.Root.ChildrenArray { obj.Parent = container From 6deac9b5bd31c943a8ab97c94ef8778ce887d581 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 16:57:22 -0700 Subject: [PATCH 06/15] undo simpler testing --- .../files/grid_nested_simple_edges.d2 | 75 ++++++++++--------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/e2etests/testdata/files/grid_nested_simple_edges.d2 b/e2etests/testdata/files/grid_nested_simple_edges.d2 index 06e713f5c..6070799f6 100644 --- a/e2etests/testdata/files/grid_nested_simple_edges.d2 +++ b/e2etests/testdata/files/grid_nested_simple_edges.d2 @@ -1,45 +1,48 @@ direction: right -# outer-grid -> outer-container +outer-grid -> outer-container -# outer-grid: { -grid-columns: 1 +outer-grid: { + grid-columns: 1 -# okok # -> container # -> etc + inner-grid -> container -> etc -container: { - label.near: top-left - # edges not yet supported here since they must be direct grid children - a - b - # c + container: { + label.near: top-left + # edges not yet supported here since they must be direct grid children + a + b + c - a -> b + a -> b + } + + inner-grid: { + grid-rows: 1 + 1 + 2 + 3 + # edges here are not supported yet since this is inside another grid + + # TODO should work now, update compile check + # 1 -> 2 -> 3 + } } -# inner-grid: { -# # grid-rows: 1 -# # 1 -# # 2 -# # 3 -# # edges here are not supported yet since this is inside another grid -# } -# } +outer-container: { + grid -> container -# outer-container: { -# grid -> container + grid: { + grid-rows: 1 + # direct child edges ok in least nested grid + 1 -> 2 -> 3 + } -# grid: { -# grid-rows: 1 -# # direct child edges ok in least nested grid -# 1 -> 2 -> 3 -# } - -# container: { -# # non grid edges ok -# 4 -> 5 -> 6 -# nested container: { -# # nested non grid edges ok -# 7 -> 8 -# } -# } -# } + container: { + # non grid edges ok + 4 -> 5 -> 6 + nested container: { + # nested non grid edges ok + 7 -> 8 + } + } +} From ceaf2fb6815ccfe8b7971485afd43be21615579f Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 17:04:39 -0700 Subject: [PATCH 07/15] remove compile error for nested grids --- d2compiler/compile.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index fab6d579f..562696574 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1092,18 +1092,20 @@ func (c *compiler) validateEdges(g *d2graph.Graph) { srcGrid := edge.Src.Parent.ClosestGridDiagram() dstGrid := edge.Dst.Parent.ClosestGridDiagram() if srcGrid != nil || dstGrid != nil { - if top := srcGrid.TopGridDiagram(); srcGrid != top { - // valid: grid.child1 -> grid.child2 - // invalid: grid.childGrid.child1 -> grid.childGrid.child2 - c.errorf(edge.GetAstEdge(), "edge must be on direct child of grid diagram %#v", top.AbsID()) - continue - } - if top := dstGrid.TopGridDiagram(); dstGrid != top { - // valid: grid.child1 -> grid.child2 - // invalid: grid.childGrid.child1 -> grid.childGrid.child2 - c.errorf(edge.GetAstEdge(), "edge must be on direct child of grid diagram %#v", top.AbsID()) - continue - } + // TODO cleanup + // if top := srcGrid.TopGridDiagram(); srcGrid != top { + // // valid: grid.child1 -> grid.child2 + // // invalid: grid.childGrid.child1 -> grid.childGrid.child2 + // c.errorf(edge.GetAstEdge(), "edge must be on direct child of grid diagram %#v", top.AbsID()) + // continue + // } + // if top := dstGrid.TopGridDiagram(); dstGrid != top { + // // valid: grid.child1 -> grid.child2 + // // invalid: grid.childGrid.child1 -> grid.childGrid.child2 + // c.errorf(edge.GetAstEdge(), "edge must be on direct child of grid diagram %#v", top.AbsID()) + // continue + // } + if srcGrid != dstGrid { // valid: a -> grid // invalid: a -> grid.child From 0aaf6e26fd2a7771a75d967c2ffe4c73acdd6a6f Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 17:05:04 -0700 Subject: [PATCH 08/15] test now supports these edges --- .../files/grid_nested_simple_edges.d2 | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/e2etests/testdata/files/grid_nested_simple_edges.d2 b/e2etests/testdata/files/grid_nested_simple_edges.d2 index 6070799f6..fecdaafe0 100644 --- a/e2etests/testdata/files/grid_nested_simple_edges.d2 +++ b/e2etests/testdata/files/grid_nested_simple_edges.d2 @@ -8,23 +8,18 @@ outer-grid: { container: { label.near: top-left - # edges not yet supported here since they must be direct grid children - a - b - c - - a -> b + (** -> **)[*].class: red + # edges on grid descendant now supported + a -> b -> c -> a + d -> e -> g.h.i + d -> f -> g.h + b -> g } inner-grid: { grid-rows: 1 - 1 - 2 - 3 - # edges here are not supported yet since this is inside another grid - - # TODO should work now, update compile check - # 1 -> 2 -> 3 + # edges inside another grid now supported + 1 -> 2 -> 3: {class: red} } } @@ -46,3 +41,5 @@ outer-container: { } } } + +classes.red.style.stroke: red From 3aed2c4110c13c6d442a0f474a19839e4b599da3 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 17:13:25 -0700 Subject: [PATCH 09/15] update compile test --- d2compiler/compile_test.go | 10 +- .../TestCompile/grid_deeper_edge.exp.json | 804 +++++++++++++++++- 2 files changed, 802 insertions(+), 12 deletions(-) diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index bf90f58c2..bfb065256 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -2494,16 +2494,18 @@ d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams ar grid-rows: 1 a -> b: ok b: { - c -> d: not yet + c -> d: ok now } a: { grid-columns: 1 - e -> f: also not yet + e -> f: also ok now } + a -> b.c: not yet + a.e -> b.c: also not yet } `, - expErr: `d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:9:3: edge must be on direct child of grid diagram "hey" -d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:5:3: grid diagrams can only have edges between children right now`, + expErr: `d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:11:2: edges from grid diagram must be external +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:12:2: edges into grid diagrams are not supported yet`, }, { name: "grid_nested", diff --git a/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json b/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json index abe81dc64..d823720b8 100644 --- a/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json +++ b/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json @@ -1,15 +1,803 @@ { - "graph": null, - "err": { - "errs": [ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-11:0:110", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-10:1:109", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:5:5-10:1:109", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:1:8-1:13:20", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:1:8-1:10:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:1:8-1:10:17", + "value": [ + { + "string": "grid-rows", + "raw_string": "grid-rows" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:12:19-1:13:20", + "raw": "1", + "value": "1" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:11:32", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:7:28", + "src": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:9:30-2:11:32", + "value": [ + { + "string": "ok", + "raw_string": "ok" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-5:2:58", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:4:37-5:2:58", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:16:55", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:8:47", + "src": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:10:49-4:16:55", + "value": [ + { + "string": "ok now", + "raw_string": "ok now" + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-9:2:107", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:4:63-9:2:107", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:2:67-7:17:82", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:2:67-7:14:79", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:2:67-7:14:79", + "value": [ + { + "string": "grid-columns", + "raw_string": "grid-columns" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:16:81-7:17:82", + "raw": "1", + "value": "1" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:21:104", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:8:91", + "src": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:10:93-8:21:104", + "value": [ + { + "string": "also ok now", + "raw_string": "also ok now" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "attributes": { + "label": { + "value": "" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + "edges": [ { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:86-8:8:92", - "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:9:3: edge must be on direct child of grid diagram \"hey\"" + "index": 0, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "ok" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 }, { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:8:47", - "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:5:3: grid diagrams can only have edges between children right now" + "index": 0, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "ok now" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "index": 0, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "also ok now" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "hey", + "id_val": "hey", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "hey" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null, + "gridRows": { + "value": "1" + } + }, + "zIndex": 0 + }, + { + "id": "a", + "id_val": "a", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null, + "gridColumns": { + "value": "1" + } + }, + "zIndex": 0 + }, + { + "id": "b", + "id_val": "b", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "b" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "id": "c", + "id_val": "c", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "c" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "id": "d", + "id_val": "d", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "d" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "id": "e", + "id_val": "e", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "e" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "id": "f", + "id_val": "f", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "f" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 } ] - } + }, + "err": null } From bb79c30fd83be05070c922721b17030da1259541 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 27 Sep 2023 17:51:39 -0700 Subject: [PATCH 10/15] updating compile edge validation --- d2compiler/compile.go | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 562696574..46d42da6b 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1092,35 +1092,34 @@ func (c *compiler) validateEdges(g *d2graph.Graph) { srcGrid := edge.Src.Parent.ClosestGridDiagram() dstGrid := edge.Dst.Parent.ClosestGridDiagram() if srcGrid != nil || dstGrid != nil { - // TODO cleanup - // if top := srcGrid.TopGridDiagram(); srcGrid != top { - // // valid: grid.child1 -> grid.child2 - // // invalid: grid.childGrid.child1 -> grid.childGrid.child2 - // c.errorf(edge.GetAstEdge(), "edge must be on direct child of grid diagram %#v", top.AbsID()) - // continue - // } - // if top := dstGrid.TopGridDiagram(); dstGrid != top { - // // valid: grid.child1 -> grid.child2 - // // invalid: grid.childGrid.child1 -> grid.childGrid.child2 - // c.errorf(edge.GetAstEdge(), "edge must be on direct child of grid diagram %#v", top.AbsID()) - // continue - // } - if srcGrid != dstGrid { // valid: a -> grid // invalid: a -> grid.child c.errorf(edge.GetAstEdge(), "edges into grid diagrams are not supported yet") continue } + } - // TODO cleanup - if srcGrid != edge.Src.Parent || dstGrid != edge.Dst.Parent { - // valid: grid.child1 -> grid.child2 - // invalid: grid.child1 -> grid.child2.child1 + // edges within a grid cell are ok now + // edges between grid cells are ok now + // edges from a grid to something outside is ok + // but edges from a grid cell must be to another grid cell - // c.errorf(edge.GetAstEdge(), "grid diagrams can only have edges between children right now") - continue - } + // TODO + // grid -> outside : ok + // grid -> grid.cell : not ok + // grid.cell -> grid.cell2 : ok + // grid.cell -> grid.cell2.inside : not ok + + if edge.Src.IsGridDiagram() { + // TODO + c.errorf(edge.GetAstEdge(), "edges from grid diagram must be external") + continue + } + if edge.Dst.IsGridDiagram() { + // TODO + c.errorf(edge.GetAstEdge(), "edges from grid diagram must be external") + continue } } } From a43aae9d1a014d5fee98f3cbf689a275fe8090d7 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 28 Sep 2023 10:54:50 -0700 Subject: [PATCH 11/15] update grid edge validation and test --- d2compiler/compile.go | 49 ++++++++++++++++++++++++-------------- d2compiler/compile_test.go | 16 +++++++++++-- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 46d42da6b..fe40dd3e8 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1098,29 +1098,42 @@ func (c *compiler) validateEdges(g *d2graph.Graph) { c.errorf(edge.GetAstEdge(), "edges into grid diagrams are not supported yet") continue } + + // edges within a grid cell are ok now + // grid.cell.a -> grid.cell.b : ok + // grid.cell.a.c -> grid.cell.b.d : ok + // edges between grid cells themselves are ok + // grid.cell -> grid.cell2 : ok + // grid.cell -> grid.cell.inside : not ok + // grid.cell -> grid.cell2.inside : not ok + srcIsGridCell := edge.Src.Parent.IsGridDiagram() + dstIsGridCell := edge.Dst.Parent.IsGridDiagram() + // if srcIsGridCell && dstIsGridCell { + // if edge.Src.Parent != edge.Dst.Parent { + + // } + // } + + if srcIsGridCell != dstIsGridCell { + if srcIsGridCell { + c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Src.AbsID()) + } else { + c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Dst.AbsID()) + } + continue + } } - // edges within a grid cell are ok now - // edges between grid cells are ok now // edges from a grid to something outside is ok - // but edges from a grid cell must be to another grid cell - - // TODO - // grid -> outside : ok - // grid -> grid.cell : not ok - // grid.cell -> grid.cell2 : ok - // grid.cell -> grid.cell2.inside : not ok - - if edge.Src.IsGridDiagram() { - // TODO - c.errorf(edge.GetAstEdge(), "edges from grid diagram must be external") - continue - } - if edge.Dst.IsGridDiagram() { - // TODO - c.errorf(edge.GetAstEdge(), "edges from grid diagram must be external") + // grid -> outside : ok + // grid -> grid.cell : not ok + // grid -> grid.cell.inner : not ok + if (edge.Src.IsGridDiagram() && edge.Dst.IsDescendantOf(edge.Src)) || + (edge.Dst.IsGridDiagram() && edge.Src.IsDescendantOf(edge.Dst)) { + c.errorf(edge.GetAstEdge(), "edges from grid diagram container must be external") continue } + } } diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index bfb065256..bbe5cfdf4 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -2495,17 +2495,29 @@ d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams ar a -> b: ok b: { c -> d: ok now + c.e -> c.f.g: ok + c.e -> d.h: ok + c -> d.h: ok } a: { grid-columns: 1 e -> f: also ok now + e: { + g -> h: ok + g -> h.h: ok + } + e -> f.i: not ok + e.g -> f.i: not ok } a -> b.c: not yet a.e -> b.c: also not yet } `, - expErr: `d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:11:2: edges from grid diagram must be external -d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:12:2: edges into grid diagrams are not supported yet`, + expErr: ` +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:17:3: grid cell "hey.a.e" can only connect to another grid cell +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:18:2: edge cannot go outside of grid cell "hey.a.e" +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:20:2: grid cell "hey.a" can only connect to another grid cell +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:21:2: edges into grid diagrams are not supported yet`, }, { name: "grid_nested", From 17f2545e755babda28385803c97f2392f54e904c Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 28 Sep 2023 11:17:46 -0700 Subject: [PATCH 12/15] improve grid edge validation, messages, and test --- d2compiler/compile.go | 44 +- d2compiler/compile_test.go | 23 +- d2graph/grid_diagram.go | 11 + .../TestCompile/grid_deeper_edge.exp.json | 804 +----------------- .../d2compiler/TestCompile/grid_edge.exp.json | 12 +- 5 files changed, 69 insertions(+), 825 deletions(-) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index fe40dd3e8..0675ebf34 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1089,16 +1089,35 @@ func (c *compiler) validateNear(g *d2graph.Graph) { func (c *compiler) validateEdges(g *d2graph.Graph) { for _, edge := range g.Edges { + // edges from a grid to something outside is ok + // grid -> outside : ok + // grid -> grid.cell : not ok + // grid -> grid.cell.inner : not ok + if edge.Src.IsGridDiagram() && edge.Dst.IsDescendantOf(edge.Src) { + c.errorf(edge.GetAstEdge(), "edge from grid diagram %#v cannot enter itself", edge.Src.AbsID()) + continue + } + if edge.Dst.IsGridDiagram() && edge.Src.IsDescendantOf(edge.Dst) { + c.errorf(edge.GetAstEdge(), "edge from grid diagram %#v cannot enter itself", edge.Dst.AbsID()) + continue + } + srcGrid := edge.Src.Parent.ClosestGridDiagram() dstGrid := edge.Dst.Parent.ClosestGridDiagram() if srcGrid != nil || dstGrid != nil { if srcGrid != dstGrid { // valid: a -> grid // invalid: a -> grid.child - c.errorf(edge.GetAstEdge(), "edges into grid diagrams are not supported yet") + if dstGrid != nil && !(srcGrid != nil && srcGrid.IsDescendantOf(dstGrid)) { + c.errorf(edge.GetAstEdge(), "edge cannot enter grid diagram %#v", dstGrid.AbsID()) + } else { + c.errorf(edge.GetAstEdge(), "edge cannot exit grid diagram %#v", srcGrid.AbsID()) + } continue } + srcCell := edge.Src.ClosestGridCell() + dstCell := edge.Dst.ClosestGridCell() // edges within a grid cell are ok now // grid.cell.a -> grid.cell.b : ok // grid.cell.a.c -> grid.cell.b.d : ok @@ -1106,14 +1125,8 @@ func (c *compiler) validateEdges(g *d2graph.Graph) { // grid.cell -> grid.cell2 : ok // grid.cell -> grid.cell.inside : not ok // grid.cell -> grid.cell2.inside : not ok - srcIsGridCell := edge.Src.Parent.IsGridDiagram() - dstIsGridCell := edge.Dst.Parent.IsGridDiagram() - // if srcIsGridCell && dstIsGridCell { - // if edge.Src.Parent != edge.Dst.Parent { - - // } - // } - + srcIsGridCell := edge.Src == srcCell + dstIsGridCell := edge.Dst == dstCell if srcIsGridCell != dstIsGridCell { if srcIsGridCell { c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Src.AbsID()) @@ -1122,16 +1135,11 @@ func (c *compiler) validateEdges(g *d2graph.Graph) { } continue } - } - // edges from a grid to something outside is ok - // grid -> outside : ok - // grid -> grid.cell : not ok - // grid -> grid.cell.inner : not ok - if (edge.Src.IsGridDiagram() && edge.Dst.IsDescendantOf(edge.Src)) || - (edge.Dst.IsGridDiagram() && edge.Src.IsDescendantOf(edge.Dst)) { - c.errorf(edge.GetAstEdge(), "edges from grid diagram container must be external") - continue + if srcCell != dstCell && (!srcIsGridCell || !dstIsGridCell) { + c.errorf(edge.GetAstEdge(), "edge cannot exit grid cell %#v", srcCell.AbsID()) + continue + } } } diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index bbe5cfdf4..942da6970 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -2478,15 +2478,15 @@ d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2:3:16: vertical-gap must grid-rows: 1 a -> b: ok } - c -> hey.b - hey.a -> c - hey -> hey.a +c -> hey.b +hey.a -> c +hey -> hey.a - hey -> c: ok +hey -> c: ok `, - expErr: `d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:2: edges into grid diagrams are not supported yet -d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:2: edges into grid diagrams are not supported yet -d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams are not supported yet`, + expErr: `d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:1: edge cannot enter grid diagram "hey" +d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:1: edge cannot exit grid diagram "hey" +d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:1: edge from grid diagram "hey" cannot enter itself`, }, { name: "grid_deeper_edge", @@ -2511,13 +2511,14 @@ d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams ar } a -> b.c: not yet a.e -> b.c: also not yet + a -> a.e: not ok } `, - expErr: ` -d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:17:3: grid cell "hey.a.e" can only connect to another grid cell -d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:18:2: edge cannot go outside of grid cell "hey.a.e" + expErr: `d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:17:3: grid cell "hey.a.e" can only connect to another grid cell +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:18:3: edge cannot exit grid cell "hey.a.e" d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:20:2: grid cell "hey.a" can only connect to another grid cell -d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:21:2: edges into grid diagrams are not supported yet`, +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:21:2: edge cannot exit grid diagram "hey.a" +d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:22:2: edge from grid diagram "hey.a" cannot enter itself`, }, { name: "grid_nested", diff --git a/d2graph/grid_diagram.go b/d2graph/grid_diagram.go index 62659df59..46f1f034d 100644 --- a/d2graph/grid_diagram.go +++ b/d2graph/grid_diagram.go @@ -15,6 +15,17 @@ func (obj *Object) ClosestGridDiagram() *Object { return obj.Parent.ClosestGridDiagram() } +func (obj *Object) ClosestGridCell() *Object { + if obj == nil { + return nil + } + // grid cells can be a nested grid diagram + if obj.Parent.IsGridDiagram() { + return obj + } + return obj.Parent.ClosestGridCell() +} + // TopGridDiagram returns the least nested (outermost) grid diagram func (obj *Object) TopGridDiagram() *Object { if obj == nil { diff --git a/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json b/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json index d823720b8..55eac24ae 100644 --- a/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json +++ b/testdata/d2compiler/TestCompile/grid_deeper_edge.exp.json @@ -1,803 +1,27 @@ { - "graph": { - "name": "", - "isFolderOnly": false, - "ast": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-11:0:110", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-10:1:109", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", - "value": [ - { - "string": "hey", - "raw_string": "hey" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:5:5-10:1:109", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:1:8-1:13:20", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:1:8-1:10:17", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:1:8-1:10:17", - "value": [ - { - "string": "grid-rows", - "raw_string": "grid-rows" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "number": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,1:12:19-1:13:20", - "raw": "1", - "value": "1" - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:11:32", - "edges": [ - { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:7:28", - "src": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:9:30-2:11:32", - "value": [ - { - "string": "ok", - "raw_string": "ok" - } - ] - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-5:2:58", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:4:37-5:2:58", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:16:55", - "edges": [ - { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:8:47", - "src": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:10:49-4:16:55", - "value": [ - { - "string": "ok now", - "raw_string": "ok now" - } - ] - } - } - } - } - ] - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-9:2:107", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:4:63-9:2:107", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:2:67-7:17:82", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:2:67-7:14:79", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:2:67-7:14:79", - "value": [ - { - "string": "grid-columns", - "raw_string": "grid-columns" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "number": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,7:16:81-7:17:82", - "raw": "1", - "value": "1" - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:21:104", - "edges": [ - { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:8:91", - "src": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", - "value": [ - { - "string": "e", - "raw_string": "e" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", - "value": [ - { - "string": "f", - "raw_string": "f" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:10:93-8:21:104", - "value": [ - { - "string": "also ok now", - "raw_string": "also ok now" - } - ] - } - } - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": [ + "graph": null, + "err": { + "errs": [ { - "index": 0, - "isCurve": false, - "src_arrow": false, - "dst_arrow": true, - "references": [ - { - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "ok" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,16:2:199-16:10:207", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:17:3: grid cell \"hey.a.e\" can only connect to another grid cell" }, { - "index": 0, - "isCurve": false, - "src_arrow": false, - "dst_arrow": true, - "references": [ - { - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "ok now" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,17:2:218-17:12:228", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:18:3: edge cannot exit grid cell \"hey.a.e\"" }, { - "index": 0, - "isCurve": false, - "src_arrow": false, - "dst_arrow": true, - "references": [ - { - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "also ok now" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - } - ], - "objects": [ - { - "id": "hey", - "id_val": "hey", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,0:0:0-0:3:3", - "value": [ - { - "string": "hey", - "raw_string": "hey" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "hey" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null, - "gridRows": { - "value": "1" - } - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,19:1:241-19:9:249", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:20:2: grid cell \"hey.a\" can only connect to another grid cell" }, { - "id": "a", - "id_val": "a", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:1:22-2:2:23", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - }, - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,6:1:60-6:2:61", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "a" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null, - "gridColumns": { - "value": "1" - } - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,20:1:260-20:11:270", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:21:2: edge cannot exit grid diagram \"hey.a\"" }, { - "id": "b", - "id_val": "b", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,2:6:27-2:7:28", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - }, - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,3:1:34-3:2:35", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "b" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - { - "id": "c", - "id_val": "c", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:2:41-4:3:42", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "c" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - { - "id": "d", - "id_val": "d", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,4:7:46-4:8:47", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "d" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - { - "id": "e", - "id_val": "e", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:2:85-8:3:86", - "value": [ - { - "string": "e", - "raw_string": "e" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "e" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - { - "id": "f", - "id_val": "f", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,8:7:90-8:8:91", - "value": [ - { - "string": "f", - "raw_string": "f" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "f" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2,21:1:286-21:9:294", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_deeper_edge.d2:22:2: edge from grid diagram \"hey.a\" cannot enter itself" } ] - }, - "err": null + } } diff --git a/testdata/d2compiler/TestCompile/grid_edge.exp.json b/testdata/d2compiler/TestCompile/grid_edge.exp.json index 01dc6d78b..ceaeca9c2 100644 --- a/testdata/d2compiler/TestCompile/grid_edge.exp.json +++ b/testdata/d2compiler/TestCompile/grid_edge.exp.json @@ -3,16 +3,16 @@ "err": { "errs": [ { - "range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,4:1:36-4:11:46", - "errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:2: edges into grid diagrams are not supported yet" + "range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,4:0:35-4:10:45", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:1: edge cannot enter grid diagram \"hey\"" }, { - "range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,5:1:48-5:11:58", - "errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:2: edges into grid diagrams are not supported yet" + "range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,5:0:46-5:10:56", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:1: edge cannot exit grid diagram \"hey\"" }, { - "range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,6:1:60-6:13:72", - "errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams are not supported yet" + "range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,6:0:57-6:12:69", + "errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:1: edge from grid diagram \"hey\" cannot enter itself" } ] } From 2591a2176096884ad3eb3c1c3b8ffc5a35874692 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 28 Sep 2023 13:58:55 -0700 Subject: [PATCH 13/15] update test --- .../dagre/board.exp.json | 968 ++++++++++++++++-- .../dagre/sketch.exp.svg | 206 ++-- 2 files changed, 984 insertions(+), 190 deletions(-) diff --git a/e2etests/testdata/stable/grid_nested_simple_edges/dagre/board.exp.json b/e2etests/testdata/stable/grid_nested_simple_edges/dagre/board.exp.json index c7cfb758d..45b186a93 100644 --- a/e2etests/testdata/stable/grid_nested_simple_edges/dagre/board.exp.json +++ b/e2etests/testdata/stable/grid_nested_simple_edges/dagre/board.exp.json @@ -10,8 +10,8 @@ "x": 0, "y": 0 }, - "width": 478, - "height": 589, + "width": 554, + "height": 1081, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -48,8 +48,8 @@ "id": "outer-container", "type": "rectangle", "pos": { - "x": 598, - "y": 218 + "x": 674, + "y": 464 }, "width": 1038, "height": 459, @@ -92,7 +92,7 @@ "x": 60, "y": 60 }, - "width": 358, + "width": 434, "height": 186, "opacity": 1, "strokeDash": 0, @@ -133,8 +133,8 @@ "x": 60, "y": 286 }, - "width": 358, - "height": 137, + "width": 434, + "height": 629, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -172,9 +172,9 @@ "type": "rectangle", "pos": { "x": 60, - "y": 463 + "y": 955 }, - "width": 358, + "width": 434, "height": 66, "opacity": 1, "strokeDash": 0, @@ -212,7 +212,7 @@ "id": "outer-grid.container.a", "type": "rectangle", "pos": { - "x": 90, + "x": 135, "y": 327 }, "width": 53, @@ -253,8 +253,8 @@ "id": "outer-grid.container.b", "type": "rectangle", "pos": { - "x": 203, - "y": 327 + "x": 187, + "y": 493 }, "width": 53, "height": 66, @@ -294,8 +294,8 @@ "id": "outer-grid.container.c", "type": "rectangle", "pos": { - "x": 316, - "y": 327 + "x": 90, + "y": 759 }, "width": 53, "height": 66, @@ -331,6 +331,252 @@ "zIndex": 0, "level": 3 }, + { + "id": "outer-grid.container.d", + "type": "rectangle", + "pos": { + "x": 342, + "y": 327 + }, + "width": 54, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "outer-grid.container.e", + "type": "rectangle", + "pos": { + "x": 411, + "y": 493 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "outer-grid.container.g", + "type": "rectangle", + "pos": { + "x": 241, + "y": 698 + }, + "width": 169, + "height": 187, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "g", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 26, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "outer-grid.container.g.h", + "type": "rectangle", + "pos": { + "x": 271, + "y": 729 + }, + "width": 109, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "h", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 4 + }, + { + "id": "outer-grid.container.g.h.i", + "type": "rectangle", + "pos": { + "x": 301, + "y": 759 + }, + "width": 49, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "i", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 4, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 5 + }, + { + "id": "outer-grid.container.f", + "type": "rectangle", + "pos": { + "x": 300, + "y": 493 + }, + "width": 51, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "f", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, { "id": "outer-grid.inner-grid.1", "type": "rectangle", @@ -458,8 +704,8 @@ "id": "outer-container.grid", "type": "rectangle", "pos": { - "x": 628, - "y": 248 + "x": 704, + "y": 494 }, "width": 358, "height": 186, @@ -499,8 +745,8 @@ "id": "outer-container.container", "type": "rectangle", "pos": { - "x": 1106, - "y": 319 + "x": 1182, + "y": 565 }, "width": 500, "height": 338, @@ -540,8 +786,8 @@ "id": "outer-container.grid.1", "type": "rectangle", "pos": { - "x": 688, - "y": 308 + "x": 764, + "y": 554 }, "width": 52, "height": 66, @@ -581,8 +827,8 @@ "id": "outer-container.grid.2", "type": "rectangle", "pos": { - "x": 780, - "y": 308 + "x": 856, + "y": 554 }, "width": 53, "height": 66, @@ -622,8 +868,8 @@ "id": "outer-container.grid.3", "type": "rectangle", "pos": { - "x": 873, - "y": 308 + "x": 949, + "y": 554 }, "width": 53, "height": 66, @@ -663,8 +909,8 @@ "id": "outer-container.container.4", "type": "rectangle", "pos": { - "x": 1136, - "y": 349 + "x": 1212, + "y": 595 }, "width": 54, "height": 66, @@ -704,8 +950,8 @@ "id": "outer-container.container.5", "type": "rectangle", "pos": { - "x": 1340, - "y": 349 + "x": 1416, + "y": 595 }, "width": 53, "height": 66, @@ -745,8 +991,8 @@ "id": "outer-container.container.6", "type": "rectangle", "pos": { - "x": 1493, - "y": 349 + "x": 1569, + "y": 595 }, "width": 53, "height": 66, @@ -786,8 +1032,8 @@ "id": "outer-container.container.nested container", "type": "rectangle", "pos": { - "x": 1310, - "y": 501 + "x": 1386, + "y": 747 }, "width": 266, "height": 126, @@ -827,8 +1073,8 @@ "id": "outer-container.container.nested container.7", "type": "rectangle", "pos": { - "x": 1340, - "y": 531 + "x": 1416, + "y": 777 }, "width": 53, "height": 66, @@ -868,8 +1114,8 @@ "id": "outer-container.container.nested container.8", "type": "rectangle", "pos": { - "x": 1493, - "y": 531 + "x": 1569, + "y": 777 }, "width": 53, "height": 66, @@ -932,20 +1178,20 @@ "labelPercentage": 0, "route": [ { - "x": 478, - "y": 340.5 + "x": 554, + "y": 586.5 }, { - "x": 518, - "y": 340.5 + "x": 594, + "y": 586.5 }, { - "x": 542, - "y": 340.5 + "x": 618, + "y": 586.5 }, { - "x": 598, - "y": 340.5 + "x": 674, + "y": 586.5 } ], "isCurve": true, @@ -979,11 +1225,11 @@ "labelPercentage": 0, "route": [ { - "x": 239, + "x": 277, "y": 245.5 }, { - "x": 239, + "x": 277, "y": 286.5 } ], @@ -1017,12 +1263,554 @@ "labelPercentage": 0, "route": [ { - "x": 239, - "y": 423 + "x": 277, + "y": 915 }, { - "x": 239, - "y": 463 + "x": 277, + "y": 955 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(a -> b)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.a", + "srcArrow": "none", + "dst": "outer-grid.container.b", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 182, + "y": 393 + }, + { + "x": 206.8000030517578, + "y": 433 + }, + { + "x": 213, + "y": 453 + }, + { + "x": 213, + "y": 493 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(b -> c)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.b", + "srcArrow": "none", + "dst": "outer-grid.container.c", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 187.75, + "y": 559 + }, + { + "x": 157.35000610351562, + "y": 599 + }, + { + "x": 149.75, + "y": 619 + }, + { + "x": 149.75, + "y": 634 + }, + { + "x": 149.75, + "y": 649 + }, + { + "x": 145.75, + "y": 719 + }, + { + "x": 129.75, + "y": 759 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(c -> a)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.c", + "srcArrow": "none", + "dst": "outer-grid.container.a", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 107.25, + "y": 759 + }, + { + "x": 96.05000305175781, + "y": 719 + }, + { + "x": 93.25, + "y": 699 + }, + { + "x": 93.25, + "y": 684 + }, + { + "x": 93.25, + "y": 669 + }, + { + "x": 93.25, + "y": 649 + }, + { + "x": 93.25, + "y": 634 + }, + { + "x": 93.25, + "y": 619 + }, + { + "x": 93.25, + "y": 592.4000244140625 + }, + { + "x": 93.25, + "y": 567.5 + }, + { + "x": 93.25, + "y": 542.5999755859375 + }, + { + "x": 101.5, + "y": 432.8919982910156 + }, + { + "x": 134.5, + "y": 392.4639892578125 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(d -> e)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.d", + "srcArrow": "none", + "dst": "outer-grid.container.e", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 396, + "y": 393 + }, + { + "x": 428.79998779296875, + "y": 433 + }, + { + "x": 437, + "y": 453 + }, + { + "x": 437, + "y": 493 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(e -> g.h.i)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.e", + "srcArrow": "none", + "dst": "outer-grid.container.g.h.i", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 437, + "y": 559 + }, + { + "x": 437, + "y": 599 + }, + { + "x": 437, + "y": 619 + }, + { + "x": 437, + "y": 634 + }, + { + "x": 437, + "y": 649 + }, + { + "x": 419.6000061035156, + "y": 721.7999877929688 + }, + { + "x": 350, + "y": 773 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(d -> f)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.d", + "srcArrow": "none", + "dst": "outer-grid.container.f", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 351, + "y": 393 + }, + { + "x": 330.20001220703125, + "y": 433 + }, + { + "x": 325, + "y": 453 + }, + { + "x": 325, + "y": 493 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(f -> g.h)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.f", + "srcArrow": "none", + "dst": "outer-grid.container.g.h", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 325, + "y": 559 + }, + { + "x": 325, + "y": 599 + }, + { + "x": 325, + "y": 667.7999877929688 + }, + { + "x": 325, + "y": 703 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(b -> g)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.b", + "srcArrow": "none", + "dst": "outer-grid.container.g", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 231, + "y": 559 + }, + { + "x": 253.39999389648438, + "y": 599 + }, + { + "x": 259, + "y": 626.7999877929688 + }, + { + "x": 259, + "y": 698 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.inner-grid.(1 -> 2)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.inner-grid.1", + "srcArrow": "none", + "dst": "outer-grid.inner-grid.2", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 171.5, + "y": 153 + }, + { + "x": 212.5, + "y": 153 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.inner-grid.(2 -> 3)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.inner-grid.2", + "srcArrow": "none", + "dst": "outer-grid.inner-grid.3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 264.5, + "y": 153 + }, + { + "x": 305.5, + "y": 153 } ], "animated": false, @@ -1055,20 +1843,20 @@ "labelPercentage": 0, "route": [ { - "x": 986, - "y": 381.5 + "x": 1062, + "y": 627.5 }, { - "x": 1026, - "y": 381.5 + "x": 1102, + "y": 627.5 }, { - "x": 1050, - "y": 381.5 + "x": 1126, + "y": 627.5 }, { - "x": 1106, - "y": 381.5 + "x": 1182, + "y": 627.5 } ], "isCurve": true, @@ -1102,12 +1890,12 @@ "labelPercentage": 0, "route": [ { - "x": 739.5, - "y": 341 + "x": 815.5, + "y": 587 }, { - "x": 780.5, - "y": 341 + "x": 856.5, + "y": 587 } ], "animated": false, @@ -1140,12 +1928,12 @@ "labelPercentage": 0, "route": [ { - "x": 832.5, - "y": 341 + "x": 908.5, + "y": 587 }, { - "x": 873.5, - "y": 341 + "x": 949.5, + "y": 587 } ], "animated": false, @@ -1178,20 +1966,20 @@ "labelPercentage": 0, "route": [ { - "x": 1190, - "y": 381.5 + "x": 1266, + "y": 627.5 }, { - "x": 1230, - "y": 381.5 + "x": 1306, + "y": 627.5 }, { - "x": 1300, - "y": 381.5 + "x": 1376, + "y": 627.5 }, { - "x": 1340, - "y": 381.5 + "x": 1416, + "y": 627.5 } ], "isCurve": true, @@ -1225,20 +2013,20 @@ "labelPercentage": 0, "route": [ { - "x": 1393, - "y": 381.5 + "x": 1469, + "y": 627.5 }, { - "x": 1433, - "y": 381.5 + "x": 1509, + "y": 627.5 }, { - "x": 1453, - "y": 381.5 + "x": 1529, + "y": 627.5 }, { - "x": 1493, - "y": 381.5 + "x": 1569, + "y": 627.5 } ], "isCurve": true, @@ -1272,20 +2060,20 @@ "labelPercentage": 0, "route": [ { - "x": 1393, - "y": 563.5 + "x": 1469, + "y": 809.5 }, { - "x": 1433, - "y": 563.5 + "x": 1509, + "y": 809.5 }, { - "x": 1453, - "y": 563.5 + "x": 1529, + "y": 809.5 }, { - "x": 1493, - "y": 563.5 + "x": 1569, + "y": 809.5 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/grid_nested_simple_edges/dagre/sketch.exp.svg b/e2etests/testdata/stable/grid_nested_simple_edges/dagre/sketch.exp.svg index 139f7da1d..72541ac4f 100644 --- a/e2etests/testdata/stable/grid_nested_simple_edges/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/grid_nested_simple_edges/dagre/sketch.exp.svg @@ -1,17 +1,17 @@ -outer-gridouter-containerinner-gridcontaineretcgridcontainerabc123123456nested container78 - - - - + .d2-383791548 .fill-N1{fill:#0A0F25;} + .d2-383791548 .fill-N2{fill:#676C7E;} + .d2-383791548 .fill-N3{fill:#9499AB;} + .d2-383791548 .fill-N4{fill:#CFD2DD;} + .d2-383791548 .fill-N5{fill:#DEE1EB;} + .d2-383791548 .fill-N6{fill:#EEF1F8;} + .d2-383791548 .fill-N7{fill:#FFFFFF;} + .d2-383791548 .fill-B1{fill:#0D32B2;} + .d2-383791548 .fill-B2{fill:#0D32B2;} + .d2-383791548 .fill-B3{fill:#E3E9FD;} + .d2-383791548 .fill-B4{fill:#E3E9FD;} + .d2-383791548 .fill-B5{fill:#EDF0FD;} + .d2-383791548 .fill-B6{fill:#F7F8FE;} + .d2-383791548 .fill-AA2{fill:#4A6FF3;} + .d2-383791548 .fill-AA4{fill:#EDF0FD;} + .d2-383791548 .fill-AA5{fill:#F7F8FE;} + .d2-383791548 .fill-AB4{fill:#EDF0FD;} + .d2-383791548 .fill-AB5{fill:#F7F8FE;} + .d2-383791548 .stroke-N1{stroke:#0A0F25;} + .d2-383791548 .stroke-N2{stroke:#676C7E;} + .d2-383791548 .stroke-N3{stroke:#9499AB;} + .d2-383791548 .stroke-N4{stroke:#CFD2DD;} + .d2-383791548 .stroke-N5{stroke:#DEE1EB;} + .d2-383791548 .stroke-N6{stroke:#EEF1F8;} + .d2-383791548 .stroke-N7{stroke:#FFFFFF;} + .d2-383791548 .stroke-B1{stroke:#0D32B2;} + .d2-383791548 .stroke-B2{stroke:#0D32B2;} + .d2-383791548 .stroke-B3{stroke:#E3E9FD;} + .d2-383791548 .stroke-B4{stroke:#E3E9FD;} + .d2-383791548 .stroke-B5{stroke:#EDF0FD;} + .d2-383791548 .stroke-B6{stroke:#F7F8FE;} + .d2-383791548 .stroke-AA2{stroke:#4A6FF3;} + .d2-383791548 .stroke-AA4{stroke:#EDF0FD;} + .d2-383791548 .stroke-AA5{stroke:#F7F8FE;} + .d2-383791548 .stroke-AB4{stroke:#EDF0FD;} + .d2-383791548 .stroke-AB5{stroke:#F7F8FE;} + .d2-383791548 .background-color-N1{background-color:#0A0F25;} + .d2-383791548 .background-color-N2{background-color:#676C7E;} + .d2-383791548 .background-color-N3{background-color:#9499AB;} + .d2-383791548 .background-color-N4{background-color:#CFD2DD;} + .d2-383791548 .background-color-N5{background-color:#DEE1EB;} + .d2-383791548 .background-color-N6{background-color:#EEF1F8;} + .d2-383791548 .background-color-N7{background-color:#FFFFFF;} + .d2-383791548 .background-color-B1{background-color:#0D32B2;} + .d2-383791548 .background-color-B2{background-color:#0D32B2;} + .d2-383791548 .background-color-B3{background-color:#E3E9FD;} + .d2-383791548 .background-color-B4{background-color:#E3E9FD;} + .d2-383791548 .background-color-B5{background-color:#EDF0FD;} + .d2-383791548 .background-color-B6{background-color:#F7F8FE;} + .d2-383791548 .background-color-AA2{background-color:#4A6FF3;} + .d2-383791548 .background-color-AA4{background-color:#EDF0FD;} + .d2-383791548 .background-color-AA5{background-color:#F7F8FE;} + .d2-383791548 .background-color-AB4{background-color:#EDF0FD;} + .d2-383791548 .background-color-AB5{background-color:#F7F8FE;} + .d2-383791548 .color-N1{color:#0A0F25;} + .d2-383791548 .color-N2{color:#676C7E;} + .d2-383791548 .color-N3{color:#9499AB;} + .d2-383791548 .color-N4{color:#CFD2DD;} + .d2-383791548 .color-N5{color:#DEE1EB;} + .d2-383791548 .color-N6{color:#EEF1F8;} + .d2-383791548 .color-N7{color:#FFFFFF;} + .d2-383791548 .color-B1{color:#0D32B2;} + .d2-383791548 .color-B2{color:#0D32B2;} + .d2-383791548 .color-B3{color:#E3E9FD;} + .d2-383791548 .color-B4{color:#E3E9FD;} + .d2-383791548 .color-B5{color:#EDF0FD;} + .d2-383791548 .color-B6{color:#F7F8FE;} + .d2-383791548 .color-AA2{color:#4A6FF3;} + .d2-383791548 .color-AA4{color:#EDF0FD;} + .d2-383791548 .color-AA5{color:#F7F8FE;} + .d2-383791548 .color-AB4{color:#EDF0FD;} + .d2-383791548 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>outer-gridouter-containerinner-gridcontaineretcgridcontainerabcdegf123123456nested containerh78i + + + + - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + \ No newline at end of file From 9f3124e56ff0e4052b12880dbc91b2f13906bab3 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 28 Sep 2023 13:59:44 -0700 Subject: [PATCH 14/15] changelog --- ci/release/changelogs/next.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 8f10656d9..335e222ee 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -2,6 +2,8 @@ #### Improvements 🧹 +- Grid cells can now contain nested edges [#1629](https://github.com/terrastruct/d2/pull/1629) + #### Bugfixes ⛑️ - Grid layout now accounts for each cell's outside labels and icons [#1624](https://github.com/terrastruct/d2/pull/1624) From 3bade4fa037749bd9af933bec715b1f39a8b6b27 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 28 Sep 2023 18:35:37 -0700 Subject: [PATCH 15/15] cleanup --- e2etests/e2e_test.go | 2 +- .../elk/board.exp.json | 862 ++++++++++++++++-- .../elk/sketch.exp.svg | 206 +++-- 3 files changed, 898 insertions(+), 172 deletions(-) diff --git a/e2etests/e2e_test.go b/e2etests/e2e_test.go index 15fb4361d..7d8a45c5d 100644 --- a/e2etests/e2e_test.go +++ b/e2etests/e2e_test.go @@ -137,7 +137,7 @@ func run(t *testing.T, tc testCase) { } layoutsTested := []string{"dagre"} - if !tc.justDagre && false { + if !tc.justDagre { layoutsTested = append(layoutsTested, "elk") } diff --git a/e2etests/testdata/stable/grid_nested_simple_edges/elk/board.exp.json b/e2etests/testdata/stable/grid_nested_simple_edges/elk/board.exp.json index 5e210cd4f..1a40e7989 100644 --- a/e2etests/testdata/stable/grid_nested_simple_edges/elk/board.exp.json +++ b/e2etests/testdata/stable/grid_nested_simple_edges/elk/board.exp.json @@ -10,8 +10,8 @@ "x": 12, "y": 12 }, - "width": 478, - "height": 618, + "width": 550, + "height": 1120, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -48,8 +48,8 @@ "id": "outer-container", "type": "rectangle", "pos": { - "x": 560, - "y": 95 + "x": 632, + "y": 346 }, "width": 1150, "height": 452, @@ -92,7 +92,7 @@ "x": 72, "y": 72 }, - "width": 358, + "width": 430, "height": 186, "opacity": 1, "strokeDash": 0, @@ -133,8 +133,8 @@ "x": 72, "y": 298 }, - "width": 358, - "height": 166, + "width": 430, + "height": 668, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -172,9 +172,9 @@ "type": "rectangle", "pos": { "x": 72, - "y": 504 + "y": 1006 }, - "width": 358, + "width": 430, "height": 66, "opacity": 1, "strokeDash": 0, @@ -212,7 +212,7 @@ "id": "outer-grid.container.a", "type": "rectangle", "pos": { - "x": 122, + "x": 136, "y": 348 }, "width": 53, @@ -253,10 +253,10 @@ "id": "outer-grid.container.b", "type": "rectangle", "pos": { - "x": 195, - "y": 348 + "x": 163, + "y": 494 }, - "width": 53, + "width": 80, "height": 66, "opacity": 1, "strokeDash": 0, @@ -294,8 +294,8 @@ "id": "outer-grid.container.c", "type": "rectangle", "pos": { - "x": 268, - "y": 348 + "x": 129, + "y": 645 }, "width": 53, "height": 66, @@ -331,6 +331,252 @@ "zIndex": 0, "level": 3 }, + { + "id": "outer-grid.container.d", + "type": "rectangle", + "pos": { + "x": 322, + "y": 348 + }, + "width": 80, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "outer-grid.container.e", + "type": "rectangle", + "pos": { + "x": 300, + "y": 494 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "outer-grid.container.g", + "type": "rectangle", + "pos": { + "x": 202, + "y": 645 + }, + "width": 249, + "height": 271, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "g", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 26, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "outer-grid.container.g.h", + "type": "rectangle", + "pos": { + "x": 252, + "y": 700 + }, + "width": 149, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "h", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 4 + }, + { + "id": "outer-grid.container.g.h.i", + "type": "rectangle", + "pos": { + "x": 302, + "y": 750 + }, + "width": 49, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "i", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 4, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 5 + }, + { + "id": "outer-grid.container.f", + "type": "rectangle", + "pos": { + "x": 373, + "y": 494 + }, + "width": 51, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "f", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, { "id": "outer-grid.inner-grid.1", "type": "rectangle", @@ -458,8 +704,8 @@ "id": "outer-container.grid", "type": "rectangle", "pos": { - "x": 610, - "y": 228 + "x": 682, + "y": 479 }, "width": 358, "height": 186, @@ -499,8 +745,8 @@ "id": "outer-container.container", "type": "rectangle", "pos": { - "x": 1038, - "y": 145 + "x": 1110, + "y": 396 }, "width": 622, "height": 352, @@ -540,8 +786,8 @@ "id": "outer-container.grid.1", "type": "rectangle", "pos": { - "x": 670, - "y": 288 + "x": 742, + "y": 539 }, "width": 52, "height": 66, @@ -581,8 +827,8 @@ "id": "outer-container.grid.2", "type": "rectangle", "pos": { - "x": 762, - "y": 288 + "x": 834, + "y": 539 }, "width": 53, "height": 66, @@ -622,8 +868,8 @@ "id": "outer-container.grid.3", "type": "rectangle", "pos": { - "x": 855, - "y": 288 + "x": 927, + "y": 539 }, "width": 53, "height": 66, @@ -663,8 +909,8 @@ "id": "outer-container.container.4", "type": "rectangle", "pos": { - "x": 1310, - "y": 195 + "x": 1382, + "y": 446 }, "width": 54, "height": 66, @@ -704,8 +950,8 @@ "id": "outer-container.container.5", "type": "rectangle", "pos": { - "x": 1434, - "y": 195 + "x": 1506, + "y": 446 }, "width": 53, "height": 66, @@ -745,8 +991,8 @@ "id": "outer-container.container.6", "type": "rectangle", "pos": { - "x": 1557, - "y": 195 + "x": 1629, + "y": 446 }, "width": 53, "height": 66, @@ -786,8 +1032,8 @@ "id": "outer-container.container.nested container", "type": "rectangle", "pos": { - "x": 1088, - "y": 281 + "x": 1160, + "y": 532 }, "width": 276, "height": 166, @@ -827,8 +1073,8 @@ "id": "outer-container.container.nested container.7", "type": "rectangle", "pos": { - "x": 1138, - "y": 331 + "x": 1210, + "y": 582 }, "width": 53, "height": 66, @@ -868,8 +1114,8 @@ "id": "outer-container.container.nested container.8", "type": "rectangle", "pos": { - "x": 1261, - "y": 331 + "x": 1333, + "y": 582 }, "width": 53, "height": 66, @@ -932,12 +1178,12 @@ "labelPercentage": 0, "route": [ { - "x": 490, - "y": 321 + "x": 562, + "y": 572 }, { - "x": 560, - "y": 321 + "x": 632, + "y": 572 } ], "animated": false, @@ -970,11 +1216,11 @@ "labelPercentage": 0, "route": [ { - "x": 251, + "x": 287, "y": 258 }, { - "x": 251, + "x": 287, "y": 298 } ], @@ -1008,12 +1254,486 @@ "labelPercentage": 0, "route": [ { - "x": 251, - "y": 464 + "x": 287, + "y": 966 }, { - "x": 251, - "y": 504 + "x": 287, + "y": 1006 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(a -> b)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.a", + "srcArrow": "none", + "dst": "outer-grid.container.b", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 171.33299255371094, + "y": 414 + }, + { + "x": 171.33299255371094, + "y": 454 + }, + { + "x": 203, + "y": 454 + }, + { + "x": 203, + "y": 494 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(b -> c)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.b", + "srcArrow": "none", + "dst": "outer-grid.container.c", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 189.66600036621094, + "y": 560 + }, + { + "x": 189.66600036621094, + "y": 600 + }, + { + "x": 164.66600036621094, + "y": 600 + }, + { + "x": 164.66600036621094, + "y": 645 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(c -> a)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.c", + "srcArrow": "none", + "dst": "outer-grid.container.a", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 147, + "y": 645 + }, + { + "x": 147, + "y": 600 + }, + { + "x": 122, + "y": 600 + }, + { + "x": 122, + "y": 454 + }, + { + "x": 153.66600036621094, + "y": 454 + }, + { + "x": 153.66600036621094, + "y": 414 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(d -> e)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.d", + "srcArrow": "none", + "dst": "outer-grid.container.e", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 349.5, + "y": 414 + }, + { + "x": 349.5, + "y": 454 + }, + { + "x": 326.8330078125, + "y": 454 + }, + { + "x": 326.8330078125, + "y": 494 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(e -> g.h.i)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.e", + "srcArrow": "none", + "dst": "outer-grid.container.g.h.i", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 326.8330078125, + "y": 560 + }, + { + "x": 326.8330078125, + "y": 750 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(d -> f)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.d", + "srcArrow": "none", + "dst": "outer-grid.container.f", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 376.1659851074219, + "y": 414 + }, + { + "x": 376.1659851074219, + "y": 454 + }, + { + "x": 398.8330078125, + "y": 454 + }, + { + "x": 398.8330078125, + "y": 494 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(f -> g.h)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.f", + "srcArrow": "none", + "dst": "outer-grid.container.g.h", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 398.8330078125, + "y": 560 + }, + { + "x": 398.8330078125, + "y": 600 + }, + { + "x": 336.8330078125, + "y": 600 + }, + { + "x": 336.8330078125, + "y": 700 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.container.(b -> g)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.container.b", + "srcArrow": "none", + "dst": "outer-grid.container.g", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 216.33299255371094, + "y": 560 + }, + { + "x": 216.33299255371094, + "y": 600 + }, + { + "x": 316.8330078125, + "y": 600 + }, + { + "x": 316.8330078125, + "y": 645 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.inner-grid.(1 -> 2)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.inner-grid.1", + "srcArrow": "none", + "dst": "outer-grid.inner-grid.2", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 183.5, + "y": 165 + }, + { + "x": 224.5, + "y": 165 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "outer-grid.inner-grid.(2 -> 3)[0]", + "classes": [ + "red" + ], + "src": "outer-grid.inner-grid.2", + "srcArrow": "none", + "dst": "outer-grid.inner-grid.3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 276.5, + "y": 165 + }, + { + "x": 317.5, + "y": 165 } ], "animated": false, @@ -1046,12 +1766,12 @@ "labelPercentage": 0, "route": [ { - "x": 968, - "y": 321 + "x": 1040, + "y": 572 }, { - "x": 1038, - "y": 321 + "x": 1110, + "y": 572 } ], "animated": false, @@ -1084,12 +1804,12 @@ "labelPercentage": 0, "route": [ { - "x": 721.5, - "y": 321 + "x": 793.5, + "y": 572 }, { - "x": 762.5, - "y": 321 + "x": 834.5, + "y": 572 } ], "animated": false, @@ -1122,12 +1842,12 @@ "labelPercentage": 0, "route": [ { - "x": 814.5, - "y": 321 + "x": 886.5, + "y": 572 }, { - "x": 855.5, - "y": 321 + "x": 927.5, + "y": 572 } ], "animated": false, @@ -1160,12 +1880,12 @@ "labelPercentage": 0, "route": [ { - "x": 1364, - "y": 228 + "x": 1436, + "y": 479 }, { - "x": 1434, - "y": 228 + "x": 1506, + "y": 479 } ], "animated": false, @@ -1198,12 +1918,12 @@ "labelPercentage": 0, "route": [ { - "x": 1487, - "y": 228 + "x": 1559, + "y": 479 }, { - "x": 1557, - "y": 228 + "x": 1629, + "y": 479 } ], "animated": false, @@ -1236,12 +1956,12 @@ "labelPercentage": 0, "route": [ { - "x": 1191, - "y": 364 + "x": 1263, + "y": 615 }, { - "x": 1261, - "y": 364 + "x": 1333, + "y": 615 } ], "animated": false, diff --git a/e2etests/testdata/stable/grid_nested_simple_edges/elk/sketch.exp.svg b/e2etests/testdata/stable/grid_nested_simple_edges/elk/sketch.exp.svg index a4eb85d78..b41c3057e 100644 --- a/e2etests/testdata/stable/grid_nested_simple_edges/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/grid_nested_simple_edges/elk/sketch.exp.svg @@ -1,17 +1,17 @@ -outer-gridouter-containerinner-gridcontaineretcgridcontainerabc123123456nested container78 - - - - + .d2-1249027147 .fill-N1{fill:#0A0F25;} + .d2-1249027147 .fill-N2{fill:#676C7E;} + .d2-1249027147 .fill-N3{fill:#9499AB;} + .d2-1249027147 .fill-N4{fill:#CFD2DD;} + .d2-1249027147 .fill-N5{fill:#DEE1EB;} + .d2-1249027147 .fill-N6{fill:#EEF1F8;} + .d2-1249027147 .fill-N7{fill:#FFFFFF;} + .d2-1249027147 .fill-B1{fill:#0D32B2;} + .d2-1249027147 .fill-B2{fill:#0D32B2;} + .d2-1249027147 .fill-B3{fill:#E3E9FD;} + .d2-1249027147 .fill-B4{fill:#E3E9FD;} + .d2-1249027147 .fill-B5{fill:#EDF0FD;} + .d2-1249027147 .fill-B6{fill:#F7F8FE;} + .d2-1249027147 .fill-AA2{fill:#4A6FF3;} + .d2-1249027147 .fill-AA4{fill:#EDF0FD;} + .d2-1249027147 .fill-AA5{fill:#F7F8FE;} + .d2-1249027147 .fill-AB4{fill:#EDF0FD;} + .d2-1249027147 .fill-AB5{fill:#F7F8FE;} + .d2-1249027147 .stroke-N1{stroke:#0A0F25;} + .d2-1249027147 .stroke-N2{stroke:#676C7E;} + .d2-1249027147 .stroke-N3{stroke:#9499AB;} + .d2-1249027147 .stroke-N4{stroke:#CFD2DD;} + .d2-1249027147 .stroke-N5{stroke:#DEE1EB;} + .d2-1249027147 .stroke-N6{stroke:#EEF1F8;} + .d2-1249027147 .stroke-N7{stroke:#FFFFFF;} + .d2-1249027147 .stroke-B1{stroke:#0D32B2;} + .d2-1249027147 .stroke-B2{stroke:#0D32B2;} + .d2-1249027147 .stroke-B3{stroke:#E3E9FD;} + .d2-1249027147 .stroke-B4{stroke:#E3E9FD;} + .d2-1249027147 .stroke-B5{stroke:#EDF0FD;} + .d2-1249027147 .stroke-B6{stroke:#F7F8FE;} + .d2-1249027147 .stroke-AA2{stroke:#4A6FF3;} + .d2-1249027147 .stroke-AA4{stroke:#EDF0FD;} + .d2-1249027147 .stroke-AA5{stroke:#F7F8FE;} + .d2-1249027147 .stroke-AB4{stroke:#EDF0FD;} + .d2-1249027147 .stroke-AB5{stroke:#F7F8FE;} + .d2-1249027147 .background-color-N1{background-color:#0A0F25;} + .d2-1249027147 .background-color-N2{background-color:#676C7E;} + .d2-1249027147 .background-color-N3{background-color:#9499AB;} + .d2-1249027147 .background-color-N4{background-color:#CFD2DD;} + .d2-1249027147 .background-color-N5{background-color:#DEE1EB;} + .d2-1249027147 .background-color-N6{background-color:#EEF1F8;} + .d2-1249027147 .background-color-N7{background-color:#FFFFFF;} + .d2-1249027147 .background-color-B1{background-color:#0D32B2;} + .d2-1249027147 .background-color-B2{background-color:#0D32B2;} + .d2-1249027147 .background-color-B3{background-color:#E3E9FD;} + .d2-1249027147 .background-color-B4{background-color:#E3E9FD;} + .d2-1249027147 .background-color-B5{background-color:#EDF0FD;} + .d2-1249027147 .background-color-B6{background-color:#F7F8FE;} + .d2-1249027147 .background-color-AA2{background-color:#4A6FF3;} + .d2-1249027147 .background-color-AA4{background-color:#EDF0FD;} + .d2-1249027147 .background-color-AA5{background-color:#F7F8FE;} + .d2-1249027147 .background-color-AB4{background-color:#EDF0FD;} + .d2-1249027147 .background-color-AB5{background-color:#F7F8FE;} + .d2-1249027147 .color-N1{color:#0A0F25;} + .d2-1249027147 .color-N2{color:#676C7E;} + .d2-1249027147 .color-N3{color:#9499AB;} + .d2-1249027147 .color-N4{color:#CFD2DD;} + .d2-1249027147 .color-N5{color:#DEE1EB;} + .d2-1249027147 .color-N6{color:#EEF1F8;} + .d2-1249027147 .color-N7{color:#FFFFFF;} + .d2-1249027147 .color-B1{color:#0D32B2;} + .d2-1249027147 .color-B2{color:#0D32B2;} + .d2-1249027147 .color-B3{color:#E3E9FD;} + .d2-1249027147 .color-B4{color:#E3E9FD;} + .d2-1249027147 .color-B5{color:#EDF0FD;} + .d2-1249027147 .color-B6{color:#F7F8FE;} + .d2-1249027147 .color-AA2{color:#4A6FF3;} + .d2-1249027147 .color-AA4{color:#EDF0FD;} + .d2-1249027147 .color-AA5{color:#F7F8FE;} + .d2-1249027147 .color-AB4{color:#EDF0FD;} + .d2-1249027147 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>outer-gridouter-containerinner-gridcontaineretcgridcontainerabcdegf123123456nested containerh78i + + + + - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + \ No newline at end of file