diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 469a5ce39..c7a47bae9 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -2,6 +2,7 @@ - `double-border` keyword implemented. [#565](https://github.com/terrastruct/d2/pull/565) - The [Dockerfile](./docs/INSTALL.md#docker) now supports rendering PNGs [#594](https://github.com/terrastruct/d2/issues/594) + - There was a minor breaking change as part of this where the default working directory of the Dockerfile is now `/home/debian/src` instead of `/root/src` to allow UID remapping with [`fixuid`](https://github.com/boxboat/fixuid). - `d2 fmt` accepts multiple files to be formatted [#718](https://github.com/terrastruct/d2/issues/718) @@ -18,7 +19,15 @@ #### Improvements 🧹 - Code snippets use bold and italic font styles as determined by highlighter [#710](https://github.com/terrastruct/d2/issues/710), [#741](https://github.com/terrastruct/d2/issues/741) +- Reduces default padding of shapes. [#702](https://github.com/terrastruct/d2/pull/702) +- Ensures labels fit inside shapes with shape-specific inner bounding boxes. [#702](https://github.com/terrastruct/d2/pull/702) +- Improves package shape dimensions with short height. [#702](https://github.com/terrastruct/d2/pull/702) +- Keeps person shape from becoming too distorted. [#702](https://github.com/terrastruct/d2/pull/702) +- Ensures shapes with icons have enough padding for their labels. [#702](https://github.com/terrastruct/d2/pull/702) #### Bugfixes ⛑️ - Fixes groups overlapping in sequence diagrams when they end in a self loop. [#728](https://github.com/terrastruct/d2/pull/728) +- Fixed dimensions of unlabeled squares or circles with only a set width or height. [#702](https://github.com/terrastruct/d2/pull/702) +- Fixed scaling of actor shapes in sequence diagrams. [#702](https://github.com/terrastruct/d2/pull/702) +- Images can now be set to sizes smaller than 128x128. [#702](https://github.com/terrastruct/d2/pull/702) diff --git a/d2exporter/export.go b/d2exporter/export.go index 06628af70..5a57f0881 100644 --- a/d2exporter/export.go +++ b/d2exporter/export.go @@ -143,6 +143,7 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape { } shape.Label = text.Text shape.LabelWidth = text.Dimensions.Width + shape.LabelHeight = text.Dimensions.Height if obj.LabelPosition != nil { shape.LabelPosition = *obj.LabelPosition diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 9a89ed7e3..a37c93b77 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -19,11 +19,13 @@ import ( "oss.terrastruct.com/d2/d2target" "oss.terrastruct.com/d2/d2themes" "oss.terrastruct.com/d2/lib/geo" + "oss.terrastruct.com/d2/lib/shape" "oss.terrastruct.com/d2/lib/textmeasure" ) const INNER_LABEL_PADDING int = 5 -const DEFAULT_SHAPE_PADDING = 100. +const DEFAULT_SHAPE_SIZE = 100. +const MIN_SHAPE_SIZE = 5 type Graph struct { Name string `json:"name"` @@ -775,9 +777,14 @@ func (obj *Object) GetLabelSize(mtexts []*d2target.MText, ruler *textmeasure.Rul return dims, nil } -func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *d2fonts.FontFamily, labelDims d2target.TextDimensions) (*d2target.TextDimensions, error) { +func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *d2fonts.FontFamily, labelDims d2target.TextDimensions, withLabelPadding bool) (*d2target.TextDimensions, error) { dims := d2target.TextDimensions{} + if withLabelPadding { + labelDims.Width += INNER_LABEL_PADDING + labelDims.Height += INNER_LABEL_PADDING + } + switch strings.ToLower(obj.Attributes.Shape.Value) { default: return d2target.NewTextDimensions(labelDims.Width, labelDims.Height), nil @@ -793,22 +800,22 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R if fdims == nil { return nil, fmt.Errorf("dimensions for class field %#v not found", f.Text()) } - lineWidth := fdims.Width - if maxWidth < lineWidth { - maxWidth = lineWidth - } + maxWidth = go2.Max(maxWidth, fdims.Width) } for _, m := range obj.Class.Methods { mdims := GetTextDimensions(mtexts, ruler, m.Text(), go2.Pointer(d2fonts.SourceCodePro)) if mdims == nil { return nil, fmt.Errorf("dimensions for class method %#v not found", m.Text()) } - lineWidth := mdims.Width - if maxWidth < lineWidth { - maxWidth = lineWidth - } + maxWidth = go2.Max(maxWidth, mdims.Width) } - dims.Width = maxWidth + // β”Œβ”€PrefixWidth β”Œβ”€CenterPadding + // β”Œβ”€β”¬β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β” + // β”‚ + getJobs() Job[] β”‚ + // β””β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”˜ + // └─PrefixPadding └──TypePadding + // β”œβ”€β”€β”€β”€β”€β”€β”€β”€ + β”œβ”€β”€β”€β”€ = maxWidth + dims.Width = d2target.PrefixPadding + d2target.PrefixWidth + maxWidth + d2target.CenterPadding + d2target.TypePadding // All rows should be the same height var anyRowText *d2target.MText @@ -818,8 +825,7 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R anyRowText = obj.Class.Methods[0].Text() } if anyRowText != nil { - // 10px of padding top and bottom so text doesn't look squished - rowHeight := GetTextDimensions(mtexts, ruler, anyRowText, go2.Pointer(d2fonts.SourceCodePro)).Height + 20 + rowHeight := GetTextDimensions(mtexts, ruler, anyRowText, go2.Pointer(d2fonts.SourceCodePro)).Height + d2target.VerticalPadding dims.Height = rowHeight * (len(obj.Class.Fields) + len(obj.Class.Methods) + 2) } else { dims.Height = go2.Max(12, labelDims.Height) @@ -841,9 +847,7 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R } c.Name.LabelWidth = nameDims.Width c.Name.LabelHeight = nameDims.Height - if maxNameWidth < nameDims.Width { - maxNameWidth = nameDims.Width - } + maxNameWidth = go2.Max(maxNameWidth, nameDims.Width) typeDims := GetTextDimensions(mtexts, ruler, ctexts[1], fontFamily) if typeDims == nil { @@ -854,6 +858,7 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R if maxTypeWidth < typeDims.Width { maxTypeWidth = typeDims.Width } + maxTypeWidth = go2.Max(maxTypeWidth, typeDims.Width) if c.Constraint != "" { // covers UNQ constraint with padding @@ -871,21 +876,6 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R return &dims, nil } -func (obj *Object) GetPadding() (x, y float64) { - switch strings.ToLower(obj.Attributes.Shape.Value) { - case d2target.ShapeImage, - d2target.ShapeSQLTable, - d2target.ShapeText, - d2target.ShapeCode: - return 0., 0. - case d2target.ShapeClass: - // TODO fix class row width measurements (see SQL table) - return 100., 0. - default: - return DEFAULT_SHAPE_PADDING, DEFAULT_SHAPE_PADDING - } -} - type Edge struct { Index int `json:"index"` @@ -1181,29 +1171,41 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler desiredHeight, _ = strconv.Atoi(obj.Attributes.Height.Value) } + dslShape := strings.ToLower(obj.Attributes.Shape.Value) + if obj.Attributes.Label.Value == "" && - obj.Attributes.Shape.Value != d2target.ShapeImage && - obj.Attributes.Shape.Value != d2target.ShapeSQLTable && - obj.Attributes.Shape.Value != d2target.ShapeClass { - obj.Width = DEFAULT_SHAPE_PADDING - obj.Height = DEFAULT_SHAPE_PADDING - if desiredWidth != 0 { - obj.Width = float64(desiredWidth) - } - if desiredHeight != 0 { - obj.Height = float64(desiredHeight) + dslShape != d2target.ShapeImage && + dslShape != d2target.ShapeSQLTable && + dslShape != d2target.ShapeClass { + + if dslShape == d2target.ShapeCircle || dslShape == d2target.ShapeSquare { + sideLength := DEFAULT_SHAPE_SIZE + if desiredWidth != 0 || desiredHeight != 0 { + sideLength = float64(go2.Max(desiredWidth, desiredHeight)) + } + obj.Width = sideLength + obj.Height = sideLength + } else { + obj.Width = DEFAULT_SHAPE_SIZE + obj.Height = DEFAULT_SHAPE_SIZE + if desiredWidth != 0 { + obj.Width = float64(desiredWidth) + } + if desiredHeight != 0 { + obj.Height = float64(desiredHeight) + } } + continue } - shapeType := strings.ToLower(obj.Attributes.Shape.Value) - labelDims, err := obj.GetLabelSize(mtexts, ruler, fontFamily) if err != nil { return err } + obj.LabelDimensions = *labelDims - switch shapeType { + switch dslShape { case d2target.ShapeText, d2target.ShapeClass, d2target.ShapeSQLTable, d2target.ShapeCode: // no labels default: @@ -1213,39 +1215,65 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler } } - if shapeType != d2target.ShapeText && obj.Attributes.Label.Value != "" { - labelDims.Width += INNER_LABEL_PADDING - labelDims.Height += INNER_LABEL_PADDING - } - obj.LabelDimensions = *labelDims - - defaultDims, err := obj.GetDefaultSize(mtexts, ruler, fontFamily, *labelDims) + // if there is a desired width or height, fit to content box without inner label padding for smallest minimum size + withInnerLabelPadding := desiredWidth == 0 && desiredHeight == 0 && + dslShape != d2target.ShapeText && obj.Attributes.Label.Value != "" + defaultDims, err := obj.GetDefaultSize(mtexts, ruler, fontFamily, *labelDims, withInnerLabelPadding) if err != nil { return err } - obj.Width = float64(go2.Max(defaultDims.Width, desiredWidth)) - obj.Height = float64(go2.Max(defaultDims.Height, desiredHeight)) - - paddingX, paddingY := obj.GetPadding() - - switch shapeType { - case d2target.ShapeSquare, d2target.ShapeCircle: - if desiredWidth != 0 || desiredHeight != 0 { - paddingX = 0. - paddingY = 0. - } - - sideLength := math.Max(obj.Width+paddingX, obj.Height+paddingY) - obj.Width = sideLength - obj.Height = sideLength - - default: + if dslShape == d2target.ShapeImage { if desiredWidth == 0 { - obj.Width += float64(paddingX) + desiredWidth = defaultDims.Width } if desiredHeight == 0 { - obj.Height += float64(paddingY) + desiredHeight = defaultDims.Height + } + obj.Width = float64(go2.Max(MIN_SHAPE_SIZE, desiredWidth)) + obj.Height = float64(go2.Max(MIN_SHAPE_SIZE, desiredHeight)) + // images don't need further processing + continue + } + + contentBox := geo.NewBox(geo.NewPoint(0, 0), float64(defaultDims.Width), float64(defaultDims.Height)) + shapeType := d2target.DSL_SHAPE_TO_SHAPE_TYPE[dslShape] + s := shape.NewShape(shapeType, contentBox) + + paddingX, paddingY := s.GetDefaultPadding() + if desiredWidth != 0 || desiredHeight != 0 { + paddingX = 0. + paddingY = 0. + } else { + // give shapes with icons extra padding to fit their label + if obj.Attributes.Icon != nil { + labelHeight := float64(labelDims.Height + INNER_LABEL_PADDING) + // Evenly pad enough to fit label above icon + paddingX += labelHeight + paddingY += labelHeight + } + switch shapeType { + case shape.TABLE_TYPE, shape.CLASS_TYPE, shape.CODE_TYPE, shape.IMAGE_TYPE: + default: + if obj.Attributes.Link != "" { + paddingX += 32 + } + if obj.Attributes.Tooltip != "" { + paddingX += 32 + } + } + } + + fitWidth, fitHeight := s.GetDimensionsToFit(contentBox.Width, contentBox.Height, paddingX, paddingY) + obj.Width = math.Max(float64(desiredWidth), fitWidth) + obj.Height = math.Max(float64(desiredHeight), fitHeight) + if s.AspectRatio1() { + sideLength := math.Max(obj.Width, obj.Height) + obj.Width = sideLength + obj.Height = sideLength + } else if desiredHeight == 0 || desiredWidth == 0 { + if s.GetType() == shape.PERSON_TYPE { + obj.Width, obj.Height = shape.LimitAR(obj.Width, obj.Height, shape.PERSON_AR_LIMIT) } } } diff --git a/d2layouts/d2sequence/sequence_diagram.go b/d2layouts/d2sequence/sequence_diagram.go index 8ef3e91a2..8a61e9e8b 100644 --- a/d2layouts/d2sequence/sequence_diagram.go +++ b/d2layouts/d2sequence/sequence_diagram.go @@ -105,6 +105,12 @@ func newSequenceDiagram(objects []*d2graph.Object, messages []*d2graph.Edge) *se sd.objectRank[actor] = rank if actor.Width < MIN_ACTOR_WIDTH { + dslShape := strings.ToLower(actor.Attributes.Shape.Value) + switch dslShape { + case d2target.ShapePerson, d2target.ShapeSquare, d2target.ShapeCircle: + // scale shape up to min width uniformly + actor.Height *= MIN_ACTOR_WIDTH / actor.Width + } actor.Width = MIN_ACTOR_WIDTH } sd.maxActorHeight = math.Max(sd.maxActorHeight, actor.Height) diff --git a/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg b/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg index f0a8aabf2..6e4e30c89 100644 --- a/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg +++ b/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="1597" height="835" viewBox="-102 -102 1597 835">1Like starbucks or something -2I'm not sure what this is +}]]>1Like starbucks or something +2I'm not sure what this is 1https://d2lang.com -2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! -3https://terrastruct.com +}]]>1https://d2lang.com +2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! +3https://terrastruct.com 1Total abstinence is easier than perfect moderation -2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! +}]]>1Total abstinence is easier than perfect moderation +2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! `, mdCSS) } if sketchRunner != nil { - fmt.Fprintf(buf, d2sketch.DefineFillPattern()) + fmt.Fprint(buf, d2sketch.DefineFillPattern()) } // only define shadow filter if a shape uses it diff --git a/d2target/class.go b/d2target/class.go index f62a3ea43..3cc39921e 100644 --- a/d2target/class.go +++ b/d2target/class.go @@ -9,6 +9,9 @@ import ( const ( PrefixPadding = 10 PrefixWidth = 20 + CenterPadding = 50 + // 10px of padding top and bottom so text doesn't look squished + VerticalPadding = 20 ) type Class struct { diff --git a/d2target/d2target.go b/d2target/d2target.go index 9e6233de7..b5325d07e 100644 --- a/d2target/d2target.go +++ b/d2target/d2target.go @@ -551,19 +551,19 @@ func (s *Shape) GetIconSize(box *geo.Box) int { if iconPosition == label.InsideMiddleCenter { size = halfMinDimension } else { - size = go2.IntMin( + size = go2.Min( minDimension, - go2.IntMax(DEFAULT_ICON_SIZE, halfMinDimension), + go2.Max(DEFAULT_ICON_SIZE, halfMinDimension), ) } - size = go2.IntMin(size, MAX_ICON_SIZE) + size = go2.Min(size, MAX_ICON_SIZE) if !iconPosition.IsOutside() { - size = go2.IntMin(size, - go2.IntMin( - go2.IntMax(int(box.Width)-2*label.PADDING, 0), - go2.IntMax(int(box.Height)-2*label.PADDING, 0), + size = go2.Min(size, + go2.Min( + go2.Max(int(box.Width)-2*label.PADDING, 0), + go2.Max(int(box.Height)-2*label.PADDING, 0), ), ) } diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go index b96ad0b77..02d82f9b5 100644 --- a/e2etests/regression_test.go +++ b/e2etests/regression_test.go @@ -444,27 +444,6 @@ group 11: { } b -> c -`, - }, - { - name: "sequence_diagram_ambiguous_edge_group", - script: ` -Office chatter: { - shape: sequence_diagram - alice: Alice - bob: Bobby - awkward small talk: { - awkward small talk.ok - alice -> bob: uhm, hi - bob -> alice: oh, hello - icebreaker attempt: { - alice -> bob: what did you have for lunch? - } - unfortunate outcome: { - bob -> alice: that's personal - } - } -} `, }, } diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 78d639d2b..a489f6398 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -1875,6 +1875,41 @@ b: B a.sp1 -> b: foo a.sp1 -> a.sp2: redirect a.sp2 -> b: bar +`, + }, + { + name: "people", + script: ` +a.shape: person +b.shape: person +c.shape: person +d.shape: person +e.shape: person +f.shape: person +g.shape: person + +a: - +b: -- +c: ---- +d: -------- +e: ---------------- +f: -------------------------------- +g: ---------------------------------------------------------------- + +1.shape: person +2.shape: person +3.shape: person +4.shape: person +5.shape: person + +1.width: 16 +2.width: 64 +3.width: 128 +4.width: 512 + +# entering both width and height overrides aspect ratio limit +5.height: 256 +5.width: 32 `, }, { diff --git a/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/board.exp.json b/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/board.exp.json index 540dacbd6..79fe2a3c7 100644 --- a/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/board.exp.json +++ b/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/board.exp.json @@ -37,8 +37,8 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 239, - "labelHeight": 150, + "labelWidth": 234, + "labelHeight": 145, "zIndex": 0, "level": 1 }, @@ -77,8 +77,8 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 160, - "labelHeight": 118, + "labelWidth": 155, + "labelHeight": 113, "zIndex": 0, "level": 1 }, @@ -117,8 +117,8 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 160, - "labelHeight": 118, + "labelWidth": 155, + "labelHeight": 113, "zIndex": 0, "level": 1 } diff --git a/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/sketch.exp.svg b/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/sketch.exp.svg index a42fc16c7..ee57c551c 100644 --- a/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/code_leading_trailing_newlines/dagre/sketch.exp.svg @@ -56,7 +56,7 @@ width="883" height="354" viewBox="-102 -102 883 354">

Oldest message

-

Offset

-

Last message

-

Next message will be
+

Oldest message

+

Offset

+

Last message

+

Next message will be
inserted here

-
M0M1M2M3M4M5M6 - +
M0M1M2M3M4M5M6 +

Oldest message

-

Offset

-

Last message

-

Next message will be
+

Oldest message

+

Offset

+

Last message

+

Next message will be
inserted here

-
M0M1M2M3M4M5M6 - +
M0M1M2M3M4M5M6 +

hey

+

hey

  • they
      @@ -804,8 +804,8 @@ width="317" height="771" viewBox="-102 -102 317 771">

      hey

      +

      hey

      • they
          @@ -804,8 +804,8 @@ width="317" height="771" viewBox="-90 -90 317 771">x

          linux: because a PC is a terrible thing to waste

          -
          a You don't have to know how the computer works,just how to work the computer. - - +x

          linux: because a PC is a terrible thing to waste

          +
          a You don't have to know how the computer works,just how to work the computer. + + x

          linux: because a PC is a terrible thing to waste

          -
          a You don't have to know how the computer works,just how to work the computer. - - +x

          linux: because a PC is a terrible thing to waste

          +
          a You don't have to know how the computer works,just how to work the computer. + + Office chatterAliceBobbyawkward small talk uhm, hioh, hellowhat did you have for lunch?that's personalok - - - - - - \ No newline at end of file diff --git a/e2etests/testdata/regression/sequence_diagram_ambiguous_edge_group/elk/board.exp.json b/e2etests/testdata/regression/sequence_diagram_ambiguous_edge_group/elk/board.exp.json deleted file mode 100644 index 42dba2171..000000000 --- a/e2etests/testdata/regression/sequence_diagram_ambiguous_edge_group/elk/board.exp.json +++ /dev/null @@ -1,606 +0,0 @@ -{ - "name": "", - "fontFamily": "SourceSansPro", - "shapes": [ - { - "id": "Office chatter", - "type": "sequence_diagram", - "pos": { - "x": 12, - "y": 12 - }, - "width": 741, - "height": 1166, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 0, - "borderRadius": 0, - "fill": "#FFFFFF", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "Office chatter", - "fontSize": 28, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 164, - "labelHeight": 41, - "labelPosition": "INSIDE_TOP_CENTER", - "zIndex": 0, - "level": 1 - }, - { - "id": "Office chatter.alice", - "type": "rectangle", - "pos": { - "x": 36, - "y": 122 - }, - "width": 150, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "Alice", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 38, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 2 - }, - { - "id": "Office chatter.bob", - "type": "rectangle", - "pos": { - "x": 286, - "y": 122 - }, - "width": 150, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "Bobby", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 48, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 2 - }, - { - "id": "Office chatter.awkward small talk", - "type": "rectangle", - "pos": { - "x": 494, - "y": 122 - }, - "width": 235, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "awkward small talk", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 135, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 2 - }, - { - "id": "Office chatter.awkward small talk.awkward small talk", - "type": "rectangle", - "pos": { - "x": 605, - "y": 362 - }, - "width": 12, - "height": 158, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#E3E9FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 135, - "labelHeight": 26, - "zIndex": 2, - "level": 3 - }, - { - "id": "Office chatter.awkward small talk.awkward small talk.ok", - "type": "page", - "pos": { - "x": 550, - "y": 378 - }, - "width": 122, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#FFFFFF", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "ok", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 22, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 5, - "level": 4 - }, - { - "id": "Office chatter.awkward small talk.icebreaker attempt", - "type": "rectangle", - "pos": { - "x": 605, - "y": -9223372036854775808 - }, - "width": 12, - "height": 80, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 0, - "borderRadius": 0, - "fill": "#DEE1EB", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": true, - "fields": null, - "methods": null, - "columns": null, - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 134, - "labelHeight": 26, - "zIndex": 2, - "level": 3 - }, - { - "id": "Office chatter.awkward small talk.unfortunate outcome", - "type": "rectangle", - "pos": { - "x": 605, - "y": -9223372036854775808 - }, - "width": 12, - "height": 80, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 0, - "borderRadius": 0, - "fill": "#DEE1EB", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "double-border": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": true, - "fields": null, - "methods": null, - "columns": null, - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 148, - "labelHeight": 26, - "zIndex": 2, - "level": 3 - } - ], - "connections": [ - { - "id": "Office chatter.(alice -> bob)[1]", - "src": "Office chatter.alice", - "srcArrow": "none", - "srcLabel": "", - "dst": "Office chatter.bob", - "dstArrow": "triangle", - "dstLabel": "", - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "uhm, hi", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 50, - "labelHeight": 21, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "labelPercentage": 0, - "route": [ - { - "x": 111, - "y": 634 - }, - { - "x": 361, - "y": 634 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 4 - }, - { - "id": "Office chatter.(bob -> alice)[1]", - "src": "Office chatter.bob", - "srcArrow": "none", - "srcLabel": "", - "dst": "Office chatter.alice", - "dstArrow": "triangle", - "dstLabel": "", - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "oh, hello", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 56, - "labelHeight": 21, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "labelPercentage": 0, - "route": [ - { - "x": 361, - "y": 764 - }, - { - "x": 111, - "y": 764 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 4 - }, - { - "id": "Office chatter.(alice -> bob)[0]", - "src": "Office chatter.alice", - "srcArrow": "none", - "srcLabel": "", - "dst": "Office chatter.bob", - "dstArrow": "triangle", - "dstLabel": "", - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "what did you have for lunch?", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 187, - "labelHeight": 21, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "labelPercentage": 0, - "route": [ - { - "x": 111, - "y": 894 - }, - { - "x": 361, - "y": 894 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 4 - }, - { - "id": "Office chatter.(bob -> alice)[0]", - "src": "Office chatter.bob", - "srcArrow": "none", - "srcLabel": "", - "dst": "Office chatter.alice", - "dstArrow": "triangle", - "dstLabel": "", - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "that's personal", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 99, - "labelHeight": 21, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "labelPercentage": 0, - "route": [ - { - "x": 361, - "y": 1024 - }, - { - "x": 111, - "y": 1024 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 4 - }, - { - "id": "(Office chatter.alice -- )[0]", - "src": "Office chatter.alice", - "srcArrow": "none", - "srcLabel": "", - "dst": "alice-lifeline-end-3851299086", - "dstArrow": "none", - "dstLabel": "", - "opacity": 1, - "strokeDash": 6, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 0, - "labelHeight": 0, - "labelPosition": "", - "labelPercentage": 0, - "route": [ - { - "x": 111, - "y": 248 - }, - { - "x": 111, - "y": 1154 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 1 - }, - { - "id": "(Office chatter.bob -- )[0]", - "src": "Office chatter.bob", - "srcArrow": "none", - "srcLabel": "", - "dst": "bob-lifeline-end-3036726343", - "dstArrow": "none", - "dstLabel": "", - "opacity": 1, - "strokeDash": 6, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 0, - "labelHeight": 0, - "labelPosition": "", - "labelPercentage": 0, - "route": [ - { - "x": 361, - "y": 248 - }, - { - "x": 361, - "y": 1154 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 1 - }, - { - "id": "(Office chatter.awkward small talk -- )[0]", - "src": "Office chatter.awkward small talk", - "srcArrow": "none", - "srcLabel": "", - "dst": "awkward small talk-lifeline-end-861194358", - "dstArrow": "none", - "dstLabel": "", - "opacity": 1, - "strokeDash": 6, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 0, - "labelHeight": 0, - "labelPosition": "", - "labelPercentage": 0, - "route": [ - { - "x": 611.5, - "y": 248 - }, - { - "x": 611.5, - "y": 1154 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 1 - } - ] -} diff --git a/e2etests/testdata/regression/sequence_diagram_ambiguous_edge_group/elk/sketch.exp.svg b/e2etests/testdata/regression/sequence_diagram_ambiguous_edge_group/elk/sketch.exp.svg deleted file mode 100644 index 4f4934866..000000000 --- a/e2etests/testdata/regression/sequence_diagram_ambiguous_edge_group/elk/sketch.exp.svg +++ /dev/null @@ -1,62 +0,0 @@ - -Office chatterAliceBobbyawkward small talk uhm, hioh, hellowhat did you have for lunch?that's personalok - - - - - - \ No newline at end of file diff --git a/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/board.exp.json b/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/board.exp.json index 29cf0cdbf..b8298da11 100644 --- a/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/board.exp.json +++ b/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/board.exp.json @@ -10,7 +10,7 @@ "y": 0 }, "width": 448, - "height": 520, + "height": 460, "opacity": 1, "strokeDash": 0, "strokeWidth": 0, @@ -37,8 +37,8 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 43, - "labelHeight": 41, + "labelWidth": 38, + "labelHeight": 36, "labelPosition": "INSIDE_TOP_CENTER", "zIndex": 0, "level": 1 @@ -51,7 +51,7 @@ "y": 110 }, "width": 150, - "height": 126, + "height": 66, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -78,8 +78,8 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 12, - "labelHeight": 26, + "labelWidth": 7, + "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 2 @@ -92,7 +92,7 @@ "y": 110 }, "width": 150, - "height": 126, + "height": 66, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -119,8 +119,8 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 13, - "labelHeight": 26, + "labelWidth": 8, + "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 2 @@ -130,10 +130,10 @@ "type": "sequence_diagram", "pos": { "x": 0, - "y": 620 + "y": 560 }, "width": 448, - "height": 520, + "height": 460, "opacity": 1, "strokeDash": 0, "strokeWidth": 0, @@ -160,8 +160,8 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 84, - "labelHeight": 41, + "labelWidth": 79, + "labelHeight": 36, "labelPosition": "INSIDE_TOP_CENTER", "zIndex": 0, "level": 1 @@ -171,10 +171,10 @@ "type": "rectangle", "pos": { "x": 24, - "y": 730 + "y": 670 }, "width": 150, - "height": 126, + "height": 66, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -201,8 +201,8 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 12, - "labelHeight": 26, + "labelWidth": 7, + "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 2 @@ -212,10 +212,10 @@ "type": "rectangle", "pos": { "x": 274, - "y": 730 + "y": 670 }, "width": 150, - "height": 126, + "height": 66, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -242,8 +242,8 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 13, - "labelHeight": 26, + "labelWidth": 8, + "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 2 @@ -277,11 +277,11 @@ "route": [ { "x": 99, - "y": 366 + "y": 306 }, { "x": 349, - "y": 366 + "y": 306 } ], "animated": false, @@ -316,11 +316,11 @@ "route": [ { "x": 99, - "y": 986 + "y": 866 }, { "x": 349, - "y": 986 + "y": 866 } ], "animated": false, @@ -353,6 +353,14 @@ "labelPosition": "", "labelPercentage": 0, "route": [ + { + "x": 224, + "y": 460 + }, + { + "x": 224, + "y": 500 + }, { "x": 224, "y": 520 @@ -360,14 +368,6 @@ { "x": 224, "y": 560 - }, - { - "x": 224, - "y": 580 - }, - { - "x": 224, - "y": 620 } ], "isCurve": true, @@ -403,11 +403,11 @@ "route": [ { "x": 99, - "y": 236 + "y": 176 }, { "x": 99, - "y": 496 + "y": 436 } ], "animated": false, @@ -442,11 +442,11 @@ "route": [ { "x": 349, - "y": 236 + "y": 176 }, { "x": 349, - "y": 496 + "y": 436 } ], "animated": false, @@ -481,11 +481,11 @@ "route": [ { "x": 99, - "y": 856 + "y": 736 }, { "x": 99, - "y": 1116 + "y": 996 } ], "animated": false, @@ -520,11 +520,11 @@ "route": [ { "x": 349, - "y": 856 + "y": 736 }, { "x": 349, - "y": 1116 + "y": 996 } ], "animated": false, diff --git a/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/sketch.exp.svg b/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/sketch.exp.svg index 6fe13d70d..4299daaaf 100644 --- a/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/sequence_diagram_name_crash/dagre/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="648" height="1340" viewBox="-100 -100 648 1340">aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + + aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + + xyThe top of the mountain

          Cats, no less liquid than their shadows, offer no angles to the wind.

          +xyThe top of the mountain

          Cats, no less liquid than their shadows, offer no angles to the wind.

          If we can't fix it, it ain't broke.

          Dieters live life in the fasting lane.

          -
          JoeDonaldi am top lefti am top righti am bottom lefti am bottom right - +
          JoeDonaldi am top lefti am top righti am bottom lefti am bottom right + xyThe top of the mountain

          Cats, no less liquid than their shadows, offer no angles to the wind.

          +xyThe top of the mountain

          Cats, no less liquid than their shadows, offer no angles to the wind.

          If we can't fix it, it ain't broke.

          Dieters live life in the fasting lane.

          -
          JoeDonaldi am top lefti am top righti am bottom lefti am bottom right - +
          JoeDonaldi am top lefti am top righti am bottom lefti am bottom right + poll the peopleresultsunfavorablefavorablewill of the people

          A winning strategy

          -
          - +poll the peopleresultsunfavorablefavorablewill of the people

          A winning strategy

          +
          + poll the peopleresultsunfavorablefavorablewill of the people

          A winning strategy

          -
          - +poll the peopleresultsunfavorablefavorablewill of the people

          A winning strategy

          +
          +

          Markdown: Syntax

          +

          Markdown: Syntax

          • Overview
              @@ -1053,8 +1053,8 @@ title for the link, surrounded in quotes. For example:

              Code

              Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:

              -
          ab - +
          ab +

          Markdown: Syntax

          +

          Markdown: Syntax

          • Overview
              @@ -1053,8 +1053,8 @@ title for the link, surrounded in quotes. For example:

              Code

              Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:

              -
          ab - +
          ab +

          Note: This document is itself written using Markdown; you +

          Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


          Overview

          -
          ab - +
          ab +

          Note: This document is itself written using Markdown; you +

          Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


          Overview

          -
          ab - +
          ab + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + +
            +
            • Overview
              • Philosophy
              • @@ -808,8 +808,8 @@ width="583" height="756" viewBox="-102 -102 583 756">
                  +
                  • Overview
                    • Philosophy
                    • @@ -808,8 +808,8 @@ width="583" height="756" viewBox="-90 -90 583 756">
                        +
                        • Overview ok this is all measured
                          • Philosophy
                          • @@ -804,8 +804,8 @@ width="449" height="732" viewBox="-102 -102 449 732">
                              +
                              • Overview ok this is all measured
                                • Philosophy
                                • @@ -804,8 +804,8 @@ width="449" height="732" viewBox="-90 -90 449 732">
                                    +
                                    • Overview
                                      • Philosophy
                                      • @@ -829,8 +829,8 @@ width="551" height="1168" viewBox="-102 -102 551 1168">
                                          +
                                          • Overview
                                            • Philosophy
                                            • @@ -829,8 +829,8 @@ width="551" height="1168" viewBox="-90 -90 551 1168">

                                              List items may consist of multiple paragraphs. Each subsequent +

                                              List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:

                                                @@ -827,8 +827,8 @@ sit amet, consectetuer adipiscing elit.

                                                Another item in the same list.

                                            -
                                          ab - +
                                        ab +

                                        List items may consist of multiple paragraphs. Each subsequent +

                                        List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:

                                          @@ -827,8 +827,8 @@ sit amet, consectetuer adipiscing elit.

                                          Another item in the same list.

                                      -
                                    ab - +
                                  ab +

                                  Markdown: Syntax

                                  -
                                  ab - +

                                  Markdown: Syntax

                                  +
                                  ab +

                                  Markdown: Syntax

                                  -
                                  ab - +

                                  Markdown: Syntax

                                  +
                                  ab +

                                  Every frustum longs to be a cone

                                  +

                                  Every frustum longs to be a cone

                                  • A continuing flow of paper is sufficient to continue the flow of paper
                                  • Please remain calm, it's no use both of us being hysterical at the same time
                                  • Visits always give pleasure: if not on arrival, then on the departure

                                  Festivity Level 1: Your guests are chatting amiably with each other.

                                  -
                                  xy - +
                                  xy +

                                  Every frustum longs to be a cone

                                  +

                                  Every frustum longs to be a cone

                                  • A continuing flow of paper is sufficient to continue the flow of paper
                                  • Please remain calm, it's no use both of us being hysterical at the same time
                                  • Visits always give pleasure: if not on arrival, then on the departure

                                  Festivity Level 1: Your guests are chatting amiably with each other.

                                  -
                                  xy - +
                                  xy + markdown

                                  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                                  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                                  -
                                  +
                              markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                              -
                              +
                            markdown

                            Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                            sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                            -
                            +
                        markdown

                        Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                        sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                        -
                        +
                      {
                      +
                      {
                       	fenced: "block",
                       	of: "json",
                       }
                       
                      -
                      ab - +
                      ab +
                      {
                      +
                      {
                       	fenced: "block",
                       	of: "json",
                       }
                       
                      -
                      ab - +
                      ab +

                      a line of text and an

                      +

                      a line of text and an

                      {
                       	indented: "block",
                       	of: "json",
                       }
                       
                      -
                      ab - +
                      ab +

                      a line of text and an

                      +

                      a line of text and an

                      {
                       	indented: "block",
                       	of: "json",
                       }
                       
                      -
                      ab - +
                      ab +

                      code

                      -
                      ab - +

                      code

                      +
                      ab +

                      code

                      -
                      ab - +

                      code

                      +
                      ab +

                      A paragraph is simply one or more consecutive lines of text, separated +

                      A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

                      -
                      ab - +
                      ab +

                      A paragraph is simply one or more consecutive lines of text, separated +

                      A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

                      -
                      ab - +
                      ab + -------------------------------------------------------------------------------------------------------------------------------12345 + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/people/elk/board.exp.json b/e2etests/testdata/stable/people/elk/board.exp.json new file mode 100644 index 000000000..86e8ac798 --- /dev/null +++ b/e2etests/testdata/stable/people/elk/board.exp.json @@ -0,0 +1,499 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "person", + "pos": { + "x": 12, + "y": 269 + }, + "width": 49, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "-", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 5, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "person", + "pos": { + "x": 81, + "y": 269 + }, + "width": 64, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "--", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 11, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "person", + "pos": { + "x": 165, + "y": 269 + }, + "width": 89, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "----", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 21, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "d", + "type": "person", + "pos": { + "x": 274, + "y": 254 + }, + "width": 142, + "height": 95, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "--------", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 43, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "e", + "type": "person", + "pos": { + "x": 436, + "y": 220 + }, + "width": 245, + "height": 163, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "----------------", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 85, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "f", + "type": "person", + "pos": { + "x": 701, + "y": 151 + }, + "width": 453, + "height": 302, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "--------------------------------", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 170, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "g", + "type": "person", + "pos": { + "x": 1174, + "y": 12 + }, + "width": 870, + "height": 580, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "----------------------------------------------------------------", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 340, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "1", + "type": "person", + "pos": { + "x": 2064, + "y": 291 + }, + "width": 18, + "height": 21, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "1", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "2", + "type": "person", + "pos": { + "x": 2102, + "y": 280 + }, + "width": 64, + "height": 43, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "3", + "type": "person", + "pos": { + "x": 2186, + "y": 259 + }, + "width": 128, + "height": 85, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "3", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "4", + "type": "person", + "pos": { + "x": 2334, + "y": 131 + }, + "width": 512, + "height": 341, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "4", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "5", + "type": "person", + "pos": { + "x": 2866, + "y": 174 + }, + "width": 32, + "height": 256, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "5", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/stable/people/elk/sketch.exp.svg b/e2etests/testdata/stable/people/elk/sketch.exp.svg new file mode 100644 index 000000000..4d0a12f5f --- /dev/null +++ b/e2etests/testdata/stable/people/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +-------------------------------------------------------------------------------------------------------------------------------12345 + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/pre/dagre/board.exp.json b/e2etests/testdata/stable/pre/dagre/board.exp.json index 6df9bec8c..589035e7e 100644 --- a/e2etests/testdata/stable/pre/dagre/board.exp.json +++ b/e2etests/testdata/stable/pre/dagre/board.exp.json @@ -7,7 +7,7 @@ "type": "text", "pos": { "x": 0, - "y": 226 + "y": 166 }, "width": 602, "height": 170, @@ -46,11 +46,11 @@ "id": "a", "type": "rectangle", "pos": { - "x": 245, + "x": 275, "y": 0 }, - "width": 113, - "height": 126, + "width": 53, + "height": 66, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -77,8 +77,8 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 13, - "labelHeight": 26, + "labelWidth": 8, + "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 1 @@ -87,11 +87,11 @@ "id": "b", "type": "rectangle", "pos": { - "x": 245, - "y": 496 + "x": 275, + "y": 436 }, - "width": 113, - "height": 126, + "width": 53, + "height": 66, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -118,8 +118,8 @@ "italic": false, "bold": true, "underline": false, - "labelWidth": 13, - "labelHeight": 26, + "labelWidth": 8, + "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 1 @@ -151,6 +151,14 @@ "labelPosition": "", "labelPercentage": 0, "route": [ + { + "x": 301, + "y": 66 + }, + { + "x": 301, + "y": 106 + }, { "x": 301, "y": 126 @@ -158,14 +166,6 @@ { "x": 301, "y": 166 - }, - { - "x": 301, - "y": 186 - }, - { - "x": 301, - "y": 226 } ], "isCurve": true, @@ -199,6 +199,14 @@ "labelPosition": "", "labelPercentage": 0, "route": [ + { + "x": 301, + "y": 336 + }, + { + "x": 301, + "y": 376 + }, { "x": 301, "y": 396 @@ -206,14 +214,6 @@ { "x": 301, "y": 436 - }, - { - "x": 301, - "y": 456 - }, - { - "x": 301, - "y": 496 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/pre/dagre/sketch.exp.svg b/e2etests/testdata/stable/pre/dagre/sketch.exp.svg index 40020e16b..41b1f6cef 100644 --- a/e2etests/testdata/stable/pre/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/pre/dagre/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="806" height="826" viewBox="-102 -102 806 826">

                      Here is an example of AppleScript:

                      +

                      Here is an example of AppleScript:

                      tell application "Foo"
                           beep
                       end tell
                       

                      A code block continues until it reaches a line that is not indented (or the end of the article).

                      -
                      ab - +
                      ab +

                      Here is an example of AppleScript:

                      +

                      Here is an example of AppleScript:

                      tell application "Foo"
                           beep
                       end tell
                       

                      A code block continues until it reaches a line that is not indented (or the end of the article).

                      -
                      ab - +
                      ab + containerscloudtall cylinderclass- +containerscloudtall cylinderclass- num int- timeout @@ -808,7 +808,7 @@ width="2482" height="2672" viewBox="-102 -102 2482 2672">containerscloudtall cylinderclass- +containerscloudtall cylinderclass- num int- timeout @@ -808,7 +808,7 @@ width="2622" height="2644" viewBox="-90 -90 2622 2644">