Vertical pad
This commit is contained in:
parent
ebac99e3db
commit
a9b8b3c0b1
2 changed files with 5 additions and 2 deletions
|
|
@ -3,6 +3,9 @@ package d2sequence
|
||||||
// leaves at least 25 units of space on the left/right when computing the space required between actors
|
// leaves at least 25 units of space on the left/right when computing the space required between actors
|
||||||
const HORIZONTAL_PAD = 50.
|
const HORIZONTAL_PAD = 50.
|
||||||
|
|
||||||
|
// leaves at least 25 units of space on the top/bottom when computing the space required between edges
|
||||||
|
const VERTICAL_PAD = 50.
|
||||||
|
|
||||||
const MIN_ACTOR_DISTANCE = 200.
|
const MIN_ACTOR_DISTANCE = 200.
|
||||||
|
|
||||||
// min vertical distance between edges
|
// min vertical distance between edges
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ func (sd *sequenceDiagram) init() {
|
||||||
sd.actors = append(sd.actors, obj)
|
sd.actors = append(sd.actors, obj)
|
||||||
sd.objectRank[obj] = len(sd.actors)
|
sd.objectRank[obj] = len(sd.actors)
|
||||||
sd.objectDepth[obj] = 0
|
sd.objectDepth[obj] = 0
|
||||||
sd.maxActorHeight = math.Max(sd.maxActorHeight, obj.Height+HORIZONTAL_PAD)
|
sd.maxActorHeight = math.Max(sd.maxActorHeight, obj.Height+VERTICAL_PAD)
|
||||||
} else {
|
} else {
|
||||||
// activations boxes are always rectangles and have no labels
|
// activations boxes are always rectangles and have no labels
|
||||||
obj.Attributes.Label = d2graph.Scalar{Value: ""}
|
obj.Attributes.Label = d2graph.Scalar{Value: ""}
|
||||||
|
|
@ -83,7 +83,7 @@ func (sd *sequenceDiagram) init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for rank, edge := range sd.edges {
|
for rank, edge := range sd.edges {
|
||||||
sd.edgeYStep = math.Max(sd.edgeYStep, float64(edge.LabelDimensions.Height)+HORIZONTAL_PAD)
|
sd.edgeYStep = math.Max(sd.edgeYStep, float64(edge.LabelDimensions.Height)+VERTICAL_PAD)
|
||||||
|
|
||||||
sd.setMinMaxEdgeRank(edge.Src, rank)
|
sd.setMinMaxEdgeRank(edge.Src, rank)
|
||||||
sd.setMinMaxEdgeRank(edge.Dst, rank)
|
sd.setMinMaxEdgeRank(edge.Dst, rank)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue