Merge pull request #498 from gavin-ts/set-width-height-on-shapes
render: support width/height on shapes
|
|
@ -2,9 +2,11 @@
|
|||
|
||||
- Tooltips can be set on shapes. See [https://d2lang.com/tour/tooltips](https://d2lang.com/tour/interactive). [#548](https://github.com/terrastruct/d2/pull/548)
|
||||
- Links can be set on shapes. See [https://d2lang.com/tour/tooltips](https://d2lang.com/tour/interactive). [#548](https://github.com/terrastruct/d2/pull/548)
|
||||
- The `width` and `height` attributes are no longer restricted to images and can be applied to non-container shapes. [#498](https://github.com/terrastruct/d2/pull/498)
|
||||
|
||||
#### Improvements 🧹
|
||||
|
||||
#### Bugfixes ⛑️
|
||||
|
||||
- Restricts where `near` key constant values can be used, with good error messages, instead of erroring (e.g. setting `near: top-center` on a container would cause bad layouts or error). [#538](https://github.com/terrastruct/d2/pull/538)
|
||||
- Fixes rendering classes and tables with empty headers. [#498](https://github.com/terrastruct/d2/pull/498)
|
||||
|
|
|
|||
|
|
@ -797,15 +797,18 @@ func (c *compiler) validateKey(obj *d2graph.Object, m *d2ast.Map, mk *d2ast.Key)
|
|||
return
|
||||
}
|
||||
|
||||
if reserved == "" && obj.Attributes.Shape.Value == d2target.ShapeImage {
|
||||
c.errorf(mk.Range.Start, mk.Range.End, "image shapes cannot have children.")
|
||||
}
|
||||
switch strings.ToLower(obj.Attributes.Shape.Value) {
|
||||
case d2target.ShapeImage:
|
||||
if reserved == "" {
|
||||
c.errorf(mk.Range.Start, mk.Range.End, "image shapes cannot have children.")
|
||||
}
|
||||
case d2target.ShapeCircle, d2target.ShapeSquare:
|
||||
checkEqual := (reserved == "width" && obj.Attributes.Height != nil) ||
|
||||
(reserved == "height" && obj.Attributes.Width != nil)
|
||||
|
||||
if reserved == "width" && obj.Attributes.Shape.Value != d2target.ShapeImage {
|
||||
c.errorf(mk.Range.Start, mk.Range.End, "width is only applicable to image shapes.")
|
||||
}
|
||||
if reserved == "height" && obj.Attributes.Shape.Value != d2target.ShapeImage {
|
||||
c.errorf(mk.Range.Start, mk.Range.End, "height is only applicable to image shapes.")
|
||||
if checkEqual && obj.Attributes.Width.Value != obj.Attributes.Height.Value {
|
||||
c.errorf(mk.Range.Start, mk.Range.End, fmt.Sprintf("width and height must be equal for %s shapes", obj.Attributes.Shape.Value))
|
||||
}
|
||||
}
|
||||
|
||||
in := d2target.IsShape(obj.Attributes.Shape.Value)
|
||||
|
|
@ -830,6 +833,14 @@ func (c *compiler) validateKey(obj *d2graph.Object, m *d2ast.Map, mk *d2ast.Key)
|
|||
return
|
||||
}
|
||||
|
||||
switch strings.ToLower(obj.Attributes.Shape.Value) {
|
||||
case d2target.ShapeSQLTable, d2target.ShapeClass:
|
||||
default:
|
||||
if len(obj.Children) > 0 && (reserved == "width" || reserved == "height") {
|
||||
c.errorf(mk.Range.Start, mk.Range.End, fmt.Sprintf("%s cannot be used on container: %s", reserved, obj.AbsID()))
|
||||
}
|
||||
}
|
||||
|
||||
if len(mk.Edges) > 0 {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,8 +95,119 @@ x: {
|
|||
height: 230
|
||||
}
|
||||
`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2:3:2: width is only applicable to image shapes.
|
||||
d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2:4:2: height is only applicable to image shapes.
|
||||
assertions: func(t *testing.T, g *d2graph.Graph) {
|
||||
if len(g.Objects) != 1 {
|
||||
t.Fatalf("expected 1 objects: %#v", g.Objects)
|
||||
}
|
||||
if g.Objects[0].ID != "hey" {
|
||||
t.Fatalf("expected g.Objects[0].ID to be 'hey': %#v", g.Objects[0])
|
||||
}
|
||||
if g.Objects[0].Attributes.Shape.Value != d2target.ShapeHexagon {
|
||||
t.Fatalf("expected g.Objects[0].Attributes.Shape.Value to be hexagon: %#v", g.Objects[0].Attributes.Shape.Value)
|
||||
}
|
||||
if g.Objects[0].Attributes.Width.Value != "200" {
|
||||
t.Fatalf("expected g.Objects[0].Attributes.Width.Value to be 200: %#v", g.Objects[0].Attributes.Width.Value)
|
||||
}
|
||||
if g.Objects[0].Attributes.Height.Value != "230" {
|
||||
t.Fatalf("expected g.Objects[0].Attributes.Height.Value to be 230: %#v", g.Objects[0].Attributes.Height.Value)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "equal_dimensions_on_circle",
|
||||
|
||||
text: `hey: "" {
|
||||
shape: circle
|
||||
width: 200
|
||||
height: 230
|
||||
}
|
||||
`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2:3:2: width and height must be equal for circle shapes
|
||||
d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2:4:2: width and height must be equal for circle shapes
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "single_dimension_on_circle",
|
||||
|
||||
text: `hey: "" {
|
||||
shape: circle
|
||||
height: 230
|
||||
}
|
||||
`,
|
||||
assertions: func(t *testing.T, g *d2graph.Graph) {
|
||||
if len(g.Objects) != 1 {
|
||||
t.Fatalf("expected 1 objects: %#v", g.Objects)
|
||||
}
|
||||
if g.Objects[0].ID != "hey" {
|
||||
t.Fatalf("expected ID to be 'hey': %#v", g.Objects[0])
|
||||
}
|
||||
if g.Objects[0].Attributes.Shape.Value != d2target.ShapeCircle {
|
||||
t.Fatalf("expected Attributes.Shape.Value to be circle: %#v", g.Objects[0].Attributes.Shape.Value)
|
||||
}
|
||||
if g.Objects[0].Attributes.Width != nil {
|
||||
t.Fatalf("expected Attributes.Width to be nil: %#v", g.Objects[0].Attributes.Width)
|
||||
}
|
||||
if g.Objects[0].Attributes.Height == nil {
|
||||
t.Fatalf("Attributes.Height is nil")
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "no_dimensions_on_containers",
|
||||
|
||||
text: `
|
||||
containers: {
|
||||
circle container: {
|
||||
shape: circle
|
||||
width: 512
|
||||
|
||||
diamond: {
|
||||
shape: diamond
|
||||
width: 128
|
||||
height: 64
|
||||
}
|
||||
}
|
||||
diamond container: {
|
||||
shape: diamond
|
||||
width: 512
|
||||
height: 256
|
||||
|
||||
circle: {
|
||||
shape: circle
|
||||
width: 128
|
||||
}
|
||||
}
|
||||
oval container: {
|
||||
shape: oval
|
||||
width: 512
|
||||
height: 256
|
||||
|
||||
hexagon: {
|
||||
shape: hexagon
|
||||
width: 128
|
||||
height: 64
|
||||
}
|
||||
}
|
||||
hexagon container: {
|
||||
shape: hexagon
|
||||
width: 512
|
||||
height: 256
|
||||
|
||||
oval: {
|
||||
shape: oval
|
||||
width: 128
|
||||
height: 64
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:5:3: width cannot be used on container: containers.circle container
|
||||
d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:15:3: width cannot be used on container: containers.diamond container
|
||||
d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:16:3: height cannot be used on container: containers.diamond container
|
||||
d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:25:3: width cannot be used on container: containers.oval container
|
||||
d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:26:3: height cannot be used on container: containers.oval container
|
||||
d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:36:3: width cannot be used on container: containers.hexagon container
|
||||
d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:37:3: height cannot be used on container: containers.hexagon container
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package d2graph
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -21,6 +22,7 @@ import (
|
|||
)
|
||||
|
||||
const INNER_LABEL_PADDING int = 5
|
||||
const DEFAULT_SHAPE_PADDING = 100.
|
||||
|
||||
// TODO: Refactor with a light abstract layer on top of AST implementing scenarios,
|
||||
// variables, imports, substitutions and then a final set of structures representing
|
||||
|
|
@ -668,6 +670,162 @@ func (obj *Object) AppendReferences(ida []string, ref Reference, unresolvedObj *
|
|||
}
|
||||
}
|
||||
|
||||
func (obj *Object) GetLabelSize(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *d2fonts.FontFamily) (*d2target.TextDimensions, error) {
|
||||
shapeType := strings.ToLower(obj.Attributes.Shape.Value)
|
||||
|
||||
var dims *d2target.TextDimensions
|
||||
switch shapeType {
|
||||
case d2target.ShapeText:
|
||||
if obj.Attributes.Language == "latex" {
|
||||
width, height, err := d2latex.Measure(obj.Text().Text)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dims = d2target.NewTextDimensions(width, height)
|
||||
} else if obj.Attributes.Language != "" {
|
||||
var err error
|
||||
dims, err = getMarkdownDimensions(mtexts, ruler, obj.Text(), fontFamily)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
dims = GetTextDimensions(mtexts, ruler, obj.Text(), fontFamily)
|
||||
}
|
||||
|
||||
case d2target.ShapeClass:
|
||||
dims = GetTextDimensions(mtexts, ruler, obj.Text(), go2.Pointer(d2fonts.SourceCodePro))
|
||||
|
||||
default:
|
||||
dims = GetTextDimensions(mtexts, ruler, obj.Text(), fontFamily)
|
||||
}
|
||||
|
||||
if shapeType == d2target.ShapeSQLTable && obj.Attributes.Label.Value == "" {
|
||||
// measure with placeholder text to determine height
|
||||
placeholder := *obj.Text()
|
||||
placeholder.Text = "Table"
|
||||
dims = GetTextDimensions(mtexts, ruler, &placeholder, fontFamily)
|
||||
}
|
||||
|
||||
if dims == nil {
|
||||
if shapeType == d2target.ShapeImage {
|
||||
dims = d2target.NewTextDimensions(0, 0)
|
||||
} else {
|
||||
return nil, fmt.Errorf("dimensions for object label %#v not found", obj.Text())
|
||||
}
|
||||
}
|
||||
|
||||
return dims, nil
|
||||
}
|
||||
|
||||
func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *d2fonts.FontFamily, labelDims d2target.TextDimensions) (*d2target.TextDimensions, error) {
|
||||
dims := d2target.TextDimensions{}
|
||||
|
||||
switch strings.ToLower(obj.Attributes.Shape.Value) {
|
||||
default:
|
||||
return d2target.NewTextDimensions(labelDims.Width, labelDims.Height), nil
|
||||
|
||||
case d2target.ShapeImage:
|
||||
return d2target.NewTextDimensions(128, 128), nil
|
||||
|
||||
case d2target.ShapeClass:
|
||||
maxWidth := labelDims.Width
|
||||
|
||||
for _, f := range obj.Class.Fields {
|
||||
fdims := GetTextDimensions(mtexts, ruler, f.Text(), go2.Pointer(d2fonts.SourceCodePro))
|
||||
if fdims == nil {
|
||||
return nil, fmt.Errorf("dimensions for class field %#v not found", f.Text())
|
||||
}
|
||||
lineWidth := fdims.Width
|
||||
if maxWidth < lineWidth {
|
||||
maxWidth = lineWidth
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
dims.Width = maxWidth
|
||||
|
||||
// All rows should be the same height
|
||||
var anyRowText *d2target.MText
|
||||
if len(obj.Class.Fields) > 0 {
|
||||
anyRowText = obj.Class.Fields[0].Text()
|
||||
} else if len(obj.Class.Methods) > 0 {
|
||||
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
|
||||
dims.Height = rowHeight * (len(obj.Class.Fields) + len(obj.Class.Methods) + 2)
|
||||
} else {
|
||||
dims.Height = labelDims.Height
|
||||
}
|
||||
|
||||
case d2target.ShapeSQLTable:
|
||||
maxNameWidth := 0
|
||||
maxTypeWidth := 0
|
||||
constraintWidth := 0
|
||||
|
||||
for i := range obj.SQLTable.Columns {
|
||||
// Note: we want to set dimensions of actual column not the for loop copy of the struct
|
||||
c := &obj.SQLTable.Columns[i]
|
||||
ctexts := c.Texts()
|
||||
|
||||
nameDims := GetTextDimensions(mtexts, ruler, ctexts[0], fontFamily)
|
||||
if nameDims == nil {
|
||||
return nil, fmt.Errorf("dimensions for sql_table name %#v not found", ctexts[0].Text)
|
||||
}
|
||||
c.Name.LabelWidth = nameDims.Width
|
||||
c.Name.LabelHeight = nameDims.Height
|
||||
if maxNameWidth < nameDims.Width {
|
||||
maxNameWidth = nameDims.Width
|
||||
}
|
||||
|
||||
typeDims := GetTextDimensions(mtexts, ruler, ctexts[1], fontFamily)
|
||||
if typeDims == nil {
|
||||
return nil, fmt.Errorf("dimensions for sql_table type %#v not found", ctexts[1].Text)
|
||||
}
|
||||
c.Type.LabelWidth = typeDims.Width
|
||||
c.Type.LabelHeight = typeDims.Height
|
||||
if maxTypeWidth < typeDims.Width {
|
||||
maxTypeWidth = typeDims.Width
|
||||
}
|
||||
|
||||
if c.Constraint != "" {
|
||||
// covers UNQ constraint with padding
|
||||
constraintWidth = 60
|
||||
}
|
||||
}
|
||||
|
||||
// The rows get padded a little due to header font being larger than row font
|
||||
dims.Height = labelDims.Height * (len(obj.SQLTable.Columns) + 1)
|
||||
dims.Width = d2target.NamePadding + maxNameWidth + d2target.TypePadding + maxTypeWidth + d2target.TypePadding + constraintWidth
|
||||
}
|
||||
|
||||
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"`
|
||||
|
||||
|
|
@ -898,166 +1056,66 @@ func appendTextDedup(texts []*d2target.MText, t *d2target.MText) []*d2target.MTe
|
|||
func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *d2fonts.FontFamily) error {
|
||||
for _, obj := range g.Objects {
|
||||
obj.Box = &geo.Box{}
|
||||
// TODO fix edge cases for unnamed class etc
|
||||
// Image shapes can set their own widths/heights
|
||||
if obj.Attributes.Label.Value == "" && obj.Attributes.Shape.Value != d2target.ShapeImage {
|
||||
obj.Width = 100
|
||||
obj.Height = 100
|
||||
continue
|
||||
|
||||
var desiredWidth int
|
||||
var desiredHeight int
|
||||
if obj.Attributes.Width != nil {
|
||||
desiredWidth, _ = strconv.Atoi(obj.Attributes.Width.Value)
|
||||
}
|
||||
if obj.Attributes.Height != nil {
|
||||
desiredHeight, _ = strconv.Atoi(obj.Attributes.Height.Value)
|
||||
}
|
||||
shapeType := strings.ToLower(obj.Attributes.Shape.Value)
|
||||
|
||||
labelDims, err := obj.GetLabelSize(mtexts, ruler, fontFamily)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var dims *d2target.TextDimensions
|
||||
var innerLabelPadding = INNER_LABEL_PADDING
|
||||
if obj.Attributes.Shape.Value == d2target.ShapeText {
|
||||
if obj.Attributes.Language == "latex" {
|
||||
width, height, err := d2latex.Measure(obj.Text().Text)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dims = d2target.NewTextDimensions(width, height)
|
||||
} else if obj.Attributes.Language != "" {
|
||||
var err error
|
||||
dims, err = getMarkdownDimensions(mtexts, ruler, obj.Text(), fontFamily)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
dims = GetTextDimensions(mtexts, ruler, obj.Text(), fontFamily)
|
||||
}
|
||||
innerLabelPadding = 0
|
||||
} else if obj.Attributes.Shape.Value == d2target.ShapeClass {
|
||||
dims = GetTextDimensions(mtexts, ruler, obj.Text(), go2.Pointer(d2fonts.SourceCodePro))
|
||||
} else {
|
||||
dims = GetTextDimensions(mtexts, ruler, obj.Text(), fontFamily)
|
||||
}
|
||||
if dims == nil {
|
||||
if obj.Attributes.Shape.Value == d2target.ShapeImage {
|
||||
dims = d2target.NewTextDimensions(0, 0)
|
||||
} else {
|
||||
return fmt.Errorf("dimensions for object label %#v not found", obj.Text())
|
||||
}
|
||||
}
|
||||
|
||||
switch obj.Attributes.Shape.Value {
|
||||
switch shapeType {
|
||||
case d2target.ShapeText, d2target.ShapeClass, d2target.ShapeSQLTable, d2target.ShapeCode:
|
||||
// no labels
|
||||
default:
|
||||
if obj.Attributes.Label.Value != "" {
|
||||
obj.LabelWidth = go2.Pointer(dims.Width)
|
||||
obj.LabelHeight = go2.Pointer(dims.Height)
|
||||
obj.LabelWidth = go2.Pointer(labelDims.Width)
|
||||
obj.LabelHeight = go2.Pointer(labelDims.Height)
|
||||
}
|
||||
}
|
||||
|
||||
dims.Width += innerLabelPadding
|
||||
dims.Height += innerLabelPadding
|
||||
obj.LabelDimensions = *dims
|
||||
obj.Width = float64(dims.Width)
|
||||
obj.Height = float64(dims.Height)
|
||||
if shapeType != d2target.ShapeText && obj.Attributes.Label.Value != "" {
|
||||
labelDims.Width += INNER_LABEL_PADDING
|
||||
labelDims.Height += INNER_LABEL_PADDING
|
||||
}
|
||||
obj.LabelDimensions = *labelDims
|
||||
|
||||
switch strings.ToLower(obj.Attributes.Shape.Value) {
|
||||
default:
|
||||
obj.Width += 100
|
||||
obj.Height += 100
|
||||
defaultDims, err := obj.GetDefaultSize(mtexts, ruler, fontFamily, *labelDims)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
case d2target.ShapeImage:
|
||||
if obj.Attributes.Width != nil {
|
||||
w, _ := strconv.Atoi(obj.Attributes.Width.Value)
|
||||
obj.Width = float64(w)
|
||||
} else {
|
||||
obj.Width = 128
|
||||
}
|
||||
if obj.Attributes.Height != nil {
|
||||
h, _ := strconv.Atoi(obj.Attributes.Height.Value)
|
||||
obj.Height = float64(h)
|
||||
} else {
|
||||
obj.Height = 128
|
||||
}
|
||||
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:
|
||||
sideLength := go2.Max(obj.Width, obj.Height)
|
||||
obj.Width = sideLength + 100
|
||||
obj.Height = sideLength + 100
|
||||
|
||||
case d2target.ShapeClass:
|
||||
maxWidth := dims.Width
|
||||
|
||||
for _, f := range obj.Class.Fields {
|
||||
fdims := GetTextDimensions(mtexts, ruler, f.Text(), go2.Pointer(d2fonts.SourceCodePro))
|
||||
if fdims == nil {
|
||||
return fmt.Errorf("dimensions for class field %#v not found", f.Text())
|
||||
}
|
||||
lineWidth := fdims.Width
|
||||
if maxWidth < lineWidth {
|
||||
maxWidth = lineWidth
|
||||
}
|
||||
}
|
||||
for _, m := range obj.Class.Methods {
|
||||
mdims := GetTextDimensions(mtexts, ruler, m.Text(), go2.Pointer(d2fonts.SourceCodePro))
|
||||
if mdims == nil {
|
||||
return fmt.Errorf("dimensions for class method %#v not found", m.Text())
|
||||
}
|
||||
lineWidth := mdims.Width
|
||||
if maxWidth < lineWidth {
|
||||
maxWidth = lineWidth
|
||||
}
|
||||
if desiredWidth != 0 || desiredHeight != 0 {
|
||||
paddingX = 0.
|
||||
paddingY = 0.
|
||||
}
|
||||
|
||||
// All rows should be the same height
|
||||
var anyRowText *d2target.MText
|
||||
if len(obj.Class.Fields) > 0 {
|
||||
anyRowText = obj.Class.Fields[0].Text()
|
||||
} else if len(obj.Class.Methods) > 0 {
|
||||
anyRowText = obj.Class.Methods[0].Text()
|
||||
sideLength := math.Max(obj.Width+paddingX, obj.Height+paddingY)
|
||||
obj.Width = sideLength
|
||||
obj.Height = sideLength
|
||||
|
||||
default:
|
||||
if desiredWidth == 0 {
|
||||
obj.Width += float64(paddingX)
|
||||
}
|
||||
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
|
||||
obj.Height = float64(rowHeight * (len(obj.Class.Fields) + len(obj.Class.Methods) + 2))
|
||||
if desiredHeight == 0 {
|
||||
obj.Height += float64(paddingY)
|
||||
}
|
||||
// Leave room for padding
|
||||
obj.Width = float64(maxWidth + 100)
|
||||
|
||||
case d2target.ShapeSQLTable:
|
||||
maxNameWidth := 0
|
||||
maxTypeWidth := 0
|
||||
constraintWidth := 0
|
||||
|
||||
for i := range obj.SQLTable.Columns {
|
||||
// Note: we want to set dimensions of actual column not the for loop copy of the struct
|
||||
c := &obj.SQLTable.Columns[i]
|
||||
ctexts := c.Texts()
|
||||
|
||||
nameDims := GetTextDimensions(mtexts, ruler, ctexts[0], fontFamily)
|
||||
if nameDims == nil {
|
||||
return fmt.Errorf("dimensions for sql_table name %#v not found", ctexts[0].Text)
|
||||
}
|
||||
c.Name.LabelWidth = nameDims.Width
|
||||
c.Name.LabelHeight = nameDims.Height
|
||||
if maxNameWidth < nameDims.Width {
|
||||
maxNameWidth = nameDims.Width
|
||||
}
|
||||
|
||||
typeDims := GetTextDimensions(mtexts, ruler, ctexts[1], fontFamily)
|
||||
if typeDims == nil {
|
||||
return fmt.Errorf("dimensions for sql_table type %#v not found", ctexts[1].Text)
|
||||
}
|
||||
c.Type.LabelWidth = typeDims.Width
|
||||
c.Type.LabelHeight = typeDims.Height
|
||||
if maxTypeWidth < typeDims.Width {
|
||||
maxTypeWidth = typeDims.Width
|
||||
}
|
||||
|
||||
if c.Constraint != "" {
|
||||
// covers UNQ constraint with padding
|
||||
constraintWidth = 60
|
||||
}
|
||||
}
|
||||
|
||||
// The rows get padded a little due to header font being larger than row font
|
||||
obj.Height = float64(dims.Height * (len(obj.SQLTable.Columns) + 1))
|
||||
obj.Width = float64(d2target.NamePadding + maxNameWidth + d2target.TypePadding + maxTypeWidth + d2target.TypePadding + constraintWidth)
|
||||
|
||||
case d2target.ShapeText, d2target.ShapeCode:
|
||||
}
|
||||
}
|
||||
for _, edge := range g.Edges {
|
||||
|
|
|
|||
|
|
@ -215,6 +215,39 @@ m6_desc: |md
|
|||
inserted here
|
||||
|
|
||||
m6_desc -> queue.M6
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "unnamed_class_table_code",
|
||||
script: `
|
||||
|
||||
class -> users -> code
|
||||
|
||||
class: "" {
|
||||
shape: class
|
||||
-num: int
|
||||
-timeout: int
|
||||
-pid
|
||||
|
||||
+getStatus(): Enum
|
||||
+getJobs(): "Job[]"
|
||||
+setTimeout(seconds int)
|
||||
}
|
||||
|
||||
users: "" {
|
||||
shape: sql_table
|
||||
id: int
|
||||
name: string
|
||||
email: string
|
||||
password: string
|
||||
last_login: datetime
|
||||
}
|
||||
|
||||
code: |go
|
||||
a := 5
|
||||
b := a + 7
|
||||
fmt.Printf("%d", b)
|
||||
|
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1638,6 +1638,90 @@ x -> y
|
|||
script: `x: { link: https://d2lang.com }
|
||||
y: { link: https://terrastruct.com; tooltip: Gee, I feel kind of LIGHT in the head now,\nknowing I can't make my satellite dish PAYMENTS! }
|
||||
x -> y
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "unnamed_only_width",
|
||||
script: `
|
||||
|
||||
class -> users -> code -> package -> no width
|
||||
|
||||
class: "" {
|
||||
shape: class
|
||||
-num: int
|
||||
-timeout: int
|
||||
-pid
|
||||
|
||||
+getStatus(): Enum
|
||||
+getJobs(): "Job[]"
|
||||
+setTimeout(seconds int)
|
||||
}
|
||||
|
||||
users: "" {
|
||||
shape: sql_table
|
||||
id: int
|
||||
name: string
|
||||
email: string
|
||||
password: string
|
||||
last_login: datetime
|
||||
}
|
||||
|
||||
code: |go
|
||||
a := 5
|
||||
b := a + 7
|
||||
fmt.Printf("%d", b)
|
||||
|
|
||||
|
||||
package: "" { shape: package }
|
||||
no width: ""
|
||||
|
||||
|
||||
class.width: 512
|
||||
users.width: 512
|
||||
code.width: 512
|
||||
package.width: 512
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "unnamed_only_height",
|
||||
script: `
|
||||
|
||||
class -> users -> code -> package -> no height
|
||||
|
||||
class: "" {
|
||||
shape: class
|
||||
-num: int
|
||||
-timeout: int
|
||||
-pid
|
||||
|
||||
+getStatus(): Enum
|
||||
+getJobs(): "Job[]"
|
||||
+setTimeout(seconds int)
|
||||
}
|
||||
|
||||
users: "" {
|
||||
shape: sql_table
|
||||
id: int
|
||||
name: string
|
||||
email: string
|
||||
password: string
|
||||
last_login: datetime
|
||||
}
|
||||
|
||||
code: |go
|
||||
a := 5
|
||||
b := a + 7
|
||||
fmt.Printf("%d", b)
|
||||
|
|
||||
|
||||
package: "" { shape: package }
|
||||
no height: ""
|
||||
|
||||
|
||||
class.height: 512
|
||||
users.height: 512
|
||||
code.height: 512
|
||||
package.height: 512
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
400
e2etests/testdata/regression/unnamed_class_table_code/dagre/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "class",
|
||||
"type": "class",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 422,
|
||||
"height": 368,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pid",
|
||||
"type": "",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "getStatus()",
|
||||
"return": "Enum",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "getJobs()",
|
||||
"return": "Job[]",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "setTimeout(seconds int)",
|
||||
"return": "void",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"type": "sql_table",
|
||||
"pos": {
|
||||
"x": 107,
|
||||
"y": 468
|
||||
},
|
||||
"width": 208,
|
||||
"height": 186,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": [
|
||||
{
|
||||
"name": {
|
||||
"label": "id",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 15,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "int",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 23,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "name",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "email",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "password",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 80,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "last_login",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 81,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "datetime",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 77,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 59,
|
||||
"labelHeight": 31,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"type": "code",
|
||||
"pos": {
|
||||
"x": 113,
|
||||
"y": 754
|
||||
},
|
||||
"width": 196,
|
||||
"height": 70,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#FFFFFF",
|
||||
"stroke": "#0A0F25",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "golang",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 196,
|
||||
"labelHeight": 70,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "(class -> users)[0]",
|
||||
"src": "class",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "users",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 211,
|
||||
"y": 368
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 408
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 428
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 468
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(users -> code)[0]",
|
||||
"src": "users",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "code",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 211,
|
||||
"y": 654
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 694
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 714
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 754
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
62
e2etests/testdata/regression/unnamed_class_table_code/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 512 KiB |
382
e2etests/testdata/regression/unnamed_class_table_code/elk/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,382 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "class",
|
||||
"type": "class",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 12
|
||||
},
|
||||
"width": 422,
|
||||
"height": 368,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pid",
|
||||
"type": "",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "getStatus()",
|
||||
"return": "Enum",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "getJobs()",
|
||||
"return": "Job[]",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "setTimeout(seconds int)",
|
||||
"return": "void",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"type": "sql_table",
|
||||
"pos": {
|
||||
"x": 119,
|
||||
"y": 480
|
||||
},
|
||||
"width": 208,
|
||||
"height": 186,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": [
|
||||
{
|
||||
"name": {
|
||||
"label": "id",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 15,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "int",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 23,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "name",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "email",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "password",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 80,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "last_login",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 81,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "datetime",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 77,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 59,
|
||||
"labelHeight": 31,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"type": "code",
|
||||
"pos": {
|
||||
"x": 125,
|
||||
"y": 766
|
||||
},
|
||||
"width": 196,
|
||||
"height": 70,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#FFFFFF",
|
||||
"stroke": "#0A0F25",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "golang",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 196,
|
||||
"labelHeight": 70,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "(class -> users)[0]",
|
||||
"src": "class",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "users",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 223,
|
||||
"y": 380
|
||||
},
|
||||
{
|
||||
"x": 223,
|
||||
"y": 480
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(users -> code)[0]",
|
||||
"src": "users",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "code",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 223,
|
||||
"y": 666
|
||||
},
|
||||
{
|
||||
"x": 223,
|
||||
"y": 766
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
62
e2etests/testdata/regression/unnamed_class_table_code/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 512 KiB |
574
e2etests/testdata/stable/unnamed_only_height/dagre/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,574 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "class",
|
||||
"type": "class",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 422,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pid",
|
||||
"type": "",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "getStatus()",
|
||||
"return": "Enum",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "getJobs()",
|
||||
"return": "Job[]",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "setTimeout(seconds int)",
|
||||
"return": "void",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"type": "sql_table",
|
||||
"pos": {
|
||||
"x": 107,
|
||||
"y": 612
|
||||
},
|
||||
"width": 208,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": [
|
||||
{
|
||||
"name": {
|
||||
"label": "id",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 15,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "int",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 23,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "name",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "email",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "password",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 80,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "last_login",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 81,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "datetime",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 77,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 59,
|
||||
"labelHeight": 31,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"type": "code",
|
||||
"pos": {
|
||||
"x": 113,
|
||||
"y": 1224
|
||||
},
|
||||
"width": 196,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#FFFFFF",
|
||||
"stroke": "#0A0F25",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "golang",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 196,
|
||||
"labelHeight": 70,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "package",
|
||||
"type": "package",
|
||||
"pos": {
|
||||
"x": 161,
|
||||
"y": 1836
|
||||
},
|
||||
"width": 100,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#EDF0FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "no height",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 161,
|
||||
"y": 2448
|
||||
},
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#F7F8FE",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "(class -> users)[0]",
|
||||
"src": "class",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "users",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 211,
|
||||
"y": 512
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 552
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 572
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 612
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(users -> code)[0]",
|
||||
"src": "users",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "code",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 211,
|
||||
"y": 1124
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 1164
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 1184
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 1224
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(code -> package)[0]",
|
||||
"src": "code",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "package",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 211,
|
||||
"y": 1736
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 1776
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 1796
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 1836
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(package -> no height)[0]",
|
||||
"src": "package",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "no height",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 211,
|
||||
"y": 2348
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 2388
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 2408
|
||||
},
|
||||
{
|
||||
"x": 211,
|
||||
"y": 2448
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
62
e2etests/testdata/stable/unnamed_only_height/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 513 KiB |
538
e2etests/testdata/stable/unnamed_only_height/elk/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,538 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "class",
|
||||
"type": "class",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 12
|
||||
},
|
||||
"width": 422,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pid",
|
||||
"type": "",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "getStatus()",
|
||||
"return": "Enum",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "getJobs()",
|
||||
"return": "Job[]",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "setTimeout(seconds int)",
|
||||
"return": "void",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"type": "sql_table",
|
||||
"pos": {
|
||||
"x": 119,
|
||||
"y": 624
|
||||
},
|
||||
"width": 208,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": [
|
||||
{
|
||||
"name": {
|
||||
"label": "id",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 15,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "int",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 23,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "name",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "email",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "password",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 80,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "last_login",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 81,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "datetime",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 77,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 59,
|
||||
"labelHeight": 31,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"type": "code",
|
||||
"pos": {
|
||||
"x": 125,
|
||||
"y": 1236
|
||||
},
|
||||
"width": 196,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#FFFFFF",
|
||||
"stroke": "#0A0F25",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "golang",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 196,
|
||||
"labelHeight": 70,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "package",
|
||||
"type": "package",
|
||||
"pos": {
|
||||
"x": 173,
|
||||
"y": 1848
|
||||
},
|
||||
"width": 100,
|
||||
"height": 512,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#EDF0FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "no height",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 173,
|
||||
"y": 2460
|
||||
},
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#F7F8FE",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "(class -> users)[0]",
|
||||
"src": "class",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "users",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 223,
|
||||
"y": 524
|
||||
},
|
||||
{
|
||||
"x": 223,
|
||||
"y": 624
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(users -> code)[0]",
|
||||
"src": "users",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "code",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 223,
|
||||
"y": 1136
|
||||
},
|
||||
{
|
||||
"x": 223,
|
||||
"y": 1236
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(code -> package)[0]",
|
||||
"src": "code",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "package",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 223,
|
||||
"y": 1748
|
||||
},
|
||||
{
|
||||
"x": 223,
|
||||
"y": 1848
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(package -> no height)[0]",
|
||||
"src": "package",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "no height",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 223,
|
||||
"y": 2360
|
||||
},
|
||||
{
|
||||
"x": 223,
|
||||
"y": 2460
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
62
e2etests/testdata/stable/unnamed_only_height/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 512 KiB |
574
e2etests/testdata/stable/unnamed_only_width/dagre/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,574 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "class",
|
||||
"type": "class",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 512,
|
||||
"height": 368,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pid",
|
||||
"type": "",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "getStatus()",
|
||||
"return": "Enum",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "getJobs()",
|
||||
"return": "Job[]",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "setTimeout(seconds int)",
|
||||
"return": "void",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"type": "sql_table",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 468
|
||||
},
|
||||
"width": 512,
|
||||
"height": 186,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": [
|
||||
{
|
||||
"name": {
|
||||
"label": "id",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 15,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "int",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 23,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "name",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "email",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "password",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 80,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "last_login",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 81,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "datetime",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 77,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 59,
|
||||
"labelHeight": 31,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"type": "code",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 754
|
||||
},
|
||||
"width": 512,
|
||||
"height": 70,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#FFFFFF",
|
||||
"stroke": "#0A0F25",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "golang",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 196,
|
||||
"labelHeight": 70,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "package",
|
||||
"type": "package",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 924
|
||||
},
|
||||
"width": 512,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#EDF0FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "no width",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 206,
|
||||
"y": 1124
|
||||
},
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#F7F8FE",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "(class -> users)[0]",
|
||||
"src": "class",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "users",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 256,
|
||||
"y": 368
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 408
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 428
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 468
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(users -> code)[0]",
|
||||
"src": "users",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "code",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 256,
|
||||
"y": 654
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 694
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 714
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 754
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(code -> package)[0]",
|
||||
"src": "code",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "package",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 256,
|
||||
"y": 824
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 864
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 890.8
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 958
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(package -> no width)[0]",
|
||||
"src": "package",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "no width",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 256,
|
||||
"y": 1024
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 1064
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 1084
|
||||
},
|
||||
{
|
||||
"x": 256,
|
||||
"y": 1124
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
62
e2etests/testdata/stable/unnamed_only_width/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 513 KiB |
538
e2etests/testdata/stable/unnamed_only_width/elk/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,538 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "class",
|
||||
"type": "class",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 12
|
||||
},
|
||||
"width": 512,
|
||||
"height": 368,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "int",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pid",
|
||||
"type": "",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "getStatus()",
|
||||
"return": "Enum",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "getJobs()",
|
||||
"return": "Job[]",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "setTimeout(seconds int)",
|
||||
"return": "void",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"type": "sql_table",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 480
|
||||
},
|
||||
"width": 512,
|
||||
"height": 186,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#0A0F25",
|
||||
"stroke": "#FFFFFF",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": [
|
||||
{
|
||||
"name": {
|
||||
"label": "id",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 15,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "int",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 23,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "name",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "email",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 47,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "password",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 80,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "string",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 48,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"label": "last_login",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 81,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"type": {
|
||||
"label": "datetime",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 77,
|
||||
"labelHeight": 26
|
||||
},
|
||||
"constraint": "",
|
||||
"reference": ""
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"fontSize": 20,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 59,
|
||||
"labelHeight": 31,
|
||||
"zIndex": 0,
|
||||
"level": 1,
|
||||
"primaryAccentColor": "#0D32B2",
|
||||
"secondaryAccentColor": "#4A6FF3",
|
||||
"neutralAccentColor": "#676C7E"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"type": "code",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 766
|
||||
},
|
||||
"width": 512,
|
||||
"height": 70,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#FFFFFF",
|
||||
"stroke": "#0A0F25",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "golang",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 196,
|
||||
"labelHeight": 70,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "package",
|
||||
"type": "package",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 936
|
||||
},
|
||||
"width": 512,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#EDF0FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "no width",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 218,
|
||||
"y": 1136
|
||||
},
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#F7F8FE",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": 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": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "(class -> users)[0]",
|
||||
"src": "class",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "users",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 268,
|
||||
"y": 380
|
||||
},
|
||||
{
|
||||
"x": 268,
|
||||
"y": 480
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(users -> code)[0]",
|
||||
"src": "users",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "code",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 268,
|
||||
"y": 666
|
||||
},
|
||||
{
|
||||
"x": 268,
|
||||
"y": 766
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(code -> package)[0]",
|
||||
"src": "code",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "package",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 268,
|
||||
"y": 836
|
||||
},
|
||||
{
|
||||
"x": 268,
|
||||
"y": 970
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "(package -> no width)[0]",
|
||||
"src": "package",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "no width",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"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": 268,
|
||||
"y": 1036
|
||||
},
|
||||
{
|
||||
"x": 268,
|
||||
"y": 1136
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
62
e2etests/testdata/stable/unnamed_only_width/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 512 KiB |
1175
e2etests/testdata/todo/shape_set_width_height/dagre/board.exp.json
generated
vendored
Normal file
71
e2etests/testdata/todo/shape_set_width_height/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 842 KiB |
1097
e2etests/testdata/todo/shape_set_width_height/elk/board.exp.json
generated
vendored
Normal file
71
e2etests/testdata/todo/shape_set_width_height/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 842 KiB |
|
|
@ -90,6 +90,115 @@ this is a message group: {
|
|||
}
|
||||
}`,
|
||||
},
|
||||
{
|
||||
// dimensions set on containers are ignored
|
||||
name: "shape_set_width_height",
|
||||
script: `
|
||||
containers: {
|
||||
circle container: {
|
||||
shape: circle
|
||||
|
||||
diamond: {
|
||||
shape: diamond
|
||||
width: 128
|
||||
height: 64
|
||||
}
|
||||
}
|
||||
diamond container: {
|
||||
shape: diamond
|
||||
|
||||
circle: {
|
||||
shape: circle
|
||||
width: 128
|
||||
}
|
||||
}
|
||||
oval container: {
|
||||
shape: oval
|
||||
|
||||
hexagon: {
|
||||
shape: hexagon
|
||||
width: 128
|
||||
height: 64
|
||||
}
|
||||
}
|
||||
hexagon container: {
|
||||
shape: hexagon
|
||||
|
||||
oval: {
|
||||
shape: oval
|
||||
width: 128
|
||||
height: 64
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cloud: {
|
||||
shape: cloud
|
||||
width: 512
|
||||
height: 256
|
||||
}
|
||||
tall cylinder: {
|
||||
shape: cylinder
|
||||
width: 256
|
||||
height: 512
|
||||
}
|
||||
cloud -> class -> tall cylinder -> users
|
||||
|
||||
users: {
|
||||
shape: sql_table
|
||||
id: int
|
||||
name: string
|
||||
email: string
|
||||
password: string
|
||||
last_login: datetime
|
||||
|
||||
width: 800
|
||||
height: 400
|
||||
}
|
||||
|
||||
class: {
|
||||
shape: class
|
||||
-num: int
|
||||
-timeout: int
|
||||
-pid
|
||||
|
||||
+getStatus(): Enum
|
||||
+getJobs(): "Job[]"
|
||||
+setTimeout(seconds int)
|
||||
|
||||
width: 800
|
||||
height: 400
|
||||
}
|
||||
|
||||
container -> text -> code -> small code
|
||||
|
||||
text: {
|
||||
label: |md
|
||||
markdown text expanded to 800x400
|
||||
|
|
||||
height: 800
|
||||
width: 400
|
||||
}
|
||||
|
||||
code: |go
|
||||
a := 5
|
||||
b := a + 7
|
||||
fmt.Printf("%d", b)
|
||||
| {
|
||||
width: 400
|
||||
height: 300
|
||||
}
|
||||
|
||||
small code: |go
|
||||
a := 5
|
||||
b := a + 7
|
||||
fmt.Printf("%d", b)
|
||||
| {
|
||||
width: 4
|
||||
height: 3
|
||||
}
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
runa(t, tcs)
|
||||
|
|
|
|||
214
testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json
generated
vendored
|
|
@ -1,16 +1,210 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,2:1:28-2:11:38",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2:3:2: width is only applicable to image shapes."
|
||||
"graph": {
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:0:0-5:0:54",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:0:0-4:1:53",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:0:0-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "hey",
|
||||
"raw_string": "hey"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"double_quoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:5:5-0:7:7",
|
||||
"value": null
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:8:8-4:0:52",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,1:2:12-1:16:26",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,1:2:12-1:7:17",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,1:2:12-1:7:17",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,1:9:19-1:16:26",
|
||||
"value": [
|
||||
{
|
||||
"string": "hexagon",
|
||||
"raw_string": "hexagon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,2:1:28-2:11:38",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,2:1:28-2:6:33",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,2:1:28-2:6:33",
|
||||
"value": [
|
||||
{
|
||||
"string": "width",
|
||||
"raw_string": "width"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"number": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,2:8:35-2:11:38",
|
||||
"raw": "200",
|
||||
"value": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,3:1:40-3:12:51",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,3:1:40-3:7:46",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,3:1:40-3:7:46",
|
||||
"value": [
|
||||
{
|
||||
"string": "height",
|
||||
"raw_string": "height"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"number": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,3:9:48-3:12:51",
|
||||
"raw": "230",
|
||||
"value": "230"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"label_dimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,3:1:40-3:12:51",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2:4:2: height is only applicable to image shapes."
|
||||
"id": "hey",
|
||||
"id_val": "hey",
|
||||
"label_dimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,0:0:0-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "hey",
|
||||
"raw_string": "hey"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": 0
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"style": {},
|
||||
"width": {
|
||||
"value": "200"
|
||||
},
|
||||
"height": {
|
||||
"value": "230"
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "hexagon"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"err": null
|
||||
}
|
||||
|
|
|
|||
16
testdata/d2compiler/TestCompile/equal_dimensions_on_circle.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2,2:1:26-2:11:36",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2:3:2: width and height must be equal for circle shapes"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2,3:1:38-3:12:49",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2:4:2: width and height must be equal for circle shapes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
36
testdata/d2compiler/TestCompile/no_dimensions_on_containers.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,4:2:54-4:12:64",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:5:3: width cannot be used on container: containers.circle container"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,14:2:173-14:12:183",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:15:3: width cannot be used on container: containers.diamond container"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,15:2:186-15:13:197",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:16:3: height cannot be used on container: containers.diamond container"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,24:2:284-24:12:294",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:25:3: width cannot be used on container: containers.oval container"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,25:2:297-25:13:308",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:26:3: height cannot be used on container: containers.oval container"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,35:2:417-35:12:427",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:36:3: width cannot be used on container: containers.hexagon container"
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,36:2:430-36:13:441",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:37:3: height cannot be used on container: containers.hexagon container"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
178
testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
{
|
||||
"graph": {
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:0:0-4:0:40",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:0:0-3:1:39",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:0:0-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "hey",
|
||||
"raw_string": "hey"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"double_quoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:5:5-0:7:7",
|
||||
"value": null
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:8:8-3:0:38",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,1:1:11-1:14:24",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,1:1:11-1:6:16",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,1:1:11-1:6:16",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,1:8:18-1:14:24",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,2:1:26-2:12:37",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,2:1:26-2:7:32",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,2:1:26-2:7:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "height",
|
||||
"raw_string": "height"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"number": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,2:9:34-2:12:37",
|
||||
"raw": "230",
|
||||
"value": "230"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"label_dimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "hey",
|
||||
"id_val": "hey",
|
||||
"label_dimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,0:0:0-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "hey",
|
||||
"raw_string": "hey"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": 0
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"style": {},
|
||||
"height": {
|
||||
"value": "230"
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": null
|
||||
}
|
||||