adjust legend positions

This commit is contained in:
Alexander Wang 2025-03-04 14:18:58 -07:00
parent 8a624ab1b2
commit 052faecbbd
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
3 changed files with 25 additions and 25 deletions

View file

@ -137,14 +137,14 @@ func (c *compiler) compileLegend(g *d2graph.Graph, m *d2ir.Map) {
} }
} }
obj.Box = &geo.Box{} obj.Box = &geo.Box{}
obj.TopLeft = geo.NewPoint(0, 0) obj.TopLeft = geo.NewPoint(10, 10)
objects = append(objects, obj) objects = append(objects, obj)
} }
for _, edge := range legendGraph.Edges { for _, edge := range legendGraph.Edges {
edge.Route = []*geo.Point{ edge.Route = []*geo.Point{
{X: 0, Y: 0}, {X: 10, Y: 10},
{X: 0, Y: 0}, {X: 110, Y: 10},
} }
} }

View file

@ -816,8 +816,8 @@
], ],
"box": { "box": {
"TopLeft": { "TopLeft": {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
"Width": 0, "Width": 0,
"Height": 0 "Height": 0
@ -913,8 +913,8 @@
], ],
"box": { "box": {
"TopLeft": { "TopLeft": {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
"Width": 0, "Width": 0,
"Height": 0 "Height": 0
@ -950,12 +950,12 @@
"isCurve": false, "isCurve": false,
"route": [ "route": [
{ {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
{ {
"x": 0, "x": 110,
"y": 0 "y": 10
} }
], ],
"src_arrow": false, "src_arrow": false,
@ -994,12 +994,12 @@
"isCurve": false, "isCurve": false,
"route": [ "route": [
{ {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
{ {
"x": 0, "x": 110,
"y": 0 "y": 10
} }
], ],
"src_arrow": false, "src_arrow": false,

View file

@ -166,8 +166,8 @@
"id": "legend", "id": "legend",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
"width": 0, "width": 0,
"height": 0, "height": 0,
@ -207,8 +207,8 @@
"id": "legend.l1", "id": "legend.l1",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
"width": 0, "width": 0,
"height": 0, "height": 0,
@ -248,8 +248,8 @@
"id": "legend.l2", "id": "legend.l2",
"type": "oval", "type": "oval",
"pos": { "pos": {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
"width": 0, "width": 0,
"height": 0, "height": 0,
@ -313,12 +313,12 @@
"link": "", "link": "",
"route": [ "route": [
{ {
"x": 0, "x": 10,
"y": 0 "y": 10
}, },
{ {
"x": 0, "x": 110,
"y": 0 "y": 10
} }
], ],
"animated": false, "animated": false,