From 1fcb075e04ed5e56be1528bd70237c858cbe333e Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Fri, 24 Feb 2023 19:05:23 -0800 Subject: [PATCH 1/4] no near --- d2compiler/compile.go | 4 ++++ d2compiler/compile_test.go | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 8cc6452a7..7bed57db9 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -678,6 +678,10 @@ func (c *compiler) validateNear(g *d2graph.Graph) { c.errorf(obj.Attributes.NearKey, "near keys cannot be set to an descendant") continue } + if nearObj.OuterSequenceDiagram() != nil { + c.errorf(obj.Attributes.NearKey, "near keys cannot be set to an object within sequence diagrams") + continue + } } else if isConst { is := false for _, e := range g.Edges { diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 8a8bb33c3..1347435c4 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1774,6 +1774,17 @@ dst.id <-> src.dst_id assert.String(t, "sequence_diagram", g.Objects[0].Attributes.Shape.Value) }, }, + { + name: "near_sequence", + + text: `x: { + shape: sequence_diagram + a +} +b.near: x.a +`, + expErr: `d2/testdata/d2compiler/TestCompile/near_sequence.d2:5:9: near keys cannot be set to an object within sequence diagrams`, + }, { name: "sequence-timestamp", From 4411fbdabc976965a9fc922dada42ef9fb3f5b2f Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Fri, 24 Feb 2023 20:17:09 -0800 Subject: [PATCH 2/4] fix class shape in sequence diagram render --- d2graph/d2graph.go | 12 +-- e2etests/regression_test.go | 11 +++ .../dagre/board.exp.json | 91 +++++++++++++++++++ .../dagre/sketch.exp.svg | 43 +++++++++ .../elk/board.exp.json | 91 +++++++++++++++++++ .../elk/sketch.exp.svg | 43 +++++++++ 6 files changed, 285 insertions(+), 6 deletions(-) create mode 100644 e2etests/testdata/regression/class_font_style_sequence/dagre/board.exp.json create mode 100644 e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/regression/class_font_style_sequence/elk/board.exp.json create mode 100644 e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 99206e667..ae3bfc74d 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -338,6 +338,12 @@ func (l ContainerLevel) LabelSize() int { func (obj *Object) GetFill() string { level := int(obj.Level()) + shape := obj.Attributes.Shape.Value + + if strings.EqualFold(shape, d2target.ShapeSQLTable) || strings.EqualFold(shape, d2target.ShapeClass) { + return color.N1 + } + if obj.IsSequenceDiagramNote() { return color.N7 } else if obj.IsSequenceDiagramGroup() { @@ -366,8 +372,6 @@ func (obj *Object) GetFill() string { return color.N7 } - shape := obj.Attributes.Shape.Value - if shape == "" || strings.EqualFold(shape, d2target.ShapeSquare) || strings.EqualFold(shape, d2target.ShapeCircle) || strings.EqualFold(shape, d2target.ShapeOval) || strings.EqualFold(shape, d2target.ShapeRectangle) { if level == 1 { if !obj.IsContainer() { @@ -409,10 +413,6 @@ func (obj *Object) GetFill() string { return color.N5 } - if strings.EqualFold(shape, d2target.ShapeSQLTable) || strings.EqualFold(shape, d2target.ShapeClass) { - return color.N1 - } - return color.N7 } diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go index dc2f152bc..00b3c1b1b 100644 --- a/e2etests/regression_test.go +++ b/e2etests/regression_test.go @@ -39,6 +39,17 @@ group.nested: { `, expErr: "no actors declared in sequence diagram", }, + { + name: "class_font_style_sequence", + script: `shape: sequence_diagram +a: { + shape: class + style: { + font-color: red + } +} +`, + }, { name: "nested_steps", script: `a: { diff --git a/e2etests/testdata/regression/class_font_style_sequence/dagre/board.exp.json b/e2etests/testdata/regression/class_font_style_sequence/dagre/board.exp.json new file mode 100644 index 000000000..247dd556c --- /dev/null +++ b/e2etests/testdata/regression/class_font_style_sequence/dagre/board.exp.json @@ -0,0 +1,91 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "class", + "pos": { + "x": 12, + "y": 52 + }, + "width": 117, + "height": 92, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "red", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 31, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + } + ], + "connections": [ + { + "id": "(a -- )[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "a-lifeline-end-2251863791", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 70.5, + "y": 144 + }, + { + "x": 70.5, + "y": 214 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + } + ] +} diff --git a/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg b/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg new file mode 100644 index 000000000..682ad03a0 --- /dev/null +++ b/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg @@ -0,0 +1,43 @@ +a + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/class_font_style_sequence/elk/board.exp.json b/e2etests/testdata/regression/class_font_style_sequence/elk/board.exp.json new file mode 100644 index 000000000..247dd556c --- /dev/null +++ b/e2etests/testdata/regression/class_font_style_sequence/elk/board.exp.json @@ -0,0 +1,91 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "class", + "pos": { + "x": 12, + "y": 52 + }, + "width": 117, + "height": 92, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "red", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 31, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + } + ], + "connections": [ + { + "id": "(a -- )[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "a-lifeline-end-2251863791", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 70.5, + "y": 144 + }, + { + "x": 70.5, + "y": 214 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + } + ] +} diff --git a/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg b/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg new file mode 100644 index 000000000..682ad03a0 --- /dev/null +++ b/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg @@ -0,0 +1,43 @@ +a + + + \ No newline at end of file From 0216c8b5f0e0b22957f46b75b00beaa639154d71 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Fri, 24 Feb 2023 20:26:40 -0800 Subject: [PATCH 3/4] fix font-color for tables and class --- d2renderers/d2sketch/sketch.go | 4 ++-- d2renderers/d2svg/class.go | 2 +- d2renderers/d2svg/d2svg.go | 13 ++---------- d2renderers/d2svg/table.go | 2 +- d2target/d2target.go | 20 +++++++++++++++++++ .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/board.exp.json | 4 ++-- .../dagre/sketch.exp.svg | 4 ++-- .../elk/board.exp.json | 4 ++-- .../elk/sketch.exp.svg | 4 ++-- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../TestCompile/near_sequence.exp.json | 12 +++++++++++ 14 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 testdata/d2compiler/TestCompile/near_sequence.exp.json diff --git a/d2renderers/d2sketch/sketch.go b/d2renderers/d2sketch/sketch.go index fc34270b0..aa48de619 100644 --- a/d2renderers/d2sketch/sketch.go +++ b/d2renderers/d2sketch/sketch.go @@ -382,7 +382,7 @@ func Table(r *Runner, shape d2target.Shape) (string, error) { textEl := d2themes.NewThemableElement("text") textEl.X = tl.X textEl.Y = tl.Y + float64(shape.LabelHeight)*3/4 - textEl.Fill = shape.Stroke + textEl.Fill = shape.GetFontColor() textEl.ClassName = "text" textEl.Style = fmt.Sprintf("text-anchor:%s;font-size:%vpx", "start", 4+shape.FontSize, @@ -532,7 +532,7 @@ func Class(r *Runner, shape d2target.Shape) (string, error) { textEl := d2themes.NewThemableElement("text") textEl.X = tl.X + float64(shape.LabelWidth)/2 textEl.Y = tl.Y + float64(shape.LabelHeight)*3/4 - textEl.Fill = shape.Stroke + textEl.Fill = shape.GetFontColor() textEl.ClassName = "text-mono" textEl.Style = fmt.Sprintf("text-anchor:%s;font-size:%vpx", "middle", diff --git a/d2renderers/d2svg/class.go b/d2renderers/d2svg/class.go index 7b5e2b59a..6cf8e6889 100644 --- a/d2renderers/d2svg/class.go +++ b/d2renderers/d2svg/class.go @@ -30,7 +30,7 @@ func classHeader(shape d2target.Shape, box *geo.Box, text string, textWidth, tex textEl := d2themes.NewThemableElement("text") textEl.X = tl.X + textWidth/2 textEl.Y = tl.Y + textHeight*3/4 - textEl.Fill = shape.Stroke + textEl.Fill = shape.GetFontColor() textEl.ClassName = "text-mono" textEl.Style = fmt.Sprintf(`text-anchor:%s;font-size:%vpx;`, "middle", 4+fontSize, diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index 87d403ac0..61d54b6f6 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -562,11 +562,6 @@ func drawConnection(writer io.Writer, labelMaskID string, connection d2target.Co } else if connection.Italic { fontClass += "-italic" } - fontColor := color.N1 - if connection.Color != color.Empty { - fontColor = connection.Color - } - if connection.Fill != color.Empty { rectEl := d2themes.NewThemableElement("rect") rectEl.X, rectEl.Y = labelTL.X, labelTL.Y @@ -578,7 +573,7 @@ func drawConnection(writer io.Writer, labelMaskID string, connection d2target.Co textEl := d2themes.NewThemableElement("text") textEl.X = labelTL.X + float64(connection.LabelWidth)/2 textEl.Y = labelTL.Y + float64(connection.FontSize) - textEl.Fill = fontColor + textEl.Fill = connection.GetFontColor() textEl.ClassName = fontClass textEl.Style = fmt.Sprintf("text-anchor:%s;font-size:%vpx", "middle", connection.FontSize) textEl.Content = RenderText(connection.Label, textEl.X, float64(connection.LabelHeight)) @@ -1112,10 +1107,6 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske fmt.Fprint(writer, mdEl.Render()) fmt.Fprint(writer, ``) } else { - fontColor := color.N1 - if targetShape.Color != color.Empty { - fontColor = targetShape.Color - } if targetShape.LabelFill != "" { rectEl := d2themes.NewThemableElement("rect") rectEl.X = labelTL.X @@ -1129,7 +1120,7 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske textEl.X = labelTL.X + float64(targetShape.LabelWidth)/2 // text is vertically positioned at its baseline which is at labelTL+FontSize textEl.Y = labelTL.Y + float64(targetShape.FontSize) - textEl.Fill = fontColor + textEl.Fill = targetShape.GetFontColor() textEl.ClassName = fontClass textEl.Style = fmt.Sprintf("text-anchor:%s;font-size:%vpx", "middle", targetShape.FontSize) textEl.Content = RenderText(targetShape.Label, textEl.X, float64(targetShape.LabelHeight)) diff --git a/d2renderers/d2svg/table.go b/d2renderers/d2svg/table.go index 383b6aab5..e4f0695ac 100644 --- a/d2renderers/d2svg/table.go +++ b/d2renderers/d2svg/table.go @@ -31,7 +31,7 @@ func tableHeader(shape d2target.Shape, box *geo.Box, text string, textWidth, tex textEl := d2themes.NewThemableElement("text") textEl.X = tl.X textEl.Y = tl.Y + textHeight*3/4 - textEl.Fill = shape.Stroke + textEl.Fill = shape.GetFontColor() textEl.ClassName = "text" textEl.Style = fmt.Sprintf("text-anchor:%s;font-size:%vpx", "start", 4+fontSize, diff --git a/d2target/d2target.go b/d2target/d2target.go index cc445d674..2a3aa5ff8 100644 --- a/d2target/d2target.go +++ b/d2target/d2target.go @@ -197,6 +197,19 @@ type Shape struct { NeutralAccentColor string `json:"neutralAccentColor,omitempty"` } +func (s Shape) GetFontColor() string { + if s.Type == ShapeClass || s.Type == ShapeSQLTable { + if !color.IsThemeColor(s.Color) { + return s.Color + } + return s.Stroke + } + if s.Color != color.Empty { + return s.Color + } + return color.N1 +} + func (s Shape) CSSStyle() string { out := "" @@ -302,6 +315,13 @@ func BaseConnection() *Connection { } } +func (c Connection) GetFontColor() string { + if c.Color != color.Empty { + return c.Color + } + return color.N1 +} + func (c Connection) CSSStyle() string { out := "" diff --git a/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg b/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg index 682ad03a0..10929229e 100644 --- a/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/class_font_style_sequence/dagre/sketch.exp.svg @@ -37,7 +37,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>a +]]>a \ No newline at end of file diff --git a/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg b/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg index 682ad03a0..10929229e 100644 --- a/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg +++ b/e2etests/testdata/regression/class_font_style_sequence/elk/sketch.exp.svg @@ -37,7 +37,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>a +]]>a \ No newline at end of file diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json index f1d01a939..7c4a835c0 100644 --- a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json @@ -97,7 +97,7 @@ "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B5", + "fill": "N1", "stroke": "N7", "shadow": false, "3d": false, @@ -819,7 +819,7 @@ "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B5", + "fill": "N1", "stroke": "N7", "shadow": false, "3d": false, diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg index 090313fe6..5fa77ee27 100644 --- a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg @@ -65,9 +65,9 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>a labelblabelsa class+public() boolvoid-private() intvoidcloudyyyy:= 5 +]]>a labelblabelsa class+public() boolvoid-private() intvoidcloudyyyy:= 5 := a + 7 -fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side +fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json index f1d01a939..7c4a835c0 100644 --- a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json @@ -97,7 +97,7 @@ "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B5", + "fill": "N1", "stroke": "N7", "shadow": false, "3d": false, @@ -819,7 +819,7 @@ "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B5", + "fill": "N1", "stroke": "N7", "shadow": false, "3d": false, diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg index 090313fe6..5fa77ee27 100644 --- a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg @@ -65,9 +65,9 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>a labelblabelsa class+public() boolvoid-private() intvoidcloudyyyy:= 5 +]]>a labelblabelsa class+public() boolvoid-private() intvoidcloudyyyy:= 5 := a + 7 -fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side +fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side diff --git a/e2etests/testdata/stable/sql_table_column_styles/dagre/sketch.exp.svg b/e2etests/testdata/stable/sql_table_column_styles/dagre/sketch.exp.svg index 1bf933cc1..4c4b64541 100644 --- a/e2etests/testdata/stable/sql_table_column_styles/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/sql_table_column_styles/dagre/sketch.exp.svg @@ -44,7 +44,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>Humor in the CourtCould you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.Humor in the Court2Could you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.BatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)voidBatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)void +]]>Humor in the CourtCould you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.Humor in the Court2Could you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.BatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)voidBatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)void \ No newline at end of file diff --git a/e2etests/testdata/stable/sql_table_column_styles/elk/sketch.exp.svg b/e2etests/testdata/stable/sql_table_column_styles/elk/sketch.exp.svg index 03f8b18c1..08f8ef62d 100644 --- a/e2etests/testdata/stable/sql_table_column_styles/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/sql_table_column_styles/elk/sketch.exp.svg @@ -44,7 +44,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>Humor in the CourtCould you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.Humor in the Court2Could you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.BatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)voidBatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)void +]]>Humor in the CourtCould you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.Humor in the Court2Could you see him from where you were standing?I could see his head.And where was his head?Just above his shoulders.BatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)voidBatchManager-numint-timeoutint-pid+getStatus()Enum+getJobs()Job[]+setTimeout(seconds int)void \ No newline at end of file diff --git a/testdata/d2compiler/TestCompile/near_sequence.exp.json b/testdata/d2compiler/TestCompile/near_sequence.exp.json new file mode 100644 index 000000000..dc86eb89c --- /dev/null +++ b/testdata/d2compiler/TestCompile/near_sequence.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/near_sequence.d2,4:8:45-4:11:48", + "errmsg": "d2/testdata/d2compiler/TestCompile/near_sequence.d2:5:9: near keys cannot be set to an object within sequence diagrams" + } + ] + } +} From fabe85a0daec2921d36bfa3427dc2453f870c622 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sat, 25 Feb 2023 07:55:02 -0800 Subject: [PATCH 4/4] changelog --- ci/release/changelogs/next.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 064d91bbe..642efdc7b 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -4,7 +4,11 @@ #### Improvements 🧹 +- `near` key set to sequence diagram children get an appropriate error message. [#899](https://github.com/terrastruct/d2/issues/899) +- `class` and `sql_table` shape respect `font-color` styling as header font color. [#899](https://github.com/terrastruct/d2/issues/899) + #### Bugfixes ⛑️ - Error reported when no actors are declared in sequence diagram. [#886](https://github.com/terrastruct/d2/pull/886) - Fixed img bundling on image shapes. [#889](https://github.com/terrastruct/d2/issues/889) +- `class` shape as sequence diagram actors had wrong colors. [#899](https://github.com/terrastruct/d2/issues/899)