Merge pull request #687 from alixander/near-panic

fix panic when solo near keyword
This commit is contained in:
Alexander Wang 2023-01-19 15:18:16 -08:00 committed by GitHub
commit 69823d1a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 513 additions and 129 deletions

View file

@ -23,3 +23,4 @@
- Icon URLs that needed escaping (e.g. with ampersands) are handled correctly by CLI. [#666](https://github.com/terrastruct/d2/pull/666) - Icon URLs that needed escaping (e.g. with ampersands) are handled correctly by CLI. [#666](https://github.com/terrastruct/d2/pull/666)
- Fixes markdown shapes being slightly too short for their text in some cases. [#665](https://github.com/terrastruct/d2/pull/665) - Fixes markdown shapes being slightly too short for their text in some cases. [#665](https://github.com/terrastruct/d2/pull/665)
- Fixes self-connections inside layouts when using ELK. [#676](https://github.com/terrastruct/d2/pull/676) - Fixes self-connections inside layouts when using ELK. [#676](https://github.com/terrastruct/d2/pull/676)
- Fixes panic when the only diagram object has `near` set to a constant. [#687](https://github.com/terrastruct/d2/pull/687)

View file

@ -27,12 +27,12 @@ func Layout(ctx context.Context, g *d2graph.Graph, constantNears []*d2graph.Obje
// So place the center ones first, then the later ones will consider them for bounding box // So place the center ones first, then the later ones will consider them for bounding box
for _, processCenters := range []bool{true, false} { for _, processCenters := range []bool{true, false} {
for _, obj := range constantNears { for _, obj := range constantNears {
if processCenters == strings.Contains(d2graph.Key(obj.Attributes.NearKey)[0], "center") { if processCenters == strings.Contains(d2graph.Key(obj.Attributes.NearKey)[0], "-center") {
obj.TopLeft = geo.NewPoint(place(obj)) obj.TopLeft = geo.NewPoint(place(obj))
} }
} }
for _, obj := range constantNears { for _, obj := range constantNears {
if processCenters == strings.Contains(d2graph.Key(obj.Attributes.NearKey)[0], "center") { if processCenters == strings.Contains(d2graph.Key(obj.Attributes.NearKey)[0], "-center") {
// The z-index for constant nears does not matter, as it will not collide // The z-index for constant nears does not matter, as it will not collide
g.Objects = append(g.Objects, obj) g.Objects = append(g.Objects, obj)
obj.Parent.Children[obj.ID] = obj obj.Parent.Children[obj.ID] = obj
@ -152,5 +152,14 @@ func boundingBox(g *d2graph.Graph) (tl, br *geo.Point) {
} }
} }
if math.IsInf(x1, 1) && math.IsInf(x2, -1) {
x1 = 0
x2 = 0
}
if math.IsInf(y1, 1) && math.IsInf(y2, -1) {
y1 = 0
y2 = 0
}
return geo.NewPoint(x1, y1), geo.NewPoint(x2, y2) return geo.NewPoint(x1, y1), geo.NewPoint(x2, y2)
} }

View file

@ -17,6 +17,7 @@ func WithoutSequenceDiagrams(ctx context.Context, g *d2graph.Graph) (map[string]
edgesToRemove := make(map[*d2graph.Edge]struct{}) edgesToRemove := make(map[*d2graph.Edge]struct{})
sequenceDiagrams := make(map[string]*sequenceDiagram) sequenceDiagrams := make(map[string]*sequenceDiagram)
if len(g.Objects) > 0 {
queue := make([]*d2graph.Object, 1, len(g.Objects)) queue := make([]*d2graph.Object, 1, len(g.Objects))
queue[0] = g.Root queue[0] = g.Root
for len(queue) > 0 { for len(queue) > 0 {
@ -56,6 +57,7 @@ func WithoutSequenceDiagrams(ctx context.Context, g *d2graph.Graph) (map[string]
objectsToRemove[obj] = struct{}{} objectsToRemove[obj] = struct{}{}
} }
} }
}
layoutEdges, edgeOrder := getLayoutEdges(g, edgesToRemove) layoutEdges, edgeOrder := getLayoutEdges(g, edgesToRemove)
g.Edges = layoutEdges g.Edges = layoutEdges

View file

@ -1815,6 +1815,20 @@ x.y -> a.b: {
style.animated: true style.animated: true
target-arrowhead.shape: cf-many target-arrowhead.shape: cf-many
} }
`,
},
{
name: "near-alone",
script: `
x: {
near: top-center
}
y: {
near: bottom-center
}
z: {
near: center-left
}
`, `,
}, },
} }

View file

@ -122,11 +122,51 @@
"zIndex": 0, "zIndex": 0,
"level": 1 "level": 1
}, },
{
"id": "bottom",
"type": "text",
"pos": {
"x": -414,
"y": 372
},
"width": 943,
"height": 131,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "transparent",
"stroke": "#0A0F25",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "# Cats, no less liquid than their shadows, offer no angles to the wind.\n\nIf we can't fix it, it ain't broke.\n\nDieters live life in the fasting lane.",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "markdown",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 943,
"labelHeight": 131,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{ {
"id": "Joe", "id": "Joe",
"type": "person", "type": "person",
"pos": { "pos": {
"x": -151, "x": -565,
"y": 113 "y": 113
}, },
"width": 131, "width": 131,
@ -166,7 +206,7 @@
"id": "Donald", "id": "Donald",
"type": "person", "type": "person",
"pos": { "pos": {
"x": 134, "x": 548,
"y": 113 "y": 113
}, },
"width": 155, "width": 155,
@ -202,46 +242,6 @@
"zIndex": 0, "zIndex": 0,
"level": 1 "level": 1
}, },
{
"id": "bottom",
"type": "text",
"pos": {
"x": -414,
"y": 372
},
"width": 943,
"height": 131,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "transparent",
"stroke": "#0A0F25",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "# Cats, no less liquid than their shadows, offer no angles to the wind.\n\nIf we can't fix it, it ain't broke.\n\nDieters live life in the fasting lane.",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "markdown",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 943,
"labelHeight": 131,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{ {
"id": "i am top left", "id": "i am top left",
"type": "text", "type": "text",

View file

@ -3,7 +3,7 @@
id="d2-svg" id="d2-svg"
style="background: white;" style="background: white;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="1410" height="748" viewBox="-643 -143 1410 748"><style type="text/css"> width="1472" height="748" viewBox="-667 -143 1472 748"><style type="text/css">
<![CDATA[ <![CDATA[
.shape { .shape {
shape-rendering: geometricPrecision; shape-rendering: geometricPrecision;
@ -796,11 +796,11 @@ width="1410" height="748" viewBox="-643 -143 1410 748"><style type="text/css">
.md .contains-task-list:dir(rtl) .task-list-item-checkbox { .md .contains-task-list:dir(rtl) .task-list-item-checkbox {
margin: 0 -1.6em 0.25em 0.2em; margin: 0 -1.6em 0.25em 0.2em;
} }
</style><g id="x"><g class="shape" ><rect x="1" y="0" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="57.500000" y="66.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="0" y="226" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="57.000000" y="292.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="The top of the mountain"><g class="shape" ></g><text class="text" x="57.000000" y="-25.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">The top of the mountain</text></g><g id="Joe"><g class="shape" ><path d="M -20 239 H -151 V 237.2093 C -151 215.7209 -136.6149 196.3488 -113.9824 187.0698 C -126.4495 179.5814 -133.9297 167.3721 -133.9297 154.0233 C -133.9297 131.3953 -112.2562 113 -85.5959 113 C -58.9356 113 -37.2621 131.3953 -37.2621 154.0233 C -37.2621 167.3721 -44.5505 179.4186 -57.2094 187.2326 C -34.5769 196.5117 -20.1918 215.8838 -20.1918 237.3721 V 239 H -20 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="-85.500000" y="179.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Joe</text></g><g id="Donald"><g class="shape" ><path d="M 289 239 H 134 V 237.2093 C 134 215.7209 151.0205 196.3488 177.7994 187.0698 C 163.0483 179.5814 154.1977 167.3721 154.1977 154.0233 C 154.1977 131.3953 179.8419 113 211.3865 113 C 242.9312 113 268.5754 131.3953 268.5754 154.0233 C 268.5754 167.3721 259.9517 179.4186 244.9736 187.2326 C 271.7525 196.5117 288.773 215.8838 288.773 237.3721 V 239 H 289 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="211.500000" y="179.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Donald</text></g><g id="bottom"><g class="shape" ></g><g><foreignObject requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" x="-414.000000" y="372.000000" width="943" height="131"><div xmlns="http://www.w3.org/1999/xhtml" class="md" style="background-color:transparent;color:#0A0F25;"><h1>Cats, no less liquid than their shadows, offer no angles to the wind.</h1> </style><g id="x"><g class="shape" ><rect x="1" y="0" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="57.500000" y="66.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="0" y="226" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="57.000000" y="292.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="The top of the mountain"><g class="shape" ></g><text class="text" x="57.000000" y="-25.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">The top of the mountain</text></g><g id="bottom"><g class="shape" ></g><g><foreignObject requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" x="-414.000000" y="372.000000" width="943" height="131"><div xmlns="http://www.w3.org/1999/xhtml" class="md" style="background-color:transparent;color:#0A0F25;"><h1>Cats, no less liquid than their shadows, offer no angles to the wind.</h1>
<p>If we can't fix it, it ain't broke.</p> <p>If we can't fix it, it ain't broke.</p>
<p>Dieters live life in the fasting lane.</p> <p>Dieters live life in the fasting lane.</p>
</div></foreignObject></g></g><g id="i am top left"><g class="shape" ></g><text class="text" x="-474.000000" y="-25.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top left</text></g><g id="i am top right"><g class="shape" ></g><text class="text" x="593.000000" y="-25.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top right</text></g><g id="i am bottom left"><g class="shape" ></g><text class="text" x="-487.500000" y="388.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom left</text></g><g id="i am bottom right"><g class="shape" ></g><text class="text" x="606.500000" y="388.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom right</text></g><g id="(x -&gt; y)[0]"><marker id="mk-3990223579" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon class="connection" fill="#0D32B2" stroke-width="2" points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" /> </marker><path d="M 57.000000 128.000000 C 57.000000 166.000000 57.000000 186.000000 57.000000 222.000000" class="connection" style="fill:none;stroke:#0D32B2;stroke-width:2;" marker-end="url(#mk-3990223579)" mask="url(#745848506)"/></g><mask id="745848506" maskUnits="userSpaceOnUse" x="-100" y="-100" width="1410" height="748"> </div></foreignObject></g></g><g id="Joe"><g class="shape" ><path d="M -434 239 H -565 V 237.2093 C -565 215.7209 -550.6149 196.3488 -527.9824 187.0698 C -540.4495 179.5814 -547.9297 167.3721 -547.9297 154.0233 C -547.9297 131.3953 -526.2562 113 -499.5959 113 C -472.9356 113 -451.2621 131.3953 -451.2621 154.0233 C -451.2621 167.3721 -458.5505 179.4186 -471.2094 187.2326 C -448.5769 196.5117 -434.1918 215.8838 -434.1918 237.3721 V 239 H -434 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="-499.500000" y="179.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Joe</text></g><g id="Donald"><g class="shape" ><path d="M 703 239 H 548 V 237.2093 C 548 215.7209 565.0205 196.3488 591.7994 187.0698 C 577.0483 179.5814 568.1977 167.3721 568.1977 154.0233 C 568.1977 131.3953 593.8419 113 625.3865 113 C 656.9312 113 682.5754 131.3953 682.5754 154.0233 C 682.5754 167.3721 673.9517 179.4186 658.9736 187.2326 C 685.7525 196.5117 702.773 215.8838 702.773 237.3721 V 239 H 703 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="625.500000" y="179.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Donald</text></g><g id="i am top left"><g class="shape" ></g><text class="text" x="-474.000000" y="-25.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top left</text></g><g id="i am top right"><g class="shape" ></g><text class="text" x="593.000000" y="-25.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top right</text></g><g id="i am bottom left"><g class="shape" ></g><text class="text" x="-487.500000" y="388.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom left</text></g><g id="i am bottom right"><g class="shape" ></g><text class="text" x="606.500000" y="388.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom right</text></g><g id="(x -&gt; y)[0]"><marker id="mk-3990223579" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon class="connection" fill="#0D32B2" stroke-width="2" points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" /> </marker><path d="M 57.000000 128.000000 C 57.000000 166.000000 57.000000 186.000000 57.000000 222.000000" class="connection" style="fill:none;stroke:#0D32B2;stroke-width:2;" marker-end="url(#mk-3990223579)" mask="url(#3289954198)"/></g><mask id="3289954198" maskUnits="userSpaceOnUse" x="-100" y="-100" width="1472" height="748">
<rect x="-100" y="-100" width="1410" height="748" fill="white"></rect> <rect x="-100" y="-100" width="1472" height="748" fill="white"></rect>
</mask><style type="text/css"><![CDATA[ </mask><style type="text/css"><![CDATA[
.text { .text {

Before

Width:  |  Height:  |  Size: 662 KiB

After

Width:  |  Height:  |  Size: 662 KiB

View file

@ -122,11 +122,51 @@
"zIndex": 0, "zIndex": 0,
"level": 1 "level": 1
}, },
{
"id": "bottom",
"type": "text",
"pos": {
"x": -402,
"y": 384
},
"width": 943,
"height": 131,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "transparent",
"stroke": "#0A0F25",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "# Cats, no less liquid than their shadows, offer no angles to the wind.\n\nIf we can't fix it, it ain't broke.\n\nDieters live life in the fasting lane.",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "markdown",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 943,
"labelHeight": 131,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{ {
"id": "Joe", "id": "Joe",
"type": "person", "type": "person",
"pos": { "pos": {
"x": -139, "x": -553,
"y": 125 "y": 125
}, },
"width": 131, "width": 131,
@ -166,7 +206,7 @@
"id": "Donald", "id": "Donald",
"type": "person", "type": "person",
"pos": { "pos": {
"x": 146, "x": 560,
"y": 125 "y": 125
}, },
"width": 155, "width": 155,
@ -202,46 +242,6 @@
"zIndex": 0, "zIndex": 0,
"level": 1 "level": 1
}, },
{
"id": "bottom",
"type": "text",
"pos": {
"x": -402,
"y": 384
},
"width": 943,
"height": 131,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "transparent",
"stroke": "#0A0F25",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "# Cats, no less liquid than their shadows, offer no angles to the wind.\n\nIf we can't fix it, it ain't broke.\n\nDieters live life in the fasting lane.",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "markdown",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 943,
"labelHeight": 131,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{ {
"id": "i am top left", "id": "i am top left",
"type": "text", "type": "text",

View file

@ -3,7 +3,7 @@
id="d2-svg" id="d2-svg"
style="background: white;" style="background: white;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="1410" height="748" viewBox="-631 -131 1410 748"><style type="text/css"> width="1472" height="748" viewBox="-655 -131 1472 748"><style type="text/css">
<![CDATA[ <![CDATA[
.shape { .shape {
shape-rendering: geometricPrecision; shape-rendering: geometricPrecision;
@ -796,11 +796,11 @@ width="1410" height="748" viewBox="-631 -131 1410 748"><style type="text/css">
.md .contains-task-list:dir(rtl) .task-list-item-checkbox { .md .contains-task-list:dir(rtl) .task-list-item-checkbox {
margin: 0 -1.6em 0.25em 0.2em; margin: 0 -1.6em 0.25em 0.2em;
} }
</style><g id="x"><g class="shape" ><rect x="12" y="12" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="68.500000" y="78.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="12" y="238" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="69.000000" y="304.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="The top of the mountain"><g class="shape" ></g><text class="text" x="69.000000" y="-13.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">The top of the mountain</text></g><g id="Joe"><g class="shape" ><path d="M -8 251 H -139 V 249.2093 C -139 227.7209 -124.6149 208.3488 -101.9824 199.0698 C -114.4495 191.5814 -121.9297 179.3721 -121.9297 166.0233 C -121.9297 143.3953 -100.2562 125 -73.5959 125 C -46.9356 125 -25.2621 143.3953 -25.2621 166.0233 C -25.2621 179.3721 -32.5505 191.4186 -45.2094 199.2326 C -22.5769 208.5117 -8.1918 227.8838 -8.1918 249.3721 V 251 H -8 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="-73.500000" y="191.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Joe</text></g><g id="Donald"><g class="shape" ><path d="M 301 251 H 146 V 249.2093 C 146 227.7209 163.0205 208.3488 189.7994 199.0698 C 175.0483 191.5814 166.1977 179.3721 166.1977 166.0233 C 166.1977 143.3953 191.8419 125 223.3865 125 C 254.9312 125 280.5754 143.3953 280.5754 166.0233 C 280.5754 179.3721 271.9517 191.4186 256.9736 199.2326 C 283.7525 208.5117 300.773 227.8838 300.773 249.3721 V 251 H 301 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="223.500000" y="191.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Donald</text></g><g id="bottom"><g class="shape" ></g><g><foreignObject requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" x="-402.000000" y="384.000000" width="943" height="131"><div xmlns="http://www.w3.org/1999/xhtml" class="md" style="background-color:transparent;color:#0A0F25;"><h1>Cats, no less liquid than their shadows, offer no angles to the wind.</h1> </style><g id="x"><g class="shape" ><rect x="12" y="12" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="68.500000" y="78.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="12" y="238" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="69.000000" y="304.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="The top of the mountain"><g class="shape" ></g><text class="text" x="69.000000" y="-13.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">The top of the mountain</text></g><g id="bottom"><g class="shape" ></g><g><foreignObject requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" x="-402.000000" y="384.000000" width="943" height="131"><div xmlns="http://www.w3.org/1999/xhtml" class="md" style="background-color:transparent;color:#0A0F25;"><h1>Cats, no less liquid than their shadows, offer no angles to the wind.</h1>
<p>If we can't fix it, it ain't broke.</p> <p>If we can't fix it, it ain't broke.</p>
<p>Dieters live life in the fasting lane.</p> <p>Dieters live life in the fasting lane.</p>
</div></foreignObject></g></g><g id="i am top left"><g class="shape" ></g><text class="text" x="-462.000000" y="-13.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top left</text></g><g id="i am top right"><g class="shape" ></g><text class="text" x="605.000000" y="-13.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top right</text></g><g id="i am bottom left"><g class="shape" ></g><text class="text" x="-475.500000" y="400.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom left</text></g><g id="i am bottom right"><g class="shape" ></g><text class="text" x="618.500000" y="400.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom right</text></g><g id="(x -&gt; y)[0]"><marker id="mk-3990223579" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon class="connection" fill="#0D32B2" stroke-width="2" points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" /> </marker><path d="M 69.000000 140.000000 L 69.000000 234.000000" class="connection" style="fill:none;stroke:#0D32B2;stroke-width:2;" marker-end="url(#mk-3990223579)" mask="url(#2047429981)"/></g><mask id="2047429981" maskUnits="userSpaceOnUse" x="-100" y="-100" width="1410" height="748"> </div></foreignObject></g></g><g id="Joe"><g class="shape" ><path d="M -422 251 H -553 V 249.2093 C -553 227.7209 -538.6149 208.3488 -515.9824 199.0698 C -528.4495 191.5814 -535.9297 179.3721 -535.9297 166.0233 C -535.9297 143.3953 -514.2562 125 -487.5959 125 C -460.9356 125 -439.2621 143.3953 -439.2621 166.0233 C -439.2621 179.3721 -446.5505 191.4186 -459.2094 199.2326 C -436.5769 208.5117 -422.1918 227.8838 -422.1918 249.3721 V 251 H -422 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="-487.500000" y="191.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Joe</text></g><g id="Donald"><g class="shape" ><path d="M 715 251 H 560 V 249.2093 C 560 227.7209 577.0205 208.3488 603.7994 199.0698 C 589.0483 191.5814 580.1977 179.3721 580.1977 166.0233 C 580.1977 143.3953 605.8419 125 637.3865 125 C 668.9312 125 694.5754 143.3953 694.5754 166.0233 C 694.5754 179.3721 685.9517 191.4186 670.9736 199.2326 C 697.7525 208.5117 714.773 227.8838 714.773 249.3721 V 251 H 715 Z" style="fill:#E3E9FD;stroke:#0D32B2;stroke-width:2;"/></g><text class="text-bold" x="637.500000" y="191.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">Donald</text></g><g id="i am top left"><g class="shape" ></g><text class="text" x="-462.000000" y="-13.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top left</text></g><g id="i am top right"><g class="shape" ></g><text class="text" x="605.000000" y="-13.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am top right</text></g><g id="i am bottom left"><g class="shape" ></g><text class="text" x="-475.500000" y="400.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom left</text></g><g id="i am bottom right"><g class="shape" ></g><text class="text" x="618.500000" y="400.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">i am bottom right</text></g><g id="(x -&gt; y)[0]"><marker id="mk-3990223579" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon class="connection" fill="#0D32B2" stroke-width="2" points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" /> </marker><path d="M 69.000000 140.000000 L 69.000000 234.000000" class="connection" style="fill:none;stroke:#0D32B2;stroke-width:2;" marker-end="url(#mk-3990223579)" mask="url(#509112499)"/></g><mask id="509112499" maskUnits="userSpaceOnUse" x="-100" y="-100" width="1472" height="748">
<rect x="-100" y="-100" width="1410" height="748" fill="white"></rect> <rect x="-100" y="-100" width="1472" height="748" fill="white"></rect>
</mask><style type="text/css"><![CDATA[ </mask><style type="text/css"><![CDATA[
.text { .text {

Before

Width:  |  Height:  |  Size: 662 KiB

After

Width:  |  Height:  |  Size: 662 KiB

View file

@ -0,0 +1,127 @@
{
"name": "",
"fontFamily": "SourceSansPro",
"shapes": [
{
"id": "x",
"type": "",
"pos": {
"x": -56,
"y": -146
},
"width": 113,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#F7F8FE",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "x",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 13,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "y",
"type": "",
"pos": {
"x": -57,
"y": 20
},
"width": 114,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#F7F8FE",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "y",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 14,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "z",
"type": "",
"pos": {
"x": -189,
"y": -63
},
"width": 112,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#F7F8FE",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "z",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 12,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
}
],
"connections": []
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 325 KiB

127
e2etests/testdata/stable/near-alone/elk/board.exp.json generated vendored Normal file
View file

@ -0,0 +1,127 @@
{
"name": "",
"fontFamily": "SourceSansPro",
"shapes": [
{
"id": "x",
"type": "",
"pos": {
"x": -56,
"y": -146
},
"width": 113,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#F7F8FE",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "x",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 13,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "y",
"type": "",
"pos": {
"x": -57,
"y": 20
},
"width": 114,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#F7F8FE",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "y",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 14,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "z",
"type": "",
"pos": {
"x": -189,
"y": -63
},
"width": 112,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#F7F8FE",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "z",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 12,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
}
],
"connections": []
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 325 KiB