Merge pull request #2408 from alixander/adjust-legend-positions
adjust legend positions
This commit is contained in:
commit
95c7182f48
3 changed files with 37 additions and 35 deletions
|
|
@ -137,14 +137,16 @@ func (c *compiler) compileLegend(g *d2graph.Graph, m *d2ir.Map) {
|
|||
}
|
||||
}
|
||||
obj.Box = &geo.Box{}
|
||||
obj.TopLeft = geo.NewPoint(0, 0)
|
||||
obj.TopLeft = geo.NewPoint(10, 10)
|
||||
obj.Width = 100
|
||||
obj.Height = 100
|
||||
objects = append(objects, obj)
|
||||
}
|
||||
|
||||
for _, edge := range legendGraph.Edges {
|
||||
edge.Route = []*geo.Point{
|
||||
{X: 0, Y: 0},
|
||||
{X: 0, Y: 0},
|
||||
{X: 10, Y: 10},
|
||||
{X: 110, Y: 10},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
32
testdata/d2compiler/TestCompile/legend.exp.json
generated
vendored
32
testdata/d2compiler/TestCompile/legend.exp.json
generated
vendored
|
|
@ -816,11 +816,11 @@
|
|||
],
|
||||
"box": {
|
||||
"TopLeft": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
"Width": 0,
|
||||
"Height": 0
|
||||
"Width": 100,
|
||||
"Height": 100
|
||||
},
|
||||
"attributes": {
|
||||
"label": {
|
||||
|
|
@ -913,11 +913,11 @@
|
|||
],
|
||||
"box": {
|
||||
"TopLeft": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
"Width": 0,
|
||||
"Height": 0
|
||||
"Width": 100,
|
||||
"Height": 100
|
||||
},
|
||||
"attributes": {
|
||||
"label": {
|
||||
|
|
@ -950,12 +950,12 @@
|
|||
"isCurve": false,
|
||||
"route": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 110,
|
||||
"y": 10
|
||||
}
|
||||
],
|
||||
"src_arrow": false,
|
||||
|
|
@ -994,12 +994,12 @@
|
|||
"isCurve": false,
|
||||
"route": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 110,
|
||||
"y": 10
|
||||
}
|
||||
],
|
||||
"src_arrow": false,
|
||||
|
|
|
|||
32
testdata/d2exporter/TestExport/legend/basic_legend.exp.json
generated
vendored
32
testdata/d2exporter/TestExport/legend/basic_legend.exp.json
generated
vendored
|
|
@ -166,11 +166,11 @@
|
|||
"id": "legend",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
|
|
@ -207,11 +207,11 @@
|
|||
"id": "legend.l1",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
|
|
@ -248,11 +248,11 @@
|
|||
"id": "legend.l2",
|
||||
"type": "oval",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
|
|
@ -313,12 +313,12 @@
|
|||
"link": "",
|
||||
"route": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 10,
|
||||
"y": 10
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"x": 110,
|
||||
"y": 10
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue