adjust legend positions
This commit is contained in:
parent
8a624ab1b2
commit
052faecbbd
3 changed files with 25 additions and 25 deletions
|
|
@ -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},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
24
testdata/d2compiler/TestCompile/legend.exp.json
generated
vendored
24
testdata/d2compiler/TestCompile/legend.exp.json
generated
vendored
|
|
@ -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,
|
||||||
|
|
|
||||||
20
testdata/d2exporter/TestExport/legend/basic_legend.exp.json
generated
vendored
20
testdata/d2exporter/TestExport/legend/basic_legend.exp.json
generated
vendored
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue