diff --git a/d2layouts/d2near/layout.go b/d2layouts/d2near/layout.go index 183b8dadc..747a0b1be 100644 --- a/d2layouts/d2near/layout.go +++ b/d2layouts/d2near/layout.go @@ -93,25 +93,67 @@ func place(obj *d2graph.Object) (float64, float64) { tl, br := boundingBox(obj.Graph) w := br.X - tl.X h := br.Y - tl.Y + + var x, y float64 switch d2graph.Key(obj.Attributes.NearKey)[0] { case "top-left": - return tl.X - obj.Width - pad, tl.Y - obj.Height - pad + x, y = tl.X-obj.Width-pad, tl.Y-obj.Height-pad + break case "top-center": - return tl.X + w/2 - obj.Width/2, tl.Y - obj.Height - pad + x, y = tl.X+w/2-obj.Width/2, tl.Y-obj.Height-pad + break case "top-right": - return br.X + pad, tl.Y - obj.Height - pad + x, y = br.X+pad, tl.Y-obj.Height-pad + break case "center-left": - return tl.X - obj.Width - pad, tl.Y + h/2 - obj.Height/2 + x, y = tl.X-obj.Width-pad, tl.Y+h/2-obj.Height/2 + break case "center-right": - return br.X + pad, tl.Y + h/2 - obj.Height/2 + x, y = br.X+pad, tl.Y+h/2-obj.Height/2 + break case "bottom-left": - return tl.X - obj.Width - pad, br.Y + pad + x, y = tl.X-obj.Width-pad, br.Y+pad + break case "bottom-center": - return br.X - w/2 - obj.Width/2, br.Y + pad + x, y = br.X-w/2-obj.Width/2, br.Y+pad + break case "bottom-right": - return br.X + pad, br.Y + pad + x, y = br.X+pad, br.Y+pad + break } - return 0, 0 + + return calcLabelDimension(obj, x, y) +} + +func calcLabelDimension(obj *d2graph.Object, x float64, y float64) (float64, float64) { + var position string + if obj.LabelPosition != nil { + if strings.Contains(*obj.LabelPosition, "INSIDE") { + return x, y + } + if strings.Contains(*obj.LabelPosition, "_TOP_") { + position = "TOP" + } else if strings.Contains(*obj.LabelPosition, "_LEFT_") { + position = "LEFT" + } else if strings.Contains(*obj.LabelPosition, "_RIGHT_") { + position = "RIGHT" + } else if strings.Contains(*obj.LabelPosition, "_BOTTOM_") { + position = "BOTTOM" + } + + switch position { + case "TOP": + return x, y - float64(*obj.LabelHeight) + case "BOTTOM": + return x, y + float64(*obj.LabelHeight) + case "LEFT": + return x - float64(*obj.LabelWidth), y + case "RIGHT": + return x + float64(*obj.LabelWidth), y + } + } + + return x, y } // WithoutConstantNears plucks out the graph objects which have "near" set to a constant value diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index d843aaf25..5b8594221 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -1921,576 +1921,6 @@ i am bottom left: { shape: text; near: bottom-left } i am bottom right: { shape: text; near: bottom-right } `, }, - { - name: "constant_near_title", - script: `title: |md - # A winning strategy -| { near: top-center } - -poll the people -> results -results -> unfavorable -> poll the people -results -> favorable -> will of the people -`, - }, - { - name: "text_font_sizes", - script: `bear: { shape: text; style.font-size: 22; style.bold: true } -mama bear: { shape: text; style.font-size: 28; style.italic: true } -papa bear: { shape: text; style.font-size: 32; style.underline: true } -mama bear -> bear -papa bear -> bear -`, - }, - { - name: "tooltips", - script: `x: { tooltip: Total abstinence is easier than perfect moderation } -y: { tooltip: Gee, I feel kind of LIGHT in the head now,\nknowing I can't make my satellite dish PAYMENTS! } -x -> y -`, - }, - { - name: "links", - script: `x: { link: https://d2lang.com } - y: { link: https://terrastruct.com; tooltip: Gee, I feel kind of LIGHT in the head now,\nknowing I can't make my satellite dish PAYMENTS! } -x -> y -`, - }, - { - name: "unnamed_only_width", - script: ` - -class -> users -> code -> package -> no width - -class: "" { - shape: class - -num: int - -timeout: int - -pid - - +getStatus(): Enum - +getJobs(): "Job[]" - +setTimeout(seconds int) -} - -users: "" { - shape: sql_table - id: int - name: string - email: string - password: string - last_login: datetime -} - -code: |go - a := 5 - b := a + 7 - fmt.Printf("%d", b) -| - -package: "" { shape: package } -no width: "" - - -class.width: 512 -users.width: 512 -code.width: 512 -package.width: 512 -`, - }, - { - name: "unnamed_only_height", - script: ` - -class -> users -> code -> package -> no height - -class: "" { - shape: class - -num: int - -timeout: int - -pid - - +getStatus(): Enum - +getJobs(): "Job[]" - +setTimeout(seconds int) -} - -users: "" { - shape: sql_table - id: int - name: string - email: string - password: string - last_login: datetime -} - -code: |go - a := 5 - b := a + 7 - fmt.Printf("%d", b) -| - -package: "" { shape: package } -no height: "" - - -class.height: 512 -users.height: 512 -code.height: 512 -package.height: 512 -`, - }, - { - name: "container_dimensions", - script: `a: { - width: 500 - b -> c - b.width: 400 - c.width: 600 -} - -b: { - width: 700 - b -> c - e: { - height: 300 - } -} - -c: { - width: 200 - height: 300 - a -} -`, - dagreFeatureError: `Object "a" has attribute "width" and/or "height" set, but layout engine "dagre" does not support dimensions set on containers.`, - }, - { - name: "crow_foot_arrowhead", - script: ` -a1 <-> b1: { - style.stroke-width: 1 - source-arrowhead: { - shape: cf-many - } - target-arrowhead: { - shape: cf-many - } -} -a2 <-> b2: { - style.stroke-width: 3 - source-arrowhead: { - shape: cf-many - } - target-arrowhead: { - shape: cf-many - } -} -a3 <-> b3: { - style.stroke-width: 6 - source-arrowhead: { - shape: cf-many - } - target-arrowhead: { - shape: cf-many - } -} - -c1 <-> d1: { - style.stroke-width: 1 - source-arrowhead: { - shape: cf-many-required - } - target-arrowhead: { - shape: cf-many-required - } -} -c2 <-> d2: { - style.stroke-width: 3 - source-arrowhead: { - shape: cf-many-required - } - target-arrowhead: { - shape: cf-many-required - } -} -c3 <-> d3: { - style.stroke-width: 6 - source-arrowhead: { - shape: cf-many-required - } - target-arrowhead: { - shape: cf-many-required - } -} - -e1 <-> f1: { - style.stroke-width: 1 - source-arrowhead: { - shape: cf-one - } - target-arrowhead: { - shape: cf-one - } -} -e2 <-> f2: { - style.stroke-width: 3 - source-arrowhead: { - shape: cf-one - } - target-arrowhead: { - shape: cf-one - } -} -e3 <-> f3: { - style.stroke-width: 6 - source-arrowhead: { - shape: cf-one - } - target-arrowhead: { - shape: cf-one - } -} - -g1 <-> h1: { - style.stroke-width: 1 - source-arrowhead: { - shape: cf-one-required - } - target-arrowhead: { - shape: cf-one-required - } -} -g2 <-> h2: { - style.stroke-width: 3 - source-arrowhead: { - shape: cf-one-required - } - target-arrowhead: { - shape: cf-one-required - } -} -g3 <-> h3: { - style.stroke-width: 6 - source-arrowhead: { - shape: cf-one-required - } - target-arrowhead: { - shape: cf-one-required - } -} - -c <-> d <-> f: { - style.stroke-width: 1 - style.stroke: "orange" - source-arrowhead: { - shape: cf-many-required - } - target-arrowhead: { - shape: cf-one - } -} -`, - }, - { - name: "circle_arrowhead", - script: ` -a <-> b: circle { - source-arrowhead: { - shape: circle - } - target-arrowhead: { - shape: circle - } -} - -c <-> d: filled-circle { - source-arrowhead: { - shape: circle - style.filled: true - } - target-arrowhead: { - shape: circle - style.filled: true - } -}`, - }, - { - name: "animated", - script: ` -your love life will be -> happy: { style.animated: true } -your love life will be -> harmonious: { style.animated: true } - -boredom <- immortality: { style.animated: true } - -Friday <-> Monday: { style.animated: true } - -Insomnia -- Sleep: { style.animated: true } -Insomnia -- Wake: { - style: { - animated: true - stroke-width: 2 - } -} - -Insomnia -- Dream: { - style: { - animated: true - stroke-width: 8 - } -} - -Listen <-> Talk: { - style.animated: true - source-arrowhead.shape: cf-one - target-arrowhead.shape: diamond - label: hear -} -`, - }, - { - name: "sql_table_tooltip_animated", - script: ` -x: { - shape: sql_table - y - tooltip: I like turtles -} - -a: { - shape: sql_table - b -} - -x.y -> a.b: { - style.animated: true - target-arrowhead.shape: cf-many -} -`, - }, - { - name: "sql_table_column_styles", - script: `Humor in the Court: { - shape: sql_table - Could you see him from where you were standing?: "I could see his head." - And where was his head?: Just above his shoulders. - style.fill: red - style.stroke: lightgray - style.font-color: orange - style.font-size: 20 -} - -Humor in the Court2: { - shape: sql_table - Could you see him from where you were standing?: "I could see his head." - And where was his head?: Just above his shoulders. - style.fill: red - style.stroke: lightgray - style.font-color: orange - style.font-size: 30 -} - -manager: BatchManager { - shape: class - style.font-size: 20 - - -num: int - -timeout: int - -pid - - +getStatus(): Enum - +getJobs(): "Job[]" - +setTimeout(seconds int) -} - -manager2: BatchManager { - shape: class - style.font-size: 30 - - -num: int - -timeout: int - -pid - - +getStatus(): Enum - +getJobs(): "Job[]" - +setTimeout(seconds int) -} -`, - }, - { - name: "near-alone", - script: ` -x: { - near: top-center -} -y: { - near: bottom-center -} -z: { - near: center-left -} -`, - }, - { - name: "border-radius", - script: ` -x: { - style.border-radius: 4 -} -y: { - style.border-radius: 10 -} -multiple2: { - style.border-radius: 6 - style.multiple: true -} -double: { - style.border-radius: 6 - style.double-border: true -} -three-dee: { - style.border-radius: 6 - style.3d: true -} -`, - }, - { - name: "sequence-inter-span-self", - script: ` -shape: sequence_diagram -a: A -b: B - -a.sp1 -> b: foo -a.sp1 -> a.sp2: redirect -a.sp2 -> b: bar -`, - }, - { - name: "people", - script: ` -a.shape: person -b.shape: person -c.shape: person -d.shape: person -e.shape: person -f.shape: person -g.shape: person - -a: - -b: -- -c: ---- -d: -------- -e: ---------------- -f: -------------------------------- -g: ---------------------------------------------------------------- - -1.shape: person -2.shape: person -3.shape: person -4.shape: person -5.shape: person - -1.width: 16 -2.width: 64 -3.width: 128 -4.width: 512 - -# entering both width and height overrides aspect ratio limit -5.height: 256 -5.width: 32 -`, - }, - { - name: "ovals", - script: ` -a.shape: oval -b.shape: oval -c.shape: oval -d.shape: oval -e.shape: oval -f.shape: oval -g.shape: oval - -a: - -b: -- -c: ---- -d: -------- -e: ---------------- -f: -------------------------------- -g: ---------------------------------------------------------------- - -1.shape: oval -2.shape: oval -3.shape: oval -4.shape: oval -5.shape: oval - -1.width: 16 -2.width: 64 -3.width: 128 -4.width: 512 - -# entering both width and height overrides aspect ratio limit -5.height: 256 -5.width: 32 -`, - }, - { - name: "complex-layers", - script: ` -desc: Multi-layer diagram of a home. - -window: { - style.double-border: true -} -roof -garage - -layers: { - window: { - blinds - glass - } - roof: { - shingles - starlink - utility hookup - } - garage: { - tools - vehicles - } - repair: { - desc: How to repair a home. - - steps: { - 1: { - find contractors: { - craigslist - facebook - } - } - 2: { - find contractors -> solicit quotes - } - 3: { - obtain quotes -> negotiate - } - 4: { - negotiate -> book the best bid - } - } - } -} - -scenarios: { - storm: { - water - rain - thunder - } -}`, - }, } runa(t, tcs) diff --git a/e2etests/testdata/stable/constant_near_stress/dagre/board.exp.json b/e2etests/testdata/stable/constant_near_stress/dagre/board.exp.json index 5b41f8c97..cafa765c0 100644 --- a/e2etests/testdata/stable/constant_near_stress/dagre/board.exp.json +++ b/e2etests/testdata/stable/constant_near_stress/dagre/board.exp.json @@ -170,7 +170,7 @@ "type": "person", "pos": { "x": -508, - "y": 83 + "y": 104 }, "width": 44, "height": 66, @@ -211,7 +211,7 @@ "type": "person", "pos": { "x": 518, - "y": 83 + "y": 104 }, "width": 65, "height": 66, diff --git a/e2etests/testdata/stable/constant_near_stress/dagre/sketch.exp.svg b/e2etests/testdata/stable/constant_near_stress/dagre/sketch.exp.svg index 7f6cf158c..62f1a6897 100644 --- a/e2etests/testdata/stable/constant_near_stress/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/constant_near_stress/dagre/sketch.exp.svg @@ -1,16 +1,16 @@ -xyThe top of the mountain

Cats, no less liquid than their shadows, offer no angles to the wind.

If we can't fix it, it ain't broke.

Dieters live life in the fasting lane.

-
JoeDonaldi am top lefti am top righti am bottom lefti am bottom right +JoeDonaldi am top lefti am top righti am bottom lefti am bottom right
\ No newline at end of file diff --git a/e2etests/testdata/stable/constant_near_stress/elk/board.exp.json b/e2etests/testdata/stable/constant_near_stress/elk/board.exp.json index 340654717..cc89d016a 100644 --- a/e2etests/testdata/stable/constant_near_stress/elk/board.exp.json +++ b/e2etests/testdata/stable/constant_near_stress/elk/board.exp.json @@ -170,7 +170,7 @@ "type": "person", "pos": { "x": -496, - "y": 80 + "y": 101 }, "width": 44, "height": 66, @@ -211,7 +211,7 @@ "type": "person", "pos": { "x": 530, - "y": 80 + "y": 101 }, "width": 65, "height": 66, diff --git a/e2etests/testdata/stable/constant_near_stress/elk/sketch.exp.svg b/e2etests/testdata/stable/constant_near_stress/elk/sketch.exp.svg index 85d7b032e..16049be97 100644 --- a/e2etests/testdata/stable/constant_near_stress/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/constant_near_stress/elk/sketch.exp.svg @@ -1,16 +1,16 @@ -xyThe top of the mountain

Cats, no less liquid than their shadows, offer no angles to the wind.

If we can't fix it, it ain't broke.

Dieters live life in the fasting lane.

-
JoeDonaldi am top lefti am top righti am bottom lefti am bottom right +JoeDonaldi am top lefti am top righti am bottom lefti am bottom right
\ No newline at end of file diff --git a/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json b/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json index b8cdf7a2e..61ddbe7b4 100644 --- a/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json +++ b/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json @@ -8,7 +8,7 @@ "type": "rectangle", "pos": { "x": -123, - "y": 20 + "y": -16 }, "width": 247, "height": 291, @@ -49,7 +49,7 @@ "type": "rectangle", "pos": { "x": -83, - "y": 49 + "y": 13 }, "width": 53, "height": 66, @@ -90,7 +90,7 @@ "type": "rectangle", "pos": { "x": -83, - "y": 215 + "y": 179 }, "width": 53, "height": 66, @@ -131,7 +131,7 @@ "type": "rectangle", "pos": { "x": 30, - "y": 49 + "y": 13 }, "width": 53, "height": 66, @@ -172,7 +172,7 @@ "type": "rectangle", "pos": { "x": 29, - "y": 215 + "y": 179 }, "width": 54, "height": 66, @@ -213,7 +213,7 @@ "type": "rectangle", "pos": { "x": -86, - "y": -245 + "y": -281 }, "width": 173, "height": 225, @@ -254,7 +254,7 @@ "type": "rectangle", "pos": { "x": -66, - "y": -179 + "y": -215 }, "width": 133, "height": 130, @@ -295,7 +295,7 @@ "type": "rectangle", "pos": { "x": -26, - "y": -147 + "y": -183 }, "width": 53, "height": 66, @@ -336,7 +336,7 @@ "type": "rectangle", "pos": { "x": -390, - "y": -526 + "y": -598 }, "width": 247, "height": 291, @@ -377,7 +377,7 @@ "type": "rectangle", "pos": { "x": -350, - "y": -497 + "y": -569 }, "width": 53, "height": 66, @@ -418,7 +418,7 @@ "type": "rectangle", "pos": { "x": -350, - "y": -331 + "y": -403 }, "width": 53, "height": 66, @@ -459,7 +459,7 @@ "type": "rectangle", "pos": { "x": -236, - "y": -497 + "y": -569 }, "width": 53, "height": 66, @@ -500,7 +500,7 @@ "type": "rectangle", "pos": { "x": -237, - "y": -331 + "y": -403 }, "width": 54, "height": 66, @@ -541,7 +541,7 @@ "type": "rectangle", "pos": { "x": 143, - "y": -526 + "y": -598 }, "width": 247, "height": 291, @@ -582,7 +582,7 @@ "type": "rectangle", "pos": { "x": 183, - "y": -497 + "y": -569 }, "width": 53, "height": 66, @@ -623,7 +623,7 @@ "type": "rectangle", "pos": { "x": 183, - "y": -331 + "y": -403 }, "width": 53, "height": 66, @@ -664,7 +664,7 @@ "type": "rectangle", "pos": { "x": 297, - "y": -497 + "y": -569 }, "width": 53, "height": 66, @@ -705,7 +705,7 @@ "type": "rectangle", "pos": { "x": 296, - "y": -331 + "y": -403 }, "width": 54, "height": 66, @@ -771,19 +771,19 @@ "route": [ { "x": -57, - "y": 115.5 + "y": 79.5 }, { "x": -57, - "y": 155.5 + "y": 119.5 }, { "x": -57, - "y": 175.5 + "y": 139.5 }, { "x": -57, - "y": 215.5 + "y": 179.5 } ], "isCurve": true, @@ -820,19 +820,19 @@ "route": [ { "x": 56.5, - "y": 115.5 + "y": 79.5 }, { "x": 56.5, - "y": 155.5 + "y": 119.5 }, { "x": 56.5, - "y": 175.5 + "y": 139.5 }, { "x": 56.5, - "y": 215.5 + "y": 179.5 } ], "isCurve": true, @@ -869,19 +869,19 @@ "route": [ { "x": -324, - "y": -431 + "y": -503 }, { "x": -324, - "y": -391 + "y": -463 }, { "x": -324, - "y": -371 + "y": -443 }, { "x": -324, - "y": -331 + "y": -403 } ], "isCurve": true, @@ -918,19 +918,19 @@ "route": [ { "x": -210.5, - "y": -431 + "y": -503 }, { "x": -210.5, - "y": -391 + "y": -463 }, { "x": -210.5, - "y": -371 + "y": -443 }, { "x": -210.5, - "y": -331 + "y": -403 } ], "isCurve": true, @@ -967,19 +967,19 @@ "route": [ { "x": 210, - "y": -431 + "y": -503 }, { "x": 210, - "y": -391 + "y": -463 }, { "x": 210, - "y": -371 + "y": -443 }, { "x": 210, - "y": -331 + "y": -403 } ], "isCurve": true, @@ -1016,19 +1016,19 @@ "route": [ { "x": 323.5, - "y": -431 + "y": -503 }, { "x": 323.5, - "y": -391 + "y": -463 }, { "x": 323.5, - "y": -371 + "y": -443 }, { "x": 323.5, - "y": -331 + "y": -403 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg b/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg index d45f9472d..e4cd7b3ab 100644 --- a/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg @@ -1,16 +1,16 @@ -zaxyabcdbabcdabcdc - + .d2-2153435409 .fill-N1{fill:#0A0F25;} + .d2-2153435409 .fill-N2{fill:#676C7E;} + .d2-2153435409 .fill-N3{fill:#9499AB;} + .d2-2153435409 .fill-N4{fill:#CFD2DD;} + .d2-2153435409 .fill-N5{fill:#DEE1EB;} + .d2-2153435409 .fill-N6{fill:#EEF1F8;} + .d2-2153435409 .fill-N7{fill:#FFFFFF;} + .d2-2153435409 .fill-B1{fill:#0D32B2;} + .d2-2153435409 .fill-B2{fill:#0D32B2;} + .d2-2153435409 .fill-B3{fill:#E3E9FD;} + .d2-2153435409 .fill-B4{fill:#E3E9FD;} + .d2-2153435409 .fill-B5{fill:#EDF0FD;} + .d2-2153435409 .fill-B6{fill:#F7F8FE;} + .d2-2153435409 .fill-AA2{fill:#4A6FF3;} + .d2-2153435409 .fill-AA4{fill:#EDF0FD;} + .d2-2153435409 .fill-AA5{fill:#F7F8FE;} + .d2-2153435409 .fill-AB4{fill:#EDF0FD;} + .d2-2153435409 .fill-AB5{fill:#F7F8FE;} + .d2-2153435409 .stroke-N1{stroke:#0A0F25;} + .d2-2153435409 .stroke-N2{stroke:#676C7E;} + .d2-2153435409 .stroke-N3{stroke:#9499AB;} + .d2-2153435409 .stroke-N4{stroke:#CFD2DD;} + .d2-2153435409 .stroke-N5{stroke:#DEE1EB;} + .d2-2153435409 .stroke-N6{stroke:#EEF1F8;} + .d2-2153435409 .stroke-N7{stroke:#FFFFFF;} + .d2-2153435409 .stroke-B1{stroke:#0D32B2;} + .d2-2153435409 .stroke-B2{stroke:#0D32B2;} + .d2-2153435409 .stroke-B3{stroke:#E3E9FD;} + .d2-2153435409 .stroke-B4{stroke:#E3E9FD;} + .d2-2153435409 .stroke-B5{stroke:#EDF0FD;} + .d2-2153435409 .stroke-B6{stroke:#F7F8FE;} + .d2-2153435409 .stroke-AA2{stroke:#4A6FF3;} + .d2-2153435409 .stroke-AA4{stroke:#EDF0FD;} + .d2-2153435409 .stroke-AA5{stroke:#F7F8FE;} + .d2-2153435409 .stroke-AB4{stroke:#EDF0FD;} + .d2-2153435409 .stroke-AB5{stroke:#F7F8FE;} + .d2-2153435409 .background-color-N1{background-color:#0A0F25;} + .d2-2153435409 .background-color-N2{background-color:#676C7E;} + .d2-2153435409 .background-color-N3{background-color:#9499AB;} + .d2-2153435409 .background-color-N4{background-color:#CFD2DD;} + .d2-2153435409 .background-color-N5{background-color:#DEE1EB;} + .d2-2153435409 .background-color-N6{background-color:#EEF1F8;} + .d2-2153435409 .background-color-N7{background-color:#FFFFFF;} + .d2-2153435409 .background-color-B1{background-color:#0D32B2;} + .d2-2153435409 .background-color-B2{background-color:#0D32B2;} + .d2-2153435409 .background-color-B3{background-color:#E3E9FD;} + .d2-2153435409 .background-color-B4{background-color:#E3E9FD;} + .d2-2153435409 .background-color-B5{background-color:#EDF0FD;} + .d2-2153435409 .background-color-B6{background-color:#F7F8FE;} + .d2-2153435409 .background-color-AA2{background-color:#4A6FF3;} + .d2-2153435409 .background-color-AA4{background-color:#EDF0FD;} + .d2-2153435409 .background-color-AA5{background-color:#F7F8FE;} + .d2-2153435409 .background-color-AB4{background-color:#EDF0FD;} + .d2-2153435409 .background-color-AB5{background-color:#F7F8FE;} + .d2-2153435409 .color-N1{color:#0A0F25;} + .d2-2153435409 .color-N2{color:#676C7E;} + .d2-2153435409 .color-N3{color:#9499AB;} + .d2-2153435409 .color-N4{color:#CFD2DD;} + .d2-2153435409 .color-N5{color:#DEE1EB;} + .d2-2153435409 .color-N6{color:#EEF1F8;} + .d2-2153435409 .color-N7{color:#FFFFFF;} + .d2-2153435409 .color-B1{color:#0D32B2;} + .d2-2153435409 .color-B2{color:#0D32B2;} + .d2-2153435409 .color-B3{color:#E3E9FD;} + .d2-2153435409 .color-B4{color:#E3E9FD;} + .d2-2153435409 .color-B5{color:#EDF0FD;} + .d2-2153435409 .color-B6{color:#F7F8FE;} + .d2-2153435409 .color-AA2{color:#4A6FF3;} + .d2-2153435409 .color-AA4{color:#EDF0FD;} + .d2-2153435409 .color-AA5{color:#F7F8FE;} + .d2-2153435409 .color-AB4{color:#EDF0FD;} + .d2-2153435409 .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}]]>zaxyabcdbabcdabcdc + \ No newline at end of file diff --git a/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json b/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json index cd6e34370..dc910ddbb 100644 --- a/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json +++ b/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json @@ -8,7 +8,7 @@ "type": "rectangle", "pos": { "x": -113, - "y": 20 + "y": -16 }, "width": 227, "height": 302, @@ -49,7 +49,7 @@ "type": "rectangle", "pos": { "x": -63, - "y": 70 + "y": 34 }, "width": 53, "height": 66, @@ -90,7 +90,7 @@ "type": "rectangle", "pos": { "x": -63, - "y": 206 + "y": 170 }, "width": 53, "height": 66, @@ -131,7 +131,7 @@ "type": "rectangle", "pos": { "x": 10, - "y": 70 + "y": 34 }, "width": 53, "height": 66, @@ -172,7 +172,7 @@ "type": "rectangle", "pos": { "x": 9, - "y": 206 + "y": 170 }, "width": 54, "height": 66, @@ -213,7 +213,7 @@ "type": "rectangle", "pos": { "x": -126, - "y": -286 + "y": -322 }, "width": 253, "height": 266, @@ -254,7 +254,7 @@ "type": "rectangle", "pos": { "x": -76, - "y": -236 + "y": -272 }, "width": 153, "height": 166, @@ -295,7 +295,7 @@ "type": "rectangle", "pos": { "x": -26, - "y": -186 + "y": -222 }, "width": 53, "height": 66, @@ -336,7 +336,7 @@ "type": "rectangle", "pos": { "x": -373, - "y": -558 + "y": -630 }, "width": 227, "height": 302, @@ -377,7 +377,7 @@ "type": "rectangle", "pos": { "x": -323, - "y": -508 + "y": -580 }, "width": 53, "height": 66, @@ -418,7 +418,7 @@ "type": "rectangle", "pos": { "x": -323, - "y": -372 + "y": -444 }, "width": 53, "height": 66, @@ -459,7 +459,7 @@ "type": "rectangle", "pos": { "x": -250, - "y": -508 + "y": -580 }, "width": 53, "height": 66, @@ -500,7 +500,7 @@ "type": "rectangle", "pos": { "x": -250, - "y": -372 + "y": -444 }, "width": 54, "height": 66, @@ -541,7 +541,7 @@ "type": "rectangle", "pos": { "x": 146, - "y": -558 + "y": -630 }, "width": 227, "height": 302, @@ -582,7 +582,7 @@ "type": "rectangle", "pos": { "x": 196, - "y": -508 + "y": -580 }, "width": 53, "height": 66, @@ -623,7 +623,7 @@ "type": "rectangle", "pos": { "x": 196, - "y": -372 + "y": -444 }, "width": 53, "height": 66, @@ -664,7 +664,7 @@ "type": "rectangle", "pos": { "x": 270, - "y": -508 + "y": -580 }, "width": 53, "height": 66, @@ -705,7 +705,7 @@ "type": "rectangle", "pos": { "x": 269, - "y": -372 + "y": -444 }, "width": 54, "height": 66, @@ -771,11 +771,11 @@ "route": [ { "x": -37, - "y": 136 + "y": 100 }, { "x": -37, - "y": 206 + "y": 170 } ], "animated": false, @@ -811,11 +811,11 @@ "route": [ { "x": 36.5, - "y": 136 + "y": 100 }, { "x": 36.5, - "y": 206 + "y": 170 } ], "animated": false, @@ -851,11 +851,11 @@ "route": [ { "x": -297, - "y": -442 + "y": -514 }, { "x": -297, - "y": -372 + "y": -444 } ], "animated": false, @@ -891,11 +891,11 @@ "route": [ { "x": -223.5, - "y": -442 + "y": -514 }, { "x": -223.5, - "y": -372 + "y": -444 } ], "animated": false, @@ -931,11 +931,11 @@ "route": [ { "x": 223, - "y": -442 + "y": -514 }, { "x": 223, - "y": -372 + "y": -444 } ], "animated": false, @@ -971,11 +971,11 @@ "route": [ { "x": 296.5, - "y": -442 + "y": -514 }, { "x": 296.5, - "y": -372 + "y": -444 } ], "animated": false, diff --git a/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg b/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg index 697c8220e..2f3211cd1 100644 --- a/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg @@ -1,16 +1,16 @@ -zaxyabcdbabcdabcdc - + .d2-2351067076 .fill-N1{fill:#0A0F25;} + .d2-2351067076 .fill-N2{fill:#676C7E;} + .d2-2351067076 .fill-N3{fill:#9499AB;} + .d2-2351067076 .fill-N4{fill:#CFD2DD;} + .d2-2351067076 .fill-N5{fill:#DEE1EB;} + .d2-2351067076 .fill-N6{fill:#EEF1F8;} + .d2-2351067076 .fill-N7{fill:#FFFFFF;} + .d2-2351067076 .fill-B1{fill:#0D32B2;} + .d2-2351067076 .fill-B2{fill:#0D32B2;} + .d2-2351067076 .fill-B3{fill:#E3E9FD;} + .d2-2351067076 .fill-B4{fill:#E3E9FD;} + .d2-2351067076 .fill-B5{fill:#EDF0FD;} + .d2-2351067076 .fill-B6{fill:#F7F8FE;} + .d2-2351067076 .fill-AA2{fill:#4A6FF3;} + .d2-2351067076 .fill-AA4{fill:#EDF0FD;} + .d2-2351067076 .fill-AA5{fill:#F7F8FE;} + .d2-2351067076 .fill-AB4{fill:#EDF0FD;} + .d2-2351067076 .fill-AB5{fill:#F7F8FE;} + .d2-2351067076 .stroke-N1{stroke:#0A0F25;} + .d2-2351067076 .stroke-N2{stroke:#676C7E;} + .d2-2351067076 .stroke-N3{stroke:#9499AB;} + .d2-2351067076 .stroke-N4{stroke:#CFD2DD;} + .d2-2351067076 .stroke-N5{stroke:#DEE1EB;} + .d2-2351067076 .stroke-N6{stroke:#EEF1F8;} + .d2-2351067076 .stroke-N7{stroke:#FFFFFF;} + .d2-2351067076 .stroke-B1{stroke:#0D32B2;} + .d2-2351067076 .stroke-B2{stroke:#0D32B2;} + .d2-2351067076 .stroke-B3{stroke:#E3E9FD;} + .d2-2351067076 .stroke-B4{stroke:#E3E9FD;} + .d2-2351067076 .stroke-B5{stroke:#EDF0FD;} + .d2-2351067076 .stroke-B6{stroke:#F7F8FE;} + .d2-2351067076 .stroke-AA2{stroke:#4A6FF3;} + .d2-2351067076 .stroke-AA4{stroke:#EDF0FD;} + .d2-2351067076 .stroke-AA5{stroke:#F7F8FE;} + .d2-2351067076 .stroke-AB4{stroke:#EDF0FD;} + .d2-2351067076 .stroke-AB5{stroke:#F7F8FE;} + .d2-2351067076 .background-color-N1{background-color:#0A0F25;} + .d2-2351067076 .background-color-N2{background-color:#676C7E;} + .d2-2351067076 .background-color-N3{background-color:#9499AB;} + .d2-2351067076 .background-color-N4{background-color:#CFD2DD;} + .d2-2351067076 .background-color-N5{background-color:#DEE1EB;} + .d2-2351067076 .background-color-N6{background-color:#EEF1F8;} + .d2-2351067076 .background-color-N7{background-color:#FFFFFF;} + .d2-2351067076 .background-color-B1{background-color:#0D32B2;} + .d2-2351067076 .background-color-B2{background-color:#0D32B2;} + .d2-2351067076 .background-color-B3{background-color:#E3E9FD;} + .d2-2351067076 .background-color-B4{background-color:#E3E9FD;} + .d2-2351067076 .background-color-B5{background-color:#EDF0FD;} + .d2-2351067076 .background-color-B6{background-color:#F7F8FE;} + .d2-2351067076 .background-color-AA2{background-color:#4A6FF3;} + .d2-2351067076 .background-color-AA4{background-color:#EDF0FD;} + .d2-2351067076 .background-color-AA5{background-color:#F7F8FE;} + .d2-2351067076 .background-color-AB4{background-color:#EDF0FD;} + .d2-2351067076 .background-color-AB5{background-color:#F7F8FE;} + .d2-2351067076 .color-N1{color:#0A0F25;} + .d2-2351067076 .color-N2{color:#676C7E;} + .d2-2351067076 .color-N3{color:#9499AB;} + .d2-2351067076 .color-N4{color:#CFD2DD;} + .d2-2351067076 .color-N5{color:#DEE1EB;} + .d2-2351067076 .color-N6{color:#EEF1F8;} + .d2-2351067076 .color-N7{color:#FFFFFF;} + .d2-2351067076 .color-B1{color:#0D32B2;} + .d2-2351067076 .color-B2{color:#0D32B2;} + .d2-2351067076 .color-B3{color:#E3E9FD;} + .d2-2351067076 .color-B4{color:#E3E9FD;} + .d2-2351067076 .color-B5{color:#EDF0FD;} + .d2-2351067076 .color-B6{color:#F7F8FE;} + .d2-2351067076 .color-AA2{color:#4A6FF3;} + .d2-2351067076 .color-AA4{color:#EDF0FD;} + .d2-2351067076 .color-AA5{color:#F7F8FE;} + .d2-2351067076 .color-AB4{color:#EDF0FD;} + .d2-2351067076 .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}]]>zaxyabcdbabcdabcdc + \ No newline at end of file