diff --git a/README.md b/README.md index 1e4dafee5..95e6cfe9f 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ let us know and we'll be happy to include it here! - **Confluence plugin**: [https://github.com/andrinmeier/unofficial-d2lang-confluence-plugin](https://github.com/andrinmeier/unofficial-d2lang-confluence-plugin) - **CIL (C#, Visual Basic, F#, C++ CLR) to D2**: [https://github.com/HugoVG/AppDiagram](https://github.com/HugoVG/AppDiagram) - **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) ### Misc diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index f3c0d2a77..6dbef495b 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,5 +1,20 @@ #### Features 🚀 +- Many non-Latin languages (e.g. Chinese, Japanese, Korean) are usable now that multi-byte characters are measured correctly. [#817](https://github.com/terrastruct/d2/pull/817) +- Dimensions can be set on containers (layout engine dependent). [#845](https://github.com/terrastruct/d2/pull/845) + #### Improvements 🧹 +- Cleaner watch mode logs without timestamps. [#830](https://github.com/terrastruct/d2/pull/830) +- Remove duplicate success logs in watch mode. [#830](https://github.com/terrastruct/d2/pull/830) +- CLI reports when a feature is incompatible with layout engine, instead of silently ignoring. [#845](https://github.com/terrastruct/d2/pull/845) +- `near` key set to direct parent or ancestor throws an appropriate error message. [#851](https://github.com/terrastruct/d2/pull/851) +- Dimensions and positions are able to be set from API. [#853](https://github.com/terrastruct/d2/pull/853) + #### Bugfixes ⛑️ + +- Fixes edge case where layouts with dagre show a connection from the bottom side of shapes being slightly disconnected from the shape. [#820](https://github.com/terrastruct/d2/pull/820) +- Fixes rare compiler bug when using underscores in edges to create objects across containers. [#824](https://github.com/terrastruct/d2/pull/824) +- Fixes rare possibility of rendered connections being hidden or cut off. [#828](https://github.com/terrastruct/d2/pull/828) +- Creating nested children within `sql_table` and `class` shapes are now prevented (caused confusion when accidentally done). [#834](https://github.com/terrastruct/d2/pull/834) +- Fixes graph deserialization bug. [#837](https://github.com/terrastruct/d2/pull/837) diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 85d6f8620..3d209be6a 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -593,8 +593,11 @@ type Key struct { Value ValueBox `json:"value"` } -// TODO there's more stuff to compare +// TODO maybe need to compare Primary func (mk1 *Key) Equals(mk2 *Key) bool { + if mk1.Ampersand != mk2.Ampersand { + return false + } if (mk1.Key == nil) != (mk2.Key == nil) { return false } @@ -624,6 +627,16 @@ func (mk1 *Key) Equals(mk2 *Key) bool { } } } + if mk1.EdgeKey != nil { + if len(mk1.EdgeKey.Path) != len(mk2.EdgeKey.Path) { + return false + } + for i, id := range mk1.EdgeKey.Path { + if id.Unbox().ScalarString() != mk2.EdgeKey.Path[i].Unbox().ScalarString() { + return false + } + } + } if mk1.Value.Map != nil { if len(mk1.Value.Map.Nodes) != len(mk2.Value.Map.Nodes) { diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 584dd20af..2a2e3becd 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -160,6 +160,17 @@ func (c *compiler) compileField(obj *d2graph.Object, f *d2ir.Field) { return } + if obj.Parent != nil { + if obj.Parent.Attributes.Shape.Value == d2target.ShapeSQLTable { + c.errorf(f.LastRef().AST(), "sql_table columns cannot have children") + return + } + if obj.Parent.Attributes.Shape.Value == d2target.ShapeClass { + c.errorf(f.LastRef().AST(), "class fields cannot have children") + return + } + } + obj = obj.EnsureChild(d2graphIDA([]string{f.Name})) if f.Primary() != nil { c.compileLabel(obj.Attributes, f) @@ -178,7 +189,7 @@ func (c *compiler) compileField(obj *d2graph.Object, f *d2ir.Field) { } } scopeObjIDA := d2ir.IDA(fr.Context.ScopeMap) - scopeObj, _ := obj.Graph.Root.HasChild(scopeObjIDA) + scopeObj, _ := obj.Graph.Root.HasChildIDVal(scopeObjIDA) obj.References = append(obj.References, d2graph.Reference{ Key: fr.KeyPath, KeyPathIndex: fr.KeyPathIndex(), @@ -255,7 +266,9 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) { nearKey.Range = scalar.GetRange() attrs.NearKey = nearKey case "tooltip": - attrs.Tooltip = scalar.ScalarString() + attrs.Tooltip = &d2graph.Scalar{} + attrs.Tooltip.Value = scalar.ScalarString() + attrs.Tooltip.MapKey = f.LastPrimaryKey() case "width": _, err := strconv.Atoi(scalar.ScalarString()) if err != nil { @@ -274,8 +287,28 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) { attrs.Height = &d2graph.Scalar{} attrs.Height.Value = scalar.ScalarString() attrs.Height.MapKey = f.LastPrimaryKey() + case "top": + _, err := strconv.Atoi(scalar.ScalarString()) + if err != nil { + c.errorf(scalar, "non-integer top %#v: %s", scalar.ScalarString(), err) + return + } + attrs.Top = &d2graph.Scalar{} + attrs.Top.Value = scalar.ScalarString() + attrs.Top.MapKey = f.LastPrimaryKey() + case "left": + _, err := strconv.Atoi(scalar.ScalarString()) + if err != nil { + c.errorf(scalar, "non-integer left %#v: %s", scalar.ScalarString(), err) + return + } + attrs.Left = &d2graph.Scalar{} + attrs.Left.Value = scalar.ScalarString() + attrs.Left.MapKey = f.LastPrimaryKey() case "link": - attrs.Link = scalar.ScalarString() + attrs.Link = &d2graph.Scalar{} + attrs.Link.Value = scalar.ScalarString() + attrs.Link.MapKey = f.LastPrimaryKey() case "direction": dirs := []string{"up", "down", "right", "left"} if !go2.Contains(dirs, scalar.ScalarString()) { @@ -353,6 +386,10 @@ func compileStyleFieldInit(attrs *d2graph.Attributes, f *d2ir.Field) { attrs.Width = &d2graph.Scalar{MapKey: f.LastPrimaryKey()} case "height": attrs.Height = &d2graph.Scalar{MapKey: f.LastPrimaryKey()} + case "top": + attrs.Top = &d2graph.Scalar{MapKey: f.LastPrimaryKey()} + case "left": + attrs.Left = &d2graph.Scalar{MapKey: f.LastPrimaryKey()} case "double-border": attrs.Style.DoubleBorder = &d2graph.Scalar{MapKey: f.LastPrimaryKey()} } @@ -382,7 +419,7 @@ func (c *compiler) compileEdge(obj *d2graph.Object, e *d2ir.Edge) { edge.Attributes.Label.MapKey = e.LastPrimaryKey() for _, er := range e.References { scopeObjIDA := d2ir.IDA(er.Context.ScopeMap) - scopeObj, _ := edge.Src.Graph.Root.HasChild(d2graphIDA(scopeObjIDA)) + scopeObj, _ := edge.Src.Graph.Root.HasChildIDVal(d2graphIDA(scopeObjIDA)) edge.References = append(edge.References, d2graph.EdgeReference{ Edge: er.Context.Edge, MapKey: er.Context.Key, @@ -559,14 +596,6 @@ func (c *compiler) validateKey(obj *d2graph.Object, f *d2ir.Field) { keyword := strings.ToLower(f.Name) _, isReserved := d2graph.ReservedKeywords[keyword] if isReserved { - switch obj.Attributes.Shape.Value { - case d2target.ShapeSQLTable, d2target.ShapeClass: - default: - if len(obj.Children) > 0 && (f.Name == "width" || f.Name == "height") { - c.errorf(f.LastPrimaryKey(), fmt.Sprintf("%s cannot be used on container: %s", f.Name, obj.AbsID())) - } - } - switch obj.Attributes.Shape.Value { case d2target.ShapeCircle, d2target.ShapeSquare: checkEqual := (keyword == "width" && obj.Attributes.Height != nil) || (keyword == "height" && obj.Attributes.Width != nil) @@ -615,21 +644,33 @@ func (c *compiler) validateKey(obj *d2graph.Object, f *d2ir.Field) { func (c *compiler) validateNear(g *d2graph.Graph) { for _, obj := range g.Objects { if obj.Attributes.NearKey != nil { - _, isKey := g.Root.HasChild(d2graph.Key(obj.Attributes.NearKey)) + nearObj, isKey := g.Root.HasChild(d2graph.Key(obj.Attributes.NearKey)) _, isConst := d2graph.NearConstants[d2graph.Key(obj.Attributes.NearKey)[0]] - if !isKey && !isConst { - c.errorf(obj.Attributes.NearKey, "near key %#v must be the absolute path to a shape or one of the following constants: %s", d2format.Format(obj.Attributes.NearKey), strings.Join(d2graph.NearConstantsArray, ", ")) - continue - } - if !isKey && isConst && obj.Parent != g.Root { - c.errorf(obj.Attributes.NearKey, "constant near keys can only be set on root level shapes") - continue - } - if !isKey && isConst && len(obj.ChildrenArray) > 0 { - c.errorf(obj.Attributes.NearKey, "constant near keys cannot be set on shapes with children") - continue - } - if !isKey && isConst { + if isKey { + // Doesn't make sense to set near to an ancestor or descendant + nearIsAncestor := false + for curr := obj; curr != nil; curr = curr.Parent { + if curr == nearObj { + nearIsAncestor = true + break + } + } + if nearIsAncestor { + c.errorf(obj.Attributes.NearKey, "near keys cannot be set to an ancestor") + continue + } + nearIsDescendant := false + for curr := nearObj; curr != nil; curr = curr.Parent { + if curr == obj { + nearIsDescendant = true + break + } + } + if nearIsDescendant { + c.errorf(obj.Attributes.NearKey, "near keys cannot be set to an descendant") + continue + } + } else if isConst { is := false for _, e := range g.Edges { if e.Src == obj || e.Dst == obj { @@ -641,6 +682,17 @@ func (c *compiler) validateNear(g *d2graph.Graph) { c.errorf(obj.Attributes.NearKey, "constant near keys cannot be set on connected shapes") continue } + if obj.Parent != g.Root { + c.errorf(obj.Attributes.NearKey, "constant near keys can only be set on root level shapes") + continue + } + if len(obj.ChildrenArray) > 0 { + c.errorf(obj.Attributes.NearKey, "constant near keys cannot be set on shapes with children") + continue + } + } else { + c.errorf(obj.Attributes.NearKey, "near key %#v must be the absolute path to a shape or one of the following constants: %s", d2format.Format(obj.Attributes.NearKey), strings.Join(d2graph.NearConstantsArray, ", ")) + continue } } } diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 37e68632c..85a27d860 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -86,7 +86,6 @@ x: { } }, }, - { name: "dimensions_on_nonimage", @@ -114,6 +113,17 @@ x: { } }, }, + { + name: "positions", + text: `hey: { + top: 200 + left: 230 +} +`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, "200", g.Objects[0].Attributes.Top.Value) + }, + }, { name: "equal_dimensions_on_circle", @@ -153,8 +163,7 @@ d2/testdata/d2compiler/TestCompile/equal_dimensions_on_circle.d2:4:2: width and }, }, { - name: "no_dimensions_on_containers", - + name: "dimensions_on_containers", text: ` containers: { circle container: { @@ -201,13 +210,6 @@ containers: { } } `, - expErr: `d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:5:3: width cannot be used on container: containers.circle container -d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:15:3: width cannot be used on container: containers.diamond container -d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:16:3: height cannot be used on container: containers.diamond container -d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:25:3: width cannot be used on container: containers.oval container -d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:26:3: height cannot be used on container: containers.oval container -d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:36:3: width cannot be used on container: containers.hexagon container -d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:37:3: height cannot be used on container: containers.hexagon container`, }, { name: "dimension_with_style", @@ -337,6 +339,17 @@ x: { tassert.Equal(t, g.Objects[0].AbsID(), g.Objects[1].References[0].ScopeObj.AbsID()) }, }, + { + name: "underscore_connection", + text: `a: { + _.c.d -> _.c.b +} +`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, 4, len(g.Objects)) + tassert.Equal(t, 1, len(g.Edges)) + }, + }, { name: "underscore_parent_not_root", @@ -1351,8 +1364,8 @@ x -> y: { if len(g.Objects) != 1 { t.Fatal(g.Objects) } - if g.Objects[0].Attributes.Link != "https://google.com" { - t.Fatal(g.Objects[0].Attributes.Link) + if g.Objects[0].Attributes.Link.Value != "https://google.com" { + t.Fatal(g.Objects[0].Attributes.Link.Value) } }, }, @@ -1367,8 +1380,8 @@ x -> y: { if len(g.Objects) != 1 { t.Fatal(g.Objects) } - if g.Objects[0].Attributes.Link != "Overview.Untitled board 7.zzzzz" { - t.Fatal(g.Objects[0].Attributes.Link) + if g.Objects[0].Attributes.Link.Value != "Overview.Untitled board 7.zzzzz" { + t.Fatal(g.Objects[0].Attributes.Link.Value) } }, }, @@ -1377,6 +1390,29 @@ x -> y: { text: `x.near: top-center `, + }, + { + name: "near-invalid", + + text: `mongodb: MongoDB { + perspective: perspective (View) { + password + } + + explanation: |md + perspective.model.js + | { + near: mongodb + } +} + +a: { + near: a.b + b +} +`, + expErr: `d2/testdata/d2compiler/TestCompile/near-invalid.d2:9:11: near keys cannot be set to an ancestor +d2/testdata/d2compiler/TestCompile/near-invalid.d2:14:9: near keys cannot be set to an descendant`, }, { name: "near_bad_constant", @@ -1472,6 +1508,36 @@ d2/testdata/d2compiler/TestCompile/errors/reserved_icon_style.d2:2:9: near key " shape: sql_table x: {p -> q} }`, + expErr: `d2/testdata/d2compiler/TestCompile/edge_in_column.d2:3:7: sql_table columns cannot have children +d2/testdata/d2compiler/TestCompile/edge_in_column.d2:3:12: sql_table columns cannot have children`, + }, + { + name: "no-nested-columns-sql", + + text: `x: { + shape: sql_table + a -- b.b +}`, + expErr: `d2/testdata/d2compiler/TestCompile/no-nested-columns-sql.d2:3:10: sql_table columns cannot have children`, + }, + { + name: "no-nested-columns-sql-2", + + text: `x: { + shape: sql_table + a +} +x.a.b`, + expErr: `d2/testdata/d2compiler/TestCompile/no-nested-columns-sql-2.d2:5:5: sql_table columns cannot have children`, + }, + { + name: "no-nested-columns-class", + + text: `x: { + shape: class + a.a +}`, + expErr: `d2/testdata/d2compiler/TestCompile/no-nested-columns-class.d2:3:5: class fields cannot have children`, }, { name: "edge_to_style", diff --git a/d2exporter/export.go b/d2exporter/export.go index 0237d554a..1dcf55179 100644 --- a/d2exporter/export.go +++ b/d2exporter/export.go @@ -152,8 +152,12 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape { } } - shape.Tooltip = obj.Attributes.Tooltip - shape.Link = obj.Attributes.Link + if obj.Attributes.Tooltip != nil { + shape.Tooltip = obj.Attributes.Tooltip.Value + } + if obj.Attributes.Link != nil { + shape.Link = obj.Attributes.Link.Value + } shape.Icon = obj.Attributes.Icon if obj.IconPosition != nil { shape.IconPosition = *obj.IconPosition @@ -232,7 +236,9 @@ func toConnection(edge *d2graph.Edge, theme *d2themes.Theme) d2target.Connection connection.Animated, _ = strconv.ParseBool(edge.Attributes.Style.Animated.Value) } - connection.Tooltip = edge.Attributes.Tooltip + if edge.Attributes.Tooltip != nil { + connection.Tooltip = edge.Attributes.Tooltip.Value + } connection.Icon = edge.Attributes.Icon if edge.Attributes.Style.Italic != nil { diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 317e30eee..385a6b2ed 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -95,13 +95,15 @@ type Attributes struct { Label Scalar `json:"label"` Style Style `json:"style"` Icon *url.URL `json:"icon,omitempty"` - Tooltip string `json:"tooltip,omitempty"` - Link string `json:"link,omitempty"` + Tooltip *Scalar `json:"tooltip,omitempty"` + Link *Scalar `json:"link,omitempty"` - // Only applicable for images right now Width *Scalar `json:"width,omitempty"` Height *Scalar `json:"height,omitempty"` + Top *Scalar `json:"top,omitempty"` + Left *Scalar `json:"left,omitempty"` + // TODO consider separate Attributes struct for shape-specific and edge-specific // Shapes only NearKey *d2ast.KeyPath `json:"near_key"` @@ -558,6 +560,38 @@ func (obj *Object) HasChild(ids []string) (*Object, bool) { return child, true } +// Keep in sync with HasChild. +func (obj *Object) HasChildIDVal(ids []string) (*Object, bool) { + if len(ids) == 0 { + return obj, true + } + if len(ids) == 1 && ids[0] != "style" { + _, ok := ReservedKeywords[ids[0]] + if ok { + return obj, true + } + } + + id := ids[0] + ids = ids[1:] + + var child *Object + for _, ch2 := range obj.ChildrenArray { + if ch2.IDVal == id { + child = ch2 + break + } + } + if child == nil { + return nil, false + } + + if len(ids) >= 1 { + return child.HasChildIDVal(ids) + } + return child, true +} + func (obj *Object) HasEdge(mk *d2ast.Key) (*Edge, bool) { ea, ok := obj.FindEdges(mk) if !ok { @@ -1279,10 +1313,10 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler switch shapeType { case shape.TABLE_TYPE, shape.CLASS_TYPE, shape.CODE_TYPE, shape.IMAGE_TYPE: default: - if obj.Attributes.Link != "" { + if obj.Attributes.Link != nil { paddingX += 32 } - if obj.Attributes.Tooltip != "" { + if obj.Attributes.Tooltip != nil { paddingX += 32 } } @@ -1410,6 +1444,8 @@ var SimpleReservedKeywords = map[string]struct{}{ "width": {}, "height": {}, "direction": {}, + "top": {}, + "left": {}, } // ReservedKeywordHolders are reserved keywords that are meaningless on its own and exist solely to hold a set of reserved keywords diff --git a/d2graph/serde.go b/d2graph/serde.go index 76e83ae2c..0b7c49ca1 100644 --- a/d2graph/serde.go +++ b/d2graph/serde.go @@ -2,8 +2,10 @@ package d2graph import ( "encoding/json" + "fmt" "strings" + "oss.terrastruct.com/d2/d2target" "oss.terrastruct.com/util-go/go2" ) @@ -24,10 +26,10 @@ func DeserializeGraph(bytes []byte, g *Graph) error { return err } - g.Root = &Object{ - Graph: g, - Children: make(map[string]*Object), - } + var root Object + convert(sg.Root, &root) + g.Root = &root + root.Graph = g idToObj := make(map[string]*Object) idToObj[""] = g.Root @@ -49,7 +51,7 @@ func DeserializeGraph(bytes []byte, g *Graph) error { for _, id := range so["ChildrenArray"].([]interface{}) { o := idToObj[id.(string)] childrenArray = append(childrenArray, o) - children[strings.ToLower(id.(string))] = o + children[strings.ToLower(o.ID)] = o o.Parent = idToObj[so["AbsID"].(string)] } @@ -158,3 +160,316 @@ func convert[T, Q any](from T, to *Q) error { } return nil } + +func CompareSerializedGraph(g, other *Graph) error { + if len(g.Objects) != len(other.Objects) { + return fmt.Errorf("object count differs: g=%d, other=%d", len(g.Objects), len(other.Objects)) + } + + if len(g.Edges) != len(other.Edges) { + return fmt.Errorf("edge count differs: g=%d, other=%d", len(g.Edges), len(other.Edges)) + } + + if err := CompareSerializedObject(g.Root, other.Root); err != nil { + return fmt.Errorf("root differs: %v", err) + } + + for i := 0; i < len(g.Objects); i++ { + if err := CompareSerializedObject(g.Objects[i], other.Objects[i]); err != nil { + return fmt.Errorf( + "objects differ at %d [g=%s, other=%s]: %v", + i, + g.Objects[i].ID, + other.Objects[i].ID, + err, + ) + } + } + + for i := 0; i < len(g.Edges); i++ { + if err := CompareSerializedEdge(g.Edges[i], other.Edges[i]); err != nil { + return fmt.Errorf( + "edges differ at %d [g=%s, other=%s]: %v", + i, + g.Edges[i].AbsID(), + other.Edges[i].AbsID(), + err, + ) + } + } + + return nil +} + +func CompareSerializedObject(obj, other *Object) error { + if obj != nil && other == nil { + return fmt.Errorf("other is nil") + } else if obj == nil && other != nil { + return fmt.Errorf("obj is nil") + } else if obj == nil { + // both are nil + return nil + } + + if obj.ID != other.ID { + return fmt.Errorf("ids differ: obj=%s, other=%s", obj.ID, other.ID) + } + + if obj.AbsID() != other.AbsID() { + return fmt.Errorf("absolute ids differ: obj=%s, other=%s", obj.AbsID(), other.AbsID()) + } + + if obj.Box != nil && other.Box == nil { + return fmt.Errorf("other should have a box") + } else if obj.Box == nil && other.Box != nil { + return fmt.Errorf("other should not have a box") + } else if obj.Box != nil { + if obj.Width != other.Width { + return fmt.Errorf("widths differ: obj=%f, other=%f", obj.Width, other.Width) + } + + if obj.Height != other.Height { + return fmt.Errorf("heights differ: obj=%f, other=%f", obj.Height, other.Height) + } + } + + if obj.Parent != nil && other.Parent == nil { + return fmt.Errorf("other should have a parent") + } else if obj.Parent == nil && other.Parent != nil { + return fmt.Errorf("other should not have a parent") + } else if obj.Parent != nil && obj.Parent.ID != other.Parent.ID { + return fmt.Errorf("parent differs: obj=%s, other=%s", obj.Parent.ID, other.Parent.ID) + } + + if len(obj.Children) != len(other.Children) { + return fmt.Errorf("children count differs: obj=%d, other=%d", len(obj.Children), len(other.Children)) + } + + for childID, objChild := range obj.Children { + if otherChild, exists := other.Children[childID]; exists { + if err := CompareSerializedObject(objChild, otherChild); err != nil { + return fmt.Errorf("children differ at key %s: %v", childID, err) + } + } else { + return fmt.Errorf("child %s does not exist in other", childID) + } + } + + if len(obj.ChildrenArray) != len(other.ChildrenArray) { + return fmt.Errorf("childrenArray count differs: obj=%d, other=%d", len(obj.ChildrenArray), len(other.ChildrenArray)) + } + + for i := 0; i < len(obj.ChildrenArray); i++ { + if err := CompareSerializedObject(obj.ChildrenArray[i], other.ChildrenArray[i]); err != nil { + return fmt.Errorf("childrenArray differs at %d: %v", i, err) + } + } + + if obj.Attributes != nil && other.Attributes == nil { + return fmt.Errorf("other should have attributes") + } else if obj.Attributes == nil && other.Attributes != nil { + return fmt.Errorf("other should not have attributes") + } else if obj.Attributes != nil { + if d2target.IsShape(obj.Attributes.Shape.Value) != d2target.IsShape(other.Attributes.Shape.Value) { + return fmt.Errorf( + "shapes differ: obj=%s, other=%s", + obj.Attributes.Shape.Value, + other.Attributes.Shape.Value, + ) + } + + if obj.Attributes.Icon == nil && other.Attributes.Icon != nil { + return fmt.Errorf("other does not have an icon") + } else if obj.Attributes.Icon != nil && other.Attributes.Icon == nil { + return fmt.Errorf("obj does not have an icon") + } + + if obj.Attributes.Direction.Value != other.Attributes.Direction.Value { + return fmt.Errorf( + "directions differ: obj=%s, other=%s", + obj.Attributes.Direction.Value, + other.Attributes.Direction.Value, + ) + } + + if obj.Attributes.Label.Value != other.Attributes.Label.Value { + return fmt.Errorf( + "labels differ: obj=%s, other=%s", + obj.Attributes.Label.Value, + other.Attributes.Label.Value, + ) + } + + if obj.Attributes.NearKey != nil { + if other.Attributes.NearKey == nil { + return fmt.Errorf("other does not have near") + } + objKey := strings.Join(Key(obj.Attributes.NearKey), ".") + deserKey := strings.Join(Key(other.Attributes.NearKey), ".") + if objKey != deserKey { + return fmt.Errorf( + "near differs: obj=%s, other=%s", + objKey, + deserKey, + ) + } + } else if other.Attributes.NearKey != nil { + return fmt.Errorf("other should not have near") + } + } + + if obj.SQLTable == nil && other.SQLTable != nil { + return fmt.Errorf("other is not a sql table") + } else if obj.SQLTable != nil && other.SQLTable == nil { + return fmt.Errorf("obj is not a sql table") + } + + if obj.SQLTable != nil { + if len(obj.SQLTable.Columns) != len(other.SQLTable.Columns) { + return fmt.Errorf( + "table columns count differ: obj=%d, other=%d", + len(obj.SQLTable.Columns), + len(other.SQLTable.Columns), + ) + } + } + + if obj.LabelWidth != nil { + if other.LabelWidth == nil { + return fmt.Errorf("other does not have a label width") + } + if *obj.LabelWidth != *other.LabelWidth { + return fmt.Errorf( + "label widths differ: obj=%d, other=%d", + *obj.LabelWidth, + *other.LabelWidth, + ) + } + } else if other.LabelWidth != nil { + return fmt.Errorf("other should not have label width") + } + + if obj.LabelHeight != nil { + if other.LabelHeight == nil { + return fmt.Errorf("other does not have a label height") + } + if *obj.LabelHeight != *other.LabelHeight { + return fmt.Errorf( + "label heights differ: obj=%d, other=%d", + *obj.LabelHeight, + *other.LabelHeight, + ) + } + } else if other.LabelHeight != nil { + return fmt.Errorf("other should not have label height") + } + + return nil +} + +func CompareSerializedEdge(edge, other *Edge) error { + if edge.AbsID() != other.AbsID() { + return fmt.Errorf( + "absolute ids differ: edge=%s, other=%s", + edge.AbsID(), + other.AbsID(), + ) + } + + if edge.Src.AbsID() != other.Src.AbsID() { + return fmt.Errorf( + "sources differ: edge=%s, other=%s", + edge.Src.AbsID(), + other.Src.AbsID(), + ) + } + + if edge.Dst.AbsID() != other.Dst.AbsID() { + return fmt.Errorf( + "targets differ: edge=%s, other=%s", + edge.Dst.AbsID(), + other.Dst.AbsID(), + ) + } + + if edge.SrcArrow != other.SrcArrow { + return fmt.Errorf( + "source arrows differ: edge=%t, other=%t", + edge.SrcArrow, + other.SrcArrow, + ) + } + + if edge.DstArrow != other.DstArrow { + return fmt.Errorf( + "target arrows differ: edge=%t, other=%t", + edge.DstArrow, + other.DstArrow, + ) + } + + if edge.MinWidth != other.MinWidth { + return fmt.Errorf( + "min width differs: edge=%d, other=%d", + edge.MinWidth, + other.MinWidth, + ) + } + + if edge.MinHeight != other.MinHeight { + return fmt.Errorf( + "min height differs: edge=%d, other=%d", + edge.MinHeight, + other.MinHeight, + ) + } + + if edge.Attributes.Label.Value != other.Attributes.Label.Value { + return fmt.Errorf( + "labels differ: edge=%s, other=%s", + edge.Attributes.Label.Value, + other.Attributes.Label.Value, + ) + } + + if edge.LabelDimensions.Width != other.LabelDimensions.Width { + return fmt.Errorf( + "label width differs: edge=%d, other=%d", + edge.LabelDimensions.Width, + other.LabelDimensions.Width, + ) + } + + if edge.LabelDimensions.Height != other.LabelDimensions.Height { + return fmt.Errorf( + "label hieght differs: edge=%d, other=%d", + edge.LabelDimensions.Height, + other.LabelDimensions.Height, + ) + } + + if edge.SrcTableColumnIndex != nil && other.SrcTableColumnIndex == nil { + return fmt.Errorf("other should have src column index") + } else if other.SrcTableColumnIndex != nil && edge.SrcTableColumnIndex == nil { + return fmt.Errorf("other should not have src column index") + } else if other.SrcTableColumnIndex != nil { + edgeColumn := *edge.SrcTableColumnIndex + otherColumn := *other.SrcTableColumnIndex + if edgeColumn != otherColumn { + return fmt.Errorf("src column differs: edge=%d, other=%d", edgeColumn, otherColumn) + } + } + + if edge.DstTableColumnIndex != nil && other.DstTableColumnIndex == nil { + return fmt.Errorf("other should have dst column index") + } else if other.DstTableColumnIndex != nil && edge.DstTableColumnIndex == nil { + return fmt.Errorf("other should not have dst column index") + } else if other.DstTableColumnIndex != nil { + edgeColumn := *edge.DstTableColumnIndex + otherColumn := *other.DstTableColumnIndex + if edgeColumn != otherColumn { + return fmt.Errorf("dst column differs: edge=%d, other=%d", edgeColumn, otherColumn) + } + } + return nil +} diff --git a/d2graph/serde_test.go b/d2graph/serde_test.go index 070400f20..9d52b91f7 100644 --- a/d2graph/serde_test.go +++ b/d2graph/serde_test.go @@ -17,19 +17,19 @@ func TestSerialization(t *testing.T) { assert.Nil(t, err) asserts := func(g *d2graph.Graph) { + a := g.Root.ChildrenArray[0] + a_a := a.ChildrenArray[0] + assert.Equal(t, 4, len(g.Objects)) assert.Equal(t, 1, len(g.Root.ChildrenArray)) - assert.Equal(t, 1, len(g.Root.ChildrenArray[0].ChildrenArray)) - assert.Equal(t, 2, len(g.Root.ChildrenArray[0].ChildrenArray[0].ChildrenArray)) - assert.Equal(t, - g.Root.ChildrenArray[0], - g.Root.ChildrenArray[0].ChildrenArray[0].Parent, - ) + assert.Equal(t, 1, len(a.ChildrenArray)) + assert.Equal(t, 2, len(a_a.ChildrenArray)) + assert.Equal(t, a, a_a.Parent) + assert.Equal(t, g.Root, a.Parent) - assert.Equal(t, - g.Root, - g.Root.ChildrenArray[0].Parent, - ) + assert.Contains(t, a.Children, "a") + assert.Contains(t, a_a.Children, "b") + assert.Contains(t, a_a.Children, "c") assert.Equal(t, 1, len(g.Edges)) assert.Equal(t, "b", g.Edges[0].Src.ID) diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 455a38707..9f37917e3 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -379,7 +379,9 @@ func (eid *EdgeID) Match(eid2 *EdgeID) bool { return true } -func (eid *EdgeID) resolveUnderscores(m *Map) (*EdgeID, *Map, error) { +// resolve resolves both underscores and commons in eid. +// It returns the new eid, containing map adjusted for underscores and common ida. +func (eid *EdgeID) resolve(m *Map) (_ *EdgeID, _ *Map, common []string, _ error) { eid = eid.Copy() maxUnderscores := go2.Max(countUnderscores(eid.SrcPath), countUnderscores(eid.DstPath)) for i := 0; i < maxUnderscores; i++ { @@ -397,23 +399,20 @@ func (eid *EdgeID) resolveUnderscores(m *Map) (*EdgeID, *Map, error) { } m = ParentMap(m) if m == nil { - return nil, nil, errors.New("invalid underscore") + return nil, nil, nil, errors.New("invalid underscore") } } - return eid, m, nil -} -func (eid *EdgeID) trimCommon() (common []string, _ *EdgeID) { - eid = eid.Copy() for len(eid.SrcPath) > 1 && len(eid.DstPath) > 1 { if !strings.EqualFold(eid.SrcPath[0], eid.DstPath[0]) { - return common, eid + return eid, m, common, nil } common = append(common, eid.SrcPath[0]) eid.SrcPath = eid.SrcPath[1:] eid.DstPath = eid.DstPath[1:] } - return common, eid + + return eid, m, common, nil } type Edge struct { @@ -732,11 +731,10 @@ func (m *Map) DeleteField(ida ...string) *Field { } func (m *Map) GetEdges(eid *EdgeID) []*Edge { - eid, m, err := eid.resolveUnderscores(m) + eid, m, common, err := eid.resolve(m) if err != nil { return nil } - common, eid := eid.trimCommon() if len(common) > 0 { f := m.GetField(common...) if f == nil { @@ -762,16 +760,12 @@ func (m *Map) CreateEdge(eid *EdgeID, refctx *RefContext) (*Edge, error) { return nil, d2parser.Errorf(refctx.Edge, "cannot create edge inside edge") } - eid, m, err := eid.resolveUnderscores(m) + eid, m, common, err := eid.resolve(m) if err != nil { return nil, d2parser.Errorf(refctx.Edge, err.Error()) } - common, eid := eid.trimCommon() if len(common) > 0 { - tmp := *refctx.Edge.Src - kp := &tmp - kp.Path = kp.Path[:len(common)] - f, err := m.EnsureField(kp, nil) + f, err := m.EnsureField(d2ast.MakeKeyPath(common), nil) if err != nil { return nil, err } diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index d1c91f2ed..d46da1e7c 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -350,7 +350,8 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err return true } // Edge should only move if it's not connected to the bottom side of the shrinking container - return p.Y != obj.TopLeft.Y+obj.Height + // Give some margin for error + return !(obj.TopLeft.Y+obj.Height-1 <= p.Y && obj.TopLeft.Y+obj.Height+1 >= p.Y && p.X != obj.TopLeft.X && p.X != (obj.TopLeft.X+obj.Width)) } for _, e := range g.Edges { if _, ok := movedEdges[e]; ok { diff --git a/d2layouts/d2elklayout/layout.go b/d2layouts/d2elklayout/layout.go index 7e1703b05..a413923c3 100644 --- a/d2layouts/d2elklayout/layout.go +++ b/d2layouts/d2elklayout/layout.go @@ -9,6 +9,7 @@ import ( _ "embed" "encoding/json" "fmt" + "math" "strings" "github.com/dop251/goja" @@ -102,6 +103,9 @@ type elkOpts struct { ForceNodeModelOrder bool `json:"elk.layered.crossingMinimization.forceNodeModelOrder,omitempty"` ConsiderModelOrder string `json:"elk.layered.considerModelOrder.strategy,omitempty"` + NodeSizeConstraints string `json:"elk.nodeSize.constraints,omitempty"` + NodeSizeMinimum string `json:"elk.nodeSize.minimum,omitempty"` + ConfigurableOpts } @@ -173,15 +177,17 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err walk(g.Root, nil, func(obj, parent *d2graph.Object) { height := obj.Height + width := obj.Width if obj.LabelWidth != nil && obj.LabelHeight != nil { if obj.Attributes.Shape.Value == d2target.ShapeImage || obj.Attributes.Icon != nil { height += float64(*obj.LabelHeight) + label.PADDING } + width = go2.Max(width, float64(*obj.LabelWidth)) } n := &ELKNode{ ID: obj.AbsID(), - Width: obj.Width, + Width: width, Height: height, } @@ -192,6 +198,8 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err EdgeEdgeBetweenLayersSpacing: 50, HierarchyHandling: "INCLUDE_CHILDREN", ConsiderModelOrder: "NODES_AND_EDGES", + // Why is it (height, width)? I have no clue, but it works. + NodeSizeMinimum: fmt.Sprintf("(%d, %d)", int(math.Ceil(height)), int(math.Ceil(width))), ConfigurableOpts: ConfigurableOpts{ NodeSpacing: opts.NodeSpacing, EdgeNodeSpacing: opts.EdgeNodeSpacing, @@ -199,6 +207,12 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err Padding: opts.Padding, }, } + // Only set if specified. + // There's a bug where if it's the node label dimensions that set the NodeSizeMinimum, + // then suddenly it's reversed back to (width, height). I must be missing something + if obj.Attributes.Width != nil || obj.Attributes.Height != nil { + n.LayoutOptions.NodeSizeConstraints = "MINIMUM_SIZE" + } if n.LayoutOptions.Padding == DefaultOpts.Padding { // Default diff --git a/d2layouts/d2layoutfeatures/d2layoutfeatures.go b/d2layouts/d2layoutfeatures/d2layoutfeatures.go new file mode 100644 index 000000000..40771b229 --- /dev/null +++ b/d2layouts/d2layoutfeatures/d2layoutfeatures.go @@ -0,0 +1,11 @@ +package d2layoutfeatures + +// When this is true, objects can set ther `near` key to another object +// When this is false, objects can only set `near` to constants +const NEAR_OBJECT = "near_object" + +// When this is true, containers can have dimensions set +const CONTAINER_DIMENSIONS = "container_dimensions" + +// When this is true, objects can specify their `top` and `left` keywords +const TOP_LEFT = "top_left" diff --git a/d2layouts/d2near/layout.go b/d2layouts/d2near/layout.go index 057ca405a..8a57e9a3f 100644 --- a/d2layouts/d2near/layout.go +++ b/d2layouts/d2near/layout.go @@ -98,7 +98,7 @@ func WithoutConstantNears(ctx context.Context, g *d2graph.Graph) (nears []*d2gra nears = append(nears, obj) g.Objects = append(g.Objects[:i], g.Objects[i+1:]...) i-- - delete(obj.Parent.Children, obj.ID) + delete(obj.Parent.Children, strings.ToLower(obj.ID)) for i := 0; i < len(obj.Parent.ChildrenArray); i++ { if obj.Parent.ChildrenArray[i] == obj { obj.Parent.ChildrenArray = append(obj.Parent.ChildrenArray[:i], obj.Parent.ChildrenArray[i+1:]...) diff --git a/d2oracle/edit.go b/d2oracle/edit.go index 1d3103a28..8905450a7 100644 --- a/d2oracle/edit.go +++ b/d2oracle/edit.go @@ -111,6 +111,25 @@ func _set(g *d2graph.Graph, key string, tag, value *string) error { toSkip := 1 reserved := false + + // If you're setting `(x -> y)[0].style.opacity` + // There's 3 cases you need to handle: + // 1. The edge has no map. + // 2. The edge has a style map with opacity not existing + // 3. The edge has a style map with opacity existing + // + // How each case is handled: + // 1. Append that mapkey to edge. + // 2. Append opacity to the style map + // 3. Set opacity + // + // There's certainly cleaner code to achieve this, but currently, there's a lot of logic to correctly scope, merge, append. + // The tests should be comprehensive enough for a safe refactor someday + // + // reservedKey = "style" + // reservedTargetKey = "opacity" + reservedKey := "" + reservedTargetKey := "" if mk.Key != nil { found := true for _, idel := range d2graph.Key(mk.Key) { @@ -162,12 +181,14 @@ func _set(g *d2graph.Graph, key string, tag, value *string) error { } attrs := obj.Attributes + var edge *d2graph.Edge if len(mk.Edges) == 1 { if mk.EdgeIndex == nil { appendMapKey(scope, mk) return nil } - edge, ok := obj.HasEdge(mk) + var ok bool + edge, ok = obj.HasEdge(mk) if !ok { return errors.New("edge not found") } @@ -179,7 +200,17 @@ func _set(g *d2graph.Graph, key string, tag, value *string) error { // (y -> z)[0].style.animated: true if len(ref.MapKey.Edges) == 1 && ref.MapKey.EdgeIndex == nil { onlyInChain = false - break + } + // If a ref has an exact match on this key, just change the value + tmp1 := *ref.MapKey + tmp2 := *mk + noVal1 := &tmp1 + noVal2 := &tmp2 + noVal1.Value = d2ast.ValueBox{} + noVal2.Value = d2ast.ValueBox{} + if noVal1.Equals(noVal2) { + ref.MapKey.Value = mk.Value + return nil } } if onlyInChain { @@ -206,10 +237,26 @@ func _set(g *d2graph.Graph, key string, tag, value *string) error { if ref.MapKey.Value.Map != nil { foundMap = true scope = ref.MapKey.Value.Map - // TODO when edges can have more fields, search for style - if len(scope.Nodes) == 1 && scope.Nodes[0].MapKey.Value.Map != nil { - scope = scope.Nodes[0].MapKey.Value.Map - mk.Key.Path = mk.Key.Path[1:] + for _, n := range scope.Nodes { + if n.MapKey.Value.Map == nil { + continue + } + if n.MapKey.Key == nil || len(n.MapKey.Key.Path) != 1 { + continue + } + if n.MapKey.Key.Path[0].Unbox().ScalarString() == mk.Key.Path[toSkip-1].Unbox().ScalarString() { + scope = n.MapKey.Value.Map + if mk.Key.Path[0].Unbox().ScalarString() == "source-arrowhead" && edge.SrcArrowhead != nil { + attrs = edge.SrcArrowhead + } + if mk.Key.Path[0].Unbox().ScalarString() == "target-arrowhead" && edge.DstArrowhead != nil { + attrs = edge.DstArrowhead + } + reservedKey = mk.Key.Path[0].Unbox().ScalarString() + mk.Key.Path = mk.Key.Path[1:] + reservedTargetKey = mk.Key.Path[0].Unbox().ScalarString() + break + } } break } @@ -228,17 +275,79 @@ func _set(g *d2graph.Graph, key string, tag, value *string) error { if reserved { reservedIndex := toSkip - 1 if mk.Key != nil && len(mk.Key.Path) > 0 { - switch mk.Key.Path[reservedIndex].Unbox().ScalarString() { + if reservedKey == "" { + reservedKey = mk.Key.Path[reservedIndex].Unbox().ScalarString() + } + switch reservedKey { case "shape": if attrs.Shape.MapKey != nil { attrs.Shape.MapKey.SetScalar(mk.Value.ScalarBox()) return nil } - case "style": - if len(mk.Key.Path[reservedIndex:]) != 2 { - return errors.New("malformed style setting, expected 2 part path") + case "link": + if attrs.Link != nil && attrs.Link.MapKey != nil { + attrs.Link.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil } - switch mk.Key.Path[reservedIndex+1].Unbox().ScalarString() { + case "tooltip": + if attrs.Tooltip != nil && attrs.Tooltip.MapKey != nil { + attrs.Tooltip.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + case "width": + if attrs.Width != nil && attrs.Width.MapKey != nil { + attrs.Width.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + case "height": + if attrs.Height != nil && attrs.Height.MapKey != nil { + attrs.Height.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + case "top": + if attrs.Top != nil && attrs.Top.MapKey != nil { + attrs.Top.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + case "left": + if attrs.Left != nil && attrs.Left.MapKey != nil { + attrs.Left.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + case "source-arrowhead", "target-arrowhead": + if reservedKey == "source-arrowhead" { + attrs = edge.SrcArrowhead + } else { + attrs = edge.DstArrowhead + } + if attrs != nil { + if reservedTargetKey == "" { + if len(mk.Key.Path[reservedIndex:]) != 2 { + return errors.New("malformed style setting, expected 2 part path") + } + reservedTargetKey = mk.Key.Path[reservedIndex+1].Unbox().ScalarString() + } + switch reservedTargetKey { + case "shape": + if attrs.Shape.MapKey != nil { + attrs.Shape.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + case "label": + if attrs.Label.MapKey != nil { + attrs.Label.MapKey.SetScalar(mk.Value.ScalarBox()) + return nil + } + } + } + case "style": + if reservedTargetKey == "" { + if len(mk.Key.Path[reservedIndex:]) != 2 { + return errors.New("malformed style setting, expected 2 part path") + } + reservedTargetKey = mk.Key.Path[reservedIndex+1].Unbox().ScalarString() + } + switch reservedTargetKey { case "opacity": if attrs.Style.Opacity != nil { attrs.Style.Opacity.MapKey.SetScalar(mk.Value.ScalarBox()) @@ -667,6 +776,10 @@ func deleteReserved(g *d2graph.Graph, mk *d2ast.Key) (*d2graph.Graph, error) { if id == "near" || id == "tooltip" || id == "icon" || + id == "width" || + id == "height" || + id == "left" || + id == "top" || id == "link" { err := deleteObjField(g, obj, id) if err != nil { @@ -690,7 +803,9 @@ func deleteMapField(m *d2ast.Map, field string) { if n.MapKey != nil && n.MapKey.Key != nil { if n.MapKey.Key.Path[0].Unbox().ScalarString() == field { deleteFromMap(m, n.MapKey) - } else if n.MapKey.Key.Path[0].Unbox().ScalarString() == "style" { + } else if n.MapKey.Key.Path[0].Unbox().ScalarString() == "style" || + n.MapKey.Key.Path[0].Unbox().ScalarString() == "source-arrowhead" || + n.MapKey.Key.Path[0].Unbox().ScalarString() == "target-arrowhead" { if n.MapKey.Value.Map != nil { deleteMapField(n.MapKey.Value.Map, field) if len(n.MapKey.Value.Map.Nodes) == 0 { @@ -773,13 +888,14 @@ func deleteObject(g *d2graph.Graph, key *d2ast.KeyPath, obj *d2graph.Object) (*d if len(ref.MapKey.Edges) == 0 { isSuffix := ref.KeyPathIndex == len(ref.Key.Path)-1 ref.Key.Path = append(ref.Key.Path[:ref.KeyPathIndex], ref.Key.Path[ref.KeyPathIndex+1:]...) - withoutReserved := go2.Filter(ref.Key.Path, func(x *d2ast.StringBox) bool { - _, ok := d2graph.ReservedKeywords[x.Unbox().ScalarString()] - return !ok + withoutSpecial := go2.Filter(ref.Key.Path, func(x *d2ast.StringBox) bool { + _, isReserved := d2graph.ReservedKeywords[x.Unbox().ScalarString()] + isSpecial := isReserved || x.Unbox().ScalarString() == "_" + return !isSpecial }) if obj.Attributes.Shape.Value == d2target.ShapeSQLTable || obj.Attributes.Shape.Value == d2target.ShapeClass { ref.MapKey.Value.Map = nil - } else if len(withoutReserved) == 0 { + } else if len(withoutSpecial) == 0 { hoistRefChildren(g, key, ref) deleteFromMap(ref.Scope, ref.MapKey) } else if ref.MapKey.Value.Unbox() == nil && @@ -1167,7 +1283,7 @@ func move(g *d2graph.Graph, key, newKey string) (*d2graph.Graph, error) { } ida := d2graph.Key(ref.Key) - resolvedObj, resolvedIDA, err := d2graph.ResolveUnderscoreKey(ida, obj) + resolvedObj, resolvedIDA, err := d2graph.ResolveUnderscoreKey(ida, ref.ScopeObj) if err != nil { return nil, err } @@ -1839,6 +1955,12 @@ func DeleteIDDeltas(g *d2graph.Graph, key string) (deltas map[string]string, err conflictNewIDs := make(map[*d2graph.Object]string) conflictOldIDs := make(map[*d2graph.Object]string) if mk.Key != nil { + ida := d2graph.Key(mk.Key) + // Deleting a reserved field cannot possibly have any deltas + if _, ok := d2graph.ReservedKeywords[ida[len(ida)-1]]; ok { + return nil, nil + } + var ok bool obj, ok = g.Root.HasChild(d2graph.Key(mk.Key)) if !ok { @@ -2066,7 +2188,13 @@ func hasSpace(tag string) bool { } func getMostNestedRefs(obj *d2graph.Object) []d2graph.Reference { - most := obj.References[0] + var most d2graph.Reference + for _, ref := range obj.References { + if len(ref.MapKey.Edges) == 0 { + most = ref + break + } + } for _, ref := range obj.References { if len(ref.MapKey.Edges) != 0 { continue @@ -2080,11 +2208,11 @@ func getMostNestedRefs(obj *d2graph.Object) []d2graph.Reference { if err != nil { mostKey = &d2ast.KeyPath{} } - _, resolvedScopeKey, err := d2graph.ResolveUnderscoreKey(d2graph.Key(scopeKey), obj) + _, resolvedScopeKey, err := d2graph.ResolveUnderscoreKey(d2graph.Key(scopeKey), ref.ScopeObj) if err != nil { continue } - _, resolvedMostKey, err := d2graph.ResolveUnderscoreKey(d2graph.Key(mostKey), obj) + _, resolvedMostKey, err := d2graph.ResolveUnderscoreKey(d2graph.Key(mostKey), ref.ScopeObj) if err != nil { continue } diff --git a/d2oracle/edit_test.go b/d2oracle/edit_test.go index dd3b430fc..7cd1ef697 100644 --- a/d2oracle/edit_test.go +++ b/d2oracle/edit_test.go @@ -695,6 +695,151 @@ square.style.opacity: 0.2 } }, }, + { + name: "set_position", + text: `square +`, + key: `square.top`, + value: go2.Pointer(`200`), + exp: `square: {top: 200} +`, + }, + { + name: "replace_position", + text: `square: { + width: 100 + top: 32 + left: 44 +} +`, + key: `square.top`, + value: go2.Pointer(`200`), + exp: `square: { + width: 100 + top: 200 + left: 44 +} +`, + }, + { + name: "set_dimensions", + text: `square +`, + key: `square.width`, + value: go2.Pointer(`200`), + exp: `square: {width: 200} +`, + }, + { + name: "replace_dimensions", + text: `square: { + width: 100 +} +`, + key: `square.width`, + value: go2.Pointer(`200`), + exp: `square: { + width: 200 +} +`, + }, + { + name: "set_tooltip", + text: `square +`, + key: `square.tooltip`, + value: go2.Pointer(`y`), + exp: `square: {tooltip: y} +`, + }, + { + name: "replace_tooltip", + text: `square: { + tooltip: x +} +`, + key: `square.tooltip`, + value: go2.Pointer(`y`), + exp: `square: { + tooltip: y +} +`, + }, + { + name: "replace_link", + text: `square: { + link: https://google.com +} +`, + key: `square.link`, + value: go2.Pointer(`https://apple.com`), + exp: `square: { + link: https://apple.com +} +`, + }, + { + name: "replace_arrowhead", + text: `x -> y: { + target-arrowhead.shape: diamond +} +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`circle`), + exp: `x -> y: { + target-arrowhead.shape: circle +} +`, + }, + { + name: "replace_arrowhead_map", + text: `x -> y: { + target-arrowhead: { + shape: diamond + } +} +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`circle`), + exp: `x -> y: { + target-arrowhead: { + shape: circle + } +} +`, + }, + { + name: "replace_edge_style_map", + text: `x -> y: { + style: { + stroke-dash: 3 + } +} +`, + key: `(x -> y)[0].style.stroke-dash`, + value: go2.Pointer(`4`), + exp: `x -> y: { + style: { + stroke-dash: 4 + } +} +`, + }, + { + name: "replace_edge_style", + text: `x -> y: { + style.stroke-width: 1 + style.stroke-dash: 4 +} +`, + key: `(x -> y)[0].style.stroke-dash`, + value: go2.Pointer(`3`), + exp: `x -> y: { + style.stroke-width: 1 + style.stroke-dash: 3 +} +`, + }, { name: "label_unset", text: `square: "Always try to do things in chronological order; it's less confusing that way." @@ -1024,6 +1169,57 @@ a.b -> a.c: {style.animated: true} value: go2.Pointer(`true`), exp: `x -> y: {style.animated: true} +`, + }, + { + name: "edge_set_arrowhead", + text: `x -> y +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`diamond`), + + exp: `x -> y: {target-arrowhead.shape: diamond} +`, + }, + { + name: "edge_replace_arrowhead", + text: `x -> y: {target-arrowhead.shape: circle} +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`diamond`), + + exp: `x -> y: {target-arrowhead.shape: diamond} +`, + }, + { + name: "edge_replace_arrowhead_indexed", + text: `x -> y +(x -> y)[0].target-arrowhead.shape: circle +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`diamond`), + + exp: `x -> y +(x -> y)[0].target-arrowhead.shape: diamond +`, + }, + { + name: "edge_merge_arrowhead", + text: `x -> y: { + target-arrowhead: { + label: 1 + } +} +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`diamond`), + + exp: `x -> y: { + target-arrowhead: { + label: 1 + shape: diamond + } +} `, }, { @@ -1043,6 +1239,30 @@ a.b -> a.c: {style.animated: true} animated: true } } +`, + }, + { + name: "edge_flat_merge_arrowhead", + text: `x -> y -> z +(x -> y)[0].target-arrowhead.shape: diamond +`, + key: `(x -> y)[0].target-arrowhead.shape`, + value: go2.Pointer(`circle`), + + exp: `x -> y -> z +(x -> y)[0].target-arrowhead.shape: circle +`, + }, + { + name: "edge_index_merge_style", + text: `x -> y -> z +(x -> y)[0].style.opacity: 0.4 +`, + key: `(x -> y)[0].style.opacity`, + value: go2.Pointer(`0.5`), + + exp: `x -> y -> z +(x -> y)[0].style.opacity: 0.5 `, }, { @@ -1755,6 +1975,20 @@ b assert.JSON(t, 0, len(g.Objects[0].Children)) }, }, + { + name: "out_of_newline_container", + + text: `"a\n": { + b +} +`, + key: `"a\n".b`, + newKey: `b`, + + exp: `"a\n" +b +`, + }, { name: "partial_slice", @@ -1987,6 +2221,50 @@ c: { assert.JSON(t, len(g.Objects), 3) }, }, + { + name: "underscore-connection", + + text: `a: { + b + + _.c.d -> b +} + +c: { + d +} +`, + key: `a.b`, + newKey: `c.b`, + + exp: `a: { + _.c.d -> _.c.b +} + +c: { + d + b +} +`, + }, + + { + name: "nested-underscore-move-out", + text: `guitar: { + books: { + _._.pipe + } +} +`, + key: `pipe`, + newKey: `guitar.pipe`, + + exp: `guitar: { + books + pipe +} +`, + }, { name: "flat_middle_container", @@ -2162,7 +2440,7 @@ a.b.c: { `, }, { - name: "near", + name: "invalid-near", text: `x: { near: y @@ -2176,6 +2454,33 @@ y near: x.y y } +`, + expErr: `failed to move: "y" to "x.y": failed to recompile: +x: { + near: x.y + y +} + +d2/testdata/d2oracle/TestMove/invalid-near.d2:2:9: near keys cannot be set to an descendant`, + }, + { + name: "near", + + text: `x: { + near: y +} +a +y +`, + key: `y`, + newKey: `a.y`, + + exp: `x: { + near: a.y +} +a: { + y +} `, }, { @@ -3149,6 +3454,41 @@ c -> d exp: `books: { _.pipe } +`, + }, + { + name: "only-underscore", + + text: `guitar: { + books: { + _._.pipe + } +} +`, + key: `pipe`, + + exp: `guitar: { + books +} +`, + }, + { + name: "only-underscore-nested", + + text: `guitar: { + books: { + _._.pipe: { + a + } + } +} +`, + key: `pipe`, + + exp: `guitar: { + books +} +a `, }, { @@ -3291,6 +3631,71 @@ x key: `x`, exp: `y +`, + }, + { + name: "arrowhead", + + text: `x -> y: { + target-arrowhead.shape: diamond +} +`, + key: `(x -> y)[0].target-arrowhead`, + + exp: `x -> y +`, + }, + { + name: "arrowhead_shape", + + text: `x -> y: { + target-arrowhead.shape: diamond +} +`, + key: `(x -> y)[0].target-arrowhead.shape`, + + exp: `x -> y +`, + }, + { + name: "arrowhead_label", + + text: `x -> y: { + target-arrowhead.shape: diamond + target-arrowhead.label: 1 +} +`, + key: `(x -> y)[0].target-arrowhead.label`, + + exp: `x -> y: { + target-arrowhead.shape: diamond +} +`, + }, + { + name: "arrowhead_map", + + text: `x -> y: { + target-arrowhead: { + shape: diamond + } +} +`, + key: `(x -> y)[0].target-arrowhead.shape`, + + exp: `x -> y +`, + }, + { + name: "edge-only-style", + + text: `x -> y: { + style.stroke: red +} +`, + key: `(x -> y)[0].style.stroke`, + + exp: `x -> y `, }, { @@ -4339,6 +4744,30 @@ A -> B: {style.stroke: "#2b50c2"} exp: `A: {style.stroke: "#000e3d"} B A -> B +`, + }, + { + name: "width", + + text: `x: { + width: 200 +} +`, + key: `x.width`, + + exp: `x +`, + }, + { + name: "left", + + text: `x: { + left: 200 +} +`, + key: `x.left`, + + exp: `x `, }, } @@ -4701,6 +5130,46 @@ x.y.z.w.e.p.l -> x.y.z.1.2.3.4 exp: `{ "x.x": "x" +}`, + }, + { + name: "nested-height", + + text: `x: { + a -> b + height: 200 +} +`, + key: `x.height`, + + exp: `null`, + }, + { + name: "edge-style", + + text: `x <-> y: { + target-arrowhead: circle + source-arrowhead: diamond +} +`, + key: `(x <-> y)[0].target-arrowhead`, + + exp: `null`, + }, + { + name: "only-reserved", + text: `guitar: { + books: { + _._.pipe: { + a + } + } +} +`, + key: `pipe`, + + exp: `{ + "pipe.a": "a" }`, }, { diff --git a/d2plugin/exec.go b/d2plugin/exec.go index b76a802d0..04f0743f7 100644 --- a/d2plugin/exec.go +++ b/d2plugin/exec.go @@ -119,6 +119,9 @@ func (p *execPlugin) Info(ctx context.Context) (_ *PluginInfo, err error) { return nil, fmt.Errorf("failed to unmarshal json: %w", err) } + info.Type = "binary" + info.Path = p.path + p.info = &info return &info, nil } diff --git a/d2plugin/plugin.go b/d2plugin/plugin.go index a6eefdf7e..56002678d 100644 --- a/d2plugin/plugin.go +++ b/d2plugin/plugin.go @@ -71,11 +71,14 @@ type PluginInfo struct { ShortHelp string `json:"shortHelp"` LongHelp string `json:"longHelp"` - // These two are set by ListPlugins and not the plugin itself. + // Set to bundled when returning from the plugin. + // execPlugin will set to binary when used. // bundled | binary Type string `json:"type"` // If Type == binary then this contains the absolute path to the binary. Path string `json:"path"` + + Features []PluginFeature `json:"features"` } const binaryPrefix = "d2plugin-" @@ -122,12 +125,6 @@ func ListPluginInfos(ctx context.Context, ps []Plugin) ([]*PluginInfo, error) { if err != nil { return nil, err } - if ep, ok := p.(*execPlugin); ok { - info.Type = "binary" - info.Path = ep.path - } else { - info.Type = "bundled" - } infoSlice = append(infoSlice, info) } diff --git a/d2plugin/plugin_dagre.go b/d2plugin/plugin_dagre.go index 37c18a268..815c64910 100644 --- a/d2plugin/plugin_dagre.go +++ b/d2plugin/plugin_dagre.go @@ -66,6 +66,8 @@ func (p dagrePlugin) Info(ctx context.Context) (*PluginInfo, error) { return &PluginInfo{ Name: "dagre", + Type: "bundled", + Features: []PluginFeature{}, ShortHelp: "The directed graph layout library Dagre", LongHelp: fmt.Sprintf(`dagre is a directed graph layout library for JavaScript. See https://d2lang.com/tour/dagre for more. diff --git a/d2plugin/plugin_elk.go b/d2plugin/plugin_elk.go index 3f5210249..3b2113c6d 100644 --- a/d2plugin/plugin_elk.go +++ b/d2plugin/plugin_elk.go @@ -85,7 +85,11 @@ func (p elkPlugin) Info(ctx context.Context) (*PluginInfo, error) { f.AddToOpts(opts) } return &PluginInfo{ - Name: "elk", + Name: "elk", + Type: "bundled", + Features: []PluginFeature{ + CONTAINER_DIMENSIONS, + }, ShortHelp: "Eclipse Layout Kernel (ELK) with the Layered algorithm.", LongHelp: fmt.Sprintf(`ELK is a layout engine offered by Eclipse. Originally written in Java, it has been ported to Javascript and cross-compiled into D2. diff --git a/d2plugin/plugin_features.go b/d2plugin/plugin_features.go new file mode 100644 index 000000000..f41462b37 --- /dev/null +++ b/d2plugin/plugin_features.go @@ -0,0 +1,54 @@ +package d2plugin + +import ( + "fmt" + + "oss.terrastruct.com/d2/d2graph" +) + +type PluginFeature string + +// When this is true, objects can set ther `near` key to another object +// When this is false, objects can only set `near` to constants +const NEAR_OBJECT PluginFeature = "near_object" + +// When this is true, containers can have dimensions set +const CONTAINER_DIMENSIONS PluginFeature = "container_dimensions" + +// When this is true, objects can specify their `top` and `left` keywords +const TOP_LEFT PluginFeature = "top_left" + +func FeatureSupportCheck(info *PluginInfo, g *d2graph.Graph) error { + // Older version of plugin. Skip checking. + if info.Features == nil { + return nil + } + + featureMap := make(map[PluginFeature]struct{}, len(info.Features)) + for _, f := range info.Features { + featureMap[f] = struct{}{} + } + + for _, obj := range g.Objects { + if obj.Attributes.Top != nil || obj.Attributes.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) + } + } + if (obj.Attributes.Width != nil || obj.Attributes.Height != 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) + } + } + + if obj.Attributes.NearKey != nil { + _, isKey := g.Root.HasChild(d2graph.Key(obj.Attributes.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 nil +} diff --git a/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg b/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg index cf50b884e..884558064 100644 --- a/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg +++ b/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg @@ -39,8 +39,8 @@ width="1433" height="1589" viewBox="-146 -71 1433 1589"> \ No newline at end of file diff --git a/e2etests/testdata/measured/empty-shape/dagre/sketch.exp.svg b/e2etests/testdata/measured/empty-shape/dagre/sketch.exp.svg index 914a423a0..659fb392c 100644 --- a/e2etests/testdata/measured/empty-shape/dagre/sketch.exp.svg +++ b/e2etests/testdata/measured/empty-shape/dagre/sketch.exp.svg @@ -39,7 +39,7 @@ width="304" height="304" viewBox="-102 -102 304 304"> \ No newline at end of file diff --git a/e2etests/testdata/measured/empty-sql_table/dagre/sketch.exp.svg b/e2etests/testdata/measured/empty-sql_table/dagre/sketch.exp.svg index 53a789b51..565c497b9 100644 --- a/e2etests/testdata/measured/empty-sql_table/dagre/sketch.exp.svg +++ b/e2etests/testdata/measured/empty-sql_table/dagre/sketch.exp.svg @@ -39,7 +39,7 @@ width="254" height="216" viewBox="-102 -102 254 216"> \ No newline at end of file diff --git a/e2etests/testdata/regression/ampersand-escape/dagre/sketch.exp.svg b/e2etests/testdata/regression/ampersand-escape/dagre/sketch.exp.svg index 15a7a2d4d..9b25cef7b 100644 --- a/e2etests/testdata/regression/ampersand-escape/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/ampersand-escape/dagre/sketch.exp.svg @@ -52,8 +52,8 @@ width="572" height="286" viewBox="-102 -118 572 286">askuhykfnsomsczrgtigsjjcfi 1234 + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/dagre-disconnect/elk/board.exp.json b/e2etests/testdata/regression/dagre-disconnect/elk/board.exp.json new file mode 100644 index 000000000..40e6404ae --- /dev/null +++ b/e2etests/testdata/regression/dagre-disconnect/elk/board.exp.json @@ -0,0 +1,1434 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 184, + "y": 373 + }, + "width": 421, + "height": 527, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.k", + "type": "rectangle", + "pos": { + "x": 234, + "y": 423 + }, + "width": 151, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 11, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.k.t", + "type": "rectangle", + "pos": { + "x": 284, + "y": 473 + }, + "width": 51, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "t", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "a.f", + "type": "rectangle", + "pos": { + "x": 235, + "y": 679 + }, + "width": 293, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "f", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 8, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.f.i", + "type": "rectangle", + "pos": { + "x": 285, + "y": 729 + }, + "width": 49, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "i", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 4, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "a.f.g", + "type": "rectangle", + "pos": { + "x": 354, + "y": 729 + }, + "width": 54, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "g", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "s", + "type": "rectangle", + "pos": { + "x": 277, + "y": 1401 + }, + "width": 424, + "height": 271, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "s", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 11, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "s.n", + "type": "rectangle", + "pos": { + "x": 327, + "y": 1453 + }, + "width": 151, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "red", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "n", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 11, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "k", + "type": "rectangle", + "pos": { + "x": 12, + "y": 734 + }, + "width": 152, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "k.s", + "type": "rectangle", + "pos": { + "x": 62, + "y": 784 + }, + "width": 52, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "s", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "u", + "type": "rectangle", + "pos": { + "x": 254, + "y": 1040 + }, + "width": 397, + "height": 271, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "u", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 11, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "u.o", + "type": "rectangle", + "pos": { + "x": 304, + "y": 1095 + }, + "width": 54, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "o", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "h", + "type": "rectangle", + "pos": { + "x": 269, + "y": 12 + }, + "width": 252, + "height": 271, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "h", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "h.m", + "type": "rectangle", + "pos": { + "x": 319, + "y": 62 + }, + "width": 152, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "m", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 18, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "h.m.s", + "type": "rectangle", + "pos": { + "x": 369, + "y": 112 + }, + "width": 52, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "s", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "a.f.j", + "type": "rectangle", + "pos": { + "x": 428, + "y": 729 + }, + "width": 50, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "j", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 5, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "u.s", + "type": "rectangle", + "pos": { + "x": 378, + "y": 1095 + }, + "width": 150, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "s", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "u.s.j", + "type": "rectangle", + "pos": { + "x": 428, + "y": 1145 + }, + "width": 50, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "j", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 5, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "u.c", + "type": "rectangle", + "pos": { + "x": 548, + "y": 1195 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "s.z", + "type": "rectangle", + "pos": { + "x": 498, + "y": 1456 + }, + "width": 153, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "z", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "s.z.c", + "type": "rectangle", + "pos": { + "x": 548, + "y": 1506 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "s.n.f", + "type": "rectangle", + "pos": { + "x": 377, + "y": 1503 + }, + "width": 51, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "f", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "y", + "type": "rectangle", + "pos": { + "x": 327, + "y": 1752 + }, + "width": 151, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "y", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 13, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "y.r", + "type": "rectangle", + "pos": { + "x": 377, + "y": 1802 + }, + "width": 51, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "r", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.g", + "type": "rectangle", + "pos": { + "x": 406, + "y": 428 + }, + "width": 149, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "g", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 11, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.g.i", + "type": "rectangle", + "pos": { + "x": 456, + "y": 478 + }, + "width": 49, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "i", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 4, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + } + ], + "connections": [ + { + "id": "a.(k.t -> f.i)[0]", + "src": "a.k.t", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.f.i", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 309.5, + "y": 539 + }, + { + "x": 309.5, + "y": 729 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a.f.g -> s.n)[0]", + "src": "a.f.g", + "srcArrow": "none", + "srcLabel": "", + "dst": "s.n", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 381, + "y": 795 + }, + { + "x": 381, + "y": 945 + }, + { + "x": 243, + "y": 945 + }, + { + "x": 243, + "y": 1356 + }, + { + "x": 402.5, + "y": 1356 + }, + { + "x": 402.5, + "y": 1453.5 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(k.s <-> u.o)[0]", + "src": "k.s", + "srcArrow": "triangle", + "srcLabel": "", + "dst": "u.o", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 88, + "y": 850 + }, + { + "x": 88, + "y": 995 + }, + { + "x": 331, + "y": 995 + }, + { + "x": 331, + "y": 1095 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(h.m.s -> a.f.g)[0]", + "src": "h.m.s", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.f.g", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 395, + "y": 178 + }, + { + "x": 395, + "y": 634 + }, + { + "x": 381, + "y": 634 + }, + { + "x": 381, + "y": 729 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a.f.j -> u.s.j)[0]", + "src": "a.f.j", + "srcArrow": "none", + "srcLabel": "", + "dst": "u.s.j", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 453, + "y": 795 + }, + { + "x": 453, + "y": 1145 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(u.c -> s.z.c)[0]", + "src": "u.c", + "srcArrow": "none", + "srcLabel": "", + "dst": "s.z.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 574.5, + "y": 1261 + }, + { + "x": 574.5, + "y": 1506 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(s.n -> y.r)[0]", + "src": "s.n", + "srcArrow": "none", + "srcLabel": "", + "dst": "y.r", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "red", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 402.5, + "y": 1619.5 + }, + { + "x": 402.5, + "y": 1802 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(y.r -> a.g.i)[0]", + "src": "y.r", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.g.i", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "1\n2\n3\n4", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 9, + "labelHeight": 69, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 402.5, + "y": 1868 + }, + { + "x": 402.5, + "y": 1963 + }, + { + "x": 711, + "y": 1963 + }, + { + "x": 711, + "y": 328 + }, + { + "x": 480.5, + "y": 328 + }, + { + "x": 480.5, + "y": 478 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/dagre-disconnect/elk/sketch.exp.svg b/e2etests/testdata/regression/dagre-disconnect/elk/sketch.exp.svg new file mode 100644 index 000000000..14b25b787 --- /dev/null +++ b/e2etests/testdata/regression/dagre-disconnect/elk/sketch.exp.svg @@ -0,0 +1,66 @@ + +askuhykfnsomsczrgtigsjjcfi 1234 + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg b/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg index 29e2ab435..ad0947372 100644 --- a/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg @@ -39,8 +39,8 @@ width="562" height="730" viewBox="-102 -100 562 730"> \ No newline at end of file diff --git a/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg b/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg index 18f97f6a3..1df0f1fd3 100644 --- a/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg +++ b/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg @@ -39,7 +39,7 @@ width="452" height="332" viewBox="-90 -90 452 332"> \ No newline at end of file diff --git a/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg b/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg index 636457be9..272e6397b 100644 --- a/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg @@ -39,8 +39,8 @@ width="470" height="368" viewBox="-102 -100 470 368">x

linux: because a PC is a terrible thing to waste

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

linux: because a PC is a terrible thing to waste

-
a You don't have to know how the computer works,just how to work the computer. - +a You don't have to know how the computer works,just how to work the computer. + aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + diff --git a/e2etests/testdata/stable/chaos2/elk/sketch.exp.svg b/e2etests/testdata/stable/chaos2/elk/sketch.exp.svg index 742b1557d..dc33a8744 100644 --- a/e2etests/testdata/stable/chaos2/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/chaos2/elk/sketch.exp.svg @@ -796,8 +796,8 @@ width="898" height="2166" viewBox="-90 -90 898 2166">aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + diff --git a/e2etests/testdata/stable/circle_arrowhead/dagre/sketch.exp.svg b/e2etests/testdata/stable/circle_arrowhead/dagre/sketch.exp.svg index 0304d0331..8eb599547 100644 --- a/e2etests/testdata/stable/circle_arrowhead/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/circle_arrowhead/dagre/sketch.exp.svg @@ -39,8 +39,8 @@ width="379" height="457" viewBox="-102 -102 379 457">xyThe top of the mountain

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

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

Dieters live life in the fasting lane.

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

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

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

Dieters live life in the fasting lane.

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

A winning strategy

-
- + + poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

-
- + + abcbcbcea + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/container_dimensions/elk/board.exp.json b/e2etests/testdata/stable/container_dimensions/elk/board.exp.json new file mode 100644 index 000000000..96eb760eb --- /dev/null +++ b/e2etests/testdata/stable/container_dimensions/elk/board.exp.json @@ -0,0 +1,455 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 134 + }, + "width": 700, + "height": 292, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.b", + "type": "rectangle", + "pos": { + "x": 162, + "y": 184 + }, + "width": 400, + "height": 61, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.c", + "type": "rectangle", + "pos": { + "x": 62, + "y": 315 + }, + "width": 600, + "height": 61, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 732, + "y": 12 + }, + "width": 700, + "height": 536, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 13, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b.b", + "type": "rectangle", + "pos": { + "x": 782, + "y": 296 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "b.c", + "type": "rectangle", + "pos": { + "x": 782, + "y": 432 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "b.e", + "type": "rectangle", + "pos": { + "x": 855, + "y": 62 + }, + "width": 48, + "height": 300, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "c", + "type": "rectangle", + "pos": { + "x": 1452, + "y": 130 + }, + "width": 200, + "height": 300, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c.a", + "type": "rectangle", + "pos": { + "x": 1502, + "y": 180 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + } + ], + "connections": [ + { + "id": "a.(b -> c)[0]", + "src": "a.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 362, + "y": 245 + }, + { + "x": 362, + "y": 315 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "b.(b -> c)[0]", + "src": "b.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 808.5, + "y": 362 + }, + { + "x": 808.5, + "y": 432 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/stable/container_dimensions/elk/sketch.exp.svg b/e2etests/testdata/stable/container_dimensions/elk/sketch.exp.svg new file mode 100644 index 000000000..3a1b99b89 --- /dev/null +++ b/e2etests/testdata/stable/container_dimensions/elk/sketch.exp.svg @@ -0,0 +1,59 @@ + +abcbcbcea + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/container_edges/dagre/sketch.exp.svg b/e2etests/testdata/stable/container_edges/dagre/sketch.exp.svg index 5fc9bb735..551035cce 100644 --- a/e2etests/testdata/stable/container_edges/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/container_edges/dagre/sketch.exp.svg @@ -39,8 +39,8 @@ width="550" height="1234" viewBox="-102 -102 550 1234">mixed togethersugarsolution we get - +mixed togethersugarsolution we get + mixed togethersugarsolution we get - +mixed togethersugarsolution we get +

Markdown: Syntax

-
ab - +ab +

Markdown: Syntax

-
ab - +ab + markdown

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

-
- + + markdown

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

-
- + + markdown

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

-
- + + markdown

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

-
- + +

code

-
ab - +ab +

code

-
ab - +ab + bearmama bearpapa bear - +bearmama bearpapa bear + bearmama bearpapa bear - +bearmama bearpapa bear +

床前明月光,

+

疑是地上霜。

+

举头望明月,

+

低头思故乡。

+
所以,即使夏天很热 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/chinese/elk/board.exp.json b/e2etests/testdata/unicode/chinese/elk/board.exp.json new file mode 100644 index 000000000..a6fe84f83 --- /dev/null +++ b/e2etests/testdata/unicode/chinese/elk/board.exp.json @@ -0,0 +1,128 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "poem", + "type": "text", + "pos": { + "x": 66, + "y": 12 + }, + "width": 118, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "床前明月光,\n\n疑是地上霜。\n\n举头望明月,\n\n低头思故乡。", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "markdown", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 118, + "labelHeight": 144, + "zIndex": 0, + "level": 1 + }, + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 226 + }, + "width": 226, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "所以,即使夏天很热", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 181, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(poem -> a)[0]", + "src": "poem", + "srcArrow": "none", + "srcLabel": "", + "dst": "a", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 125, + "y": 156 + }, + { + "x": 125, + "y": 226 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/chinese/elk/sketch.exp.svg b/e2etests/testdata/unicode/chinese/elk/sketch.exp.svg new file mode 100644 index 000000000..7c5da6304 --- /dev/null +++ b/e2etests/testdata/unicode/chinese/elk/sketch.exp.svg @@ -0,0 +1,820 @@ + +

床前明月光,

+

疑是地上霜。

+

举头望明月,

+

低头思故乡。

+
所以,即使夏天很热 + + +
\ No newline at end of file diff --git a/e2etests/testdata/unicode/emojis/dagre/board.exp.json b/e2etests/testdata/unicode/emojis/dagre/board.exp.json new file mode 100644 index 000000000..4da2e1406 --- /dev/null +++ b/e2etests/testdata/unicode/emojis/dagre/board.exp.json @@ -0,0 +1,179 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 0, + "y": 0 + }, + "width": 205, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "🙈🙈🙈🙈🙈🙈🙈🙈", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 160, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊", + "type": "rectangle", + "pos": { + "x": 265, + "y": 0 + }, + "width": 833, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 788, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️", + "type": "rectangle", + "pos": { + "x": 229, + "y": 166 + }, + "width": 905, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 860, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊ -> ☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️)[0]", + "src": "✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊", + "srcArrow": "none", + "srcLabel": "", + "dst": "☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 681.5, + "y": 66 + }, + { + "x": 681.5, + "y": 106 + }, + { + "x": 681.5, + "y": 126 + }, + { + "x": 681.5, + "y": 166 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/emojis/dagre/sketch.exp.svg b/e2etests/testdata/unicode/emojis/dagre/sketch.exp.svg new file mode 100644 index 000000000..7a2d87909 --- /dev/null +++ b/e2etests/testdata/unicode/emojis/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +🙈🙈🙈🙈🙈🙈🙈🙈✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️ + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/emojis/elk/board.exp.json b/e2etests/testdata/unicode/emojis/elk/board.exp.json new file mode 100644 index 000000000..2e524b35a --- /dev/null +++ b/e2etests/testdata/unicode/emojis/elk/board.exp.json @@ -0,0 +1,170 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 205, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "🙈🙈🙈🙈🙈🙈🙈🙈", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 160, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊", + "type": "rectangle", + "pos": { + "x": 237, + "y": 12 + }, + "width": 833, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 788, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️", + "type": "rectangle", + "pos": { + "x": 201, + "y": 148 + }, + "width": 905, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 860, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊ -> ☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️)[0]", + "src": "✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊", + "srcArrow": "none", + "srcLabel": "", + "dst": "☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 653.5, + "y": 78 + }, + { + "x": 653.5, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/emojis/elk/sketch.exp.svg b/e2etests/testdata/unicode/emojis/elk/sketch.exp.svg new file mode 100644 index 000000000..85f892d60 --- /dev/null +++ b/e2etests/testdata/unicode/emojis/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +🙈🙈🙈🙈🙈🙈🙈🙈✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️ + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/japanese-basic/dagre/board.exp.json b/e2etests/testdata/unicode/japanese-basic/dagre/board.exp.json new file mode 100644 index 000000000..4bc654165 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-basic/dagre/board.exp.json @@ -0,0 +1,48 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 0, + "y": 0 + }, + "width": 246, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ああああああああああ", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 201, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/unicode/japanese-basic/dagre/sketch.exp.svg b/e2etests/testdata/unicode/japanese-basic/dagre/sketch.exp.svg new file mode 100644 index 000000000..47a46f5be --- /dev/null +++ b/e2etests/testdata/unicode/japanese-basic/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +ああああああああああ + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/japanese-basic/elk/board.exp.json b/e2etests/testdata/unicode/japanese-basic/elk/board.exp.json new file mode 100644 index 000000000..7b54eaf15 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-basic/elk/board.exp.json @@ -0,0 +1,48 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 246, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ああああああああああ", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 201, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/unicode/japanese-basic/elk/sketch.exp.svg b/e2etests/testdata/unicode/japanese-basic/elk/sketch.exp.svg new file mode 100644 index 000000000..3d6d77b13 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-basic/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +ああああああああああ + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/japanese-full/dagre/board.exp.json b/e2etests/testdata/unicode/japanese-full/dagre/board.exp.json new file mode 100644 index 000000000..76f3ee1c3 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-full/dagre/board.exp.json @@ -0,0 +1,138 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 0, + "y": 0 + }, + "width": 1382, + "height": 98, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ある日、トマトが道を歩いていたら、道路の向こうからキュウリがやって来ました。\nトマトは驚いて尋ねました。\n「キュウリさん、どうしてあなたはここにいるのですか?」 キュウリは答えました。「あなたと同じ理由でここにいます。サラダになるために。」", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 1337, + "labelHeight": 53, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 8, + "y": 219 + }, + "width": 1367, + "height": 115, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "「バナナは皮を剥いて食べるものです。」", + "fontSize": 55, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 1322, + "labelHeight": 70, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "「バカは死ななきゃ治らない。」", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 289, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 691, + "y": 98 + }, + { + "x": 691, + "y": 146.4 + }, + { + "x": 691, + "y": 170.7 + }, + { + "x": 691, + "y": 219.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/japanese-full/dagre/sketch.exp.svg b/e2etests/testdata/unicode/japanese-full/dagre/sketch.exp.svg new file mode 100644 index 000000000..6c8ac7b97 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-full/dagre/sketch.exp.svg @@ -0,0 +1,59 @@ + +ある日、トマトが道を歩いていたら、道路の向こうからキュウリがやって来ました。トマトは驚いて尋ねました。「キュウリさん、どうしてあなたはここにいるのですか?」 キュウリは答えました。「あなたと同じ理由でここにいます。サラダになるために。」「バナナは皮を剥いて食べるものです。」 「バカは死ななきゃ治らない。」 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/japanese-full/elk/board.exp.json b/e2etests/testdata/unicode/japanese-full/elk/board.exp.json new file mode 100644 index 000000000..08cca5c14 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-full/elk/board.exp.json @@ -0,0 +1,129 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 1382, + "height": 98, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ある日、トマトが道を歩いていたら、道路の向こうからキュウリがやって来ました。\nトマトは驚いて尋ねました。\n「キュウリさん、どうしてあなたはここにいるのですか?」 キュウリは答えました。「あなたと同じ理由でここにいます。サラダになるために。」", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 1337, + "labelHeight": 53, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 19, + "y": 271 + }, + "width": 1367, + "height": 115, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "「バナナは皮を剥いて食べるものです。」", + "fontSize": 55, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 1322, + "labelHeight": 70, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "「バカは死ななきゃ治らない。」", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 289, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 703, + "y": 110 + }, + { + "x": 703, + "y": 271 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/japanese-full/elk/sketch.exp.svg b/e2etests/testdata/unicode/japanese-full/elk/sketch.exp.svg new file mode 100644 index 000000000..d43cfa9c5 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-full/elk/sketch.exp.svg @@ -0,0 +1,59 @@ + +ある日、トマトが道を歩いていたら、道路の向こうからキュウリがやって来ました。トマトは驚いて尋ねました。「キュウリさん、どうしてあなたはここにいるのですか?」 キュウリは答えました。「あなたと同じ理由でここにいます。サラダになるために。」「バナナは皮を剥いて食べるものです。」 「バカは死ななきゃ治らない。」 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/japanese-mixed/dagre/board.exp.json b/e2etests/testdata/unicode/japanese-mixed/dagre/board.exp.json new file mode 100644 index 000000000..506dfab48 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-mixed/dagre/board.exp.json @@ -0,0 +1,494 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 1646, + "y": 0 + }, + "width": 668, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 623, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 0, + "y": 166 + }, + "width": 3959, + "height": 171, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶", + "fontSize": 100, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 3914, + "labelHeight": 126, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "rectangle", + "pos": { + "x": 1817, + "y": 437 + }, + "width": 326, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "今日はTokyoでsushiを食べました", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 281, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "d", + "type": "rectangle", + "pos": { + "x": 888, + "y": 603 + }, + "width": 2184, + "height": 100, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "先日、Shibuyaで友達とshoppingを楽😊しんだ後、ramen屋でdelicious😊なラーメンを食べた。", + "fontSize": 43, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 2139, + "labelHeight": 55, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "e", + "type": "rectangle", + "pos": { + "x": 1877, + "y": 803 + }, + "width": 206, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "English English English", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 161, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "f", + "type": "rectangle", + "pos": { + "x": 1897, + "y": 969 + }, + "width": 165, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "先日先日先日", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 120, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1979.5, + "y": 66 + }, + { + "x": 1979.5, + "y": 106 + }, + { + "x": 1979.5, + "y": 126 + }, + { + "x": 1979.5, + "y": 166 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1979.5, + "y": 337 + }, + { + "x": 1979.5, + "y": 377 + }, + { + "x": 1979.5, + "y": 397 + }, + { + "x": 1979.5, + "y": 437 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1979.5, + "y": 503 + }, + { + "x": 1979.5, + "y": 543 + }, + { + "x": 1979.5, + "y": 563 + }, + { + "x": 1979.5, + "y": 603 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(d -> e)[0]", + "src": "d", + "srcArrow": "none", + "srcLabel": "", + "dst": "e", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1979.5, + "y": 703 + }, + { + "x": 1979.5, + "y": 743 + }, + { + "x": 1979.5, + "y": 763 + }, + { + "x": 1979.5, + "y": 803 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(e -> f)[0]", + "src": "e", + "srcArrow": "none", + "srcLabel": "", + "dst": "f", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1979.5, + "y": 869 + }, + { + "x": 1979.5, + "y": 909 + }, + { + "x": 1979.5, + "y": 929 + }, + { + "x": 1979.5, + "y": 969 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/japanese-mixed/dagre/sketch.exp.svg b/e2etests/testdata/unicode/japanese-mixed/dagre/sketch.exp.svg new file mode 100644 index 000000000..1afd8aafa --- /dev/null +++ b/e2etests/testdata/unicode/japanese-mixed/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶今日はTokyoでsushiを食べました先日、Shibuyaで友達とshoppingを楽😊しんだ後、ramen屋でdelicious😊なラーメンを食べた。English English English先日先日先日 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/japanese-mixed/elk/board.exp.json b/e2etests/testdata/unicode/japanese-mixed/elk/board.exp.json new file mode 100644 index 000000000..622db44fb --- /dev/null +++ b/e2etests/testdata/unicode/japanese-mixed/elk/board.exp.json @@ -0,0 +1,449 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 1657, + "y": 12 + }, + "width": 668, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 623, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 12, + "y": 148 + }, + "width": 3959, + "height": 171, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶", + "fontSize": 100, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 3914, + "labelHeight": 126, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "rectangle", + "pos": { + "x": 1828, + "y": 389 + }, + "width": 326, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "今日はTokyoでsushiを食べました", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 281, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "d", + "type": "rectangle", + "pos": { + "x": 899, + "y": 525 + }, + "width": 2184, + "height": 100, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "先日、Shibuyaで友達とshoppingを楽😊しんだ後、ramen屋でdelicious😊なラーメンを食べた。", + "fontSize": 43, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 2139, + "labelHeight": 55, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "e", + "type": "rectangle", + "pos": { + "x": 1888, + "y": 695 + }, + "width": 206, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "English English English", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 161, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "f", + "type": "rectangle", + "pos": { + "x": 1909, + "y": 831 + }, + "width": 165, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "先日先日先日", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 120, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1991.5, + "y": 78 + }, + { + "x": 1991.5, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1991.5, + "y": 319 + }, + { + "x": 1991.5, + "y": 389 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1991.5, + "y": 455 + }, + { + "x": 1991.5, + "y": 525 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(d -> e)[0]", + "src": "d", + "srcArrow": "none", + "srcLabel": "", + "dst": "e", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1991.5, + "y": 625 + }, + { + "x": 1991.5, + "y": 695 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(e -> f)[0]", + "src": "e", + "srcArrow": "none", + "srcLabel": "", + "dst": "f", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1991.5, + "y": 761 + }, + { + "x": 1991.5, + "y": 831 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/japanese-mixed/elk/sketch.exp.svg b/e2etests/testdata/unicode/japanese-mixed/elk/sketch.exp.svg new file mode 100644 index 000000000..80b292087 --- /dev/null +++ b/e2etests/testdata/unicode/japanese-mixed/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶今日はTokyoでsushiを食べました先日、Shibuyaで友達とshoppingを楽😊しんだ後、ramen屋でdelicious😊なラーメンを食べた。English English English先日先日先日 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/korean/dagre/board.exp.json b/e2etests/testdata/unicode/korean/dagre/board.exp.json new file mode 100644 index 000000000..57d6026fc --- /dev/null +++ b/e2etests/testdata/unicode/korean/dagre/board.exp.json @@ -0,0 +1,48 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 0, + "y": 0 + }, + "width": 205, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "고생끝에낙이온다", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 160, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/unicode/korean/dagre/sketch.exp.svg b/e2etests/testdata/unicode/korean/dagre/sketch.exp.svg new file mode 100644 index 000000000..fcb408cea --- /dev/null +++ b/e2etests/testdata/unicode/korean/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +고생끝에낙이온다 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/korean/elk/board.exp.json b/e2etests/testdata/unicode/korean/elk/board.exp.json new file mode 100644 index 000000000..bf70b2118 --- /dev/null +++ b/e2etests/testdata/unicode/korean/elk/board.exp.json @@ -0,0 +1,48 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 205, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "고생끝에낙이온다", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 160, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/unicode/korean/elk/sketch.exp.svg b/e2etests/testdata/unicode/korean/elk/sketch.exp.svg new file mode 100644 index 000000000..001cf2974 --- /dev/null +++ b/e2etests/testdata/unicode/korean/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +고생끝에낙이온다 + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/mixed-language-2/dagre/board.exp.json b/e2etests/testdata/unicode/mixed-language-2/dagre/board.exp.json new file mode 100644 index 000000000..de3b3e2bf --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language-2/dagre/board.exp.json @@ -0,0 +1,1486 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 31, + "y": 0 + }, + "width": 240, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "我 (wǒ) - Mandarin Chinese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 195, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 30, + "y": 166 + }, + "width": 241, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ສະບາຍດີ (sabaai dii) - Lao", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 196, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "rectangle", + "pos": { + "x": 0, + "y": 332 + }, + "width": 301, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ជំរាបសួរ (jomreab suor) - Khmer", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 256, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "d", + "type": "rectangle", + "pos": { + "x": 29, + "y": 498 + }, + "width": 244, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "สวัสดี (sà-wàt-dii) - Thai", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 199, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "e", + "type": "rectangle", + "pos": { + "x": 336, + "y": 0 + }, + "width": 237, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ສະບາຍດີ (sabaidee) - Lao", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 192, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "f", + "type": "rectangle", + "pos": { + "x": 331, + "y": 166 + }, + "width": 247, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ဟယ်လို (helaou) - Burmese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 202, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "g", + "type": "rectangle", + "pos": { + "x": 367, + "y": 332 + }, + "width": 176, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "mari (まり) - Ainu", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 131, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "h", + "type": "rectangle", + "pos": { + "x": 368, + "y": 498 + }, + "width": 173, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "cào (草) - Zhuang", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 128, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "i", + "type": "rectangle", + "pos": { + "x": 633, + "y": 0 + }, + "width": 282, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "күнтізбе (kúntízbe) - Kazakh", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 237, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "j", + "type": "rectangle", + "pos": { + "x": 662, + "y": 166 + }, + "width": 224, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "բարև (barev) - Armenian", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 179, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "k", + "type": "rectangle", + "pos": { + "x": 642, + "y": 332 + }, + "width": 265, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "монгол (mongol) - Mongolian", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 220, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "l", + "type": "rectangle", + "pos": { + "x": 675, + "y": 498 + }, + "width": 199, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "mila (میلا) - Uyghur", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 154, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "m", + "type": "rectangle", + "pos": { + "x": 975, + "y": 0 + }, + "width": 255, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "નમસ્તે (namaste) - Gujarati", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 210, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "n", + "type": "rectangle", + "pos": { + "x": 996, + "y": 166 + }, + "width": 213, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "漢字 (kanji) - Japanese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 168, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "o", + "type": "rectangle", + "pos": { + "x": 1024, + "y": 332 + }, + "width": 158, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "위 (wi) - Korean", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 113, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "p", + "type": "rectangle", + "pos": { + "x": 984, + "y": 498 + }, + "width": 238, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "吾哥 (ngǔgāi) - Cantonese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 193, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"မင်္ဂလာပါ (mingalaba) - Burmese\"", + "type": "rectangle", + "pos": { + "x": 1290, + "y": 0 + }, + "width": 307, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "မင်္ဂလာပါ (mingalaba) - Burmese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 262, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"сайн уу (sain uu) - Mongolian\"", + "type": "rectangle", + "pos": { + "x": 1657, + "y": 0 + }, + "width": 264, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "сайн уу (sain uu) - Mongolian", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 219, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi\"", + "type": "rectangle", + "pos": { + "x": 1981, + "y": 0 + }, + "width": 328, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 283, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"你吃了吗 (ní chī le ma) - Mandarin Chinese\"", + "type": "rectangle", + "pos": { + "x": 2369, + "y": 0 + }, + "width": 370, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "你吃了吗 (ní chī le ma) - Mandarin Chinese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 325, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"饭 (fan) - Zhuang\"", + "type": "rectangle", + "pos": { + "x": 2799, + "y": 0 + }, + "width": 167, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "饭 (fan) - Zhuang", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 122, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "مەن سىزنى ياخشى ئۈمىد ق", + "type": "rectangle", + "pos": { + "x": 3026, + "y": 0 + }, + "width": 266, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "مەن سىزنى ياخشى ئۈمىد ق", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 221, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 150.5, + "y": 66 + }, + { + "x": 150.5, + "y": 106 + }, + { + "x": 150.5, + "y": 126 + }, + { + "x": 150.5, + "y": 166 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 150.5, + "y": 232 + }, + { + "x": 150.5, + "y": 272 + }, + { + "x": 150.5, + "y": 292 + }, + { + "x": 150.5, + "y": 332 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 150.5, + "y": 398 + }, + { + "x": 150.5, + "y": 438 + }, + { + "x": 150.5, + "y": 458 + }, + { + "x": 150.5, + "y": 498 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(e -> f)[0]", + "src": "e", + "srcArrow": "none", + "srcLabel": "", + "dst": "f", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 454.5, + "y": 66 + }, + { + "x": 454.5, + "y": 106 + }, + { + "x": 454.5, + "y": 126 + }, + { + "x": 454.5, + "y": 166 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(f -> g)[0]", + "src": "f", + "srcArrow": "none", + "srcLabel": "", + "dst": "g", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 454.5, + "y": 232 + }, + { + "x": 454.5, + "y": 272 + }, + { + "x": 454.5, + "y": 292 + }, + { + "x": 454.5, + "y": 332 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(g -> h)[0]", + "src": "g", + "srcArrow": "none", + "srcLabel": "", + "dst": "h", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 454.5, + "y": 398 + }, + { + "x": 454.5, + "y": 438 + }, + { + "x": 454.5, + "y": 458 + }, + { + "x": 454.5, + "y": 498 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(i -> j)[0]", + "src": "i", + "srcArrow": "none", + "srcLabel": "", + "dst": "j", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 774, + "y": 66 + }, + { + "x": 774, + "y": 106 + }, + { + "x": 774, + "y": 126 + }, + { + "x": 774, + "y": 166 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(j -> k)[0]", + "src": "j", + "srcArrow": "none", + "srcLabel": "", + "dst": "k", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 774, + "y": 232 + }, + { + "x": 774, + "y": 272 + }, + { + "x": 774, + "y": 292 + }, + { + "x": 774, + "y": 332 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(k -> l)[0]", + "src": "k", + "srcArrow": "none", + "srcLabel": "", + "dst": "l", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 774, + "y": 398 + }, + { + "x": 774, + "y": 438 + }, + { + "x": 774, + "y": 458 + }, + { + "x": 774, + "y": 498 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(m -> n)[0]", + "src": "m", + "srcArrow": "none", + "srcLabel": "", + "dst": "n", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1102.5, + "y": 66 + }, + { + "x": 1102.5, + "y": 106 + }, + { + "x": 1102.5, + "y": 126 + }, + { + "x": 1102.5, + "y": 166 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(n -> o)[0]", + "src": "n", + "srcArrow": "none", + "srcLabel": "", + "dst": "o", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1102.5, + "y": 232 + }, + { + "x": 1102.5, + "y": 272 + }, + { + "x": 1102.5, + "y": 292 + }, + { + "x": 1102.5, + "y": 332 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(o -> p)[0]", + "src": "o", + "srcArrow": "none", + "srcLabel": "", + "dst": "p", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1102.5, + "y": 398 + }, + { + "x": 1102.5, + "y": 438 + }, + { + "x": 1102.5, + "y": 458 + }, + { + "x": 1102.5, + "y": 498 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/mixed-language-2/dagre/sketch.exp.svg b/e2etests/testdata/unicode/mixed-language-2/dagre/sketch.exp.svg new file mode 100644 index 000000000..f5711932c --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language-2/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +我 (wǒ) - Mandarin Chineseສະບາຍດີ (sabaai dii) - Laoជំរាបសួរ (jomreab suor) - Khmerสวัสดี (sà-wàt-dii) - Thaiສະບາຍດີ (sabaidee) - Laoဟယ်လို (helaou) - Burmesemari (まり) - Ainucào (草) - Zhuangкүнтізбе (kúntízbe) - Kazakhբարև (barev) - Armenianмонгол (mongol) - Mongolianmila (میلا) - Uyghurનમસ્તે (namaste) - Gujarati漢字 (kanji) - Japanese위 (wi) - Korean吾哥 (ngǔgāi) - Cantoneseမင်္ဂလာပါ (mingalaba) - Burmeseсайн уу (sain uu) - Mongolianਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi你吃了吗 (ní chī le ma) - Mandarin Chinese饭 (fan) - Zhuangمەن سىزنى ياخشى ئۈمىد ق + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/mixed-language-2/elk/board.exp.json b/e2etests/testdata/unicode/mixed-language-2/elk/board.exp.json new file mode 100644 index 000000000..17a1da589 --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language-2/elk/board.exp.json @@ -0,0 +1,1378 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 42, + "y": 12 + }, + "width": 240, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "我 (wǒ) - Mandarin Chinese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 195, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 42, + "y": 148 + }, + "width": 241, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ສະບາຍດີ (sabaai dii) - Lao", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 196, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "rectangle", + "pos": { + "x": 12, + "y": 284 + }, + "width": 301, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ជំរាបសួរ (jomreab suor) - Khmer", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 256, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "d", + "type": "rectangle", + "pos": { + "x": 40, + "y": 420 + }, + "width": 244, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "สวัสดี (sà-wàt-dii) - Thai", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 199, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "e", + "type": "rectangle", + "pos": { + "x": 308, + "y": 12 + }, + "width": 237, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ສະບາຍດີ (sabaidee) - Lao", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 192, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "f", + "type": "rectangle", + "pos": { + "x": 303, + "y": 148 + }, + "width": 247, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ဟယ်လို (helaou) - Burmese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 202, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "g", + "type": "rectangle", + "pos": { + "x": 338, + "y": 284 + }, + "width": 176, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "mari (まり) - Ainu", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 131, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "h", + "type": "rectangle", + "pos": { + "x": 340, + "y": 420 + }, + "width": 173, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "cào (草) - Zhuang", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 128, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "i", + "type": "rectangle", + "pos": { + "x": 565, + "y": 12 + }, + "width": 282, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "күнтізбе (kúntízbe) - Kazakh", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 237, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "j", + "type": "rectangle", + "pos": { + "x": 594, + "y": 148 + }, + "width": 224, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "բարև (barev) - Armenian", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 179, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "k", + "type": "rectangle", + "pos": { + "x": 573, + "y": 284 + }, + "width": 265, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "монгол (mongol) - Mongolian", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 220, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "l", + "type": "rectangle", + "pos": { + "x": 606, + "y": 420 + }, + "width": 199, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "mila (میلا) - Uyghur", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 154, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "m", + "type": "rectangle", + "pos": { + "x": 867, + "y": 12 + }, + "width": 255, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "નમસ્તે (namaste) - Gujarati", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 210, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "n", + "type": "rectangle", + "pos": { + "x": 888, + "y": 148 + }, + "width": 213, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "漢字 (kanji) - Japanese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 168, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "o", + "type": "rectangle", + "pos": { + "x": 915, + "y": 284 + }, + "width": 158, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "위 (wi) - Korean", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 113, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "p", + "type": "rectangle", + "pos": { + "x": 875, + "y": 420 + }, + "width": 238, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "吾哥 (ngǔgāi) - Cantonese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 193, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"မင်္ဂလာပါ (mingalaba) - Burmese\"", + "type": "rectangle", + "pos": { + "x": 1142, + "y": 12 + }, + "width": 307, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "မင်္ဂလာပါ (mingalaba) - Burmese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 262, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"сайн уу (sain uu) - Mongolian\"", + "type": "rectangle", + "pos": { + "x": 1469, + "y": 12 + }, + "width": 264, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "сайн уу (sain uu) - Mongolian", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 219, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi\"", + "type": "rectangle", + "pos": { + "x": 1753, + "y": 12 + }, + "width": 328, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 283, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"你吃了吗 (ní chī le ma) - Mandarin Chinese\"", + "type": "rectangle", + "pos": { + "x": 2101, + "y": 12 + }, + "width": 370, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "你吃了吗 (ní chī le ma) - Mandarin Chinese", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 325, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "\"饭 (fan) - Zhuang\"", + "type": "rectangle", + "pos": { + "x": 2491, + "y": 12 + }, + "width": 167, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "饭 (fan) - Zhuang", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 122, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "مەن سىزنى ياخشى ئۈمىد ق", + "type": "rectangle", + "pos": { + "x": 2678, + "y": 12 + }, + "width": 266, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "مەن سىزنى ياخشى ئۈمىد ق", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 221, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 162.5, + "y": 78 + }, + { + "x": 162.5, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 162.5, + "y": 214 + }, + { + "x": 162.5, + "y": 284 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 162.5, + "y": 350 + }, + { + "x": 162.5, + "y": 420 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(e -> f)[0]", + "src": "e", + "srcArrow": "none", + "srcLabel": "", + "dst": "f", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 426.5, + "y": 78 + }, + { + "x": 426.5, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(f -> g)[0]", + "src": "f", + "srcArrow": "none", + "srcLabel": "", + "dst": "g", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 426.5, + "y": 214 + }, + { + "x": 426.5, + "y": 284 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(g -> h)[0]", + "src": "g", + "srcArrow": "none", + "srcLabel": "", + "dst": "h", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 426.5, + "y": 350 + }, + { + "x": 426.5, + "y": 420 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(i -> j)[0]", + "src": "i", + "srcArrow": "none", + "srcLabel": "", + "dst": "j", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 706, + "y": 78 + }, + { + "x": 706, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(j -> k)[0]", + "src": "j", + "srcArrow": "none", + "srcLabel": "", + "dst": "k", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 706, + "y": 214 + }, + { + "x": 706, + "y": 284 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(k -> l)[0]", + "src": "k", + "srcArrow": "none", + "srcLabel": "", + "dst": "l", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 706, + "y": 350 + }, + { + "x": 706, + "y": 420 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(m -> n)[0]", + "src": "m", + "srcArrow": "none", + "srcLabel": "", + "dst": "n", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 994.5, + "y": 78 + }, + { + "x": 994.5, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(n -> o)[0]", + "src": "n", + "srcArrow": "none", + "srcLabel": "", + "dst": "o", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 994.5, + "y": 214 + }, + { + "x": 994.5, + "y": 284 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(o -> p)[0]", + "src": "o", + "srcArrow": "none", + "srcLabel": "", + "dst": "p", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 994.5, + "y": 350 + }, + { + "x": 994.5, + "y": 420 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/mixed-language-2/elk/sketch.exp.svg b/e2etests/testdata/unicode/mixed-language-2/elk/sketch.exp.svg new file mode 100644 index 000000000..c29add6e6 --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language-2/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +我 (wǒ) - Mandarin Chineseສະບາຍດີ (sabaai dii) - Laoជំរាបសួរ (jomreab suor) - Khmerสวัสดี (sà-wàt-dii) - Thaiສະບາຍດີ (sabaidee) - Laoဟယ်လို (helaou) - Burmesemari (まり) - Ainucào (草) - Zhuangкүнтізбе (kúntízbe) - Kazakhբարև (barev) - Armenianмонгол (mongol) - Mongolianmila (میلا) - Uyghurનમસ્તે (namaste) - Gujarati漢字 (kanji) - Japanese위 (wi) - Korean吾哥 (ngǔgāi) - Cantoneseမင်္ဂလာပါ (mingalaba) - Burmeseсайн уу (sain uu) - Mongolianਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi你吃了吗 (ní chī le ma) - Mandarin Chinese饭 (fan) - Zhuangمەن سىزنى ياخشى ئۈمىد ق + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/mixed-language/dagre/board.exp.json b/e2etests/testdata/unicode/mixed-language/dagre/board.exp.json new file mode 100644 index 000000000..310f55112 --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language/dagre/board.exp.json @@ -0,0 +1,226 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 275, + "y": 0 + }, + "width": 428, + "height": 98, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "有一个叫做夏天的季节。\n ある季節、夏という名前がついています。\n한 계절, 여름이란 이름이 있습니다.", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 383, + "labelHeight": 53, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 0, + "y": 198 + }, + "width": 448, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "夏天的时候,天气非常热,人们总是流着汗。", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 403, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "text", + "pos": { + "x": 508, + "y": 199 + }, + "width": 492, + "height": 64, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "夏になると、とても暑くて、人々は汗を流しています。\n\n여름에는 매우 더워서 사람들은 땀을 흘립니다.", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "markdown", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 492, + "labelHeight": 64, + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 357.83838383838383, + "y": 98 + }, + { + "x": 250.76767676767676, + "y": 138 + }, + { + "x": 224, + "y": 158 + }, + { + "x": 224, + "y": 198 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a -> c)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 620.1616161616162, + "y": 98 + }, + { + "x": 727.2323232323232, + "y": 138 + }, + { + "x": 754, + "y": 158.2 + }, + { + "x": 754, + "y": 199 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/mixed-language/dagre/sketch.exp.svg b/e2etests/testdata/unicode/mixed-language/dagre/sketch.exp.svg new file mode 100644 index 000000000..35d0ac951 --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language/dagre/sketch.exp.svg @@ -0,0 +1,818 @@ + +有一个叫做夏天的季节。 ある季節、夏という名前がついています。한 계절, 여름이란 이름이 있습니다.夏天的时候,天气非常热,人们总是流着汗。

夏になると、とても暑くて、人々は汗を流しています。

+

여름에는 매우 더워서 사람들은 땀을 흘립니다.

+
+ + +
\ No newline at end of file diff --git a/e2etests/testdata/unicode/mixed-language/elk/board.exp.json b/e2etests/testdata/unicode/mixed-language/elk/board.exp.json new file mode 100644 index 000000000..cdd2c0da3 --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language/elk/board.exp.json @@ -0,0 +1,216 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 93, + "y": 12 + }, + "width": 428, + "height": 98, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "有一个叫做夏天的季节。\n ある季節、夏という名前がついています。\n한 계절, 여름이란 이름이 있습니다.", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 383, + "labelHeight": 53, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 12, + "y": 190 + }, + "width": 448, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "夏天的时候,天气非常热,人们总是流着汗。", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 403, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "text", + "pos": { + "x": 480, + "y": 190 + }, + "width": 492, + "height": 64, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "夏になると、とても暑くて、人々は汗を流しています。\n\n여름에는 매우 더워서 사람들은 땀을 흘립니다.", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "markdown", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 492, + "labelHeight": 64, + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 236, + "y": 110 + }, + { + "x": 236, + "y": 190 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a -> c)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 378.66666666666663, + "y": 110 + }, + { + "x": 378.66666666666663, + "y": 150 + }, + { + "x": 726, + "y": 150 + }, + { + "x": 726, + "y": 190 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/unicode/mixed-language/elk/sketch.exp.svg b/e2etests/testdata/unicode/mixed-language/elk/sketch.exp.svg new file mode 100644 index 000000000..cc469c16f --- /dev/null +++ b/e2etests/testdata/unicode/mixed-language/elk/sketch.exp.svg @@ -0,0 +1,818 @@ + +有一个叫做夏天的季节。 ある季節、夏という名前がついています。한 계절, 여름이란 이름이 있습니다.夏天的时候,天气非常热,人们总是流着汗。

夏になると、とても暑くて、人々は汗を流しています。

+

여름에는 매우 더워서 사람들은 땀을 흘립니다.

+
+ + +
\ No newline at end of file diff --git a/e2etests/testdata/unicode/with-style/dagre/board.exp.json b/e2etests/testdata/unicode/with-style/dagre/board.exp.json new file mode 100644 index 000000000..475a72efb --- /dev/null +++ b/e2etests/testdata/unicode/with-style/dagre/board.exp.json @@ -0,0 +1,48 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "おやすみなさい", + "type": "rectangle", + "pos": { + "x": 0, + "y": 0 + }, + "width": 185, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 15, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": true, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "おやすみなさい", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 140, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/unicode/with-style/dagre/sketch.exp.svg b/e2etests/testdata/unicode/with-style/dagre/sketch.exp.svg new file mode 100644 index 000000000..f50767e30 --- /dev/null +++ b/e2etests/testdata/unicode/with-style/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +おやすみなさい + + + \ No newline at end of file diff --git a/e2etests/testdata/unicode/with-style/elk/board.exp.json b/e2etests/testdata/unicode/with-style/elk/board.exp.json new file mode 100644 index 000000000..201320c67 --- /dev/null +++ b/e2etests/testdata/unicode/with-style/elk/board.exp.json @@ -0,0 +1,48 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "おやすみなさい", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 185, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 15, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": true, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "おやすみなさい", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 140, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/unicode/with-style/elk/sketch.exp.svg b/e2etests/testdata/unicode/with-style/elk/sketch.exp.svg new file mode 100644 index 000000000..4b6c98b44 --- /dev/null +++ b/e2etests/testdata/unicode/with-style/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +おやすみなさい + + + \ No newline at end of file diff --git a/e2etests/unicode_test.go b/e2etests/unicode_test.go new file mode 100644 index 000000000..b92906256 --- /dev/null +++ b/e2etests/unicode_test.go @@ -0,0 +1,139 @@ +package e2etests + +import ( + _ "embed" + "testing" +) + +func testUnicode(t *testing.T) { + tcs := []testCase{ + { + name: "japanese-basic", + script: `a: ああああああああああ +`, + }, + { + name: "japanese-full", + script: `a: "ある日、トマトが道を歩いていたら、道路の向こうからキュウリがやって来ました。\nトマトは驚いて尋ねました。\n「キュウリさん、どうしてあなたはここにいるのですか?」 キュウリは答えました。「あなたと同じ理由でここにいます。サラダになるために。」" + +b: "「バナナは皮を剥いて食べるものです。」" { + style.font-size: 55 +} + +a -> b: 「バカは死ななきゃ治らない。」 +`, + }, + { + name: "emojis", + script: `a: 🙈🙈🙈🙈🙈🙈🙈🙈 +✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊✊ -> ☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️ +`, + }, + { + name: "with-style", + script: `おやすみなさい: {style.stroke-width: 15; style.double-border: true} +`, + }, + { + name: "japanese-mixed", + script: `a: "トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶" +b: "トマトが赤くなったのはなぜですか?Because it saw the salad dressing!👩‍👩‍👧‍👶👩‍👩‍👧‍👶" { + style.font-size: 100 +} +c: 今日はTokyoでsushiを食べました +d: 先日、Shibuyaで友達とshoppingを楽😊しんだ後、ramen屋でdelicious😊なラーメンを食べた。{ + style.font-size: 43 +} +e: English English English +f: 先日先日先日 +a -> b -> c -> d -> e -> f + +`, + }, + { + name: "chinese", + script: `poem: |md + 床前明月光, + + 疑是地上霜。 + + 举头望明月, + + 低头思故乡。 +| +a: 所以,即使夏天很热 +poem -> a +`, + }, + { + name: "korean", + script: `a: 고생끝에낙이온다 +`, + }, + { + name: "mixed-language", + script: `a: 有一个叫做夏天的季节。\n ある季節、夏という名前がついています。\n한 계절, 여름이란 이름이 있습니다. +b: 夏天的时候,天气非常热,人们总是流着汗。 +c: |md + 夏になると、とても暑くて、人々は汗を流しています。 + + 여름에는 매우 더워서 사람들은 땀을 흘립니다. +| +a -> b +a -> c +`, + }, + { + name: "mixed-language-2", + script: `a: 我 (wǒ) - Mandarin Chinese +b: ສະບາຍດີ (sabaai dii) - Lao +c: ជំរាបសួរ (jomreab suor) - Khmer + +d: สวัสดี (sà-wàt-dii) - Thai + +e: ສະບາຍດີ (sabaidee) - Lao + +f: ဟယ်လို (helaou) - Burmese + +g: mari (まり) - Ainu + +h: cào (草) - Zhuang + +i: күнтізбе (kúntízbe) - Kazakh + +j: բարև (barev) - Armenian + +k: монгол (mongol) - Mongolian + +l: mila (میلا) - Uyghur + +m: નમસ્તે (namaste) - Gujarati + +n: 漢字 (kanji) - Japanese + +o: 위 (wi) - Korean + +p: 吾哥 (ngǔgāi) - Cantonese + +a -> b -> c -> d +e -> f -> g -> h +i -> j -> k -> l +m -> n -> o -> p + +မင်္ဂလာပါ (mingalaba) - Burmese + +сайн уу (sain uu) - Mongolian + +ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ (sat sri akal) - Punjabi + +你吃了吗 (ní chī le ma) - Mandarin Chinese + +饭 (fan) - Zhuang + +مەن سىزنى ياخشى ئۈمىد ق +`, + }, + } + + runa(t, tcs) +} diff --git a/go.mod b/go.mod index dd035d480..02ded6971 100644 --- a/go.mod +++ b/go.mod @@ -13,6 +13,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 github.com/mazznoer/csscolorparser v0.1.3 github.com/playwright-community/playwright-go v0.2000.1 + github.com/rivo/uniseg v0.4.3 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 github.com/yuin/goldmark v1.5.3 diff --git a/go.sum b/go.sum index d5f4cbb5b..1d9faae0c 100644 --- a/go.sum +++ b/go.sum @@ -134,6 +134,8 @@ github.com/playwright-community/playwright-go v0.2000.1/go.mod h1:1y9cM9b9dVHnuR github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= +github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= diff --git a/lib/textmeasure/markdown.go b/lib/textmeasure/markdown.go index 4a30afbbb..bb9cdaa46 100644 --- a/lib/textmeasure/markdown.go +++ b/lib/textmeasure/markdown.go @@ -257,6 +257,8 @@ func (ruler *Ruler) measureNode(depth int, n *html.Node, fontFamily *d2fonts.Fon if isCode { w *= FontSize_pre_code_em h *= FontSize_pre_code_em + } else { + w = ruler.scaleUnicode(w, font, str) } if debugMeasure { fmt.Printf("%stext(%v,%v)\n", depthStr, w, h) diff --git a/lib/textmeasure/textmeasure.go b/lib/textmeasure/textmeasure.go index b46cc1711..2e539e86d 100644 --- a/lib/textmeasure/textmeasure.go +++ b/lib/textmeasure/textmeasure.go @@ -5,10 +5,12 @@ package textmeasure import ( "math" + "strings" "unicode" "unicode/utf8" "github.com/golang/freetype/truetype" + "github.com/rivo/uniseg" "oss.terrastruct.com/d2/d2renderers/d2fonts" "oss.terrastruct.com/d2/lib/geo" @@ -164,8 +166,52 @@ func (r *Ruler) addFontSize(font d2fonts.Font) { r.tabWidths[font] = atlas.glyph(' ').advance * TAB_SIZE } +func (t *Ruler) scaleUnicode(w float64, font d2fonts.Font, s string) float64 { + // Weird unicode stuff is going on when this is true + // See https://github.com/rivo/uniseg#grapheme-clusters + // This method is a good-enough approximation. It overshoots, but not by much. + // I suspect we need to import a font with the right glyphs to get the precise measurements + // but Hans fonts are heavy. + if uniseg.GraphemeClusterCount(s) != len(s) { + for _, line := range strings.Split(s, "\n") { + lineW, _ := t.MeasurePrecise(font, line) + gr := uniseg.NewGraphemes(line) + + mono := d2fonts.SourceCodePro.Font(font.Size, font.Style) + for gr.Next() { + if gr.Width() == 1 { + continue + } + // For each grapheme which doesn't have width=1, the ruler measured wrongly. + // So, replace the measured width with a scaled measurement of a monospace version + var prevRune rune + dot := t.Orig.Copy() + b := newRect() + for _, r := range gr.Runes() { + var control bool + dot, control = t.controlRune(r, dot, font) + if control { + continue + } + + var bounds *rect + _, _, bounds, dot = t.atlases[font].DrawRune(prevRune, r, dot) + b = b.union(bounds) + + prevRune = r + } + lineW -= b.w() + lineW += t.spaceWidth(mono) * float64(gr.Width()) + } + w = math.Max(w, lineW) + } + } + return w +} + func (t *Ruler) Measure(font d2fonts.Font, s string) (width, height int) { w, h := t.MeasurePrecise(font, s) + w = t.scaleUnicode(w, font, s) return int(math.Ceil(w)), int(math.Ceil(h)) } diff --git a/main.go b/main.go index 848caa636..54e47b189 100644 --- a/main.go +++ b/main.go @@ -199,7 +199,6 @@ func run(ctx context.Context, ms *xmain.State) (err error) { if inputPath == "-" { return xmain.UsageErrorf("-w[atch] cannot be combined with reading input from stdin") } - ms.Log.SetTS(true) w, err := newWatcher(ctx, ms, watcherOpts{ layoutPlugin: plugin, sketch: *sketchFlag, @@ -233,6 +232,7 @@ func run(ctx context.Context, ms *xmain.State) (err error) { } func compile(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketch bool, pad, themeID int64, inputPath, outputPath string, bundle, forceAppendix bool, page playwright.Page) (_ []byte, written bool, _ error) { + start := time.Now() input, err := ms.ReadPath(inputPath) if err != nil { return nil, false, err @@ -252,16 +252,27 @@ func compile(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketc if sketch { opts.FontFamily = go2.Pointer(d2fonts.HandDrawn) } - diagram, _, err := d2lib.Compile(ctx, string(input), opts) + diagram, g, err := d2lib.Compile(ctx, string(input), opts) if err != nil { return nil, false, err } + pluginInfo, err := plugin.Info(ctx) + if err != nil { + return nil, false, err + } + + err = d2plugin.FeatureSupportCheck(pluginInfo, g) + if err != nil { + return nil, false, err + } + + compileDir := time.Since(start) var svg []byte if filepath.Ext(outputPath) == ".pdf" { svg, err = renderPDF(ctx, ms, plugin, sketch, pad, outputPath, page, ruler, diagram, nil, nil) } else { - svg, err = render(ctx, ms, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, diagram) + svg, err = render(ctx, ms, compileDir, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, diagram) } if err != nil { return svg, false, err @@ -271,30 +282,33 @@ func compile(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketc return svg, true, nil } -func render(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketch bool, pad int64, inputPath, outputPath string, bundle, forceAppendix bool, page playwright.Page, ruler *textmeasure.Ruler, diagram *d2target.Diagram) ([]byte, error) { +func render(ctx context.Context, ms *xmain.State, compileDur time.Duration, plugin d2plugin.Plugin, sketch bool, pad int64, inputPath, outputPath string, bundle, forceAppendix bool, page playwright.Page, ruler *textmeasure.Ruler, diagram *d2target.Diagram) ([]byte, error) { outputPath = layerOutputPath(outputPath, diagram) for _, dl := range diagram.Layers { - _, err := render(ctx, ms, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, dl) + _, err := render(ctx, ms, compileDur, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, dl) if err != nil { return nil, err } } for _, dl := range diagram.Scenarios { - _, err := render(ctx, ms, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, dl) + _, err := render(ctx, ms, compileDur, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, dl) if err != nil { return nil, err } } for _, dl := range diagram.Steps { - _, err := render(ctx, ms, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, dl) + _, err := render(ctx, ms, compileDur, plugin, sketch, pad, inputPath, outputPath, bundle, forceAppendix, page, ruler, dl) if err != nil { return nil, err } } + start := time.Now() svg, err := _render(ctx, ms, plugin, sketch, pad, outputPath, bundle, forceAppendix, page, ruler, diagram) if err != nil { return svg, err } + dur := compileDur + time.Since(start) + ms.Log.Success.Printf("successfully compiled %s to %s in %s", inputPath, outputPath, dur) return svg, nil } diff --git a/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json b/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json new file mode 100644 index 000000000..a5b45a2b1 --- /dev/null +++ b/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json @@ -0,0 +1,1435 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,0:0:0-45:0:505", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,1:0:1-44:1:504", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,1:0:1-1:10:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,1:0:1-1:10:11", + "value": [ + { + "string": "containers", + "raw_string": "containers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,1:12:13-44:0:503", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,2:1:16-11:2:131", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,2:1:16-2:17:32", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,2:1:16-2:17:32", + "value": [ + { + "string": "circle container", + "raw_string": "circle container" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,2:19:34-11:1:130", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,3:2:38-3:15:51", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,3:2:38-3:7:43", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,3:2:38-3:7:43", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,3:9:45-3:15:51", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,4:2:54-4:12:64", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,4:2:54-4:7:59", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,4:2:54-4:7:59", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,4:9:61-4:12:64", + "raw": "512", + "value": "512" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,6:2:68-10:3:128", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,6:2:68-6:9:75", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,6:2:68-6:9:75", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,6:11:77-10:2:127", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,7:3:82-7:17:96", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,7:3:82-7:8:87", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,7:3:82-7:8:87", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,7:10:89-7:17:96", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,8:3:100-8:13:110", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,8:3:100-8:8:105", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,8:3:100-8:8:105", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,8:10:107-8:13:110", + "raw": "128", + "value": "128" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,9:3:114-9:13:124", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,9:3:114-9:9:120", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,9:3:114-9:9:120", + "value": [ + { + "string": "height", + "raw_string": "height" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,9:11:122-9:13:124", + "raw": "64", + "value": "64" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,12:1:133-21:2:248", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,12:1:133-12:18:150", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,12:1:133-12:18:150", + "value": [ + { + "string": "diamond container", + "raw_string": "diamond container" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,12:20:152-21:1:247", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,13:2:156-13:16:170", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,13:2:156-13:7:161", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,13:2:156-13:7:161", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,13:9:163-13:16:170", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,14:2:173-14:12:183", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,14:2:173-14:7:178", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,14:2:173-14:7:178", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,14:9:180-14:12:183", + "raw": "512", + "value": "512" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,15:2:186-15:13:197", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,15:2:186-15:8:192", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,15:2:186-15:8:192", + "value": [ + { + "string": "height", + "raw_string": "height" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,15:10:194-15:13:197", + "raw": "256", + "value": "256" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,17:2:201-20:3:245", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,17:2:201-17:8:207", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,17:2:201-17:8:207", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,17:10:209-20:2:244", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,18:3:214-18:16:227", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,18:3:214-18:8:219", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,18:3:214-18:8:219", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,18:10:221-18:16:227", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,19:3:231-19:13:241", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,19:3:231-19:8:236", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,19:3:231-19:8:236", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,19:10:238-19:13:241", + "raw": "128", + "value": "128" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,22:1:250-32:2:375", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,22:1:250-22:15:264", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,22:1:250-22:15:264", + "value": [ + { + "string": "oval container", + "raw_string": "oval container" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,22:17:266-32:1:374", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,23:2:270-23:13:281", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,23:2:270-23:7:275", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,23:2:270-23:7:275", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,23:9:277-23:13:281", + "value": [ + { + "string": "oval", + "raw_string": "oval" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,24:2:284-24:12:294", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,24:2:284-24:7:289", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,24:2:284-24:7:289", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,24:9:291-24:12:294", + "raw": "512", + "value": "512" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,25:2:297-25:13:308", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,25:2:297-25:8:303", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,25:2:297-25:8:303", + "value": [ + { + "string": "height", + "raw_string": "height" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,25:10:305-25:13:308", + "raw": "256", + "value": "256" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,27:2:312-31:3:372", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,27:2:312-27:9:319", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,27:2:312-27:9:319", + "value": [ + { + "string": "hexagon", + "raw_string": "hexagon" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,27:11:321-31:2:371", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,28:3:326-28:17:340", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,28:3:326-28:8:331", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,28:3:326-28:8:331", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,28:10:333-28:17:340", + "value": [ + { + "string": "hexagon", + "raw_string": "hexagon" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,29:3:344-29:13:354", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,29:3:344-29:8:349", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,29:3:344-29:8:349", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,29:10:351-29:13:354", + "raw": "128", + "value": "128" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,30:3:358-30:13:368", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,30:3:358-30:9:364", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,30:3:358-30:9:364", + "value": [ + { + "string": "height", + "raw_string": "height" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,30:11:366-30:13:368", + "raw": "64", + "value": "64" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,33:1:377-43:2:502", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,33:1:377-33:18:394", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,33:1:377-33:18:394", + "value": [ + { + "string": "hexagon container", + "raw_string": "hexagon container" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,33:20:396-43:1:501", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,34:2:400-34:16:414", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,34:2:400-34:7:405", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,34:2:400-34:7:405", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,34:9:407-34:16:414", + "value": [ + { + "string": "hexagon", + "raw_string": "hexagon" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,35:2:417-35:12:427", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,35:2:417-35:7:422", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,35:2:417-35:7:422", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,35:9:424-35:12:427", + "raw": "512", + "value": "512" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,36:2:430-36:13:441", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,36:2:430-36:8:436", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,36:2:430-36:8:436", + "value": [ + { + "string": "height", + "raw_string": "height" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,36:10:438-36:13:441", + "raw": "256", + "value": "256" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,38:2:445-42:3:499", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,38:2:445-38:6:449", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,38:2:445-38:6:449", + "value": [ + { + "string": "oval", + "raw_string": "oval" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,38:8:451-42:2:498", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,39:3:456-39:14:467", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,39:3:456-39:8:461", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,39:3:456-39:8:461", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,39:10:463-39:14:467", + "value": [ + { + "string": "oval", + "raw_string": "oval" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,40:3:471-40:13:481", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,40:3:471-40:8:476", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,40:3:471-40:8:476", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,40:10:478-40:13:481", + "raw": "128", + "value": "128" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,41:3:485-41:13:495", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,41:3:485-41:9:491", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,41:3:485-41:9:491", + "value": [ + { + "string": "height", + "raw_string": "height" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,41:11:493-41:13:495", + "raw": "64", + "value": "64" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "containers", + "id_val": "containers", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,1:0:1-1:10:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,1:0:1-1:10:11", + "value": [ + { + "string": "containers", + "raw_string": "containers" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "containers" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "circle container", + "id_val": "circle container", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,2:1:16-2:17:32", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,2:1:16-2:17:32", + "value": [ + { + "string": "circle container", + "raw_string": "circle container" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "circle container" + }, + "style": {}, + "width": { + "value": "512" + }, + "near_key": null, + "shape": { + "value": "circle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "diamond", + "id_val": "diamond", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,6:2:68-6:9:75", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,6:2:68-6:9:75", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "diamond" + }, + "style": {}, + "width": { + "value": "128" + }, + "height": { + "value": "64" + }, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "diamond container", + "id_val": "diamond container", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,12:1:133-12:18:150", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,12:1:133-12:18:150", + "value": [ + { + "string": "diamond container", + "raw_string": "diamond container" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "diamond container" + }, + "style": {}, + "width": { + "value": "512" + }, + "height": { + "value": "256" + }, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "circle", + "id_val": "circle", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,17:2:201-17:8:207", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,17:2:201-17:8:207", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "circle" + }, + "style": {}, + "width": { + "value": "128" + }, + "near_key": null, + "shape": { + "value": "circle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "oval container", + "id_val": "oval container", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,22:1:250-22:15:264", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,22:1:250-22:15:264", + "value": [ + { + "string": "oval container", + "raw_string": "oval container" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "oval container" + }, + "style": {}, + "width": { + "value": "512" + }, + "height": { + "value": "256" + }, + "near_key": null, + "shape": { + "value": "oval" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "hexagon", + "id_val": "hexagon", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,27:2:312-27:9:319", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,27:2:312-27:9:319", + "value": [ + { + "string": "hexagon", + "raw_string": "hexagon" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "hexagon" + }, + "style": {}, + "width": { + "value": "128" + }, + "height": { + "value": "64" + }, + "near_key": null, + "shape": { + "value": "hexagon" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "hexagon container", + "id_val": "hexagon container", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,33:1:377-33:18:394", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,33:1:377-33:18:394", + "value": [ + { + "string": "hexagon container", + "raw_string": "hexagon container" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "hexagon container" + }, + "style": {}, + "width": { + "value": "512" + }, + "height": { + "value": "256" + }, + "near_key": null, + "shape": { + "value": "hexagon" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "oval", + "id_val": "oval", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,38:2:445-38:6:449", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,38:2:445-38:6:449", + "value": [ + { + "string": "oval", + "raw_string": "oval" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "oval" + }, + "style": {}, + "width": { + "value": "128" + }, + "height": { + "value": "64" + }, + "near_key": null, + "shape": { + "value": "oval" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/edge_in_column.exp.json b/testdata/d2compiler/TestCompile/edge_in_column.exp.json index 7783ac781..4a390573c 100644 --- a/testdata/d2compiler/TestCompile/edge_in_column.exp.json +++ b/testdata/d2compiler/TestCompile/edge_in_column.exp.json @@ -1,384 +1,16 @@ { - "graph": { - "name": "", - "ast": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:0:0-3:1:39", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:0:0-3:1:39", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:3:3-3:0:38", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,1:2:7-1:18:23", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,1:2:7-1:7:12", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,1:2:7-1:7:12", - "value": [ - { - "string": "shape", - "raw_string": "shape" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,1:9:14-1:18:23", - "value": [ - { - "string": "sql_table", - "raw_string": "sql_table" - } - ] - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:2:26-2:13:37", - "key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:2:26-2:3:27", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:2:26-2:3:27", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:5:29-2:12:36", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:12:36", - "edges": [ - { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:12:36", - "src": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:8:32", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:7:31", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:10:34-2:12:36", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:11:35-2:12:36", - "value": [ - { - "string": "q", - "raw_string": "q" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "label_dimensions": { - "width": 0, - "height": 0 - }, - "attributes": { - "label": { - "value": "" - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": { - "value": "" - } - }, - "zIndex": 0 - }, - "edges": [ + "graph": null, + "err": { + "ioerr": null, + "errs": [ { - "index": 0, - "minWidth": 0, - "minHeight": 0, - "label_dimensions": { - "width": 0, - "height": 0 - }, - "isCurve": false, - "src_arrow": false, - "dst_arrow": true, - "references": [ - { - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "" - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": { - "value": "" - } - }, - "zIndex": 0 - } - ], - "objects": [ - { - "id": "x", - "id_val": "x", - "label_dimensions": { - "width": 0, - "height": 0 - }, - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "sql_table": { - "columns": [ - { - "name": { - "label": "x", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 0, - "labelHeight": 0 - }, - "type": { - "label": "", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 0, - "labelHeight": 0 - }, - "constraint": "", - "reference": "" - } - ] - }, - "attributes": { - "label": { - "value": "x" - }, - "style": {}, - "near_key": null, - "shape": { - "value": "sql_table" - }, - "direction": { - "value": "" - }, - "constraint": { - "value": "" - } - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:7:31", + "errmsg": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2:3:7: sql_table columns cannot have children" }, { - "id": "p", - "id_val": "p", - "label_dimensions": { - "width": 0, - "height": 0 - }, - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:8:32", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:6:30-2:7:31", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "p" - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": { - "value": "" - } - }, - "zIndex": 0 - }, - { - "id": "q", - "id_val": "q", - "label_dimensions": { - "width": 0, - "height": 0 - }, - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:10:34-2:12:36", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:11:35-2:12:36", - "value": [ - { - "string": "q", - "raw_string": "q" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": 0 - } - ], - "attributes": { - "label": { - "value": "q" - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": { - "value": "" - } - }, - "zIndex": 0 + "range": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2,2:11:35-2:12:36", + "errmsg": "d2/testdata/d2compiler/TestCompile/edge_in_column.d2:3:12: sql_table columns cannot have children" } ] - }, - "err": null + } } diff --git a/testdata/d2compiler/TestCompile/near-invalid.exp.json b/testdata/d2compiler/TestCompile/near-invalid.exp.json new file mode 100644 index 000000000..f04575527 --- /dev/null +++ b/testdata/d2compiler/TestCompile/near-invalid.exp.json @@ -0,0 +1,16 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/near-invalid.d2,8:10:133-8:17:140", + "errmsg": "d2/testdata/d2compiler/TestCompile/near-invalid.d2:9:11: near keys cannot be set to an ancestor" + }, + { + "range": "d2/testdata/d2compiler/TestCompile/near-invalid.d2,13:8:161-13:11:164", + "errmsg": "d2/testdata/d2compiler/TestCompile/near-invalid.d2:14:9: near keys cannot be set to an descendant" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/no-nested-columns-class.exp.json b/testdata/d2compiler/TestCompile/no-nested-columns-class.exp.json new file mode 100644 index 000000000..cc9546885 --- /dev/null +++ b/testdata/d2compiler/TestCompile/no-nested-columns-class.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/no-nested-columns-class.d2,2:4:24-2:5:25", + "errmsg": "d2/testdata/d2compiler/TestCompile/no-nested-columns-class.d2:3:5: class fields cannot have children" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/no-nested-columns-sql-2.exp.json b/testdata/d2compiler/TestCompile/no-nested-columns-sql-2.exp.json new file mode 100644 index 000000000..15bef32df --- /dev/null +++ b/testdata/d2compiler/TestCompile/no-nested-columns-sql-2.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/no-nested-columns-sql-2.d2,4:4:34-4:5:35", + "errmsg": "d2/testdata/d2compiler/TestCompile/no-nested-columns-sql-2.d2:5:5: sql_table columns cannot have children" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/no-nested-columns-sql.exp.json b/testdata/d2compiler/TestCompile/no-nested-columns-sql.exp.json new file mode 100644 index 000000000..782ccce94 --- /dev/null +++ b/testdata/d2compiler/TestCompile/no-nested-columns-sql.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/no-nested-columns-sql.d2,2:9:33-2:10:34", + "errmsg": "d2/testdata/d2compiler/TestCompile/no-nested-columns-sql.d2:3:10: sql_table columns cannot have children" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/no_dimensions_on_containers.exp.json b/testdata/d2compiler/TestCompile/no_dimensions_on_containers.exp.json deleted file mode 100644 index ec21bacd7..000000000 --- a/testdata/d2compiler/TestCompile/no_dimensions_on_containers.exp.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "graph": null, - "err": { - "ioerr": null, - "errs": [ - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,4:2:54-4:12:64", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:5:3: width cannot be used on container: containers.circle container" - }, - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,14:2:173-14:12:183", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:15:3: width cannot be used on container: containers.diamond container" - }, - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,15:2:186-15:13:197", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:16:3: height cannot be used on container: containers.diamond container" - }, - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,24:2:284-24:12:294", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:25:3: width cannot be used on container: containers.oval container" - }, - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,25:2:297-25:13:308", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:26:3: height cannot be used on container: containers.oval container" - }, - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,35:2:417-35:12:427", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:36:3: width cannot be used on container: containers.hexagon container" - }, - { - "range": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2,36:2:430-36:13:441", - "errmsg": "d2/testdata/d2compiler/TestCompile/no_dimensions_on_containers.d2:37:3: height cannot be used on container: containers.hexagon container" - } - ] - } -} diff --git a/testdata/d2compiler/TestCompile/path_link.exp.json b/testdata/d2compiler/TestCompile/path_link.exp.json index 9a1cb6fc3..7c96d68c6 100644 --- a/testdata/d2compiler/TestCompile/path_link.exp.json +++ b/testdata/d2compiler/TestCompile/path_link.exp.json @@ -129,7 +129,9 @@ "value": "x" }, "style": {}, - "link": "Overview.Untitled board 7.zzzzz", + "link": { + "value": "Overview.Untitled board 7.zzzzz" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/positions.exp.json b/testdata/d2compiler/TestCompile/positions.exp.json new file mode 100644 index 000000000..bde5c7157 --- /dev/null +++ b/testdata/d2compiler/TestCompile/positions.exp.json @@ -0,0 +1,179 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:0:0-4:0:30", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:0:0-3:1:29", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:0:0-0:3:3", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:5:5-3:0:28", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,1:1:8-1:9:16", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,1:1:8-1:4:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,1:1:8-1:4:11", + "value": [ + { + "string": "top", + "raw_string": "top" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,1:6:13-1:9:16", + "raw": "200", + "value": "200" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,2:1:18-2:10:27", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,2:1:18-2:5:22", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,2:1:18-2:5:22", + "value": [ + { + "string": "left", + "raw_string": "left" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,2:7:24-2:10:27", + "raw": "230", + "value": "230" + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "hey", + "id_val": "hey", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/positions.d2,0:0:0-0:3:3", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "hey" + }, + "style": {}, + "top": { + "value": "200" + }, + "left": { + "value": "230" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/underscore_connection.exp.json b/testdata/d2compiler/TestCompile/underscore_connection.exp.json new file mode 100644 index 000000000..cdcd84009 --- /dev/null +++ b/testdata/d2compiler/TestCompile/underscore_connection.exp.json @@ -0,0 +1,489 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:0:0-3:0:24", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:0:0-2:1:23", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:3:3-2:0:22", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:16:21", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:16:21", + "src": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:8:13", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:3:8", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:4:9-1:5:10", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:6:11-1:7:12", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:10:15-1:16:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:11:16-1:12:17", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:13:18-1:14:19", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:15:20-1:16:21", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "a", + "id_val": "a", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "c", + "id_val": "c", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:8:13", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:3:8", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:4:9-1:5:10", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:6:11-1:7:12", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "key_path_index": 1, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:10:15-1:16:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:11:16-1:12:17", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:13:18-1:14:19", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:15:20-1:16:21", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 1, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "c" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "d", + "id_val": "d", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:8:13", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:2:7-1:3:8", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:4:9-1:5:10", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:6:11-1:7:12", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "key_path_index": 2, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "d" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "b", + "id_val": "b", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:10:15-1:16:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:11:16-1:12:17", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:13:18-1:14:19", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/underscore_connection.d2,1:15:20-1:16:21", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 2, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "b" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/url_link.exp.json b/testdata/d2compiler/TestCompile/url_link.exp.json index b0ebf8a9d..eca980a30 100644 --- a/testdata/d2compiler/TestCompile/url_link.exp.json +++ b/testdata/d2compiler/TestCompile/url_link.exp.json @@ -129,7 +129,9 @@ "value": "x" }, "style": {}, - "link": "https://google.com", + "link": { + "value": "https://google.com" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2oracle/TestDelete/arrowhead.exp.json b/testdata/d2oracle/TestDelete/arrowhead.exp.json new file mode 100644 index 000000000..eb4cd6ebb --- /dev/null +++ b/testdata/d2oracle/TestDelete/arrowhead.exp.json @@ -0,0 +1,214 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-1:0:7", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/arrowhead_label.exp.json b/testdata/d2oracle/TestDelete/arrowhead_label.exp.json new file mode 100644 index 000000000..30ff73b25 --- /dev/null +++ b/testdata/d2oracle/TestDelete/arrowhead_label.exp.json @@ -0,0 +1,280 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-3:0:46", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-2:1:45", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:8:8-2:0:44", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,1:2:12-1:33:43", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,1:2:12-1:24:34", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,1:2:12-1:18:28", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,1:19:29-1:24:34", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,1:26:36-1:33:43", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_label.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/arrowhead_map.exp.json b/testdata/d2oracle/TestDelete/arrowhead_map.exp.json new file mode 100644 index 000000000..9fab0d94b --- /dev/null +++ b/testdata/d2oracle/TestDelete/arrowhead_map.exp.json @@ -0,0 +1,214 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-1:0:7", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_map.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/arrowhead_shape.exp.json b/testdata/d2oracle/TestDelete/arrowhead_shape.exp.json new file mode 100644 index 000000000..6ad6f3824 --- /dev/null +++ b/testdata/d2oracle/TestDelete/arrowhead_shape.exp.json @@ -0,0 +1,214 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-1:0:7", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/arrowhead_shape.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/delete_icon.exp.json b/testdata/d2oracle/TestDelete/delete_icon.exp.json index 374b88cb2..66fcdfb72 100644 --- a/testdata/d2oracle/TestDelete/delete_icon.exp.json +++ b/testdata/d2oracle/TestDelete/delete_icon.exp.json @@ -209,7 +209,9 @@ "value": "x" }, "style": {}, - "link": "https://google.com", + "link": { + "value": "https://google.com" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2oracle/TestDelete/edge-only-style.exp.json b/testdata/d2oracle/TestDelete/edge-only-style.exp.json new file mode 100644 index 000000000..50846ea3b --- /dev/null +++ b/testdata/d2oracle/TestDelete/edge-only-style.exp.json @@ -0,0 +1,214 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-1:0:7", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/edge-only-style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/left.exp.json b/testdata/d2oracle/TestDelete/left.exp.json new file mode 100644 index 000000000..0be52a3ad --- /dev/null +++ b/testdata/d2oracle/TestDelete/left.exp.json @@ -0,0 +1,109 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/left.d2,0:0:0-1:0:2", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/left.d2,0:0:0-0:1:1", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/left.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/left.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/left.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/left.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/only-underscore-nested.exp.json b/testdata/d2oracle/TestDelete/only-underscore-nested.exp.json new file mode 100644 index 000000000..483e50180 --- /dev/null +++ b/testdata/d2oracle/TestDelete/only-underscore-nested.exp.json @@ -0,0 +1,255 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:0:0-4:0:22", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:0:0-2:1:19", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:0:0-0:6:6", + "value": [ + { + "string": "guitar", + "raw_string": "guitar" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:8:8-2:0:18", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,1:2:12-1:7:17", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,1:2:12-1:7:17", + "value": [ + { + "string": "books", + "raw_string": "books" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,3:0:20-3:1:21", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,3:0:20-3:1:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,3:0:20-3:1:21", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "guitar", + "id_val": "guitar", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,0:0:0-0:6:6", + "value": [ + { + "string": "guitar", + "raw_string": "guitar" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "guitar" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "books", + "id_val": "books", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,1:2:12-1:7:17", + "value": [ + { + "string": "books", + "raw_string": "books" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "books" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "a", + "id_val": "a", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,3:0:20-3:1:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore-nested.d2,3:0:20-3:1:21", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/only-underscore.exp.json b/testdata/d2oracle/TestDelete/only-underscore.exp.json new file mode 100644 index 000000000..ce90b0614 --- /dev/null +++ b/testdata/d2oracle/TestDelete/only-underscore.exp.json @@ -0,0 +1,185 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:0:0-3:0:20", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:0:0-2:1:19", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:0:0-0:6:6", + "value": [ + { + "string": "guitar", + "raw_string": "guitar" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:8:8-2:0:18", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,1:2:12-1:7:17", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,1:2:12-1:7:17", + "value": [ + { + "string": "books", + "raw_string": "books" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "guitar", + "id_val": "guitar", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,0:0:0-0:6:6", + "value": [ + { + "string": "guitar", + "raw_string": "guitar" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "guitar" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "books", + "id_val": "books", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/only-underscore.d2,1:2:12-1:7:17", + "value": [ + { + "string": "books", + "raw_string": "books" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "books" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestDelete/width.exp.json b/testdata/d2oracle/TestDelete/width.exp.json new file mode 100644 index 000000000..c1c010bcb --- /dev/null +++ b/testdata/d2oracle/TestDelete/width.exp.json @@ -0,0 +1,109 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestDelete/width.d2,0:0:0-1:0:2", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestDelete/width.d2,0:0:0-0:1:1", + "key": { + "range": "d2/testdata/d2oracle/TestDelete/width.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/width.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestDelete/width.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestDelete/width.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestMove/invalid-near.exp.json b/testdata/d2oracle/TestMove/invalid-near.exp.json new file mode 100644 index 000000000..f557d2637 --- /dev/null +++ b/testdata/d2oracle/TestMove/invalid-near.exp.json @@ -0,0 +1,4 @@ +{ + "graph": null, + "err": "failed to move: \"y\" to \"x.y\": failed to recompile:\nx: {\n near: x.y\n y\n}\n\nd2/testdata/d2oracle/TestMove/invalid-near.d2:2:9: near keys cannot be set to an descendant" +} diff --git a/testdata/d2oracle/TestMove/near.exp.json b/testdata/d2oracle/TestMove/near.exp.json index 81e71d5e4..1bb25dbb0 100644 --- a/testdata/d2oracle/TestMove/near.exp.json +++ b/testdata/d2oracle/TestMove/near.exp.json @@ -2,11 +2,11 @@ "graph": { "name": "", "ast": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,0:0:0-4:0:23", + "range": "d2/testdata/d2oracle/TestMove/near.d2,0:0:0-6:0:30", "nodes": [ { "map_key": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,0:0:0-3:1:22", + "range": "d2/testdata/d2oracle/TestMove/near.d2,0:0:0-2:1:18", "key": { "range": "d2/testdata/d2oracle/TestMove/near.d2,0:0:0-0:1:1", "path": [ @@ -26,7 +26,7 @@ "primary": {}, "value": { "map": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,0:3:3-3:0:21", + "range": "d2/testdata/d2oracle/TestMove/near.d2,0:3:3-2:0:17", "nodes": [ { "map_key": { @@ -53,23 +53,52 @@ "range": "d2/testdata/d2oracle/TestMove/near.d2,1:8:13-1:11:16", "value": [ { - "string": "x.y", - "raw_string": "x.y" + "string": "a.y", + "raw_string": "a.y" } ] } } } - }, + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/near.d2,3:0:19-5:1:29", + "key": { + "range": "d2/testdata/d2oracle/TestMove/near.d2,3:0:19-3:1:20", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/near.d2,3:0:19-3:1:20", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestMove/near.d2,3:3:22-5:0:28", + "nodes": [ { "map_key": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,2:2:19-2:3:20", + "range": "d2/testdata/d2oracle/TestMove/near.d2,4:2:26-4:3:27", "key": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,2:2:19-2:3:20", + "range": "d2/testdata/d2oracle/TestMove/near.d2,4:2:26-4:3:27", "path": [ { "unquoted_string": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,2:2:19-2:3:20", + "range": "d2/testdata/d2oracle/TestMove/near.d2,4:2:26-4:3:27", "value": [ { "string": "y", @@ -160,8 +189,8 @@ "range": ",0:0:0-0:1:1", "value": [ { - "string": "x", - "raw_string": "x" + "string": "a", + "raw_string": "a" } ] } @@ -191,6 +220,53 @@ }, "zIndex": 0 }, + { + "id": "a", + "id_val": "a", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/near.d2,3:0:19-3:1:20", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/near.d2,3:0:19-3:1:20", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, { "id": "y", "id_val": "y", @@ -201,11 +277,11 @@ "references": [ { "key": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,2:2:19-2:3:20", + "range": "d2/testdata/d2oracle/TestMove/near.d2,4:2:26-4:3:27", "path": [ { "unquoted_string": { - "range": "d2/testdata/d2oracle/TestMove/near.d2,2:2:19-2:3:20", + "range": "d2/testdata/d2oracle/TestMove/near.d2,4:2:26-4:3:27", "value": [ { "string": "y", diff --git a/testdata/d2oracle/TestMove/nested-underscore-move-out.exp.json b/testdata/d2oracle/TestMove/nested-underscore-move-out.exp.json new file mode 100644 index 000000000..79df7f9c5 --- /dev/null +++ b/testdata/d2oracle/TestMove/nested-underscore-move-out.exp.json @@ -0,0 +1,255 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:0:0-4:0:27", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:0:0-3:1:26", + "key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:0:0-0:6:6", + "value": [ + { + "string": "guitar", + "raw_string": "guitar" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:8:8-3:0:25", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,1:2:12-1:7:17", + "key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,1:2:12-1:7:17", + "value": [ + { + "string": "books", + "raw_string": "books" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,2:2:20-2:6:24", + "key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,2:2:20-2:6:24", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,2:2:20-2:6:24", + "value": [ + { + "string": "pipe", + "raw_string": "pipe" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "guitar", + "id_val": "guitar", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,0:0:0-0:6:6", + "value": [ + { + "string": "guitar", + "raw_string": "guitar" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "guitar" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "books", + "id_val": "books", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,1:2:12-1:7:17", + "value": [ + { + "string": "books", + "raw_string": "books" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "books" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "pipe", + "id_val": "pipe", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,2:2:20-2:6:24", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/nested-underscore-move-out.d2,2:2:20-2:6:24", + "value": [ + { + "string": "pipe", + "raw_string": "pipe" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "pipe" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestMove/out_of_newline_container.exp.json b/testdata/d2oracle/TestMove/out_of_newline_container.exp.json new file mode 100644 index 000000000..53bcddb77 --- /dev/null +++ b/testdata/d2oracle/TestMove/out_of_newline_container.exp.json @@ -0,0 +1,179 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,0:0:0-2:0:8", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,0:0:0-0:5:5", + "key": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,0:0:0-0:5:5", + "path": [ + { + "double_quoted_string": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,0:0:0-0:5:5", + "value": [ + { + "string": "a\n", + "raw_string": "a\\n" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,1:0:6-1:1:7", + "key": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,1:0:6-1:1:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,1:0:6-1:1:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "\"a\\n\"", + "id_val": "a\n", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,0:0:0-0:5:5", + "path": [ + { + "double_quoted_string": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,0:0:0-0:5:5", + "value": [ + { + "string": "a\n", + "raw_string": "a\\n" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "a\n" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "b", + "id_val": "b", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,1:0:6-1:1:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/out_of_newline_container.d2,1:0:6-1:1:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "b" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestMove/underscore-connection.exp.json b/testdata/d2oracle/TestMove/underscore-connection.exp.json new file mode 100644 index 000000000..46568d214 --- /dev/null +++ b/testdata/d2oracle/TestMove/underscore-connection.exp.json @@ -0,0 +1,624 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:0:0-8:0:40", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:0:0-2:1:23", + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:3:3-2:0:22", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:16:21", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:16:21", + "src": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:8:13", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:3:8", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:4:9-1:5:10", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:6:11-1:7:12", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:10:15-1:16:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:11:16-1:12:17", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:13:18-1:14:19", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:15:20-1:16:21", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,4:0:25-7:1:39", + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,4:0:25-4:1:26", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,4:0:25-4:1:26", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,4:3:28-7:0:38", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,5:2:32-5:3:33", + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,5:2:32-5:3:33", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,5:2:32-5:3:33", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,6:2:36-6:3:37", + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,6:2:36-6:3:37", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,6:2:36-6:3:37", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "a", + "id_val": "a", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "a" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "c", + "id_val": "c", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:8:13", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:3:8", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:4:9-1:5:10", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:6:11-1:7:12", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "key_path_index": 1, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:10:15-1:16:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:11:16-1:12:17", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:13:18-1:14:19", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:15:20-1:16:21", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 1, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,4:0:25-4:1:26", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,4:0:25-4:1:26", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "c" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "d", + "id_val": "d", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:8:13", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:2:7-1:3:8", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:4:9-1:5:10", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:6:11-1:7:12", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "key_path_index": 2, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,5:2:32-5:3:33", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,5:2:32-5:3:33", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "d" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "b", + "id_val": "b", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:10:15-1:16:21", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:11:16-1:12:17", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:13:18-1:14:19", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,1:15:20-1:16:21", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 2, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,6:2:36-6:3:37", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestMove/underscore-connection.d2,6:2:36-6:3:37", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "b" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.exp.json b/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.exp.json new file mode 100644 index 000000000..36c828de4 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.exp.json @@ -0,0 +1,499 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-2:0:55", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-0:11:11", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-0:7:7", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:4:4-0:11:11", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:9:9-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:10:10-0:11:11", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:0:12-1:42:54", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:1:13-1:7:19", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:1:13-1:3:15", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:1:13-1:2:14", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:5:17-1:7:19", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:6:18-1:7:19", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:8:20-1:11:23", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:12:24-1:34:46", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:12:24-1:28:40", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:29:41-1:34:46", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:36:48-1:42:54", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "circle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + }, + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 1 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:1:13-1:3:15", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:1:13-1:2:14", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 1 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:5:17-1:7:19", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,1:6:18-1:7:19", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "z", + "id_val": "z", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:9:9-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_flat_merge_arrowhead.d2,0:10:10-0:11:11", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 1 + } + ], + "attributes": { + "label": { + "value": "z" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_index_merge_style.exp.json b/testdata/d2oracle/TestSet/edge_index_merge_style.exp.json new file mode 100644 index 000000000..d8dcf3782 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_index_merge_style.exp.json @@ -0,0 +1,483 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-2:0:43", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-0:11:11", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-0:7:7", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:4:4-0:11:11", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:9:9-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:10:10-0:11:11", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:0:12-1:30:42", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:1:13-1:7:19", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:1:13-1:3:15", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:1:13-1:2:14", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:5:17-1:7:19", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:6:18-1:7:19", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:8:20-1:11:23", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:12:24-1:25:37", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:12:24-1:17:29", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:18:30-1:25:37", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:27:39-1:30:42", + "raw": "0.5", + "value": "1/2" + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + }, + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": { + "opacity": { + "value": "0.5" + } + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 1 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:1:13-1:3:15", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:1:13-1:2:14", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:4:4-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 1 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:5:17-1:7:19", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,1:6:18-1:7:19", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "z", + "id_val": "z", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:9:9-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_index_merge_style.d2,0:10:10-0:11:11", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 1 + } + ], + "attributes": { + "label": { + "value": "z" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_merge_arrowhead.exp.json b/testdata/d2oracle/TestSet/edge_merge_arrowhead.exp.json new file mode 100644 index 000000000..5ab8b6250 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_merge_arrowhead.exp.json @@ -0,0 +1,327 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-6:0:70", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-5:1:69", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:8:8-5:0:68", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,1:2:12-4:3:67", + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,1:2:12-1:18:28", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,1:2:12-1:18:28", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,1:20:30-4:2:66", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,2:4:36-2:12:44", + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,2:4:36-2:9:41", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,2:4:36-2:9:41", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,2:11:43-2:12:44", + "raw": "1", + "value": "1" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,3:4:49-3:18:63", + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,3:4:49-3:9:54", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,3:4:49-3:9:54", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,3:11:56-3:18:63", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "1" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_merge_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_replace_arrowhead.exp.json b/testdata/d2oracle/TestSet/edge_replace_arrowhead.exp.json new file mode 100644 index 000000000..2099babb4 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_replace_arrowhead.exp.json @@ -0,0 +1,280 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-1:0:42", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-0:41:41", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:8:8-0:40:40", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:9:9-0:40:40", + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:9:9-0:31:31", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:9:9-0:25:25", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:26:26-0:31:31", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:33:33-0:40:40", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.exp.json b/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.exp.json new file mode 100644 index 000000000..17bc34333 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.exp.json @@ -0,0 +1,361 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-2:0:51", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:0:7-1:43:50", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:1:8-1:7:14", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:1:8-1:3:10", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:1:8-1:2:9", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:5:12-1:7:14", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:6:13-1:7:14", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:8:15-1:11:18", + "int": 0, + "glob": false + }, + "edge_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:12:19-1:34:41", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:12:19-1:28:35", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:29:36-1:34:41", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:36:43-1:43:50", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + }, + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:1:8-1:3:10", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:1:8-1:2:9", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:5:12-1:7:14", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_arrowhead_indexed.d2,1:6:13-1:7:14", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_replace_style.exp.json b/testdata/d2oracle/TestSet/edge_replace_style.exp.json new file mode 100644 index 000000000..f15dc4109 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_replace_style.exp.json @@ -0,0 +1,280 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-1:0:42", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-0:41:41", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:8:8-0:40:40", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:9:9-0:40:40", + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:9:9-0:31:31", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:9:9-0:25:25", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:26:26-0:31:31", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:33:33-0:40:40", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_replace_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/edge_set_arrowhead.exp.json b/testdata/d2oracle/TestSet/edge_set_arrowhead.exp.json new file mode 100644 index 000000000..0c3855cc9 --- /dev/null +++ b/testdata/d2oracle/TestSet/edge_set_arrowhead.exp.json @@ -0,0 +1,280 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-1:0:42", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-0:41:41", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:8:8-0:40:40", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:9:9-0:40:40", + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:9:9-0:31:31", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:9:9-0:25:25", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:26:26-0:31:31", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:33:33-0:40:40", + "value": [ + { + "string": "diamond", + "raw_string": "diamond" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "diamond" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/edge_set_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_arrowhead.exp.json b/testdata/d2oracle/TestSet/replace_arrowhead.exp.json new file mode 100644 index 000000000..dcc2c7bdc --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_arrowhead.exp.json @@ -0,0 +1,280 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-3:0:45", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-2:1:44", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:8:8-2:0:43", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,1:2:12-1:32:42", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,1:2:12-1:24:34", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,1:2:12-1:18:28", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,1:19:29-1:24:34", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,1:26:36-1:32:42", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "circle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_arrowhead_map.exp.json b/testdata/d2oracle/TestSet/replace_arrowhead_map.exp.json new file mode 100644 index 000000000..dcabb24e7 --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_arrowhead_map.exp.json @@ -0,0 +1,298 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-5:0:56", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-4:1:55", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:8:8-4:0:54", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,1:2:12-3:3:53", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,1:2:12-1:18:28", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,1:2:12-1:18:28", + "value": [ + { + "string": "target-arrowhead", + "raw_string": "target-arrowhead" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,1:20:30-3:2:52", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,2:4:36-2:17:49", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,2:4:36-2:9:41", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,2:4:36-2:9:41", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,2:11:43-2:17:49", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "dstArrowhead": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "circle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_arrowhead_map.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_dimensions.exp.json b/testdata/d2oracle/TestSet/replace_dimensions.exp.json new file mode 100644 index 000000000..cfb65d1c3 --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_dimensions.exp.json @@ -0,0 +1,147 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:0:0-3:0:25", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:0:0-2:1:24", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:8:8-2:0:23", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,1:2:12-1:12:22", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,1:2:12-1:7:17", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,1:9:19-1:12:22", + "raw": "200", + "value": "200" + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_dimensions.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "width": { + "value": "200" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_edge_style.exp.json b/testdata/d2oracle/TestSet/replace_edge_style.exp.json new file mode 100644 index 000000000..0b015d938 --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_edge_style.exp.json @@ -0,0 +1,307 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-4:0:59", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-3:1:58", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:8:8-3:0:57", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,1:2:12-1:23:33", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,1:2:12-1:20:30", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,1:2:12-1:7:17", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,1:8:18-1:20:30", + "value": [ + { + "string": "stroke-width", + "raw_string": "stroke-width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,1:22:32-1:23:33", + "raw": "1", + "value": "1" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,2:2:36-2:22:56", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,2:2:36-2:19:53", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,2:2:36-2:7:41", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,2:8:42-2:19:53", + "value": [ + { + "string": "stroke-dash", + "raw_string": "stroke-dash" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,2:21:55-2:22:56", + "raw": "3", + "value": "3" + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": { + "strokeWidth": { + "value": "1" + }, + "strokeDash": { + "value": "3" + } + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_edge_style_map.exp.json b/testdata/d2oracle/TestSet/replace_edge_style_map.exp.json new file mode 100644 index 000000000..5bacdac19 --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_edge_style_map.exp.json @@ -0,0 +1,282 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-5:0:46", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-4:1:45", + "edges": [ + { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-0:6:6", + "src": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:8:8-4:0:44", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,1:2:12-3:3:43", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,1:2:12-1:7:17", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,1:9:19-3:2:42", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,2:4:25-2:18:39", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,2:4:25-2:15:36", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,2:4:25-2:15:36", + "value": [ + { + "string": "stroke-dash", + "raw_string": "stroke-dash" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,2:17:38-2:18:39", + "raw": "4", + "value": "4" + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": { + "strokeDash": { + "value": "4" + } + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "y", + "id_val": "y", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:4:4-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_edge_style_map.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_link.exp.json b/testdata/d2oracle/TestSet/replace_link.exp.json new file mode 100644 index 000000000..a6ad42efe --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_link.exp.json @@ -0,0 +1,151 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:0:0-3:0:38", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:0:0-2:1:37", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:8:8-2:0:36", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,1:2:12-1:25:35", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,1:2:12-1:6:16", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,1:2:12-1:6:16", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,1:8:18-1:25:35", + "value": [ + { + "string": "https://apple.com", + "raw_string": "https://apple.com" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_link.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "link": { + "value": "https://apple.com" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_position.exp.json b/testdata/d2oracle/TestSet/replace_position.exp.json new file mode 100644 index 000000000..8a0cfec54 --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_position.exp.json @@ -0,0 +1,211 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:0:0-5:0:47", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:0:0-4:1:46", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:8:8-4:0:45", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,1:2:12-1:12:22", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,1:2:12-1:7:17", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,1:2:12-1:7:17", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,1:9:19-1:12:22", + "raw": "100", + "value": "100" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,2:2:25-2:10:33", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,2:2:25-2:5:28", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,2:2:25-2:5:28", + "value": [ + { + "string": "top", + "raw_string": "top" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,2:7:30-2:10:33", + "raw": "200", + "value": "200" + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,3:2:36-3:10:44", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,3:2:36-3:6:40", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,3:2:36-3:6:40", + "value": [ + { + "string": "left", + "raw_string": "left" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,3:8:42-3:10:44", + "raw": "44", + "value": "44" + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_position.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "width": { + "value": "100" + }, + "top": { + "value": "200" + }, + "left": { + "value": "44" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/replace_tooltip.exp.json b/testdata/d2oracle/TestSet/replace_tooltip.exp.json new file mode 100644 index 000000000..7aab2f7e2 --- /dev/null +++ b/testdata/d2oracle/TestSet/replace_tooltip.exp.json @@ -0,0 +1,151 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:0:0-3:0:25", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:0:0-2:1:24", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:8:8-2:0:23", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,1:2:12-1:12:22", + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,1:2:12-1:9:19", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,1:2:12-1:9:19", + "value": [ + { + "string": "tooltip", + "raw_string": "tooltip" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,1:11:21-1:12:22", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/replace_tooltip.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "tooltip": { + "value": "y" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/set_dimensions.exp.json b/testdata/d2oracle/TestSet/set_dimensions.exp.json new file mode 100644 index 000000000..073461ca1 --- /dev/null +++ b/testdata/d2oracle/TestSet/set_dimensions.exp.json @@ -0,0 +1,147 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:0:0-1:0:21", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:0:0-0:20:20", + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:8:8-0:19:19", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:9:9-0:19:19", + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:9:9-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:9:9-0:14:14", + "value": [ + { + "string": "width", + "raw_string": "width" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:16:16-0:19:19", + "raw": "200", + "value": "200" + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_dimensions.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "width": { + "value": "200" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/set_position.exp.json b/testdata/d2oracle/TestSet/set_position.exp.json new file mode 100644 index 000000000..321da083b --- /dev/null +++ b/testdata/d2oracle/TestSet/set_position.exp.json @@ -0,0 +1,147 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:0:0-1:0:19", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:0:0-0:18:18", + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:8:8-0:17:17", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:9:9-0:17:17", + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:9:9-0:12:12", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:9:9-0:12:12", + "value": [ + { + "string": "top", + "raw_string": "top" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:14:14-0:17:17", + "raw": "200", + "value": "200" + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_position.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "top": { + "value": "200" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/testdata/d2oracle/TestSet/set_tooltip.exp.json b/testdata/d2oracle/TestSet/set_tooltip.exp.json new file mode 100644 index 000000000..15cd02ebd --- /dev/null +++ b/testdata/d2oracle/TestSet/set_tooltip.exp.json @@ -0,0 +1,151 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:0:0-1:0:21", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:0:0-0:20:20", + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:8:8-0:19:19", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:9:9-0:19:19", + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:9:9-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:9:9-0:16:16", + "value": [ + { + "string": "tooltip", + "raw_string": "tooltip" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:18:18-0:19:19", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "square", + "id_val": "square", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2oracle/TestSet/set_tooltip.d2,0:0:0-0:6:6", + "value": [ + { + "string": "square", + "raw_string": "square" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "square" + }, + "style": {}, + "tooltip": { + "value": "y" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": "" +} diff --git a/watch.go b/watch.go index 72d19fdb2..44eaa453f 100644 --- a/watch.go +++ b/watch.go @@ -367,8 +367,6 @@ func (w *watcher) compileLoop(ctx context.Context) error { } errs = err.Error() w.ms.Log.Error.Print(errs) - } else { - w.ms.Log.Success.Printf("successfully %scompiled %v to %v", recompiledPrefix, w.inputPath, w.outputPath) } w.broadcast(&compileResult{ SVG: string(svg),