Merge branch 'terrastruct:master' into master
3
.gitignore
vendored
|
|
@ -6,3 +6,6 @@ e2e_report.html
|
|||
bin
|
||||
out
|
||||
d2
|
||||
|
||||
# https://github.com/golang/go/blob/8b67cf0bc6ad657fddcbaaa10729d0086f08f9a9/src/cmd/go/internal/test/test.go#L415-L416
|
||||
e2etests.test
|
||||
|
|
@ -227,6 +227,7 @@ let us know and we'll be happy to include it here!
|
|||
- **D2 Snippets (for text editors)**: [https://github.com/Paracelsus-Rose/D2-Language-Code-Snippets](https://github.com/Paracelsus-Rose/D2-Language-Code-Snippets)
|
||||
- **Mongo to D2**: [https://github.com/novuhq/mongo-to-D2](https://github.com/novuhq/mongo-to-D2)
|
||||
- **Pandoc filter**: [https://github.com/ram02z/d2-filter](https://github.com/ram02z/d2-filter)
|
||||
- **Logseq-D2**: [https://github.com/b-yp/logseq-d2](https://github.com/b-yp/logseq-d2)
|
||||
|
||||
### Misc
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,22 @@
|
|||
#### Features 🚀
|
||||
|
||||
- `class` field now accepts arrays. See [docs](TODO). [#1256](https://github.com/terrastruct/d2/pull/1256)
|
||||
- Pill shape is implemented with rectangles of large border radius. Thanks @Poivey ! [#1006](https://github.com/terrastruct/d2/pull/1006)
|
||||
|
||||
#### Improvements 🧹
|
||||
|
||||
- ELK self loops get distributed around the object instead of stacking [#1232](https://github.com/terrastruct/d2/pull/1232)
|
||||
- ELK preserves order of objects in cycles [#1235](https://github.com/terrastruct/d2/pull/1235)
|
||||
- Improper usages of `class` and `style` get error messages [#1254](https://github.com/terrastruct/d2/pull/1254)
|
||||
- Improves scaling of object widths/heights in grid diagrams [#1263](https://github.com/terrastruct/d2/pull/1263)
|
||||
- Enhance Markdown parsing error message by appending link to docs [#1269](https://github.com/terrastruct/d2/pull/1269)
|
||||
|
||||
#### Bugfixes ⛑️
|
||||
|
||||
- Fixes an issue with markdown labels that are empty when rendered [#1223](https://github.com/terrastruct/d2/issues/1223)
|
||||
- ELK self loops always have enough space for long labels [#1232](https://github.com/terrastruct/d2/pull/1232)
|
||||
- Fixes panic when setting `shape` to be `class` or `sql_table` within a class [#1251](https://github.com/terrastruct/d2/pull/1251)
|
||||
- Fixes rare panic exporting to gifs [#1257](https://github.com/terrastruct/d2/pull/1257)
|
||||
- Fixes bad performance in large grid diagrams [#1263](https://github.com/terrastruct/d2/pull/1263)
|
||||
- Fixes bug in ELK when container has ID "root" [#1268](https://github.com/terrastruct/d2/pull/1268)
|
||||
- Fixes edge case panic with invalid CLI arguments [#1271](https://github.com/terrastruct/d2/pull/1271)
|
||||
|
|
|
|||
|
|
@ -126,11 +126,25 @@ func (c *compiler) errorf(n d2ast.Node, f string, v ...interface{}) {
|
|||
func (c *compiler) compileMap(obj *d2graph.Object, m *d2ir.Map) {
|
||||
class := m.GetField("class")
|
||||
if class != nil {
|
||||
className := class.Primary()
|
||||
if className == nil {
|
||||
c.errorf(class.LastRef().AST(), "class missing value")
|
||||
var classNames []string
|
||||
if class.Primary() != nil {
|
||||
classNames = append(classNames, class.Primary().String())
|
||||
} else if class.Composite != nil {
|
||||
if arr, ok := class.Composite.(*d2ir.Array); ok {
|
||||
for _, class := range arr.Values {
|
||||
if scalar, ok := class.(*d2ir.Scalar); ok {
|
||||
classNames = append(classNames, scalar.Value.ScalarString())
|
||||
} else {
|
||||
c.errorf(class.LastPrimaryKey(), "invalid value in array")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
classMap := m.GetClassMap(className.String())
|
||||
c.errorf(class.LastRef().AST(), "class missing value")
|
||||
}
|
||||
|
||||
for _, className := range classNames {
|
||||
classMap := m.GetClassMap(className)
|
||||
if classMap != nil {
|
||||
c.compileMap(obj, classMap)
|
||||
}
|
||||
|
|
@ -150,15 +164,17 @@ func (c *compiler) compileMap(obj *d2graph.Object, m *d2ir.Map) {
|
|||
c.compileField(obj, f)
|
||||
}
|
||||
|
||||
switch obj.Shape.Value {
|
||||
case d2target.ShapeClass:
|
||||
c.compileClass(obj)
|
||||
case d2target.ShapeSQLTable:
|
||||
c.compileSQLTable(obj)
|
||||
}
|
||||
if !m.IsClass() {
|
||||
switch obj.Shape.Value {
|
||||
case d2target.ShapeClass:
|
||||
c.compileClass(obj)
|
||||
case d2target.ShapeSQLTable:
|
||||
c.compileSQLTable(obj)
|
||||
}
|
||||
|
||||
for _, e := range m.Edges {
|
||||
c.compileEdge(obj, e)
|
||||
for _, e := range m.Edges {
|
||||
c.compileEdge(obj, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -195,6 +211,7 @@ func (c *compiler) compileField(obj *d2graph.Object, f *d2ir.Field) {
|
|||
return
|
||||
} else if f.Name == "style" {
|
||||
if f.Map() == nil {
|
||||
c.errorf(f.LastRef().AST(), `"style" expected to be set to a map, or contain an additional keyword like "style.opacity: 0.4"`)
|
||||
return
|
||||
}
|
||||
c.compileStyle(&obj.Attributes, f.Map())
|
||||
|
|
@ -290,7 +307,7 @@ func (c *compiler) compileLabel(attrs *d2graph.Attributes, f d2ir.Node) {
|
|||
|
||||
func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) {
|
||||
if f.Primary() == nil {
|
||||
if f.Composite != nil {
|
||||
if f.Composite != nil && !strings.EqualFold(f.Name, "class") {
|
||||
c.errorf(f.LastPrimaryKey(), "reserved field %v does not accept composite", f.Name)
|
||||
}
|
||||
return
|
||||
|
|
@ -460,7 +477,17 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) {
|
|||
attrs.HorizontalGap.Value = scalar.ScalarString()
|
||||
attrs.HorizontalGap.MapKey = f.LastPrimaryKey()
|
||||
case "class":
|
||||
attrs.Classes = append(attrs.Classes, scalar.ScalarString())
|
||||
if f.Primary() != nil {
|
||||
attrs.Classes = append(attrs.Classes, scalar.ScalarString())
|
||||
} else if f.Composite != nil {
|
||||
if arr, ok := f.Composite.(*d2ir.Array); ok {
|
||||
for _, class := range arr.Values {
|
||||
if scalar, ok := class.(*d2ir.Scalar); ok {
|
||||
attrs.Classes = append(attrs.Classes, scalar.Value.ScalarString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case "classes":
|
||||
}
|
||||
|
||||
|
|
@ -479,6 +506,10 @@ func (c *compiler) compileStyle(attrs *d2graph.Attributes, m *d2ir.Map) {
|
|||
}
|
||||
|
||||
func (c *compiler) compileStyleField(attrs *d2graph.Attributes, f *d2ir.Field) {
|
||||
if _, ok := d2graph.StyleKeywords[strings.ToLower(f.Name)]; !ok {
|
||||
c.errorf(f.LastRef().AST(), `invalid style keyword: "%s"`, f.Name)
|
||||
return
|
||||
}
|
||||
if f.Primary() == nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -575,11 +606,25 @@ func (c *compiler) compileEdge(obj *d2graph.Object, e *d2ir.Edge) {
|
|||
func (c *compiler) compileEdgeMap(edge *d2graph.Edge, m *d2ir.Map) {
|
||||
class := m.GetField("class")
|
||||
if class != nil {
|
||||
className := class.Primary()
|
||||
if className == nil {
|
||||
c.errorf(class.LastRef().AST(), "class missing value")
|
||||
var classNames []string
|
||||
if class.Primary() != nil {
|
||||
classNames = append(classNames, class.Primary().String())
|
||||
} else if class.Composite != nil {
|
||||
if arr, ok := class.Composite.(*d2ir.Array); ok {
|
||||
for _, class := range arr.Values {
|
||||
if scalar, ok := class.(*d2ir.Scalar); ok {
|
||||
classNames = append(classNames, scalar.Value.ScalarString())
|
||||
} else {
|
||||
c.errorf(class.LastPrimaryKey(), "invalid value in array")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
classMap := m.GetClassMap(className.String())
|
||||
c.errorf(class.LastRef().AST(), "class missing value")
|
||||
}
|
||||
|
||||
for _, className := range classNames {
|
||||
classMap := m.GetClassMap(className)
|
||||
if classMap != nil {
|
||||
c.compileEdgeMap(edge, classMap)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -598,6 +598,18 @@ x: {
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "md_block_string_err",
|
||||
|
||||
text: `test: |md
|
||||
# What about pipes
|
||||
|
||||
Will escaping \| work?
|
||||
|
|
||||
`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/md_block_string_err.d2:4:19: unexpected text after md block string. See https://d2lang.com/tour/text#advanced-block-strings.
|
||||
d2/testdata/d2compiler/TestCompile/md_block_string_err.d2:5:1: block string must be terminated with |`,
|
||||
},
|
||||
{
|
||||
name: "underscore_edge_existing",
|
||||
|
||||
|
|
@ -1678,6 +1690,24 @@ x.a.b`,
|
|||
}`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/no-nested-columns-class.d2:3:5: class fields cannot have children`,
|
||||
},
|
||||
{
|
||||
name: "improper-class-ref",
|
||||
|
||||
text: `myobj.class.style.stroke-dash: 3`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/improper-class-ref.d2:1:7: "class" must be the last part of the key`,
|
||||
},
|
||||
{
|
||||
name: "tail-style",
|
||||
|
||||
text: `myobj.style: 3`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/tail-style.d2:1:7: "style" expected to be set to a map, or contain an additional keyword like "style.opacity: 0.4"`,
|
||||
},
|
||||
{
|
||||
name: "bad-style-nesting",
|
||||
|
||||
text: `myobj.style.style.stroke-dash: 3`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/bad-style-nesting.d2:1:13: invalid style keyword: "style"`,
|
||||
},
|
||||
{
|
||||
name: "edge_to_style",
|
||||
|
||||
|
|
@ -2382,6 +2412,35 @@ nostar -> 1star: { class: path }
|
|||
tassert.Equal(t, "then", g.Edges[0].Label.Value)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "array-classes",
|
||||
text: `classes: {
|
||||
dragon_ball: {
|
||||
label: ""
|
||||
shape: circle
|
||||
style.fill: orange
|
||||
}
|
||||
path: {
|
||||
label: "then"
|
||||
style.stroke-width: 4
|
||||
}
|
||||
path2: {
|
||||
style.stroke-width: 2
|
||||
}
|
||||
}
|
||||
nostar: { class: [dragon_ball; path] }
|
||||
1star: { class: [path; dragon_ball] }
|
||||
|
||||
nostar -> 1star: { class: [path; path2] }
|
||||
`,
|
||||
assertions: func(t *testing.T, g *d2graph.Graph) {
|
||||
tassert.Equal(t, "then", g.Objects[0].Label.Value)
|
||||
tassert.Equal(t, "", g.Objects[1].Label.Value)
|
||||
tassert.Equal(t, "circle", g.Objects[0].Shape.Value)
|
||||
tassert.Equal(t, "circle", g.Objects[1].Shape.Value)
|
||||
tassert.Equal(t, "2", g.Edges[0].Style.StrokeWidth.Value)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "reordered-classes",
|
||||
text: `classes: {
|
||||
|
|
@ -2397,6 +2456,20 @@ classes.x.shape: diamond
|
|||
tassert.Equal(t, "diamond", g.Objects[0].Shape.Value)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "class-shape-class",
|
||||
text: `classes: {
|
||||
classClass: {
|
||||
shape: class
|
||||
}
|
||||
}
|
||||
|
||||
object: {
|
||||
class: classClass
|
||||
length(): int
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "no-class-primary",
|
||||
text: `x.class
|
||||
|
|
|
|||
|
|
@ -200,15 +200,9 @@ func toConnection(edge *d2graph.Edge, theme *d2themes.Theme) d2target.Connection
|
|||
text := edge.Text()
|
||||
|
||||
if edge.SrcArrow {
|
||||
connection.SrcArrow = d2target.TriangleArrowhead
|
||||
if edge.SrcArrowhead != nil {
|
||||
if edge.SrcArrowhead.Shape.Value != "" {
|
||||
filled := false
|
||||
if edge.SrcArrowhead.Style.Filled != nil {
|
||||
filled, _ = strconv.ParseBool(edge.SrcArrowhead.Style.Filled.Value)
|
||||
}
|
||||
connection.SrcArrow = d2target.ToArrowhead(edge.SrcArrowhead.Shape.Value, filled)
|
||||
}
|
||||
connection.SrcArrow = d2target.DefaultArrowhead
|
||||
if edge.SrcArrowhead != nil && edge.SrcArrowhead.Shape.Value != "" {
|
||||
connection.SrcArrow = edge.SrcArrowhead.ToArrowhead()
|
||||
}
|
||||
}
|
||||
if edge.SrcArrowhead != nil {
|
||||
|
|
@ -221,15 +215,9 @@ func toConnection(edge *d2graph.Edge, theme *d2themes.Theme) d2target.Connection
|
|||
}
|
||||
}
|
||||
if edge.DstArrow {
|
||||
connection.DstArrow = d2target.TriangleArrowhead
|
||||
if edge.DstArrowhead != nil {
|
||||
if edge.DstArrowhead.Shape.Value != "" {
|
||||
filled := false
|
||||
if edge.DstArrowhead.Style.Filled != nil {
|
||||
filled, _ = strconv.ParseBool(edge.DstArrowhead.Style.Filled.Value)
|
||||
}
|
||||
connection.DstArrow = d2target.ToArrowhead(edge.DstArrowhead.Shape.Value, filled)
|
||||
}
|
||||
connection.DstArrow = d2target.DefaultArrowhead
|
||||
if edge.DstArrowhead != nil && edge.DstArrowhead.Shape.Value != "" {
|
||||
connection.DstArrow = edge.DstArrowhead.ToArrowhead()
|
||||
}
|
||||
}
|
||||
if edge.DstArrowhead != nil {
|
||||
|
|
|
|||
|
|
@ -164,6 +164,18 @@ func (a *Attributes) ApplyTextTransform() {
|
|||
}
|
||||
}
|
||||
|
||||
func (a *Attributes) ToArrowhead() d2target.Arrowhead {
|
||||
if a.Shape.Value == "" {
|
||||
return d2target.NoArrowhead
|
||||
}
|
||||
|
||||
filled := false
|
||||
if a.Style.Filled != nil {
|
||||
filled, _ = strconv.ParseBool(a.Style.Filled.Value)
|
||||
}
|
||||
return d2target.ToArrowhead(a.Shape.Value, filled)
|
||||
}
|
||||
|
||||
// TODO references at the root scope should have their Scope set to root graph AST
|
||||
type Reference struct {
|
||||
Key *d2ast.KeyPath `json:"key"`
|
||||
|
|
|
|||
22
d2ir/d2ir.go
|
|
@ -671,6 +671,10 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext) (*Field,
|
|||
head = strings.ToLower(head)
|
||||
}
|
||||
|
||||
if head == "class" && i < len(kp.Path)-1 {
|
||||
return nil, d2parser.Errorf(kp.Path[i].Unbox(), `"class" must be the last part of the key`)
|
||||
}
|
||||
|
||||
if head == "_" {
|
||||
return nil, d2parser.Errorf(kp.Path[i].Unbox(), `parent "_" can only be used in the beginning of paths, e.g. "_.x"`)
|
||||
}
|
||||
|
|
@ -1201,3 +1205,21 @@ func (m *Map) InClass(key *d2ast.Key) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Map) IsClass() bool {
|
||||
parentBoard := ParentBoard(m)
|
||||
if parentBoard.Map() == nil {
|
||||
return false
|
||||
}
|
||||
classes := parentBoard.Map().GetField("classes")
|
||||
if classes == nil || classes.Map() == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, class := range classes.Map().Fields {
|
||||
if class.Map() == m {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
|
|||
}
|
||||
|
||||
elkGraph := &ELKGraph{
|
||||
ID: "root",
|
||||
ID: "",
|
||||
LayoutOptions: &elkOpts{
|
||||
Thoroughness: 8,
|
||||
EdgeEdgeBetweenLayersSpacing: 50,
|
||||
|
|
@ -432,7 +432,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
|
|||
|
||||
parentX := 0.0
|
||||
parentY := 0.0
|
||||
if e.Container != "root" {
|
||||
if e.Container != "" {
|
||||
parentX = byID[e.Container].TopLeft.X
|
||||
parentY = byID[e.Container].TopLeft.Y
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package d2grid
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
|
||||
|
|
@ -266,40 +267,17 @@ func (gd *gridDiagram) layoutDynamic(g *d2graph.Graph, obj *d2graph.Object) {
|
|||
cursor := geo.NewPoint(0, 0)
|
||||
var maxY, maxX float64
|
||||
if gd.rowDirected {
|
||||
// if we have 2 rows, then each row's objects should have the same height
|
||||
// . ┌A─────────────┐ ┌B──┐ ┌C─────────┐ ┬ maxHeight(A,B,C)
|
||||
// . ├ ─ ─ ─ ─ ─ ─ ─┤ │ │ │ │ │
|
||||
// . │ │ │ │ ├ ─ ─ ─ ─ ─┤ │
|
||||
// . │ │ │ │ │ │ │
|
||||
// . └──────────────┘ └───┘ └──────────┘ ┴
|
||||
// . ┌D────────┐ ┌E────────────────┐ ┬ maxHeight(D,E)
|
||||
// . │ │ │ │ │
|
||||
// . │ │ │ │ │
|
||||
// . │ │ ├ ─ ─ ─ ─ ─ ─ ─ ─ ┤ │
|
||||
// . │ │ │ │ │
|
||||
// . └─────────┘ └─────────────────┘ ┴
|
||||
// measure row widths
|
||||
rowWidths := []float64{}
|
||||
for _, row := range layout {
|
||||
rowHeight := 0.
|
||||
x := 0.
|
||||
for _, o := range row {
|
||||
o.TopLeft = cursor.Copy()
|
||||
cursor.X += o.Width + horizontalGap
|
||||
rowHeight = math.Max(rowHeight, o.Height)
|
||||
x += o.Width + horizontalGap
|
||||
}
|
||||
rowWidth := cursor.X - horizontalGap
|
||||
rowWidth := x - horizontalGap
|
||||
rowWidths = append(rowWidths, rowWidth)
|
||||
maxX = math.Max(maxX, rowWidth)
|
||||
|
||||
// set all objects in row to the same height
|
||||
for _, o := range row {
|
||||
o.Height = rowHeight
|
||||
}
|
||||
|
||||
// new row
|
||||
cursor.X = 0
|
||||
cursor.Y += rowHeight + verticalGap
|
||||
}
|
||||
maxY = cursor.Y - horizontalGap
|
||||
|
||||
// then expand thinnest objects to make each row the same width
|
||||
// . ┌A─────────────┐ ┌B──┐ ┌C─────────┐ ┬ maxHeight(A,B,C)
|
||||
|
|
@ -319,80 +297,79 @@ func (gd *gridDiagram) layoutDynamic(g *d2graph.Graph, obj *d2graph.Object) {
|
|||
continue
|
||||
}
|
||||
delta := maxX - rowWidth
|
||||
objects := []*d2graph.Object{}
|
||||
var widest float64
|
||||
for _, o := range row {
|
||||
widest = math.Max(widest, o.Width)
|
||||
objects = append(objects, o)
|
||||
}
|
||||
sort.Slice(objects, func(i, j int) bool {
|
||||
return objects[i].Width < objects[j].Width
|
||||
})
|
||||
// expand smaller objects to fill remaining space
|
||||
for _, o := range objects {
|
||||
if o.Width < widest {
|
||||
var index int
|
||||
for i, rowObj := range row {
|
||||
if o == rowObj {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
grow := math.Min(widest-o.Width, delta)
|
||||
o.Width += grow
|
||||
// shift following objects
|
||||
for i := index + 1; i < len(row); i++ {
|
||||
row[i].TopLeft.X += grow
|
||||
}
|
||||
delta -= grow
|
||||
if delta <= 0 {
|
||||
break
|
||||
}
|
||||
diffs := make([]float64, len(row))
|
||||
totalDiff := 0.
|
||||
for i, o := range row {
|
||||
diffs[i] = widest - o.Width
|
||||
totalDiff += diffs[i]
|
||||
}
|
||||
if totalDiff > 0 {
|
||||
// expand smaller nodes up to the size of the larger ones with delta
|
||||
// percentage diff
|
||||
for i := range diffs {
|
||||
diffs[i] /= totalDiff
|
||||
}
|
||||
growth := math.Min(delta, totalDiff)
|
||||
// expand smaller objects to fill remaining space
|
||||
for i, o := range row {
|
||||
o.Width += diffs[i] * growth
|
||||
}
|
||||
}
|
||||
if delta > 0 {
|
||||
grow := delta / float64(len(row))
|
||||
for i := len(row) - 1; i >= 0; i-- {
|
||||
o := row[i]
|
||||
o.TopLeft.X += grow * float64(i)
|
||||
o.Width += grow
|
||||
delta -= grow
|
||||
if delta > totalDiff {
|
||||
growth := (delta - totalDiff) / float64(len(row))
|
||||
for _, o := range row {
|
||||
o.Width += growth
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if we have 3 columns, then each column's objects should have the same width
|
||||
// . ├maxWidth(A,B)─┤ ├maxW(C,D)─┤ ├maxWidth(E)──────┤
|
||||
// . ┌A─────────────┐ ┌C─────────┐ ┌E────────────────┐
|
||||
// . └──────────────┘ │ │ │ │
|
||||
// . ┌B──┬──────────┐ └──────────┘ │ │
|
||||
// . │ │ ┌D────────┬┐ └─────────────────┘
|
||||
// . │ │ │ │ │
|
||||
// . │ │ │ ││
|
||||
// . └───┴──────────┘ │ │
|
||||
// . │ ││
|
||||
// . └─────────┴┘
|
||||
colHeights := []float64{}
|
||||
for _, column := range layout {
|
||||
colWidth := 0.
|
||||
for _, o := range column {
|
||||
|
||||
// if we have 2 rows, then each row's objects should have the same height
|
||||
// . ┌A─────────────┐ ┌B──┐ ┌C─────────┐ ┬ maxHeight(A,B,C)
|
||||
// . ├ ─ ─ ─ ─ ─ ─ ─┤ │ │ │ │ │
|
||||
// . │ │ │ │ ├ ─ ─ ─ ─ ─┤ │
|
||||
// . │ │ │ │ │ │ │
|
||||
// . └──────────────┘ └───┘ └──────────┘ ┴
|
||||
// . ┌D────────┐ ┌E────────────────┐ ┬ maxHeight(D,E)
|
||||
// . │ │ │ │ │
|
||||
// . │ │ │ │ │
|
||||
// . │ │ ├ ─ ─ ─ ─ ─ ─ ─ ─ ┤ │
|
||||
// . │ │ │ │ │
|
||||
// . └─────────┘ └─────────────────┘ ┴
|
||||
for _, row := range layout {
|
||||
rowHeight := 0.
|
||||
for _, o := range row {
|
||||
o.TopLeft = cursor.Copy()
|
||||
cursor.Y += o.Height + verticalGap
|
||||
colWidth = math.Max(colWidth, o.Width)
|
||||
}
|
||||
colHeight := cursor.Y - verticalGap
|
||||
colHeights = append(colHeights, colHeight)
|
||||
maxY = math.Max(maxY, colHeight)
|
||||
// set all objects in column to the same width
|
||||
for _, o := range column {
|
||||
o.Width = colWidth
|
||||
cursor.X += o.Width + horizontalGap
|
||||
rowHeight = math.Max(rowHeight, o.Height)
|
||||
}
|
||||
|
||||
// new column
|
||||
cursor.Y = 0
|
||||
cursor.X += colWidth + horizontalGap
|
||||
// set all objects in row to the same height
|
||||
for _, o := range row {
|
||||
o.Height = rowHeight
|
||||
}
|
||||
|
||||
// new row
|
||||
cursor.X = 0
|
||||
cursor.Y += rowHeight + verticalGap
|
||||
}
|
||||
maxX = cursor.X - horizontalGap
|
||||
maxY = cursor.Y - horizontalGap
|
||||
} else {
|
||||
// measure column heights
|
||||
colHeights := []float64{}
|
||||
for _, column := range layout {
|
||||
y := 0.
|
||||
for _, o := range column {
|
||||
y += o.Height + verticalGap
|
||||
}
|
||||
colHeight := y - verticalGap
|
||||
colHeights = append(colHeights, colHeight)
|
||||
maxY = math.Max(maxY, colHeight)
|
||||
}
|
||||
|
||||
// then expand shortest objects to make each column the same height
|
||||
// . ├maxWidth(A,B)─┤ ├maxW(C,D)─┤ ├maxWidth(E)──────┤
|
||||
// . ┌A─────────────┐ ┌C─────────┐ ┌E────────────────┐
|
||||
|
|
@ -410,47 +387,63 @@ func (gd *gridDiagram) layoutDynamic(g *d2graph.Graph, obj *d2graph.Object) {
|
|||
continue
|
||||
}
|
||||
delta := maxY - colHeight
|
||||
objects := []*d2graph.Object{}
|
||||
var tallest float64
|
||||
for _, o := range column {
|
||||
tallest = math.Max(tallest, o.Height)
|
||||
objects = append(objects, o)
|
||||
}
|
||||
sort.Slice(objects, func(i, j int) bool {
|
||||
return objects[i].Height < objects[j].Height
|
||||
})
|
||||
// expand smaller objects to fill remaining space
|
||||
for _, o := range objects {
|
||||
if o.Height < tallest {
|
||||
var index int
|
||||
for i, colObj := range column {
|
||||
if o == colObj {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
grow := math.Min(tallest-o.Height, delta)
|
||||
o.Height += grow
|
||||
// shift following objects
|
||||
for i := index + 1; i < len(column); i++ {
|
||||
column[i].TopLeft.Y += grow
|
||||
}
|
||||
delta -= grow
|
||||
if delta <= 0 {
|
||||
break
|
||||
}
|
||||
diffs := make([]float64, len(column))
|
||||
totalDiff := 0.
|
||||
for i, o := range column {
|
||||
diffs[i] = tallest - o.Height
|
||||
totalDiff += diffs[i]
|
||||
}
|
||||
if totalDiff > 0 {
|
||||
// expand smaller nodes up to the size of the larger ones with delta
|
||||
// percentage diff
|
||||
for i := range diffs {
|
||||
diffs[i] /= totalDiff
|
||||
}
|
||||
growth := math.Min(delta, totalDiff)
|
||||
// expand smaller objects to fill remaining space
|
||||
for i, o := range column {
|
||||
o.Height += diffs[i] * growth
|
||||
}
|
||||
}
|
||||
if delta > 0 {
|
||||
grow := delta / float64(len(column))
|
||||
for i := len(column) - 1; i >= 0; i-- {
|
||||
o := column[i]
|
||||
o.TopLeft.Y += grow * float64(i)
|
||||
o.Height += grow
|
||||
delta -= grow
|
||||
if delta > totalDiff {
|
||||
growth := (delta - totalDiff) / float64(len(column))
|
||||
for _, o := range column {
|
||||
o.Height += growth
|
||||
}
|
||||
}
|
||||
}
|
||||
// if we have 3 columns, then each column's objects should have the same width
|
||||
// . ├maxWidth(A,B)─┤ ├maxW(C,D)─┤ ├maxWidth(E)──────┤
|
||||
// . ┌A─────────────┐ ┌C─────────┐ ┌E────────────────┐
|
||||
// . └──────────────┘ │ │ │ │
|
||||
// . ┌B──┬──────────┐ └──────────┘ │ │
|
||||
// . │ │ ┌D────────┬┐ └─────────────────┘
|
||||
// . │ │ │ │ │
|
||||
// . │ │ │ ││
|
||||
// . └───┴──────────┘ │ │
|
||||
// . │ ││
|
||||
// . └─────────┴┘
|
||||
for _, column := range layout {
|
||||
colWidth := 0.
|
||||
for _, o := range column {
|
||||
o.TopLeft = cursor.Copy()
|
||||
cursor.Y += o.Height + verticalGap
|
||||
colWidth = math.Max(colWidth, o.Width)
|
||||
}
|
||||
// set all objects in column to the same width
|
||||
for _, o := range column {
|
||||
o.Width = colWidth
|
||||
}
|
||||
|
||||
// new column
|
||||
cursor.Y = 0
|
||||
cursor.X += colWidth + horizontalGap
|
||||
}
|
||||
maxX = cursor.X - horizontalGap
|
||||
}
|
||||
gd.width = maxX
|
||||
gd.height = maxY
|
||||
|
|
@ -469,6 +462,68 @@ func (gd *gridDiagram) getBestLayout(targetSize float64, columns bool) [][]*d2gr
|
|||
return genLayout(gd.objects, nil)
|
||||
}
|
||||
|
||||
var gap float64
|
||||
if columns {
|
||||
gap = float64(gd.verticalGap)
|
||||
} else {
|
||||
gap = float64(gd.horizontalGap)
|
||||
}
|
||||
getSize := func(o *d2graph.Object) float64 {
|
||||
if columns {
|
||||
return o.Height
|
||||
} else {
|
||||
return o.Width
|
||||
}
|
||||
}
|
||||
|
||||
debug := false
|
||||
skipCount := 0
|
||||
// quickly eliminate bad row groupings
|
||||
startingCache := make(map[int]bool)
|
||||
// try to find a layout with all rows within 1.2*targetSize
|
||||
// skip options with a row that is 1.2*longer or shorter
|
||||
// Note: we want a low threshold to explore good options within attemptLimit,
|
||||
// but the best option may require a few rows that are far from the target size.
|
||||
okThreshold := 1.2
|
||||
// if we don't find a layout try 25% larger threshold
|
||||
thresholdStep := 0.25
|
||||
rowOk := func(row []*d2graph.Object, starting bool) (ok bool) {
|
||||
if starting {
|
||||
// we can cache results from starting positions since they repeat and don't change
|
||||
// with starting=true it will always be the 1st N objects based on len(row)
|
||||
if ok, has := startingCache[len(row)]; has {
|
||||
return ok
|
||||
}
|
||||
defer func() {
|
||||
// cache result before returning
|
||||
startingCache[len(row)] = ok
|
||||
}()
|
||||
}
|
||||
|
||||
rowSize := 0.
|
||||
for _, obj := range row {
|
||||
rowSize += getSize(obj)
|
||||
}
|
||||
if len(row) > 1 {
|
||||
rowSize += gap * float64(len(row)-1)
|
||||
// if multiple nodes are too big, it isn't ok. but a single node can't shrink so only check here
|
||||
if rowSize > okThreshold*targetSize {
|
||||
skipCount++
|
||||
return false
|
||||
}
|
||||
}
|
||||
// row is too small to be good overall
|
||||
if rowSize < targetSize/okThreshold {
|
||||
skipCount++
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
var bestLayout [][]*d2graph.Object
|
||||
bestDist := math.MaxFloat64
|
||||
count := 0
|
||||
attemptLimit := 100_000
|
||||
// get all options for where to place these cuts, preferring later cuts over earlier cuts
|
||||
// with 5 objects and 2 cuts we have these options:
|
||||
// . A B C │ D │ E <- these cuts would produce: ┌A─┐ ┌B─┐ ┌C─┐
|
||||
|
|
@ -477,41 +532,128 @@ func (gd *gridDiagram) getBestLayout(targetSize float64, columns bool) [][]*d2gr
|
|||
// . A B │ C │ D E └────────────┘
|
||||
// . A │ B C │ D E ┌E───────────┐
|
||||
// . A │ B │ C D E └────────────┘
|
||||
divisions := genDivisions(gd.objects, nCuts)
|
||||
|
||||
var bestLayout [][]*d2graph.Object
|
||||
bestDist := math.MaxFloat64
|
||||
// of these divisions, find the layout with rows closest to the targetSize
|
||||
for _, division := range divisions {
|
||||
tryDivision := func(division []int) bool {
|
||||
layout := genLayout(gd.objects, division)
|
||||
dist := getDistToTarget(layout, targetSize, float64(gd.horizontalGap), float64(gd.verticalGap), columns)
|
||||
if dist < bestDist {
|
||||
bestLayout = layout
|
||||
bestDist = dist
|
||||
}
|
||||
count++
|
||||
// with few objects we can try all options to get best result but this won't scale, so only try up to 100k options
|
||||
return count >= attemptLimit
|
||||
}
|
||||
|
||||
// try at least 3 different okThresholds
|
||||
for i := 0; i < 3 || bestLayout == nil; i++ {
|
||||
iterDivisions(gd.objects, nCuts, tryDivision, rowOk)
|
||||
okThreshold += thresholdStep
|
||||
if debug {
|
||||
fmt.Printf("increasing ok threshold to %v\n", okThreshold)
|
||||
}
|
||||
startingCache = make(map[int]bool)
|
||||
count = 0.
|
||||
}
|
||||
if debug {
|
||||
fmt.Printf("final count %d, skip count %d\n", count, skipCount)
|
||||
}
|
||||
|
||||
// try fast layout algorithm, see if it is better than first 1mil attempts
|
||||
debt := 0.
|
||||
fastDivision := make([]int, 0, nCuts)
|
||||
rowSize := 0.
|
||||
for i := 0; i < len(gd.objects); i++ {
|
||||
o := gd.objects[i]
|
||||
size := getSize(o)
|
||||
if rowSize == 0 {
|
||||
if size > targetSize-debt {
|
||||
fastDivision = append(fastDivision, i-1)
|
||||
// we build up a debt of distance past the target size across rows
|
||||
newDebt := size - targetSize
|
||||
debt += newDebt
|
||||
} else {
|
||||
rowSize += size
|
||||
}
|
||||
continue
|
||||
}
|
||||
// debt is paid by decreasing threshold to start new row and ending below targetSize
|
||||
if rowSize+(gap+size)/2. > targetSize-debt {
|
||||
fastDivision = append(fastDivision, i-1)
|
||||
newDebt := rowSize - targetSize
|
||||
debt += newDebt
|
||||
rowSize = size
|
||||
} else {
|
||||
rowSize += gap + size
|
||||
}
|
||||
}
|
||||
if len(fastDivision) == nCuts {
|
||||
layout := genLayout(gd.objects, fastDivision)
|
||||
dist := getDistToTarget(layout, targetSize, float64(gd.horizontalGap), float64(gd.verticalGap), columns)
|
||||
if dist < bestDist {
|
||||
bestLayout = layout
|
||||
bestDist = dist
|
||||
}
|
||||
}
|
||||
return bestLayout
|
||||
}
|
||||
|
||||
// process current division, return true to stop iterating
|
||||
type iterDivision func(division []int) (done bool)
|
||||
type checkCut func(objects []*d2graph.Object, starting bool) (ok bool)
|
||||
|
||||
// get all possible divisions of objects by the number of cuts
|
||||
func genDivisions(objects []*d2graph.Object, nCuts int) (divisions [][]int) {
|
||||
func iterDivisions(objects []*d2graph.Object, nCuts int, f iterDivision, check checkCut) {
|
||||
if len(objects) < 2 || nCuts == 0 {
|
||||
return nil
|
||||
return
|
||||
}
|
||||
done := false
|
||||
// we go in this order to prefer extra objects in starting rows rather than later ones
|
||||
lastObj := len(objects) - 1
|
||||
// with objects=[A, B, C, D, E]; nCuts=2
|
||||
// d:depth; i:index; n:nCuts;
|
||||
// ┌────┬───┬───┬─────────────────────┬────────────┐
|
||||
// │ d │ i │ n │ objects │ cuts │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ 0 │ 4 │ 2 │ [A B C D | E] │ │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ └1 │ 3 │ 1 │ [A B C | D] │ + | E] │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ └1 │ 2 │ 1 │ [A B | C D] │ + | E] │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ └1 │ 1 │ 1 │ [A | B C D] │ + | E] │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ 0 │ 3 │ 2 │ [A B C | D E] │ │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ └1 │ 2 │ 1 │ [A B | C] │ + | D E] │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ └1 │ 1 │ 1 │ [A | B C] │ + | D E] │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ 0 │ 2 │ 2 │ [A B | C D E] │ │
|
||||
// ├────┼───┼───┼─────────────────────┼────────────┤
|
||||
// │ └1 │ 1 │ 1 │ [A | B] │ + | C D E] │
|
||||
// └────┴───┴───┴─────────────────────┴────────────┘
|
||||
for index := lastObj; index >= nCuts; index-- {
|
||||
if !check(objects[index:], false) {
|
||||
// optimization: if current cut gives a bad grouping, don't recurse
|
||||
continue
|
||||
}
|
||||
if nCuts > 1 {
|
||||
for _, inner := range genDivisions(objects[:index], nCuts-1) {
|
||||
divisions = append(divisions, append(inner, index-1))
|
||||
}
|
||||
iterDivisions(objects[:index], nCuts-1, func(inner []int) bool {
|
||||
done = f(append(inner, index-1))
|
||||
return done
|
||||
}, check)
|
||||
} else {
|
||||
divisions = append(divisions, []int{index - 1})
|
||||
if !check(objects[:index], true) {
|
||||
// e.g. [A B C | D] if [A,B,C] is bad, skip it
|
||||
continue
|
||||
}
|
||||
done = f([]int{index - 1})
|
||||
}
|
||||
if done {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return divisions
|
||||
}
|
||||
|
||||
// generate a grid of objects from the given cut indices
|
||||
|
|
@ -525,6 +667,9 @@ func genLayout(objects []*d2graph.Object, cutIndices []int) [][]*d2graph.Object
|
|||
} else {
|
||||
stop = len(objects) - 1
|
||||
}
|
||||
if stop >= objIndex {
|
||||
layout[i] = make([]*d2graph.Object, 0, stop-objIndex+1)
|
||||
}
|
||||
for ; objIndex <= stop; objIndex++ {
|
||||
layout[i] = append(layout[i], objects[objIndex])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,7 +413,11 @@ func (p *parser) parseMap(isFileMap bool) *d2ast.Map {
|
|||
if after != p.pos {
|
||||
if n.Unbox() != nil {
|
||||
if n.MapKey != nil && n.MapKey.Value.Unbox() != nil {
|
||||
p.errorf(after, p.pos, "unexpected text after %v", n.MapKey.Value.Unbox().Type())
|
||||
ps := ""
|
||||
if _, ok := n.MapKey.Value.Unbox().(*d2ast.BlockString); ok {
|
||||
ps = ". See https://d2lang.com/tour/text#advanced-block-strings."
|
||||
}
|
||||
p.errorf(after, p.pos, "unexpected text after %v%s", n.MapKey.Value.Unbox().Type(), ps)
|
||||
} else {
|
||||
p.errorf(after, p.pos, "unexpected text after %v", n.Unbox().Type())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ func FeatureSupportCheck(info *PluginInfo, g *d2graph.Graph) error {
|
|||
for _, obj := range g.Objects {
|
||||
if obj.Top != nil || obj.Left != nil {
|
||||
if _, ok := featureMap[TOP_LEFT]; !ok {
|
||||
return fmt.Errorf(`Object "%s" has attribute "top" and/or "left" set, but layout engine "%s" does not support locked positions.`, obj.AbsID(), info.Name)
|
||||
return fmt.Errorf(`Object "%s" has attribute "top" and/or "left" set, but layout engine "%s" does not support locked positions. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`, obj.AbsID(), info.Name)
|
||||
}
|
||||
}
|
||||
if (obj.WidthAttr != nil || obj.HeightAttr != nil) && len(obj.ChildrenArray) > 0 {
|
||||
if _, ok := featureMap[CONTAINER_DIMENSIONS]; !ok {
|
||||
return fmt.Errorf(`Object "%s" has attribute "width" and/or "height" set, but layout engine "%s" does not support dimensions set on containers.`, obj.AbsID(), info.Name)
|
||||
return fmt.Errorf(`Object "%s" has attribute "width" and/or "height" set, but layout engine "%s" does not support dimensions set on containers. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`, obj.AbsID(), info.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ func FeatureSupportCheck(info *PluginInfo, g *d2graph.Graph) error {
|
|||
_, isKey := g.Root.HasChild(d2graph.Key(obj.NearKey))
|
||||
if isKey {
|
||||
if _, ok := featureMap[NEAR_OBJECT]; !ok {
|
||||
return fmt.Errorf(`Object "%s" has "near" set to another object, but layout engine "%s" only supports constant values for "near".`, obj.AbsID(), info.Name)
|
||||
return fmt.Errorf(`Object "%s" has "near" set to another object, but layout engine "%s" only supports constant values for "near". See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`, obj.AbsID(), info.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -63,10 +63,10 @@ func FeatureSupportCheck(info *PluginInfo, g *d2graph.Graph) error {
|
|||
continue
|
||||
}
|
||||
if e.Src == e.Dst {
|
||||
return fmt.Errorf(`Connection "%s" is a self loop on a container, but layout engine "%s" does not support this.`, e.AbsID(), info.Name)
|
||||
return fmt.Errorf(`Connection "%s" is a self loop on a container, but layout engine "%s" does not support this. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`, e.AbsID(), info.Name)
|
||||
}
|
||||
if e.Src.IsDescendantOf(e.Dst) || e.Dst.IsDescendantOf(e.Src) {
|
||||
return fmt.Errorf(`Connection "%s" goes from a container to a descendant, but layout engine "%s" does not support this.`, e.AbsID(), info.Name)
|
||||
return fmt.Errorf(`Connection "%s" goes from a container to a descendant, but layout engine "%s" does not support this. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`, e.AbsID(), info.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,20 +21,22 @@ import (
|
|||
// Also see execPlugin in exec.go for the d2 binary plugin protocol.
|
||||
func Serve(p Plugin) xmain.RunFunc {
|
||||
return func(ctx context.Context, ms *xmain.State) (err error) {
|
||||
fs, err := p.Flags(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, f := range fs {
|
||||
f.AddToOpts(ms.Opts)
|
||||
}
|
||||
err = ms.Opts.Flags.Parse(ms.Opts.Args)
|
||||
if !errors.Is(err, pflag.ErrHelp) && err != nil {
|
||||
return xmain.UsageErrorf("failed to parse flags: %v", err)
|
||||
}
|
||||
if errors.Is(err, pflag.ErrHelp) {
|
||||
// At some point we want to write a friendly help.
|
||||
return info(ctx, p, ms)
|
||||
if !ms.Opts.Flags.Parsed() {
|
||||
fs, err := p.Flags(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, f := range fs {
|
||||
f.AddToOpts(ms.Opts)
|
||||
}
|
||||
err = ms.Opts.Flags.Parse(ms.Opts.Args)
|
||||
if !errors.Is(err, pflag.ErrHelp) && err != nil {
|
||||
return xmain.UsageErrorf("failed to parse flags: %v", err)
|
||||
}
|
||||
if errors.Is(err, pflag.ErrHelp) {
|
||||
// At some point we want to write a friendly help.
|
||||
return info(ctx, p, ms)
|
||||
}
|
||||
}
|
||||
|
||||
if len(ms.Opts.Flags.Args()) < 1 {
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ Android: {
|
|||
|
||||
web -> twitter fe
|
||||
timeline scorer: "Timeline\nScorer" {
|
||||
style.fill "#ffdef1"
|
||||
style.fill: "#ffdef1"
|
||||
}
|
||||
home ranker: Home Ranker
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ prediction service2: Prediction Service {
|
|||
icon: https://cdn-icons-png.flaticon.com/512/6461/6461819.png
|
||||
}
|
||||
home scorer: Home Scorer {
|
||||
style.fill "#ffdef1"
|
||||
style.fill: "#ffdef1"
|
||||
}
|
||||
manhattan: Manhattan
|
||||
memcache: Memcache {
|
||||
|
|
@ -766,7 +766,7 @@ Android: {
|
|||
|
||||
web -> twitter fe
|
||||
timeline scorer: "Timeline\nScorer" {
|
||||
style.fill "#ffdef1"
|
||||
style.fill: "#ffdef1"
|
||||
}
|
||||
home ranker: Home Ranker
|
||||
|
||||
|
|
@ -805,7 +805,7 @@ prediction service2: Prediction Service {
|
|||
icon: https://cdn-icons-png.flaticon.com/512/6461/6461819.png
|
||||
}
|
||||
home scorer: Home Scorer {
|
||||
style.fill "#ffdef1"
|
||||
style.fill: "#ffdef1"
|
||||
}
|
||||
manhattan: Manhattan
|
||||
memcache: Memcache {
|
||||
|
|
@ -1373,5 +1373,6 @@ func run(t *testing.T, tc testCase) {
|
|||
assert.Success(t, err)
|
||||
|
||||
// We want the visual diffs to compare, but there's floating point precision differences between CI and user machines, so don't compare raw strings
|
||||
diff.Testdata(filepath.Join(dataPath, "sketch"), ".svg", svgBytes)
|
||||
err = diff.Testdata(filepath.Join(dataPath, "sketch"), ".svg", svgBytes)
|
||||
assert.Success(t, err)
|
||||
}
|
||||
|
|
|
|||
562
d2renderers/d2sketch/testdata/twitter/sketch.exp.svg
vendored
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
|
|
@ -553,19 +553,13 @@ func (connection *Connection) GetArrowheadLabelPosition(isDst bool) *geo.Point {
|
|||
index = len(connection.Route) - 2
|
||||
}
|
||||
start, end := connection.Route[index], connection.Route[index+1]
|
||||
// Note: end to start to get normal towards unlocked top position
|
||||
normalX, normalY := geo.GetUnitNormalVector(end.X, end.Y, start.X, start.Y)
|
||||
|
||||
// how much to move the label back from the very end of the edge
|
||||
var shift float64
|
||||
if start.Y == end.Y {
|
||||
// shift left/right to fit on horizontal segment
|
||||
shift = width/2. + label.PADDING
|
||||
} else if start.X == end.X {
|
||||
// shift up/down to fit on vertical segment
|
||||
shift = height/2. + label.PADDING
|
||||
} else {
|
||||
// TODO compute amount to shift according to angle instead of max
|
||||
shift = math.Max(width, height)
|
||||
}
|
||||
// determine how much to move the label back from the very end of the edge
|
||||
// e.g. if normal points up {x: 0, y:1}, shift width/2 + padding to fit
|
||||
shift := math.Abs(normalX)*(height/2.+label.PADDING) +
|
||||
math.Abs(normalY)*(width/2.+label.PADDING)
|
||||
|
||||
length := geo.Route(connection.Route).Length()
|
||||
var position float64
|
||||
|
|
@ -583,7 +577,7 @@ func (connection *Connection) GetArrowheadLabelPosition(isDst bool) *geo.Point {
|
|||
|
||||
strokeWidth := float64(connection.StrokeWidth)
|
||||
|
||||
labelTL, index := label.UnlockedTop.GetPointOnRoute(connection.Route, strokeWidth, position, width, height)
|
||||
labelTL, _ := label.UnlockedTop.GetPointOnRoute(connection.Route, strokeWidth, position, width, height)
|
||||
|
||||
var arrowSize float64
|
||||
if isDst && connection.DstArrow != NoArrowhead {
|
||||
|
|
@ -597,9 +591,6 @@ func (connection *Connection) GetArrowheadLabelPosition(isDst bool) *geo.Point {
|
|||
// labelTL already accounts for strokeWidth and padding, we only want to shift further if the arrow is larger than this
|
||||
offset := (arrowSize/2 + ARROWHEAD_PADDING) - strokeWidth/2 - label.PADDING
|
||||
if offset > 0 {
|
||||
start, end = connection.Route[index], connection.Route[index+1]
|
||||
// Note: end to start to get normal towards unlocked top position
|
||||
normalX, normalY := geo.GetUnitNormalVector(end.X, end.Y, start.X, start.Y)
|
||||
labelTL.X += normalX * offset
|
||||
labelTL.Y += normalY * offset
|
||||
}
|
||||
|
|
@ -635,6 +626,8 @@ const (
|
|||
CfMany Arrowhead = "cf-many"
|
||||
CfOneRequired Arrowhead = "cf-one-required"
|
||||
CfManyRequired Arrowhead = "cf-many-required"
|
||||
|
||||
DefaultArrowhead Arrowhead = TriangleArrowhead
|
||||
)
|
||||
|
||||
var Arrowheads = map[string]struct{}{
|
||||
|
|
@ -663,8 +656,12 @@ func ToArrowhead(arrowheadType string, filled bool) Arrowhead {
|
|||
return FilledCircleArrowhead
|
||||
}
|
||||
return CircleArrowhead
|
||||
case string(NoArrowhead):
|
||||
return NoArrowhead
|
||||
case string(ArrowArrowhead):
|
||||
return ArrowArrowhead
|
||||
case string(TriangleArrowhead):
|
||||
return TriangleArrowhead
|
||||
case string(CfOne):
|
||||
return CfOne
|
||||
case string(CfMany):
|
||||
|
|
@ -674,7 +671,7 @@ func ToArrowhead(arrowheadType string, filled bool) Arrowhead {
|
|||
case string(CfManyRequired):
|
||||
return CfManyRequired
|
||||
default:
|
||||
return TriangleArrowhead
|
||||
return DefaultArrowhead
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,14 @@ func TestCLI_E2E(t *testing.T) {
|
|||
assert.Testdata(t, ".svg", svg)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "flags-panic",
|
||||
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
|
||||
writeFile(t, dir, "hello-world.d2", `x -> y`)
|
||||
err := runTestMain(t, ctx, dir, env, "layout", "dagre", "--dagre-nodesep", "50", "hello-world.d2")
|
||||
assert.ErrorString(t, err, `failed to wait xmain test: e2etests-cli/d2: failed to unmarshal input to graph: `)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "empty-layer",
|
||||
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
|
||||
|
|
@ -318,6 +326,19 @@ steps: {
|
|||
assert.Success(t, err)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "one-layer-gif",
|
||||
skipCI: true,
|
||||
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
|
||||
writeFile(t, dir, "in.d2", `x`)
|
||||
err := runTestMain(t, ctx, dir, env, "--animate-interval=10", "in.d2", "out.gif")
|
||||
assert.Success(t, err)
|
||||
|
||||
gifBytes := readFile(t, dir, "out.gif")
|
||||
err = xgif.Validate(gifBytes, 1, 10)
|
||||
assert.Success(t, err)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "stdin",
|
||||
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
|
||||
|
|
|
|||
|
|
@ -89,6 +89,18 @@ b.1 -> b.1`,
|
|||
script: `shape: sequence_diagram
|
||||
a: A
|
||||
b: B`,
|
||||
},
|
||||
{
|
||||
name: "root-container",
|
||||
script: `main: {
|
||||
x -> y
|
||||
y <- z
|
||||
}
|
||||
|
||||
root: {
|
||||
x -> y
|
||||
y <- z
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "sequence_diagram_name_crash",
|
||||
|
|
@ -932,6 +944,8 @@ d
|
|||
a -> b -> c
|
||||
`,
|
||||
},
|
||||
loadFromFile(t, "slow_grid"),
|
||||
loadFromFile(t, "grid_oom"),
|
||||
}
|
||||
|
||||
runa(t, tcs)
|
||||
|
|
|
|||
|
|
@ -36,9 +36,13 @@ func main() {
|
|||
vFlag := false
|
||||
testCaseFlag := ""
|
||||
testSetFlag := ""
|
||||
cpuProfileFlag := false
|
||||
memProfileFlag := false
|
||||
flag.BoolVar(&deltaFlag, "delta", false, "Generate the report only for cases that changed.")
|
||||
flag.StringVar(&testSetFlag, "test-set", "", "Only run set of tests matching this string. e.g. regressions")
|
||||
flag.StringVar(&testCaseFlag, "test-case", "", "Only run tests matching this string. e.g. all_shapes")
|
||||
flag.BoolVar(&cpuProfileFlag, "cpuprofile", false, "Profile test cpu usage. `go tool pprof out/cpu.prof`")
|
||||
flag.BoolVar(&memProfileFlag, "memprofile", false, "Profile test memory usage. `go tool pprof out/mem.prof`")
|
||||
skipTests := flag.Bool("skip-tests", false, "Skip running tests first")
|
||||
flag.BoolVar(&vFlag, "v", false, "verbose")
|
||||
flag.Parse()
|
||||
|
|
@ -47,7 +51,16 @@ func main() {
|
|||
if vFlag {
|
||||
vString = "-v"
|
||||
}
|
||||
testMatchString := fmt.Sprintf("TestE2E/%s/%s", testSetFlag, testCaseFlag)
|
||||
testMatchString := fmt.Sprintf("-run=TestE2E/%s/%s", testSetFlag, testCaseFlag)
|
||||
|
||||
cpuProfileStr := ""
|
||||
if cpuProfileFlag {
|
||||
cpuProfileStr = `-cpuprofile=out/cpu.prof`
|
||||
}
|
||||
memProfileStr := ""
|
||||
if memProfileFlag {
|
||||
memProfileStr = `-memprofile=out/mem.prof`
|
||||
}
|
||||
|
||||
testDir := os.Getenv("TEST_DIR")
|
||||
if testDir == "" {
|
||||
|
|
@ -58,7 +71,18 @@ func main() {
|
|||
ctx := log.Stderr(context.Background())
|
||||
ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, "go", "test", testDir, "-run", testMatchString, vString)
|
||||
// don't want to pass empty args to CommandContext
|
||||
args := []string{"test", testDir, testMatchString}
|
||||
if cpuProfileStr != "" {
|
||||
args = append(args, cpuProfileStr)
|
||||
}
|
||||
if memProfileStr != "" {
|
||||
args = append(args, memProfileStr)
|
||||
}
|
||||
if vString != "" {
|
||||
args = append(args, vString)
|
||||
}
|
||||
cmd := exec.CommandContext(ctx, "go", args...)
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Env = append(cmd.Env, "FORCE_COLOR=1")
|
||||
cmd.Env = append(cmd.Env, "DEBUG=1")
|
||||
|
|
|
|||
|
|
@ -723,7 +723,7 @@ eee.shape: document
|
|||
eee <- aaa.ccc
|
||||
(eee <- aaa.ccc)[0]: '222'
|
||||
`,
|
||||
dagreFeatureError: `Connection "(aaa.ccc -- aaa)[0]" goes from a container to a descendant, but layout engine "dagre" does not support this.`,
|
||||
dagreFeatureError: `Connection "(aaa.ccc -- aaa)[0]" goes from a container to a descendant, but layout engine "dagre" does not support this. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`,
|
||||
},
|
||||
{
|
||||
name: "chaos2",
|
||||
|
|
@ -2133,7 +2133,7 @@ c: {
|
|||
a
|
||||
}
|
||||
`,
|
||||
dagreFeatureError: `Object "a" has attribute "width" and/or "height" set, but layout engine "dagre" does not support dimensions set on containers.`,
|
||||
dagreFeatureError: `Object "a" has attribute "width" and/or "height" set, but layout engine "dagre" does not support dimensions set on containers. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`,
|
||||
},
|
||||
{
|
||||
name: "crow_foot_arrowhead",
|
||||
|
|
@ -2422,6 +2422,24 @@ nostar: { class: dragon_ball }
|
|||
|
||||
nostar -> 1star: { class: path }
|
||||
1star -> 2star: { class: path }
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "array-classes",
|
||||
script: `classes: {
|
||||
button: {
|
||||
style.border-radius: 999
|
||||
style.stroke: black
|
||||
}
|
||||
success: {
|
||||
style.fill: "#90EE90"
|
||||
}
|
||||
error: {
|
||||
style.fill: "#EA9999"
|
||||
}
|
||||
}
|
||||
yay: Successful { class: [button; success] }
|
||||
nay: Failure { class: [button; error] }
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
@ -2699,6 +2717,7 @@ scenarios: {
|
|||
loadFromFile(t, "executive_grid"),
|
||||
loadFromFile(t, "grid_animated"),
|
||||
loadFromFile(t, "grid_gap"),
|
||||
loadFromFile(t, "grid_even"),
|
||||
loadFromFile(t, "ent2d2_basic"),
|
||||
loadFromFile(t, "ent2d2_right"),
|
||||
}
|
||||
|
|
|
|||
69
e2etests/testdata/files/grid_even.d2
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
row no growth: {
|
||||
grid-rows: 2
|
||||
|
||||
# row 1
|
||||
a.width: 620
|
||||
|
||||
# row 2 width equals row 1 (with 40 in-between each)
|
||||
b.width: 200
|
||||
c.width: 150
|
||||
d.width: 100
|
||||
e.width: 50
|
||||
}
|
||||
|
||||
row 200 growth: {
|
||||
grid-rows: 2
|
||||
|
||||
# row 1
|
||||
a.width: 820
|
||||
|
||||
# row 2 needs to grow 200 to equal row 1
|
||||
b.width: 200
|
||||
# these 3 should grow proportionally until they reach b's width
|
||||
c.width: 150
|
||||
d.width: 100
|
||||
e.width: 50
|
||||
}
|
||||
|
||||
row big growth: {
|
||||
grid-rows: 2
|
||||
|
||||
# row 1
|
||||
a.width: 1420
|
||||
# row 2 needs to grow 800
|
||||
# these should all reach width 350
|
||||
b.width: 200 # 0 + 150
|
||||
c.width: 150 # 50 + 150
|
||||
d.width: 100 # 100 + 150
|
||||
e.width: 50 # 150 + 150
|
||||
}
|
||||
|
||||
column no growth: {
|
||||
grid-columns: 2
|
||||
|
||||
a.height: 620
|
||||
b.height: 200
|
||||
c.height: 150
|
||||
d.height: 100
|
||||
e.height: 50
|
||||
}
|
||||
|
||||
column 200 growth: {
|
||||
grid-columns: 2
|
||||
|
||||
a.height: 820
|
||||
b.height: 200
|
||||
c.height: 150
|
||||
d.height: 100
|
||||
e.height: 50
|
||||
}
|
||||
|
||||
column big growth: {
|
||||
grid-columns: 2
|
||||
|
||||
a.height: 1420
|
||||
b.height: 200
|
||||
c.height: 150
|
||||
d.height: 100
|
||||
e.height: 50
|
||||
}
|
||||
1049
e2etests/testdata/files/grid_oom.d2
vendored
Normal file
147
e2etests/testdata/files/slow_grid.d2
vendored
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
grid-columns: 15
|
||||
|
||||
1: {
|
||||
shape: class
|
||||
1: ------------------
|
||||
2: -------------------------------
|
||||
3: ------------------------------
|
||||
4: -------------------------
|
||||
}
|
||||
2: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
2: ----------------------------
|
||||
}
|
||||
3: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
2: ----------------------------
|
||||
3: ------------------------------
|
||||
4: -------------------------
|
||||
}
|
||||
4: {
|
||||
shape: class
|
||||
1: ----------------------------
|
||||
}
|
||||
5: {
|
||||
shape: class
|
||||
1: --------------------
|
||||
2: ----------------------------------------------
|
||||
3: ---------------------------------
|
||||
}
|
||||
6: {
|
||||
shape: class
|
||||
1: ----------------------------------------
|
||||
2: ------------------------
|
||||
3: ------------------------
|
||||
4: --------------------------------------
|
||||
}
|
||||
7: {
|
||||
shape: class
|
||||
1: ----------------------------------------
|
||||
2: ---------------------
|
||||
3: ------------------------
|
||||
4: --------------------------------------
|
||||
}
|
||||
5: {
|
||||
shape: class
|
||||
1: ----------------------------------------
|
||||
2: ---------------------
|
||||
3: ------------------------
|
||||
4: --------------------------------------
|
||||
}
|
||||
9: {
|
||||
shape: class
|
||||
1: ----------------------
|
||||
2: -------------------------------------------
|
||||
3: -----------------------
|
||||
4: --------------------------
|
||||
5: -----------------------------
|
||||
6: -----------------------------
|
||||
7: --------------------------
|
||||
}
|
||||
10: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
}
|
||||
11: {
|
||||
shape: class
|
||||
1: ----------------
|
||||
2: ---------------------------
|
||||
3: -----------------------------
|
||||
4: ------------------------
|
||||
}
|
||||
12: {
|
||||
shape: class
|
||||
1: ----------------------
|
||||
2: -----------------------
|
||||
3: -------------
|
||||
4: -------------
|
||||
5: ------------------------
|
||||
6: ------------------------------------------------
|
||||
7: --------------------------
|
||||
}
|
||||
13: {
|
||||
shape: class
|
||||
1: --------------------------------
|
||||
}
|
||||
14: {
|
||||
shape: class
|
||||
1: ----------------
|
||||
2: ---------------------------
|
||||
3: -----------------------------
|
||||
4: ------------------------
|
||||
}
|
||||
15: {
|
||||
shape: class
|
||||
1: ------------------------
|
||||
2: ----------------------
|
||||
}
|
||||
16: {
|
||||
shape: class
|
||||
1: ----------------
|
||||
2: ------------------------------
|
||||
}
|
||||
17: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
}
|
||||
18: {
|
||||
shape: class
|
||||
1: ----------------
|
||||
}
|
||||
19: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
}
|
||||
20: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
}
|
||||
21: {
|
||||
shape: class
|
||||
1: ----------------
|
||||
2: ---------------------------
|
||||
3: -----------------------------
|
||||
4: ------------------------
|
||||
}
|
||||
22: {
|
||||
shape: class
|
||||
1: ---------------------------------------------
|
||||
2: --------------------
|
||||
3: -----------------------
|
||||
4: -------------------------------------
|
||||
}
|
||||
23: {
|
||||
shape: class
|
||||
1: ----------------
|
||||
2: ------------------------------
|
||||
}
|
||||
24: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
}
|
||||
25: {
|
||||
shape: class
|
||||
1: -----------------
|
||||
}
|
||||
9898
e2etests/testdata/regression/grid_oom/dagre/board.exp.json
generated
vendored
Normal file
95
e2etests/testdata/regression/grid_oom/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 291 KiB |
9898
e2etests/testdata/regression/grid_oom/elk/board.exp.json
generated
vendored
Normal file
95
e2etests/testdata/regression/grid_oom/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 291 KiB |
565
e2etests/testdata/regression/root-container/dagre/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,565 @@
|
|||
{
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "main",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 41
|
||||
},
|
||||
"width": 245,
|
||||
"height": 291,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B4",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "main",
|
||||
"fontSize": 28,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 57,
|
||||
"labelHeight": 36,
|
||||
"labelPosition": "OUTSIDE_TOP_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "main.x",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 40,
|
||||
"y": 70
|
||||
},
|
||||
"width": 53,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "x",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 8,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "main.y",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 96,
|
||||
"y": 236
|
||||
},
|
||||
"width": 54,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "y",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 9,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "main.z",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 153,
|
||||
"y": 70
|
||||
},
|
||||
"width": 52,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "z",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 7,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "root",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 266,
|
||||
"y": 41
|
||||
},
|
||||
"width": 245,
|
||||
"height": 291,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B4",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "root",
|
||||
"fontSize": 28,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 49,
|
||||
"labelHeight": 36,
|
||||
"labelPosition": "OUTSIDE_TOP_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "root.x",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 306,
|
||||
"y": 70
|
||||
},
|
||||
"width": 53,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "x",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 8,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "root.y",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 362,
|
||||
"y": 236
|
||||
},
|
||||
"width": 54,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "y",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 9,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "root.z",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 419,
|
||||
"y": 70
|
||||
},
|
||||
"width": 52,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "z",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 7,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "main.(x -> y)[0]",
|
||||
"src": "main.x",
|
||||
"srcArrow": "none",
|
||||
"dst": "main.y",
|
||||
"dstArrow": "triangle",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 66.75,
|
||||
"y": 136.5
|
||||
},
|
||||
{
|
||||
"x": 66.75,
|
||||
"y": 176.5
|
||||
},
|
||||
{
|
||||
"x": 73.55,
|
||||
"y": 196.5
|
||||
},
|
||||
{
|
||||
"x": 100.75,
|
||||
"y": 236.5
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "main.(y <- z)[0]",
|
||||
"src": "main.y",
|
||||
"srcArrow": "triangle",
|
||||
"dst": "main.z",
|
||||
"dstArrow": "none",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 145.3644578313253,
|
||||
"y": 236.5
|
||||
},
|
||||
{
|
||||
"x": 172.47289156626505,
|
||||
"y": 196.5
|
||||
},
|
||||
{
|
||||
"x": 179.25,
|
||||
"y": 176.5
|
||||
},
|
||||
{
|
||||
"x": 179.25,
|
||||
"y": 136.5
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "root.(x -> y)[0]",
|
||||
"src": "root.x",
|
||||
"srcArrow": "none",
|
||||
"dst": "root.y",
|
||||
"dstArrow": "triangle",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 332.5,
|
||||
"y": 136.5
|
||||
},
|
||||
{
|
||||
"x": 332.5,
|
||||
"y": 176.5
|
||||
},
|
||||
{
|
||||
"x": 339.3,
|
||||
"y": 196.5
|
||||
},
|
||||
{
|
||||
"x": 366.5,
|
||||
"y": 236.5
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "root.(y <- z)[0]",
|
||||
"src": "root.y",
|
||||
"srcArrow": "triangle",
|
||||
"dst": "root.z",
|
||||
"dstArrow": "none",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 411.1144578313253,
|
||||
"y": 236.5
|
||||
},
|
||||
{
|
||||
"x": 438.22289156626505,
|
||||
"y": 196.5
|
||||
},
|
||||
{
|
||||
"x": 445,
|
||||
"y": 176.5
|
||||
},
|
||||
{
|
||||
"x": 445,
|
||||
"y": 136.5
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"id": "",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"opacity": 0,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 0,
|
||||
"borderRadius": 0,
|
||||
"fill": "N7",
|
||||
"stroke": "",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 0
|
||||
}
|
||||
}
|
||||
102
e2etests/testdata/regression/root-container/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
529
e2etests/testdata/regression/root-container/elk/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,529 @@
|
|||
{
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "main",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 12
|
||||
},
|
||||
"width": 154,
|
||||
"height": 438,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B4",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "main",
|
||||
"fontSize": 28,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 57,
|
||||
"labelHeight": 36,
|
||||
"labelPosition": "INSIDE_TOP_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "main.x",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 62,
|
||||
"y": 62
|
||||
},
|
||||
"width": 53,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "x",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 8,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "main.y",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 62,
|
||||
"y": 198
|
||||
},
|
||||
"width": 54,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "y",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 9,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "main.z",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 63,
|
||||
"y": 334
|
||||
},
|
||||
"width": 52,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "z",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 7,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "root",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 186,
|
||||
"y": 12
|
||||
},
|
||||
"width": 154,
|
||||
"height": 438,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B4",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "root",
|
||||
"fontSize": 28,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 49,
|
||||
"labelHeight": 36,
|
||||
"labelPosition": "INSIDE_TOP_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "root.x",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 236,
|
||||
"y": 62
|
||||
},
|
||||
"width": 53,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "x",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 8,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "root.y",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 236,
|
||||
"y": 198
|
||||
},
|
||||
"width": 54,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "y",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 9,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
"id": "root.z",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 237,
|
||||
"y": 334
|
||||
},
|
||||
"width": 52,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "B5",
|
||||
"stroke": "B1",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "z",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 7,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 2
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "main.(x -> y)[0]",
|
||||
"src": "main.x",
|
||||
"srcArrow": "none",
|
||||
"dst": "main.y",
|
||||
"dstArrow": "triangle",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 89,
|
||||
"y": 128
|
||||
},
|
||||
{
|
||||
"x": 89,
|
||||
"y": 198
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "main.(y <- z)[0]",
|
||||
"src": "main.y",
|
||||
"srcArrow": "triangle",
|
||||
"dst": "main.z",
|
||||
"dstArrow": "none",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 89,
|
||||
"y": 264
|
||||
},
|
||||
{
|
||||
"x": 89,
|
||||
"y": 334
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "root.(x -> y)[0]",
|
||||
"src": "root.x",
|
||||
"srcArrow": "none",
|
||||
"dst": "root.y",
|
||||
"dstArrow": "triangle",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 263,
|
||||
"y": 128
|
||||
},
|
||||
{
|
||||
"x": 263,
|
||||
"y": 198
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "root.(y <- z)[0]",
|
||||
"src": "root.y",
|
||||
"srcArrow": "triangle",
|
||||
"dst": "root.z",
|
||||
"dstArrow": "none",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "B1",
|
||||
"borderRadius": 10,
|
||||
"label": "",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N2",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"labelPosition": "",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 263,
|
||||
"y": 264
|
||||
},
|
||||
{
|
||||
"x": 263,
|
||||
"y": 334
|
||||
}
|
||||
],
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null,
|
||||
"zIndex": 0
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"id": "",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"opacity": 0,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 0,
|
||||
"borderRadius": 0,
|
||||
"fill": "N7",
|
||||
"stroke": "",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 0
|
||||
}
|
||||
}
|
||||
102
e2etests/testdata/regression/root-container/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
1463
e2etests/testdata/regression/slow_grid/dagre/board.exp.json
generated
vendored
Normal file
95
e2etests/testdata/regression/slow_grid/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 46 KiB |
1463
e2etests/testdata/regression/slow_grid/elk/board.exp.json
generated
vendored
Normal file
95
e2etests/testdata/regression/slow_grid/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 46 KiB |
130
e2etests/testdata/stable/array-classes/dagre/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "yay",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 120,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 999,
|
||||
"fill": "#90EE90",
|
||||
"stroke": "black",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "Successful",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 75,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "nay",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 180,
|
||||
"y": 0
|
||||
},
|
||||
"width": 94,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 999,
|
||||
"fill": "#EA9999",
|
||||
"stroke": "black",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "Failure",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 49,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [],
|
||||
"root": {
|
||||
"id": "",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"opacity": 0,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 0,
|
||||
"borderRadius": 0,
|
||||
"fill": "N7",
|
||||
"stroke": "",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 0
|
||||
}
|
||||
}
|
||||
95
e2etests/testdata/stable/array-classes/dagre/sketch.exp.svg
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.4.1-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 276 68"><svg id="d2-svg" class="d2-640799908" width="276" height="68" viewBox="-1 -1 276 68"><rect x="-1.000000" y="-1.000000" width="276.000000" height="68.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
||||
.d2-640799908 .text-bold {
|
||||
font-family: "d2-640799908-font-bold";
|
||||
}
|
||||
@font-face {
|
||||
font-family: d2-640799908-font-bold;
|
||||
src: url("data:application/font-woff;base64,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");
|
||||
}]]></style><style type="text/css"><![CDATA[.shape {
|
||||
shape-rendering: geometricPrecision;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.connection {
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.blend {
|
||||
mix-blend-mode: multiply;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.d2-640799908 .fill-N1{fill:#0A0F25;}
|
||||
.d2-640799908 .fill-N2{fill:#676C7E;}
|
||||
.d2-640799908 .fill-N3{fill:#9499AB;}
|
||||
.d2-640799908 .fill-N4{fill:#CFD2DD;}
|
||||
.d2-640799908 .fill-N5{fill:#DEE1EB;}
|
||||
.d2-640799908 .fill-N6{fill:#EEF1F8;}
|
||||
.d2-640799908 .fill-N7{fill:#FFFFFF;}
|
||||
.d2-640799908 .fill-B1{fill:#0D32B2;}
|
||||
.d2-640799908 .fill-B2{fill:#0D32B2;}
|
||||
.d2-640799908 .fill-B3{fill:#E3E9FD;}
|
||||
.d2-640799908 .fill-B4{fill:#E3E9FD;}
|
||||
.d2-640799908 .fill-B5{fill:#EDF0FD;}
|
||||
.d2-640799908 .fill-B6{fill:#F7F8FE;}
|
||||
.d2-640799908 .fill-AA2{fill:#4A6FF3;}
|
||||
.d2-640799908 .fill-AA4{fill:#EDF0FD;}
|
||||
.d2-640799908 .fill-AA5{fill:#F7F8FE;}
|
||||
.d2-640799908 .fill-AB4{fill:#EDF0FD;}
|
||||
.d2-640799908 .fill-AB5{fill:#F7F8FE;}
|
||||
.d2-640799908 .stroke-N1{stroke:#0A0F25;}
|
||||
.d2-640799908 .stroke-N2{stroke:#676C7E;}
|
||||
.d2-640799908 .stroke-N3{stroke:#9499AB;}
|
||||
.d2-640799908 .stroke-N4{stroke:#CFD2DD;}
|
||||
.d2-640799908 .stroke-N5{stroke:#DEE1EB;}
|
||||
.d2-640799908 .stroke-N6{stroke:#EEF1F8;}
|
||||
.d2-640799908 .stroke-N7{stroke:#FFFFFF;}
|
||||
.d2-640799908 .stroke-B1{stroke:#0D32B2;}
|
||||
.d2-640799908 .stroke-B2{stroke:#0D32B2;}
|
||||
.d2-640799908 .stroke-B3{stroke:#E3E9FD;}
|
||||
.d2-640799908 .stroke-B4{stroke:#E3E9FD;}
|
||||
.d2-640799908 .stroke-B5{stroke:#EDF0FD;}
|
||||
.d2-640799908 .stroke-B6{stroke:#F7F8FE;}
|
||||
.d2-640799908 .stroke-AA2{stroke:#4A6FF3;}
|
||||
.d2-640799908 .stroke-AA4{stroke:#EDF0FD;}
|
||||
.d2-640799908 .stroke-AA5{stroke:#F7F8FE;}
|
||||
.d2-640799908 .stroke-AB4{stroke:#EDF0FD;}
|
||||
.d2-640799908 .stroke-AB5{stroke:#F7F8FE;}
|
||||
.d2-640799908 .background-color-N1{background-color:#0A0F25;}
|
||||
.d2-640799908 .background-color-N2{background-color:#676C7E;}
|
||||
.d2-640799908 .background-color-N3{background-color:#9499AB;}
|
||||
.d2-640799908 .background-color-N4{background-color:#CFD2DD;}
|
||||
.d2-640799908 .background-color-N5{background-color:#DEE1EB;}
|
||||
.d2-640799908 .background-color-N6{background-color:#EEF1F8;}
|
||||
.d2-640799908 .background-color-N7{background-color:#FFFFFF;}
|
||||
.d2-640799908 .background-color-B1{background-color:#0D32B2;}
|
||||
.d2-640799908 .background-color-B2{background-color:#0D32B2;}
|
||||
.d2-640799908 .background-color-B3{background-color:#E3E9FD;}
|
||||
.d2-640799908 .background-color-B4{background-color:#E3E9FD;}
|
||||
.d2-640799908 .background-color-B5{background-color:#EDF0FD;}
|
||||
.d2-640799908 .background-color-B6{background-color:#F7F8FE;}
|
||||
.d2-640799908 .background-color-AA2{background-color:#4A6FF3;}
|
||||
.d2-640799908 .background-color-AA4{background-color:#EDF0FD;}
|
||||
.d2-640799908 .background-color-AA5{background-color:#F7F8FE;}
|
||||
.d2-640799908 .background-color-AB4{background-color:#EDF0FD;}
|
||||
.d2-640799908 .background-color-AB5{background-color:#F7F8FE;}
|
||||
.d2-640799908 .color-N1{color:#0A0F25;}
|
||||
.d2-640799908 .color-N2{color:#676C7E;}
|
||||
.d2-640799908 .color-N3{color:#9499AB;}
|
||||
.d2-640799908 .color-N4{color:#CFD2DD;}
|
||||
.d2-640799908 .color-N5{color:#DEE1EB;}
|
||||
.d2-640799908 .color-N6{color:#EEF1F8;}
|
||||
.d2-640799908 .color-N7{color:#FFFFFF;}
|
||||
.d2-640799908 .color-B1{color:#0D32B2;}
|
||||
.d2-640799908 .color-B2{color:#0D32B2;}
|
||||
.d2-640799908 .color-B3{color:#E3E9FD;}
|
||||
.d2-640799908 .color-B4{color:#E3E9FD;}
|
||||
.d2-640799908 .color-B5{color:#EDF0FD;}
|
||||
.d2-640799908 .color-B6{color:#F7F8FE;}
|
||||
.d2-640799908 .color-AA2{color:#4A6FF3;}
|
||||
.d2-640799908 .color-AA4{color:#EDF0FD;}
|
||||
.d2-640799908 .color-AA5{color:#F7F8FE;}
|
||||
.d2-640799908 .color-AB4{color:#EDF0FD;}
|
||||
.d2-640799908 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><g id="yay"><g class="shape" ><rect x="0.000000" y="0.000000" width="120.000000" height="66.000000" rx="33.000000" stroke="black" fill="#90EE90" style="stroke-width:2;" /></g><text x="60.000000" y="38.500000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">Successful</text></g><g id="nay"><g class="shape" ><rect x="180.000000" y="0.000000" width="94.000000" height="66.000000" rx="33.000000" stroke="black" fill="#EA9999" style="stroke-width:2;" /></g><text x="227.000000" y="38.500000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">Failure</text></g><mask id="d2-640799908" maskUnits="userSpaceOnUse" x="-1" y="-1" width="276" height="68">
|
||||
<rect x="-1" y="-1" width="276" height="68" fill="white"></rect>
|
||||
|
||||
</mask></svg></svg>
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
130
e2etests/testdata/stable/array-classes/elk/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "yay",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 12,
|
||||
"y": 12
|
||||
},
|
||||
"width": 120,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 999,
|
||||
"fill": "#90EE90",
|
||||
"stroke": "black",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "Successful",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 75,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
},
|
||||
{
|
||||
"id": "nay",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 152,
|
||||
"y": 12
|
||||
},
|
||||
"width": 94,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 999,
|
||||
"fill": "#EA9999",
|
||||
"stroke": "black",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "Failure",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "N1",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 49,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"zIndex": 0,
|
||||
"level": 1
|
||||
}
|
||||
],
|
||||
"connections": [],
|
||||
"root": {
|
||||
"id": "",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"opacity": 0,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 0,
|
||||
"borderRadius": 0,
|
||||
"fill": "N7",
|
||||
"stroke": "",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"double-border": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"blend": false,
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "",
|
||||
"fontSize": 0,
|
||||
"fontFamily": "",
|
||||
"language": "",
|
||||
"color": "",
|
||||
"italic": false,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 0,
|
||||
"labelHeight": 0,
|
||||
"zIndex": 0,
|
||||
"level": 0
|
||||
}
|
||||
}
|
||||
95
e2etests/testdata/stable/array-classes/elk/sketch.exp.svg
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.4.1-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 236 68"><svg id="d2-svg" class="d2-1992029540" width="236" height="68" viewBox="11 11 236 68"><rect x="11.000000" y="11.000000" width="236.000000" height="68.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
||||
.d2-1992029540 .text-bold {
|
||||
font-family: "d2-1992029540-font-bold";
|
||||
}
|
||||
@font-face {
|
||||
font-family: d2-1992029540-font-bold;
|
||||
src: url("data:application/font-woff;base64,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");
|
||||
}]]></style><style type="text/css"><![CDATA[.shape {
|
||||
shape-rendering: geometricPrecision;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.connection {
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.blend {
|
||||
mix-blend-mode: multiply;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.d2-1992029540 .fill-N1{fill:#0A0F25;}
|
||||
.d2-1992029540 .fill-N2{fill:#676C7E;}
|
||||
.d2-1992029540 .fill-N3{fill:#9499AB;}
|
||||
.d2-1992029540 .fill-N4{fill:#CFD2DD;}
|
||||
.d2-1992029540 .fill-N5{fill:#DEE1EB;}
|
||||
.d2-1992029540 .fill-N6{fill:#EEF1F8;}
|
||||
.d2-1992029540 .fill-N7{fill:#FFFFFF;}
|
||||
.d2-1992029540 .fill-B1{fill:#0D32B2;}
|
||||
.d2-1992029540 .fill-B2{fill:#0D32B2;}
|
||||
.d2-1992029540 .fill-B3{fill:#E3E9FD;}
|
||||
.d2-1992029540 .fill-B4{fill:#E3E9FD;}
|
||||
.d2-1992029540 .fill-B5{fill:#EDF0FD;}
|
||||
.d2-1992029540 .fill-B6{fill:#F7F8FE;}
|
||||
.d2-1992029540 .fill-AA2{fill:#4A6FF3;}
|
||||
.d2-1992029540 .fill-AA4{fill:#EDF0FD;}
|
||||
.d2-1992029540 .fill-AA5{fill:#F7F8FE;}
|
||||
.d2-1992029540 .fill-AB4{fill:#EDF0FD;}
|
||||
.d2-1992029540 .fill-AB5{fill:#F7F8FE;}
|
||||
.d2-1992029540 .stroke-N1{stroke:#0A0F25;}
|
||||
.d2-1992029540 .stroke-N2{stroke:#676C7E;}
|
||||
.d2-1992029540 .stroke-N3{stroke:#9499AB;}
|
||||
.d2-1992029540 .stroke-N4{stroke:#CFD2DD;}
|
||||
.d2-1992029540 .stroke-N5{stroke:#DEE1EB;}
|
||||
.d2-1992029540 .stroke-N6{stroke:#EEF1F8;}
|
||||
.d2-1992029540 .stroke-N7{stroke:#FFFFFF;}
|
||||
.d2-1992029540 .stroke-B1{stroke:#0D32B2;}
|
||||
.d2-1992029540 .stroke-B2{stroke:#0D32B2;}
|
||||
.d2-1992029540 .stroke-B3{stroke:#E3E9FD;}
|
||||
.d2-1992029540 .stroke-B4{stroke:#E3E9FD;}
|
||||
.d2-1992029540 .stroke-B5{stroke:#EDF0FD;}
|
||||
.d2-1992029540 .stroke-B6{stroke:#F7F8FE;}
|
||||
.d2-1992029540 .stroke-AA2{stroke:#4A6FF3;}
|
||||
.d2-1992029540 .stroke-AA4{stroke:#EDF0FD;}
|
||||
.d2-1992029540 .stroke-AA5{stroke:#F7F8FE;}
|
||||
.d2-1992029540 .stroke-AB4{stroke:#EDF0FD;}
|
||||
.d2-1992029540 .stroke-AB5{stroke:#F7F8FE;}
|
||||
.d2-1992029540 .background-color-N1{background-color:#0A0F25;}
|
||||
.d2-1992029540 .background-color-N2{background-color:#676C7E;}
|
||||
.d2-1992029540 .background-color-N3{background-color:#9499AB;}
|
||||
.d2-1992029540 .background-color-N4{background-color:#CFD2DD;}
|
||||
.d2-1992029540 .background-color-N5{background-color:#DEE1EB;}
|
||||
.d2-1992029540 .background-color-N6{background-color:#EEF1F8;}
|
||||
.d2-1992029540 .background-color-N7{background-color:#FFFFFF;}
|
||||
.d2-1992029540 .background-color-B1{background-color:#0D32B2;}
|
||||
.d2-1992029540 .background-color-B2{background-color:#0D32B2;}
|
||||
.d2-1992029540 .background-color-B3{background-color:#E3E9FD;}
|
||||
.d2-1992029540 .background-color-B4{background-color:#E3E9FD;}
|
||||
.d2-1992029540 .background-color-B5{background-color:#EDF0FD;}
|
||||
.d2-1992029540 .background-color-B6{background-color:#F7F8FE;}
|
||||
.d2-1992029540 .background-color-AA2{background-color:#4A6FF3;}
|
||||
.d2-1992029540 .background-color-AA4{background-color:#EDF0FD;}
|
||||
.d2-1992029540 .background-color-AA5{background-color:#F7F8FE;}
|
||||
.d2-1992029540 .background-color-AB4{background-color:#EDF0FD;}
|
||||
.d2-1992029540 .background-color-AB5{background-color:#F7F8FE;}
|
||||
.d2-1992029540 .color-N1{color:#0A0F25;}
|
||||
.d2-1992029540 .color-N2{color:#676C7E;}
|
||||
.d2-1992029540 .color-N3{color:#9499AB;}
|
||||
.d2-1992029540 .color-N4{color:#CFD2DD;}
|
||||
.d2-1992029540 .color-N5{color:#DEE1EB;}
|
||||
.d2-1992029540 .color-N6{color:#EEF1F8;}
|
||||
.d2-1992029540 .color-N7{color:#FFFFFF;}
|
||||
.d2-1992029540 .color-B1{color:#0D32B2;}
|
||||
.d2-1992029540 .color-B2{color:#0D32B2;}
|
||||
.d2-1992029540 .color-B3{color:#E3E9FD;}
|
||||
.d2-1992029540 .color-B4{color:#E3E9FD;}
|
||||
.d2-1992029540 .color-B5{color:#EDF0FD;}
|
||||
.d2-1992029540 .color-B6{color:#F7F8FE;}
|
||||
.d2-1992029540 .color-AA2{color:#4A6FF3;}
|
||||
.d2-1992029540 .color-AA4{color:#EDF0FD;}
|
||||
.d2-1992029540 .color-AA5{color:#F7F8FE;}
|
||||
.d2-1992029540 .color-AB4{color:#EDF0FD;}
|
||||
.d2-1992029540 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><g id="yay"><g class="shape" ><rect x="12.000000" y="12.000000" width="120.000000" height="66.000000" rx="33.000000" stroke="black" fill="#90EE90" style="stroke-width:2;" /></g><text x="72.000000" y="50.500000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">Successful</text></g><g id="nay"><g class="shape" ><rect x="152.000000" y="12.000000" width="94.000000" height="66.000000" rx="33.000000" stroke="black" fill="#EA9999" style="stroke-width:2;" /></g><text x="199.000000" y="50.500000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">Failure</text></g><mask id="d2-1992029540" maskUnits="userSpaceOnUse" x="11" y="11" width="236" height="68">
|
||||
<rect x="11" y="11" width="236" height="68" fill="white"></rect>
|
||||
|
||||
</mask></svg></svg>
|
||||
|
After Width: | Height: | Size: 9.7 KiB |
24
e2etests/testdata/stable/dagger_grid/dagre/board.exp.json
generated
vendored
|
|
@ -256,7 +256,7 @@
|
|||
"x": 280,
|
||||
"y": 140
|
||||
},
|
||||
"width": 120,
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -294,10 +294,10 @@
|
|||
"id": "flow8",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 440,
|
||||
"x": 420,
|
||||
"y": 140
|
||||
},
|
||||
"width": 160,
|
||||
"width": 170,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -335,10 +335,10 @@
|
|||
"id": "flow9",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 640,
|
||||
"x": 630,
|
||||
"y": 140
|
||||
},
|
||||
"width": 160,
|
||||
"width": 170,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -473,7 +473,7 @@
|
|||
"x": 0,
|
||||
"y": 508
|
||||
},
|
||||
"width": 139,
|
||||
"width": 123,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -511,10 +511,10 @@
|
|||
"id": "WINDOWS",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 179,
|
||||
"x": 163,
|
||||
"y": 508
|
||||
},
|
||||
"width": 117,
|
||||
"width": 131,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -552,10 +552,10 @@
|
|||
"id": "LINUX",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 336,
|
||||
"x": 334,
|
||||
"y": 508
|
||||
},
|
||||
"width": 139,
|
||||
"width": 122,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -593,10 +593,10 @@
|
|||
"id": "MACOS",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 515,
|
||||
"x": 496,
|
||||
"y": 508
|
||||
},
|
||||
"width": 106,
|
||||
"width": 124,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
24
e2etests/testdata/stable/dagger_grid/elk/board.exp.json
generated
vendored
|
|
@ -256,7 +256,7 @@
|
|||
"x": 280,
|
||||
"y": 140
|
||||
},
|
||||
"width": 120,
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -294,10 +294,10 @@
|
|||
"id": "flow8",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 440,
|
||||
"x": 420,
|
||||
"y": 140
|
||||
},
|
||||
"width": 160,
|
||||
"width": 170,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -335,10 +335,10 @@
|
|||
"id": "flow9",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 640,
|
||||
"x": 630,
|
||||
"y": 140
|
||||
},
|
||||
"width": 160,
|
||||
"width": 170,
|
||||
"height": 100,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -473,7 +473,7 @@
|
|||
"x": 0,
|
||||
"y": 508
|
||||
},
|
||||
"width": 139,
|
||||
"width": 123,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -511,10 +511,10 @@
|
|||
"id": "WINDOWS",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 179,
|
||||
"x": 163,
|
||||
"y": 508
|
||||
},
|
||||
"width": 117,
|
||||
"width": 131,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -552,10 +552,10 @@
|
|||
"id": "LINUX",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 336,
|
||||
"x": 334,
|
||||
"y": 508
|
||||
},
|
||||
"width": 139,
|
||||
"width": 122,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -593,10 +593,10 @@
|
|||
"id": "MACOS",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 515,
|
||||
"x": 496,
|
||||
"y": 508
|
||||
},
|
||||
"width": 106,
|
||||
"width": 124,
|
||||
"height": 66,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
1524
e2etests/testdata/stable/grid_even/dagre/board.exp.json
generated
vendored
Normal file
102
e2etests/testdata/stable/grid_even/dagre/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 24 KiB |
1524
e2etests/testdata/stable/grid_even/elk/board.exp.json
generated
vendored
Normal file
102
e2etests/testdata/stable/grid_even/elk/sketch.exp.svg
vendored
Normal file
|
After Width: | Height: | Size: 24 KiB |
8
e2etests/testdata/stable/teleport_grid/dagre/board.exp.json
generated
vendored
|
|
@ -955,7 +955,7 @@
|
|||
"x": 2204,
|
||||
"y": 292
|
||||
},
|
||||
"width": 108,
|
||||
"width": 103,
|
||||
"height": 92,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -1005,7 +1005,7 @@
|
|||
"id": "infra.Kubernetes",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 2352,
|
||||
"x": 2347,
|
||||
"y": 292
|
||||
},
|
||||
"width": 152,
|
||||
|
|
@ -1058,10 +1058,10 @@
|
|||
"id": "infra.My SQL",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 2544,
|
||||
"x": 2539,
|
||||
"y": 292
|
||||
},
|
||||
"width": 122,
|
||||
"width": 126,
|
||||
"height": 92,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 54 KiB |
8
e2etests/testdata/stable/teleport_grid/elk/board.exp.json
generated
vendored
|
|
@ -955,7 +955,7 @@
|
|||
"x": 1323,
|
||||
"y": 210
|
||||
},
|
||||
"width": 108,
|
||||
"width": 103,
|
||||
"height": 92,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
@ -1005,7 +1005,7 @@
|
|||
"id": "infra.Kubernetes",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 1471,
|
||||
"x": 1466,
|
||||
"y": 210
|
||||
},
|
||||
"width": 152,
|
||||
|
|
@ -1058,10 +1058,10 @@
|
|||
"id": "infra.My SQL",
|
||||
"type": "rectangle",
|
||||
"pos": {
|
||||
"x": 1663,
|
||||
"x": 1658,
|
||||
"y": 210
|
||||
},
|
||||
"width": 122,
|
||||
"width": 126,
|
||||
"height": 92,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
|
@ -14,14 +14,14 @@ func testTodo(t *testing.T) {
|
|||
container.first -> container.second: 1->2
|
||||
container -> container.second: c->2
|
||||
`,
|
||||
dagreFeatureError: `Connection "(container -> container.second)[0]" goes from a container to a descendant, but layout engine "dagre" does not support this.`,
|
||||
dagreFeatureError: `Connection "(container -> container.second)[0]" goes from a container to a descendant, but layout engine "dagre" does not support this. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`,
|
||||
},
|
||||
{
|
||||
name: "child_parent_edges",
|
||||
script: `a.b -> a
|
||||
a.b -> a.b.c
|
||||
a.b.c.d -> a.b`,
|
||||
dagreFeatureError: `Connection "(a.b -> a)[0]" goes from a container to a descendant, but layout engine "dagre" does not support this.`,
|
||||
dagreFeatureError: `Connection "(a.b -> a)[0]" goes from a container to a descendant, but layout engine "dagre" does not support this. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`,
|
||||
},
|
||||
{
|
||||
name: "container_label_loop",
|
||||
|
|
@ -29,7 +29,7 @@ a.b.c.d -> a.b`,
|
|||
b -> c
|
||||
}
|
||||
a -> a`,
|
||||
dagreFeatureError: `Connection "(a -> a)[0]" is a self loop on a container, but layout engine "dagre" does not support this.`,
|
||||
dagreFeatureError: `Connection "(a -> a)[0]" is a self loop on a container, but layout engine "dagre" does not support this. See https://d2lang.com/tour/layouts/#layout-specific-functionality for more.`,
|
||||
},
|
||||
{
|
||||
// as nesting gets deeper, the groups advance towards `c` and may overlap its lifeline
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 207 KiB |
|
|
@ -25,7 +25,6 @@ import (
|
|||
)
|
||||
|
||||
const INFINITE_LOOP = 0
|
||||
const BG_INDEX uint8 = 255
|
||||
|
||||
var BG_COLOR = color.White
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ func AnimatePNGs(ms *xmain.State, pngs [][]byte, animIntervalMs int) ([]byte, er
|
|||
// 1. convert the PNG into a GIF compatible image (Bitmap) by quantizing it to 255 colors
|
||||
buf := bytes.NewBuffer(nil)
|
||||
err := gif.Encode(buf, pngImage, &gif.Options{
|
||||
NumColors: 255, // GIFs can have up to 256 colors, so keep 1 slot for white background
|
||||
NumColors: 256, // GIFs can have up to 256 colors
|
||||
Quantizer: quantize.MedianCutQuantizer{},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -85,12 +84,19 @@ func AnimatePNGs(ms *xmain.State, pngs [][]byte, animIntervalMs int) ([]byte, er
|
|||
left := (width - bounds.Dx()) / 2
|
||||
right := left + bounds.Dx()
|
||||
|
||||
palettedImg.Palette[BG_INDEX] = BG_COLOR
|
||||
var bgIndex int
|
||||
if len(palettedImg.Palette) == 256 {
|
||||
bgIndex = findWhiteIndex(palettedImg.Palette)
|
||||
palettedImg.Palette[bgIndex] = BG_COLOR
|
||||
} else {
|
||||
bgIndex = len(palettedImg.Palette)
|
||||
palettedImg.Palette = append(palettedImg.Palette, BG_COLOR)
|
||||
}
|
||||
frame := image.NewPaletted(image.Rect(0, 0, width, height), palettedImg.Palette)
|
||||
for x := 0; x < width; x++ {
|
||||
for y := 0; y < height; y++ {
|
||||
if x <= left || y <= top || x >= right || y >= bottom {
|
||||
frame.SetColorIndex(x, y, BG_INDEX)
|
||||
frame.SetColorIndex(x, y, uint8(bgIndex))
|
||||
} else {
|
||||
frame.SetColorIndex(x, y, palettedImg.ColorIndexAt(x-left, y-top))
|
||||
}
|
||||
|
|
@ -109,14 +115,34 @@ func AnimatePNGs(ms *xmain.State, pngs [][]byte, animIntervalMs int) ([]byte, er
|
|||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
func findWhiteIndex(palette color.Palette) int {
|
||||
nearestIndex := 0
|
||||
nearestScore := 0.
|
||||
for i, c := range palette {
|
||||
r, g, b, _ := c.RGBA()
|
||||
if r == 255 && g == 255 && b == 255 {
|
||||
return i
|
||||
}
|
||||
|
||||
avg := float64(r+g+b) / 255.
|
||||
if avg > nearestScore {
|
||||
nearestScore = avg
|
||||
nearestIndex = i
|
||||
}
|
||||
}
|
||||
return nearestIndex
|
||||
}
|
||||
|
||||
func Validate(gifBytes []byte, nFrames int, intervalMS int) error {
|
||||
anim, err := gif.DecodeAll(bytes.NewBuffer(gifBytes))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if anim.LoopCount != INFINITE_LOOP {
|
||||
if nFrames > 1 && anim.LoopCount != INFINITE_LOOP {
|
||||
return fmt.Errorf("expected infinite loop, got=%d", anim.LoopCount)
|
||||
} else if nFrames == 1 && anim.LoopCount != -1 {
|
||||
return fmt.Errorf("wrong loop count for single frame gif, got=%d", anim.LoopCount)
|
||||
}
|
||||
|
||||
if len(anim.Image) != nFrames {
|
||||
|
|
|
|||
822
testdata/d2compiler/TestCompile/array-classes.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,822 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,0:0:0-18:0:306",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,0:0:0-13:1:185",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,0:0:0-0:7:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,0:0:0-0:7:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "classes",
|
||||
"raw_string": "classes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,0:9:9-13:0:184",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,1:2:13-5:3:86",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,1:2:13-1:13:24",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,1:2:13-1:13:24",
|
||||
"value": [
|
||||
{
|
||||
"string": "dragon_ball",
|
||||
"raw_string": "dragon_ball"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,1:15:26-5:2:85",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,2:4:32-2:13:41",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,2:4:32-2:9:37",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,2:4:32-2:9:37",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"double_quoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,2:11:39-2:13:41",
|
||||
"value": null
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,3:4:46-3:17:59",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,3:4:46-3:9:51",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,3:4:46-3:9:51",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,3:11:53-3:17:59",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,4:4:64-4:22:82",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,4:4:64-4:14:74",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,4:4:64-4:9:69",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,4:10:70-4:14:74",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,4:16:76-4:22:82",
|
||||
"value": [
|
||||
{
|
||||
"string": "orange",
|
||||
"raw_string": "orange"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,6:2:89-9:3:144",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,6:2:89-6:6:93",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,6:2:89-6:6:93",
|
||||
"value": [
|
||||
{
|
||||
"string": "path",
|
||||
"raw_string": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,6:8:95-9:2:143",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,7:4:101-7:17:114",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,7:4:101-7:9:106",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,7:4:101-7:9:106",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"double_quoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,7:11:108-7:17:114",
|
||||
"value": [
|
||||
{
|
||||
"string": "then",
|
||||
"raw_string": "then"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,8:4:119-8:25:140",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,8:4:119-8:22:137",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,8:4:119-8:9:124",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,8:10:125-8:22:137",
|
||||
"value": [
|
||||
{
|
||||
"string": "stroke-width",
|
||||
"raw_string": "stroke-width"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"number": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,8:24:139-8:25:140",
|
||||
"raw": "4",
|
||||
"value": "4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,10:1:146-12:2:183",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,10:1:146-10:6:151",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,10:1:146-10:6:151",
|
||||
"value": [
|
||||
{
|
||||
"string": "path2",
|
||||
"raw_string": "path2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,10:8:153-12:1:182",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,11:4:159-11:25:180",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,11:4:159-11:22:177",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,11:4:159-11:9:164",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,11:10:165-11:22:177",
|
||||
"value": [
|
||||
{
|
||||
"string": "stroke-width",
|
||||
"raw_string": "stroke-width"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"number": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,11:24:179-11:25:180",
|
||||
"raw": "2",
|
||||
"value": "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:0:186-14:38:224",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:0:186-14:6:192",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:0:186-14:6:192",
|
||||
"value": [
|
||||
{
|
||||
"string": "nostar",
|
||||
"raw_string": "nostar"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:8:194-14:37:223",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:10:196-14:36:222",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:10:196-14:15:201",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:10:196-14:15:201",
|
||||
"value": [
|
||||
{
|
||||
"string": "class",
|
||||
"raw_string": "class"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"array": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:17:203-14:35:221",
|
||||
"nodes": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:18:204-14:29:215",
|
||||
"value": [
|
||||
{
|
||||
"string": "dragon_ball",
|
||||
"raw_string": "dragon_ball"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:31:217-14:35:221",
|
||||
"value": [
|
||||
{
|
||||
"string": "path",
|
||||
"raw_string": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:0:225-15:37:262",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:0:225-15:5:230",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:0:225-15:5:230",
|
||||
"value": [
|
||||
{
|
||||
"string": "1star",
|
||||
"raw_string": "1star"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:7:232-15:36:261",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:9:234-15:35:260",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:9:234-15:14:239",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:9:234-15:14:239",
|
||||
"value": [
|
||||
{
|
||||
"string": "class",
|
||||
"raw_string": "class"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"array": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:16:241-15:34:259",
|
||||
"nodes": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:17:242-15:21:246",
|
||||
"value": [
|
||||
{
|
||||
"string": "path",
|
||||
"raw_string": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:23:248-15:34:259",
|
||||
"value": [
|
||||
{
|
||||
"string": "dragon_ball",
|
||||
"raw_string": "dragon_ball"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:0:264-17:41:305",
|
||||
"edges": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:0:264-17:15:279",
|
||||
"src": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:0:264-17:7:271",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:0:264-17:6:270",
|
||||
"value": [
|
||||
{
|
||||
"string": "nostar",
|
||||
"raw_string": "nostar"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:9:273-17:15:279",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:10:274-17:15:279",
|
||||
"value": [
|
||||
{
|
||||
"string": "1star",
|
||||
"raw_string": "1star"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:17:281-17:40:304",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:19:283-17:39:303",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:19:283-17:24:288",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:19:283-17:24:288",
|
||||
"value": [
|
||||
{
|
||||
"string": "class",
|
||||
"raw_string": "class"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"array": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:26:290-17:38:302",
|
||||
"nodes": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:27:291-17:31:295",
|
||||
"value": [
|
||||
{
|
||||
"string": "path",
|
||||
"raw_string": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:33:297-17:38:302",
|
||||
"value": [
|
||||
{
|
||||
"string": "path2",
|
||||
"raw_string": "path2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": [
|
||||
{
|
||||
"index": 0,
|
||||
"isCurve": false,
|
||||
"src_arrow": false,
|
||||
"dst_arrow": true,
|
||||
"references": [
|
||||
{
|
||||
"map_key_edge_index": 0
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "then"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {
|
||||
"strokeWidth": {
|
||||
"value": "2"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"id": "nostar",
|
||||
"id_val": "nostar",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:0:186-14:6:192",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,14:0:186-14:6:192",
|
||||
"value": [
|
||||
{
|
||||
"string": "nostar",
|
||||
"raw_string": "nostar"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:0:264-17:7:271",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:0:264-17:6:270",
|
||||
"value": [
|
||||
{
|
||||
"string": "nostar",
|
||||
"raw_string": "nostar"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": 0
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "then"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {
|
||||
"fill": {
|
||||
"value": "orange"
|
||||
},
|
||||
"strokeWidth": {
|
||||
"value": "4"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "1star",
|
||||
"id_val": "1star",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:0:225-15:5:230",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,15:0:225-15:5:230",
|
||||
"value": [
|
||||
{
|
||||
"string": "1star",
|
||||
"raw_string": "1star"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:9:273-17:15:279",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,17:10:274-17:15:279",
|
||||
"value": [
|
||||
{
|
||||
"string": "1star",
|
||||
"raw_string": "1star"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": 0
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {
|
||||
"fill": {
|
||||
"value": "orange"
|
||||
},
|
||||
"strokeWidth": {
|
||||
"value": "4"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": null
|
||||
}
|
||||
12
testdata/d2compiler/TestCompile/bad-style-nesting.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/bad-style-nesting.d2,0:12:12-0:17:17",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/bad-style-nesting.d2:1:13: invalid style keyword: \"style\""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
286
testdata/d2compiler/TestCompile/class-shape-class.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,286 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,0:0:0-10:0:99",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,0:0:0-4:1:49",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,0:0:0-0:7:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,0:0:0-0:7:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "classes",
|
||||
"raw_string": "classes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,0:9:9-4:0:48",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,1:2:13-3:3:47",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,1:2:13-1:12:23",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,1:2:13-1:12:23",
|
||||
"value": [
|
||||
{
|
||||
"string": "classClass",
|
||||
"raw_string": "classClass"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,1:14:25-3:2:46",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,2:4:31-2:16:43",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,2:4:31-2:9:36",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,2:4:31-2:9:36",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,2:11:38-2:16:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "class",
|
||||
"raw_string": "class"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,6:0:51-9:1:98",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,6:0:51-6:6:57",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,6:0:51-6:6:57",
|
||||
"value": [
|
||||
{
|
||||
"string": "object",
|
||||
"raw_string": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,6:8:59-9:0:97",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,7:2:63-7:19:80",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,7:2:63-7:7:68",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,7:2:63-7:7:68",
|
||||
"value": [
|
||||
{
|
||||
"string": "class",
|
||||
"raw_string": "class"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,7:9:70-7:19:80",
|
||||
"value": [
|
||||
{
|
||||
"string": "classClass",
|
||||
"raw_string": "classClass"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,8:2:83-8:15:96",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,8:2:83-8:10:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,8:2:83-8:10:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "length()",
|
||||
"raw_string": "length()"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,8:12:93-8:15:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "int",
|
||||
"raw_string": "int"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "object",
|
||||
"id_val": "object",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,6:0:51-6:6:57",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,6:0:51-6:6:57",
|
||||
"value": [
|
||||
{
|
||||
"string": "object",
|
||||
"raw_string": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"class": {
|
||||
"fields": null,
|
||||
"methods": [
|
||||
{
|
||||
"name": "length()",
|
||||
"return": "int",
|
||||
"visibility": "public"
|
||||
}
|
||||
]
|
||||
},
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "object"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "class"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
},
|
||||
"classes": [
|
||||
"classClass"
|
||||
]
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": null
|
||||
}
|
||||
12
testdata/d2compiler/TestCompile/improper-class-ref.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/improper-class-ref.d2,0:6:6-0:11:11",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/improper-class-ref.d2:1:7: \"class\" must be the last part of the key"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
16
testdata/d2compiler/TestCompile/md_block_string_err.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/md_block_string_err.d2,3:18:50-3:24:56",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/md_block_string_err.d2:4:19: unexpected text after md block string. See https://d2lang.com/tour/text#advanced-block-strings."
|
||||
},
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/md_block_string_err.d2,4:0:57-5:0:59",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/md_block_string_err.d2:5:1: block string must be terminated with |"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
12
testdata/d2compiler/TestCompile/tail-style.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"graph": null,
|
||||
"err": {
|
||||
"ioerr": null,
|
||||
"errs": [
|
||||
{
|
||||
"range": "d2/testdata/d2compiler/TestCompile/tail-style.d2,0:6:6-0:11:11",
|
||||
"errmsg": "d2/testdata/d2compiler/TestCompile/tail-style.d2:1:7: \"style\" expected to be set to a map, or contain an additional keyword like \"style.opacity: 0.4\""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||