Skip to content

Commit

Permalink
tests and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Mar 7, 2023
1 parent 29cd98d commit d1d64c7
Show file tree
Hide file tree
Showing 47 changed files with 2,086 additions and 2,115 deletions.
2 changes: 2 additions & 0 deletions ci/release/changelogs/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Improvements 🧹

- ELK nodes with > 1 connection grow to ensure padding around ports [#981](https://github.com/terrastruct/d2/pull/981)

#### Bugfixes ⛑️

- Accept absolute paths again on the CLI. [#979](https://github.com/terrastruct/d2/pull/979)
Expand Down
11 changes: 10 additions & 1 deletion d2layouts/d2elklayout/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ var DefaultOpts = ConfigurableOpts{
SelfLoopSpacing: 50.0,
}

var port_spacing = 40.

type elkOpts struct {
Thoroughness int `json:"elk.layered.thoroughness,omitempty"`
EdgeEdgeBetweenLayersSpacing int `json:"elk.layered.spacing.edgeEdgeBetweenLayers,omitempty"`
Expand Down Expand Up @@ -186,7 +188,14 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
incoming++
}
}
obj.Width = math.Max(obj.Width, math.Max(incoming, outgoing)*80)
if incoming >= 2 || outgoing >= 2 {
switch g.Root.Attributes.Direction.Value {
case "right", "left":
obj.Height = math.Max(obj.Height, math.Max(incoming, outgoing)*port_spacing)
default:
obj.Width = math.Max(obj.Width, math.Max(incoming, outgoing)*port_spacing)
}
}

height := obj.Height
width := obj.Width
Expand Down
Binary file modified e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf
Binary file not shown.

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d1d64c7

Please sign in to comment.