diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 80566ebb2..79e5b383d 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -10,6 +10,7 @@ #### Bugfixes ⛑️ +- Fix inheritence in scenarios/steps [#1090](https://github.com/terrastruct/d2/pull/1090) - Fix a bug in 32bit builds [#1115](https://github.com/terrastruct/d2/issues/1115) - Fix a bug in ID parsing [#322](https://github.com/terrastruct/d2/issues/322) - Fix a bug in watch mode parsing SVG [#1119](https://github.com/terrastruct/d2/issues/1119) diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index b50629d94..0080b713c 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -2456,6 +2456,19 @@ layers: { assert.False(t, g.Layers[1].Scenarios[1].IsFolderOnly) }, }, + { + name: "scenarios_edge_index", + run: func(t *testing.T) { + assertCompile(t, `a -> x + +scenarios: { + 1: { + (a -> x)[0].style.opacity: 0.1 + } +} +`, "") + }, + }, { name: "errs/duplicate_board", run: func(t *testing.T) { diff --git a/d2ir/compile.go b/d2ir/compile.go index fdd638a19..801529960 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -22,62 +22,20 @@ func Compile(ast *d2ast.Map) (*Map, error) { m.initRoot() m.parent.(*Field).References[0].Context.Scope = ast c.compileMap(m, ast) - c.compileScenarios(m) - c.compileSteps(m) if !c.err.Empty() { return nil, c.err } return m, nil } -func (c *compiler) compileScenarios(m *Map) { - scenariosf := m.GetField("scenarios") - if scenariosf == nil { +func (c *compiler) overlay(base *Map, f *Field) { + if f.Map() == nil || f.Primary() != nil { + c.errorf(f.References[0].Context.Key, "invalid %s", NodeBoardKind(f)) return } - scenarios := scenariosf.Map() - if scenarios == nil { - return - } - - for _, sf := range scenarios.Fields { - if sf.Map() == nil || sf.Primary() != nil { - c.errorf(sf.References[0].Context.Key, "invalid scenario") - continue - } - base := m.CopyBase(sf) - OverlayMap(base, sf.Map()) - sf.Composite = base - c.compileScenarios(sf.Map()) - c.compileSteps(sf.Map()) - } -} - -func (c *compiler) compileSteps(m *Map) { - stepsf := m.GetField("steps") - if stepsf == nil { - return - } - steps := stepsf.Map() - if steps == nil { - return - } - for i, sf := range steps.Fields { - if sf.Map() == nil || sf.Primary() != nil { - c.errorf(sf.References[0].Context.Key, "invalid step") - break - } - var base *Map - if i == 0 { - base = m.CopyBase(sf) - } else { - base = steps.Fields[i-1].Map().CopyBase(sf) - } - OverlayMap(base, sf.Map()) - sf.Composite = base - c.compileScenarios(sf.Map()) - c.compileSteps(sf.Map()) - } + base = base.CopyBase(f) + OverlayMap(base, f.Map()) + f.Composite = base } func (c *compiler) compileMap(dst *Map, ast *d2ast.Map) { @@ -128,6 +86,22 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) parent: f, } } + switch NodeBoardKind(f) { + case BoardScenario: + c.overlay(ParentBoard(f).Map(), f) + case BoardStep: + stepsMap := ParentMap(f) + for i := range stepsMap.Fields { + if stepsMap.Fields[i] == f { + if i == 0 { + c.overlay(ParentBoard(f).Map(), f) + } else { + c.overlay(stepsMap.Fields[i-1].Map(), f) + } + break + } + } + } c.compileMap(f.Map(), refctx.Key.Value.Map) } else if refctx.Key.Value.ScalarBox().Unbox() != nil { // If the link is a board, we need to transform it into an absolute path. diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index 71d46c924..6a97d415b 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -379,6 +379,20 @@ scenarios: { assertQuery(t, m, 0, 0, nil, "scenarios.nuclear.quiche") }, }, + { + name: "edge", + run: func(t testing.TB) { + m, err := compile(t, `a -> b +scenarios: { + 1: { + (a -> b)[0].style.opacity: 0.1 + } +}`) + assert.Success(t, err) + + assertQuery(t, m, 0, 0, nil, "(a -> b)[0]") + }, + }, } runa(t, tca) } @@ -431,9 +445,8 @@ scenarios: { shape: sql_table hey: int {constraint: primary_key} }`) - assert.ErrorString(t, err, `TestCompile/steps/steps_panic.d2:6:3: invalid scenario -TestCompile/steps/steps_panic.d2:7:3: invalid scenario -TestCompile/steps/steps_panic.d2:2:3: invalid step`) + assert.ErrorString(t, err, `TestCompile/steps/steps_panic.d2:3:3: invalid step +TestCompile/steps/steps_panic.d2:7:3: invalid scenario`) }, }, { diff --git a/d2renderers/d2svg/appendix/testdata/internal-links/sketch.exp.svg b/d2renderers/d2svg/appendix/testdata/internal-links/sketch.exp.svg index 814ce311b..3d047f163 100644 --- a/d2renderers/d2svg/appendix/testdata/internal-links/sketch.exp.svg +++ b/d2renderers/d2svg/appendix/testdata/internal-links/sketch.exp.svg @@ -1,12 +1,12 @@ -x1 + .d2-916646398 .fill-N1{fill:#0A0F25;} + .d2-916646398 .fill-N2{fill:#676C7E;} + .d2-916646398 .fill-N3{fill:#9499AB;} + .d2-916646398 .fill-N4{fill:#CFD2DD;} + .d2-916646398 .fill-N5{fill:#DEE1EB;} + .d2-916646398 .fill-N6{fill:#EEF1F8;} + .d2-916646398 .fill-N7{fill:#FFFFFF;} + .d2-916646398 .fill-B1{fill:#0D32B2;} + .d2-916646398 .fill-B2{fill:#0D32B2;} + .d2-916646398 .fill-B3{fill:#E3E9FD;} + .d2-916646398 .fill-B4{fill:#E3E9FD;} + .d2-916646398 .fill-B5{fill:#EDF0FD;} + .d2-916646398 .fill-B6{fill:#F7F8FE;} + .d2-916646398 .fill-AA2{fill:#4A6FF3;} + .d2-916646398 .fill-AA4{fill:#EDF0FD;} + .d2-916646398 .fill-AA5{fill:#F7F8FE;} + .d2-916646398 .fill-AB4{fill:#EDF0FD;} + .d2-916646398 .fill-AB5{fill:#F7F8FE;} + .d2-916646398 .stroke-N1{stroke:#0A0F25;} + .d2-916646398 .stroke-N2{stroke:#676C7E;} + .d2-916646398 .stroke-N3{stroke:#9499AB;} + .d2-916646398 .stroke-N4{stroke:#CFD2DD;} + .d2-916646398 .stroke-N5{stroke:#DEE1EB;} + .d2-916646398 .stroke-N6{stroke:#EEF1F8;} + .d2-916646398 .stroke-N7{stroke:#FFFFFF;} + .d2-916646398 .stroke-B1{stroke:#0D32B2;} + .d2-916646398 .stroke-B2{stroke:#0D32B2;} + .d2-916646398 .stroke-B3{stroke:#E3E9FD;} + .d2-916646398 .stroke-B4{stroke:#E3E9FD;} + .d2-916646398 .stroke-B5{stroke:#EDF0FD;} + .d2-916646398 .stroke-B6{stroke:#F7F8FE;} + .d2-916646398 .stroke-AA2{stroke:#4A6FF3;} + .d2-916646398 .stroke-AA4{stroke:#EDF0FD;} + .d2-916646398 .stroke-AA5{stroke:#F7F8FE;} + .d2-916646398 .stroke-AB4{stroke:#EDF0FD;} + .d2-916646398 .stroke-AB5{stroke:#F7F8FE;} + .d2-916646398 .background-color-N1{background-color:#0A0F25;} + .d2-916646398 .background-color-N2{background-color:#676C7E;} + .d2-916646398 .background-color-N3{background-color:#9499AB;} + .d2-916646398 .background-color-N4{background-color:#CFD2DD;} + .d2-916646398 .background-color-N5{background-color:#DEE1EB;} + .d2-916646398 .background-color-N6{background-color:#EEF1F8;} + .d2-916646398 .background-color-N7{background-color:#FFFFFF;} + .d2-916646398 .background-color-B1{background-color:#0D32B2;} + .d2-916646398 .background-color-B2{background-color:#0D32B2;} + .d2-916646398 .background-color-B3{background-color:#E3E9FD;} + .d2-916646398 .background-color-B4{background-color:#E3E9FD;} + .d2-916646398 .background-color-B5{background-color:#EDF0FD;} + .d2-916646398 .background-color-B6{background-color:#F7F8FE;} + .d2-916646398 .background-color-AA2{background-color:#4A6FF3;} + .d2-916646398 .background-color-AA4{background-color:#EDF0FD;} + .d2-916646398 .background-color-AA5{background-color:#F7F8FE;} + .d2-916646398 .background-color-AB4{background-color:#EDF0FD;} + .d2-916646398 .background-color-AB5{background-color:#F7F8FE;} + .d2-916646398 .color-N1{color:#0A0F25;} + .d2-916646398 .color-N2{color:#676C7E;} + .d2-916646398 .color-N3{color:#9499AB;} + .d2-916646398 .color-N4{color:#CFD2DD;} + .d2-916646398 .color-N5{color:#DEE1EB;} + .d2-916646398 .color-N6{color:#EEF1F8;} + .d2-916646398 .color-N7{color:#FFFFFF;} + .d2-916646398 .color-B1{color:#0D32B2;} + .d2-916646398 .color-B2{color:#0D32B2;} + .d2-916646398 .color-B3{color:#E3E9FD;} + .d2-916646398 .color-B4{color:#E3E9FD;} + .d2-916646398 .color-B5{color:#EDF0FD;} + .d2-916646398 .color-B6{color:#F7F8FE;} + .d2-916646398 .color-AA2{color:#4A6FF3;} + .d2-916646398 .color-AA4{color:#EDF0FD;} + .d2-916646398 .color-AA5{color:#F7F8FE;} + .d2-916646398 .color-AB4{color:#EDF0FD;} + .d2-916646398 .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}]]>x1 1root > x diff --git a/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf b/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf index 23628020d..cded31a33 100644 Binary files a/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf and b/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf differ diff --git a/e2etests/testdata/stable/complex-layers/dagre/board.exp.json b/e2etests/testdata/stable/complex-layers/dagre/board.exp.json index 2143537d3..c90970ef4 100644 --- a/e2etests/testdata/stable/complex-layers/dagre/board.exp.json +++ b/e2etests/testdata/stable/complex-layers/dagre/board.exp.json @@ -828,15 +828,15 @@ "type": "rectangle", "pos": { "x": 0, - "y": 0 + "y": 41 }, - "width": 159, - "height": 66, + "width": 361, + "height": 125, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B6", + "fill": "B4", "stroke": "B1", "shadow": false, "3d": false, @@ -851,6 +851,47 @@ "methods": null, "columns": null, "label": "find contractors", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 187, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "find contractors.craigslist", + "type": "rectangle", + "pos": { + "x": 40, + "y": 70 + }, + "width": 110, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "craigslist", "fontSize": 16, "fontFamily": "DEFAULT", "language": "", @@ -858,18 +899,59 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 114, + "labelWidth": 65, "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, - "level": 1 + "level": 2 + }, + { + "id": "find contractors.facebook", + "type": "rectangle", + "pos": { + "x": 210, + "y": 70 + }, + "width": 111, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "facebook", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 }, { "id": "solicit quotes", "type": "rectangle", "pos": { - "x": 10, - "y": 166 + "x": 196, + "y": 266 }, "width": 140, "height": 66, @@ -934,20 +1016,20 @@ "labelPercentage": 0, "route": [ { - "x": 79.5, - "y": 66 - }, - { - "x": 79.5, - "y": 106 - }, - { - "x": 79.5, - "y": 126 - }, - { - "x": 79.5, + "x": 265.5, "y": 166 + }, + { + "x": 265.5, + "y": 206 + }, + { + "x": 265.5, + "y": 226 + }, + { + "x": 265.5, + "y": 266 } ], "isCurve": true, @@ -1004,11 +1086,175 @@ "fontFamily": "SourceSansPro", "shapes": [ { - "id": "obtain quotes", + "id": "find contractors", "type": "rectangle", "pos": { "x": 0, - "y": 0 + "y": 41 + }, + "width": 361, + "height": 125, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "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": "find contractors", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 187, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "find contractors.craigslist", + "type": "rectangle", + "pos": { + "x": 40, + "y": 70 + }, + "width": 110, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "craigslist", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 65, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "find contractors.facebook", + "type": "rectangle", + "pos": { + "x": 210, + "y": 70 + }, + "width": 111, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "facebook", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "solicit quotes", + "type": "rectangle", + "pos": { + "x": 196, + "y": 266 + }, + "width": 140, + "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": "solicit quotes", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 95, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "obtain quotes", + "type": "rectangle", + "pos": { + "x": 401, + "y": 50 }, "width": 143, "height": 66, @@ -1048,8 +1294,8 @@ "id": "negotiate", "type": "rectangle", "pos": { - "x": 16, - "y": 166 + "x": 417, + "y": 266 }, "width": 112, "height": 66, @@ -1087,6 +1333,55 @@ } ], "connections": [ + { + "id": "(find contractors -> solicit quotes)[0]", + "src": "find contractors", + "srcArrow": "none", + "srcLabel": "", + "dst": "solicit quotes", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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": 265.5, + "y": 166 + }, + { + "x": 265.5, + "y": 206 + }, + { + "x": 265.5, + "y": 226 + }, + { + "x": 265.5, + "y": 266 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, { "id": "(obtain quotes -> negotiate)[0]", "src": "obtain quotes", @@ -1114,20 +1409,20 @@ "labelPercentage": 0, "route": [ { - "x": 71.5, - "y": 66 + "x": 472.5, + "y": 116 }, { - "x": 71.5, - "y": 106 + "x": 472.5, + "y": 156 }, { - "x": 71.5, - "y": 126 + "x": 472.5, + "y": 226 }, { - "x": 71.5, - "y": 166 + "x": 472.5, + "y": 266 } ], "isCurve": true, @@ -1183,12 +1478,217 @@ "isFolderOnly": false, "fontFamily": "SourceSansPro", "shapes": [ + { + "id": "find contractors", + "type": "rectangle", + "pos": { + "x": 0, + "y": 41 + }, + "width": 361, + "height": 125, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "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": "find contractors", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 187, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "find contractors.craigslist", + "type": "rectangle", + "pos": { + "x": 40, + "y": 70 + }, + "width": 110, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "craigslist", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 65, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "find contractors.facebook", + "type": "rectangle", + "pos": { + "x": 210, + "y": 70 + }, + "width": 111, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "facebook", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "solicit quotes", + "type": "rectangle", + "pos": { + "x": 196, + "y": 266 + }, + "width": 140, + "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": "solicit quotes", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 95, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "obtain quotes", + "type": "rectangle", + "pos": { + "x": 401, + "y": 50 + }, + "width": 143, + "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": "obtain quotes", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 98, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, { "id": "negotiate", "type": "rectangle", "pos": { - "x": 28, - "y": 0 + "x": 417, + "y": 266 }, "width": 112, "height": 66, @@ -1228,8 +1728,8 @@ "id": "book the best bid", "type": "rectangle", "pos": { - "x": 0, - "y": 166 + "x": 389, + "y": 432 }, "width": 167, "height": 66, @@ -1267,6 +1767,104 @@ } ], "connections": [ + { + "id": "(find contractors -> solicit quotes)[0]", + "src": "find contractors", + "srcArrow": "none", + "srcLabel": "", + "dst": "solicit quotes", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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": 265.5, + "y": 166 + }, + { + "x": 265.5, + "y": 206 + }, + { + "x": 265.5, + "y": 226 + }, + { + "x": 265.5, + "y": 266 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(obtain quotes -> negotiate)[0]", + "src": "obtain quotes", + "srcArrow": "none", + "srcLabel": "", + "dst": "negotiate", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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": 472.5, + "y": 116 + }, + { + "x": 472.5, + "y": 156 + }, + { + "x": 472.5, + "y": 226 + }, + { + "x": 472.5, + "y": 266 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, { "id": "(negotiate -> book the best bid)[0]", "src": "negotiate", @@ -1294,20 +1892,20 @@ "labelPercentage": 0, "route": [ { - "x": 83.5, - "y": 66 + "x": 472.5, + "y": 332 }, { - "x": 83.5, - "y": 106 + "x": 472.5, + "y": 372 }, { - "x": 83.5, - "y": 126 + "x": 472.5, + "y": 392 }, { - "x": 83.5, - "y": 166 + "x": 472.5, + "y": 432 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg b/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg index 082fc6a07..43fa84ddd 100644 --- a/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg @@ -1,9 +1,9 @@ -windowroofgarage + .d2-1606881621 .fill-N1{fill:#0A0F25;} + .d2-1606881621 .fill-N2{fill:#676C7E;} + .d2-1606881621 .fill-N3{fill:#9499AB;} + .d2-1606881621 .fill-N4{fill:#CFD2DD;} + .d2-1606881621 .fill-N5{fill:#DEE1EB;} + .d2-1606881621 .fill-N6{fill:#EEF1F8;} + .d2-1606881621 .fill-N7{fill:#FFFFFF;} + .d2-1606881621 .fill-B1{fill:#0D32B2;} + .d2-1606881621 .fill-B2{fill:#0D32B2;} + .d2-1606881621 .fill-B3{fill:#E3E9FD;} + .d2-1606881621 .fill-B4{fill:#E3E9FD;} + .d2-1606881621 .fill-B5{fill:#EDF0FD;} + .d2-1606881621 .fill-B6{fill:#F7F8FE;} + .d2-1606881621 .fill-AA2{fill:#4A6FF3;} + .d2-1606881621 .fill-AA4{fill:#EDF0FD;} + .d2-1606881621 .fill-AA5{fill:#F7F8FE;} + .d2-1606881621 .fill-AB4{fill:#EDF0FD;} + .d2-1606881621 .fill-AB5{fill:#F7F8FE;} + .d2-1606881621 .stroke-N1{stroke:#0A0F25;} + .d2-1606881621 .stroke-N2{stroke:#676C7E;} + .d2-1606881621 .stroke-N3{stroke:#9499AB;} + .d2-1606881621 .stroke-N4{stroke:#CFD2DD;} + .d2-1606881621 .stroke-N5{stroke:#DEE1EB;} + .d2-1606881621 .stroke-N6{stroke:#EEF1F8;} + .d2-1606881621 .stroke-N7{stroke:#FFFFFF;} + .d2-1606881621 .stroke-B1{stroke:#0D32B2;} + .d2-1606881621 .stroke-B2{stroke:#0D32B2;} + .d2-1606881621 .stroke-B3{stroke:#E3E9FD;} + .d2-1606881621 .stroke-B4{stroke:#E3E9FD;} + .d2-1606881621 .stroke-B5{stroke:#EDF0FD;} + .d2-1606881621 .stroke-B6{stroke:#F7F8FE;} + .d2-1606881621 .stroke-AA2{stroke:#4A6FF3;} + .d2-1606881621 .stroke-AA4{stroke:#EDF0FD;} + .d2-1606881621 .stroke-AA5{stroke:#F7F8FE;} + .d2-1606881621 .stroke-AB4{stroke:#EDF0FD;} + .d2-1606881621 .stroke-AB5{stroke:#F7F8FE;} + .d2-1606881621 .background-color-N1{background-color:#0A0F25;} + .d2-1606881621 .background-color-N2{background-color:#676C7E;} + .d2-1606881621 .background-color-N3{background-color:#9499AB;} + .d2-1606881621 .background-color-N4{background-color:#CFD2DD;} + .d2-1606881621 .background-color-N5{background-color:#DEE1EB;} + .d2-1606881621 .background-color-N6{background-color:#EEF1F8;} + .d2-1606881621 .background-color-N7{background-color:#FFFFFF;} + .d2-1606881621 .background-color-B1{background-color:#0D32B2;} + .d2-1606881621 .background-color-B2{background-color:#0D32B2;} + .d2-1606881621 .background-color-B3{background-color:#E3E9FD;} + .d2-1606881621 .background-color-B4{background-color:#E3E9FD;} + .d2-1606881621 .background-color-B5{background-color:#EDF0FD;} + .d2-1606881621 .background-color-B6{background-color:#F7F8FE;} + .d2-1606881621 .background-color-AA2{background-color:#4A6FF3;} + .d2-1606881621 .background-color-AA4{background-color:#EDF0FD;} + .d2-1606881621 .background-color-AA5{background-color:#F7F8FE;} + .d2-1606881621 .background-color-AB4{background-color:#EDF0FD;} + .d2-1606881621 .background-color-AB5{background-color:#F7F8FE;} + .d2-1606881621 .color-N1{color:#0A0F25;} + .d2-1606881621 .color-N2{color:#676C7E;} + .d2-1606881621 .color-N3{color:#9499AB;} + .d2-1606881621 .color-N4{color:#CFD2DD;} + .d2-1606881621 .color-N5{color:#DEE1EB;} + .d2-1606881621 .color-N6{color:#EEF1F8;} + .d2-1606881621 .color-N7{color:#FFFFFF;} + .d2-1606881621 .color-B1{color:#0D32B2;} + .d2-1606881621 .color-B2{color:#0D32B2;} + .d2-1606881621 .color-B3{color:#E3E9FD;} + .d2-1606881621 .color-B4{color:#E3E9FD;} + .d2-1606881621 .color-B5{color:#EDF0FD;} + .d2-1606881621 .color-B6{color:#F7F8FE;} + .d2-1606881621 .color-AA2{color:#4A6FF3;} + .d2-1606881621 .color-AA4{color:#EDF0FD;} + .d2-1606881621 .color-AA5{color:#F7F8FE;} + .d2-1606881621 .color-AB4{color:#EDF0FD;} + .d2-1606881621 .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}]]>windowroofgarage \ No newline at end of file diff --git a/e2etests/testdata/stable/complex-layers/elk/board.exp.json b/e2etests/testdata/stable/complex-layers/elk/board.exp.json index 0d1f96aa8..2ab04d994 100644 --- a/e2etests/testdata/stable/complex-layers/elk/board.exp.json +++ b/e2etests/testdata/stable/complex-layers/elk/board.exp.json @@ -830,13 +830,13 @@ "x": 12, "y": 12 }, - "width": 159, - "height": 66, + "width": 341, + "height": 166, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B6", + "fill": "B4", "stroke": "B1", "shadow": false, "3d": false, @@ -851,6 +851,47 @@ "methods": null, "columns": null, "label": "find contractors", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 187, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "find contractors.craigslist", + "type": "rectangle", + "pos": { + "x": 62, + "y": 62 + }, + "width": 110, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "craigslist", "fontSize": 16, "fontFamily": "DEFAULT", "language": "", @@ -858,18 +899,59 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 114, + "labelWidth": 65, "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, - "level": 1 + "level": 2 + }, + { + "id": "find contractors.facebook", + "type": "rectangle", + "pos": { + "x": 192, + "y": 62 + }, + "width": 111, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "facebook", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 }, { "id": "solicit quotes", "type": "rectangle", "pos": { - "x": 21, - "y": 148 + "x": 112, + "y": 248 }, "width": 140, "height": 66, @@ -934,12 +1016,12 @@ "labelPercentage": 0, "route": [ { - "x": 91.5, - "y": 78 + "x": 182.5, + "y": 178 }, { - "x": 91.5, - "y": 148 + "x": 182.5, + "y": 248 } ], "animated": false, @@ -995,12 +1077,176 @@ "fontFamily": "SourceSansPro", "shapes": [ { - "id": "obtain quotes", + "id": "find contractors", "type": "rectangle", "pos": { "x": 12, "y": 12 }, + "width": 341, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "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": "find contractors", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 187, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "find contractors.craigslist", + "type": "rectangle", + "pos": { + "x": 62, + "y": 62 + }, + "width": 110, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "craigslist", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 65, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "find contractors.facebook", + "type": "rectangle", + "pos": { + "x": 192, + "y": 62 + }, + "width": 111, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "facebook", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "solicit quotes", + "type": "rectangle", + "pos": { + "x": 112, + "y": 248 + }, + "width": 140, + "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": "solicit quotes", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 95, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "obtain quotes", + "type": "rectangle", + "pos": { + "x": 373, + "y": 112 + }, "width": 143, "height": 66, "opacity": 1, @@ -1039,8 +1285,8 @@ "id": "negotiate", "type": "rectangle", "pos": { - "x": 27, - "y": 148 + "x": 388, + "y": 248 }, "width": 112, "height": 66, @@ -1078,6 +1324,46 @@ } ], "connections": [ + { + "id": "(find contractors -> solicit quotes)[0]", + "src": "find contractors", + "srcArrow": "none", + "srcLabel": "", + "dst": "solicit quotes", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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.5, + "y": 178 + }, + { + "x": 182.5, + "y": 248 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, { "id": "(obtain quotes -> negotiate)[0]", "src": "obtain quotes", @@ -1105,12 +1391,12 @@ "labelPercentage": 0, "route": [ { - "x": 83.5, - "y": 78 + "x": 444.5, + "y": 178 }, { - "x": 83.5, - "y": 148 + "x": 444.5, + "y": 248 } ], "animated": false, @@ -1165,12 +1451,217 @@ "isFolderOnly": false, "fontFamily": "SourceSansPro", "shapes": [ + { + "id": "find contractors", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 341, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "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": "find contractors", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 187, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "find contractors.craigslist", + "type": "rectangle", + "pos": { + "x": 62, + "y": 62 + }, + "width": 110, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "craigslist", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 65, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "find contractors.facebook", + "type": "rectangle", + "pos": { + "x": 192, + "y": 62 + }, + "width": 111, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "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": "facebook", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "solicit quotes", + "type": "rectangle", + "pos": { + "x": 112, + "y": 248 + }, + "width": 140, + "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": "solicit quotes", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 95, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "obtain quotes", + "type": "rectangle", + "pos": { + "x": 373, + "y": 112 + }, + "width": 143, + "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": "obtain quotes", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 98, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, { "id": "negotiate", "type": "rectangle", "pos": { - "x": 39, - "y": 12 + "x": 388, + "y": 248 }, "width": 112, "height": 66, @@ -1210,8 +1701,8 @@ "id": "book the best bid", "type": "rectangle", "pos": { - "x": 12, - "y": 148 + "x": 361, + "y": 384 }, "width": 167, "height": 66, @@ -1249,6 +1740,86 @@ } ], "connections": [ + { + "id": "(find contractors -> solicit quotes)[0]", + "src": "find contractors", + "srcArrow": "none", + "srcLabel": "", + "dst": "solicit quotes", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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.5, + "y": 178 + }, + { + "x": 182.5, + "y": 248 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(obtain quotes -> negotiate)[0]", + "src": "obtain quotes", + "srcArrow": "none", + "srcLabel": "", + "dst": "negotiate", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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": 444.5, + "y": 178 + }, + { + "x": 444.5, + "y": 248 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, { "id": "(negotiate -> book the best bid)[0]", "src": "negotiate", @@ -1276,12 +1847,12 @@ "labelPercentage": 0, "route": [ { - "x": 95.5, - "y": 78 + "x": 444.5, + "y": 314 }, { - "x": 95.5, - "y": 148 + "x": 444.5, + "y": 384 } ], "animated": false, diff --git a/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg b/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg index de054737d..2b7d980fe 100644 --- a/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg @@ -1,9 +1,9 @@ -windowroofgarage + .d2-1428720329 .fill-N1{fill:#0A0F25;} + .d2-1428720329 .fill-N2{fill:#676C7E;} + .d2-1428720329 .fill-N3{fill:#9499AB;} + .d2-1428720329 .fill-N4{fill:#CFD2DD;} + .d2-1428720329 .fill-N5{fill:#DEE1EB;} + .d2-1428720329 .fill-N6{fill:#EEF1F8;} + .d2-1428720329 .fill-N7{fill:#FFFFFF;} + .d2-1428720329 .fill-B1{fill:#0D32B2;} + .d2-1428720329 .fill-B2{fill:#0D32B2;} + .d2-1428720329 .fill-B3{fill:#E3E9FD;} + .d2-1428720329 .fill-B4{fill:#E3E9FD;} + .d2-1428720329 .fill-B5{fill:#EDF0FD;} + .d2-1428720329 .fill-B6{fill:#F7F8FE;} + .d2-1428720329 .fill-AA2{fill:#4A6FF3;} + .d2-1428720329 .fill-AA4{fill:#EDF0FD;} + .d2-1428720329 .fill-AA5{fill:#F7F8FE;} + .d2-1428720329 .fill-AB4{fill:#EDF0FD;} + .d2-1428720329 .fill-AB5{fill:#F7F8FE;} + .d2-1428720329 .stroke-N1{stroke:#0A0F25;} + .d2-1428720329 .stroke-N2{stroke:#676C7E;} + .d2-1428720329 .stroke-N3{stroke:#9499AB;} + .d2-1428720329 .stroke-N4{stroke:#CFD2DD;} + .d2-1428720329 .stroke-N5{stroke:#DEE1EB;} + .d2-1428720329 .stroke-N6{stroke:#EEF1F8;} + .d2-1428720329 .stroke-N7{stroke:#FFFFFF;} + .d2-1428720329 .stroke-B1{stroke:#0D32B2;} + .d2-1428720329 .stroke-B2{stroke:#0D32B2;} + .d2-1428720329 .stroke-B3{stroke:#E3E9FD;} + .d2-1428720329 .stroke-B4{stroke:#E3E9FD;} + .d2-1428720329 .stroke-B5{stroke:#EDF0FD;} + .d2-1428720329 .stroke-B6{stroke:#F7F8FE;} + .d2-1428720329 .stroke-AA2{stroke:#4A6FF3;} + .d2-1428720329 .stroke-AA4{stroke:#EDF0FD;} + .d2-1428720329 .stroke-AA5{stroke:#F7F8FE;} + .d2-1428720329 .stroke-AB4{stroke:#EDF0FD;} + .d2-1428720329 .stroke-AB5{stroke:#F7F8FE;} + .d2-1428720329 .background-color-N1{background-color:#0A0F25;} + .d2-1428720329 .background-color-N2{background-color:#676C7E;} + .d2-1428720329 .background-color-N3{background-color:#9499AB;} + .d2-1428720329 .background-color-N4{background-color:#CFD2DD;} + .d2-1428720329 .background-color-N5{background-color:#DEE1EB;} + .d2-1428720329 .background-color-N6{background-color:#EEF1F8;} + .d2-1428720329 .background-color-N7{background-color:#FFFFFF;} + .d2-1428720329 .background-color-B1{background-color:#0D32B2;} + .d2-1428720329 .background-color-B2{background-color:#0D32B2;} + .d2-1428720329 .background-color-B3{background-color:#E3E9FD;} + .d2-1428720329 .background-color-B4{background-color:#E3E9FD;} + .d2-1428720329 .background-color-B5{background-color:#EDF0FD;} + .d2-1428720329 .background-color-B6{background-color:#F7F8FE;} + .d2-1428720329 .background-color-AA2{background-color:#4A6FF3;} + .d2-1428720329 .background-color-AA4{background-color:#EDF0FD;} + .d2-1428720329 .background-color-AA5{background-color:#F7F8FE;} + .d2-1428720329 .background-color-AB4{background-color:#EDF0FD;} + .d2-1428720329 .background-color-AB5{background-color:#F7F8FE;} + .d2-1428720329 .color-N1{color:#0A0F25;} + .d2-1428720329 .color-N2{color:#676C7E;} + .d2-1428720329 .color-N3{color:#9499AB;} + .d2-1428720329 .color-N4{color:#CFD2DD;} + .d2-1428720329 .color-N5{color:#DEE1EB;} + .d2-1428720329 .color-N6{color:#EEF1F8;} + .d2-1428720329 .color-N7{color:#FFFFFF;} + .d2-1428720329 .color-B1{color:#0D32B2;} + .d2-1428720329 .color-B2{color:#0D32B2;} + .d2-1428720329 .color-B3{color:#E3E9FD;} + .d2-1428720329 .color-B4{color:#E3E9FD;} + .d2-1428720329 .color-B5{color:#EDF0FD;} + .d2-1428720329 .color-B6{color:#F7F8FE;} + .d2-1428720329 .color-AA2{color:#4A6FF3;} + .d2-1428720329 .color-AA4{color:#EDF0FD;} + .d2-1428720329 .color-AA5{color:#F7F8FE;} + .d2-1428720329 .color-AB4{color:#EDF0FD;} + .d2-1428720329 .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}]]>windowroofgarage \ No newline at end of file diff --git a/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json b/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json index 0f6affc31..11a7eb99a 100644 --- a/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json +++ b/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json @@ -1361,7 +1361,55 @@ "zIndex": 0 }, "edges": null, - "objects": null + "objects": [ + { + "id": "clause", + "id_val": "clause", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,6:4:47-6:10:53", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,6:4:47-6:10:53", + "value": [ + { + "string": "clause", + "raw_string": "clause" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "clause" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] }, { "name": "missoula", @@ -1678,7 +1726,55 @@ "zIndex": 0 }, "edges": null, - "objects": null + "objects": [ + { + "id": "clause", + "id_val": "clause", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,6:4:47-6:10:53", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,6:4:47-6:10:53", + "value": [ + { + "string": "clause", + "raw_string": "clause" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "clause" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] } ] } diff --git a/testdata/d2compiler/TestCompile2/boards/recursive.exp.json b/testdata/d2compiler/TestCompile2/boards/recursive.exp.json index 6d2c25d9e..9db6e6755 100644 --- a/testdata/d2compiler/TestCompile2/boards/recursive.exp.json +++ b/testdata/d2compiler/TestCompile2/boards/recursive.exp.json @@ -1442,6 +1442,53 @@ }, "edges": null, "objects": [ + { + "id": "clause", + "id_val": "clause", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/recursive.d2,7:4:52-7:10:58", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/recursive.d2,7:4:52-7:10:58", + "value": [ + { + "string": "clause", + "raw_string": "clause" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "clause" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, { "id": "reindeer", "id_val": "reindeer", @@ -1815,6 +1862,100 @@ }, "edges": null, "objects": [ + { + "id": "clause", + "id_val": "clause", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/recursive.d2,7:4:52-7:10:58", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/recursive.d2,7:4:52-7:10:58", + "value": [ + { + "string": "clause", + "raw_string": "clause" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "clause" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "reindeer", + "id_val": "reindeer", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/recursive.d2,10:4:89-10:12:97", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/recursive.d2,10:4:89-10:12:97", + "value": [ + { + "string": "reindeer", + "raw_string": "reindeer" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "reindeer" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, { "id": "montana", "id_val": "montana", diff --git a/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.exp.json b/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.exp.json new file mode 100644 index 000000000..d98c89221 --- /dev/null +++ b/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.exp.json @@ -0,0 +1,760 @@ +{ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-7:0:69", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:0:8-6:1:68", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:0:8-2:9:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:0:8-2:9:17", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:11:19-6:0:67", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:2:23-5:3:66", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:2:23-3:3:24", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:2:23-3:3:24", + "value": [ + { + "string": "1", + "raw_string": "1" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:5:26-5:2:65", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:4:32-4:34:62", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:11:39", + "src": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:6:34", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:9:37-4:11:39", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:10:38-4:11:39", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:12:40-4:15:43", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:16:44-4:29:57", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:16:44-4:21:49", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:22:50-4:29:57", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:31:59-4:34:62", + "raw": "0.1", + "value": "1/10" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "a", + "id_val": "a", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "scenarios": [ + { + "name": "1", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-7:0:69", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:0:8-6:1:68", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:0:8-2:9:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:0:8-2:9:17", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,2:11:19-6:0:67", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:2:23-5:3:66", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:2:23-3:3:24", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:2:23-3:3:24", + "value": [ + { + "string": "1", + "raw_string": "1" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,3:5:26-5:2:65", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:4:32-4:34:62", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:11:39", + "src": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:6:34", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:9:37-4:11:39", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:10:38-4:11:39", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:12:40-4:15:43", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:16:44-4:29:57", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:16:44-4:21:49", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:22:50-4:29:57", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:31:59-4:34:62", + "raw": "0.1", + "value": "1/10" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + }, + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": { + "opacity": { + "value": "0.1" + } + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "a", + "id_val": "a", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:5:33-4:6:34", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:9:37-4:11:39", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/scenarios_edge_index.d2,4:10:38-4:11:39", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + } + ] + }, + "err": null +} diff --git a/testdata/d2ir/TestCompile/scenarios/edge.exp.json b/testdata/d2ir/TestCompile/scenarios/edge.exp.json new file mode 100644 index 000000000..e73a9415b --- /dev/null +++ b/testdata/d2ir/TestCompile/scenarios/edge.exp.json @@ -0,0 +1,1762 @@ +{ + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "scenarios", + "composite": { + "fields": [ + { + "name": "1", + "composite": { + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + } + ] + }, + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0 + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "opacity", + "primary": { + "value": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + }, + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + } + ] + } + ] + }, + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "value": [ + { + "string": "1", + "raw_string": "1" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "value": [ + { + "string": "1", + "raw_string": "1" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-4:3:65", + "key": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "value": [ + { + "string": "1", + "raw_string": "1" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/scenarios/edge.d2,2:5:25-4:2:64", + "nodes": [ + { + "map_key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/scenarios/edge.d2,1:0:7-1:9:16", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,1:0:7-1:9:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,1:0:7-1:9:16", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/scenarios/edge.d2,1:0:7-5:1:67", + "key": { + "range": "TestCompile/scenarios/edge.d2,1:0:7-1:9:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,1:0:7-1:9:16", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/scenarios/edge.d2,1:11:18-5:0:66", + "nodes": [ + { + "map_key": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-4:3:65", + "key": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,2:2:22-2:3:23", + "value": [ + { + "string": "1", + "raw_string": "1" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/scenarios/edge.d2,2:5:25-4:2:64", + "nodes": [ + { + "map_key": { + "range": "TestCompile/scenarios/edge.d2,3:4:31-3:34:61", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:11:38", + "src": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:7:34", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,3:9:36-3:11:38", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/scenarios/edge.d2,3:12:39-3:15:42", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:29:56", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:16:43-3:21:48", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,3:22:49-3:29:56", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/scenarios/edge.d2,3:31:58-3:34:61", + "raw": "0.1", + "value": "1/10" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +}