Merge pull request #1140 from alexstoick/feat/lifeline-inherit-actor-style
Lifeline should inherit the stroke style from the actor
|
|
@ -8,6 +8,7 @@
|
|||
#### Improvements 🧹
|
||||
|
||||
- Labels on parallel `dagre` connections include a gap between them [#1134](https://github.com/terrastruct/d2/pull/1134)
|
||||
- Sequence Diagram `Lifelines` now inherit the Actor `stroke` and `stroke-dash` [#1140](https://github.com/terrastruct/d2/pull/1140)
|
||||
|
||||
#### Bugfixes ⛑️
|
||||
|
||||
|
|
|
|||
|
|
@ -386,13 +386,19 @@ func (sd *sequenceDiagram) addLifelineEdges() {
|
|||
}
|
||||
actorLifelineEnd := actor.Center()
|
||||
actorLifelineEnd.Y = endY
|
||||
sd.lifelines = append(sd.lifelines, &d2graph.Edge{
|
||||
Attributes: &d2graph.Attributes{
|
||||
Style: d2graph.Style{
|
||||
style := d2graph.Style{
|
||||
StrokeDash: &d2graph.Scalar{Value: fmt.Sprintf("%d", LIFELINE_STROKE_DASH)},
|
||||
StrokeWidth: &d2graph.Scalar{Value: fmt.Sprintf("%d", LIFELINE_STROKE_WIDTH)},
|
||||
},
|
||||
},
|
||||
}
|
||||
if actor.Attributes.Style.StrokeDash != nil {
|
||||
style.StrokeDash = &d2graph.Scalar{Value: actor.Attributes.Style.StrokeDash.Value}
|
||||
}
|
||||
if actor.Attributes.Style.Stroke != nil {
|
||||
style.Stroke = &d2graph.Scalar{Value: actor.Attributes.Style.Stroke.Value}
|
||||
}
|
||||
|
||||
sd.lifelines = append(sd.lifelines, &d2graph.Edge{
|
||||
Attributes: &d2graph.Attributes{Style: style},
|
||||
Src: actor,
|
||||
SrcArrow: false,
|
||||
Dst: &d2graph.Object{
|
||||
|
|
|
|||
|
|
@ -1549,8 +1549,13 @@ finally: {
|
|||
sequence: {
|
||||
shape: sequence_diagram
|
||||
# items appear in this order
|
||||
scorer
|
||||
concept
|
||||
scorer {
|
||||
style.stroke: red
|
||||
style.stroke-dash: 2
|
||||
}
|
||||
concept {
|
||||
style.stroke-width: 6
|
||||
}
|
||||
essayRubric
|
||||
item
|
||||
itemOutcome
|
||||
|
|
|
|||
2
e2etests/testdata/stable/sequence_diagram_nested_span/dagre/board.exp.json
generated
vendored
|
|
@ -1302,7 +1302,7 @@
|
|||
"opacity": 1,
|
||||
"strokeDash": 6,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B2",
|
||||
"stroke": "red",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
2
e2etests/testdata/stable/sequence_diagram_nested_span/elk/board.exp.json
generated
vendored
|
|
@ -1302,7 +1302,7 @@
|
|||
"opacity": 1,
|
||||
"strokeDash": 6,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B2",
|
||||
"stroke": "red",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
2
e2etests/testdata/stable/sequence_diagram_simple/dagre/board.exp.json
generated
vendored
|
|
@ -621,7 +621,7 @@
|
|||
"opacity": 1,
|
||||
"strokeDash": 6,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B2",
|
||||
"stroke": "red",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
2
e2etests/testdata/stable/sequence_diagram_simple/elk/board.exp.json
generated
vendored
|
|
@ -621,7 +621,7 @@
|
|||
"opacity": 1,
|
||||
"strokeDash": 6,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B2",
|
||||
"stroke": "red",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
10
e2etests/testdata/stable/sequence_diagrams/dagre/board.exp.json
generated
vendored
|
|
@ -1672,11 +1672,11 @@
|
|||
"width": 100,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeDash": 2,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"stroke": "red",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
|
|
@ -1714,7 +1714,7 @@
|
|||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"strokeWidth": 6,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
|
|
@ -4744,9 +4744,9 @@
|
|||
"dstArrow": "none",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 6,
|
||||
"strokeDash": 2,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B2",
|
||||
"stroke": "red",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
10
e2etests/testdata/stable/sequence_diagrams/elk/board.exp.json
generated
vendored
|
|
@ -1672,11 +1672,11 @@
|
|||
"width": 100,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeDash": 2,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"stroke": "red",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
|
|
@ -1714,7 +1714,7 @@
|
|||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"strokeWidth": 6,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
|
|
@ -4655,9 +4655,9 @@
|
|||
"dstArrow": "none",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 6,
|
||||
"strokeDash": 2,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B2",
|
||||
"stroke": "red",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |