Skip to content

Commit

Permalink
Merge pull request #2408 from alixander/adjust-legend-positions
Browse files Browse the repository at this point in the history
adjust legend positions
  • Loading branch information
alixander authored Mar 4, 2025
2 parents 8a624ab + 61b90ec commit 95c7182
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 35 deletions.
8 changes: 5 additions & 3 deletions d2compiler/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
}

Expand Down
32 changes: 16 additions & 16 deletions testdata/d2compiler/TestCompile/legend.exp.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions testdata/d2exporter/TestExport/legend/basic_legend.exp.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 95c7182

Please sign in to comment.