diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index b99feeaea..e7803a445 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,6 +1,7 @@ #### Features ๐Ÿš€ - `style.underline` works on connections [#1836](https://github.com/terrastruct/d2/pull/1836) +- `none` is added as an accepted value for `fill-pattern`. Previously there was no way to cancel the `fill-pattern` on select objects set by a theme that applies it (Origami) [#1882](https://github.com/terrastruct/d2/pull/1882) #### Improvements ๐Ÿงน diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index b43dec1e1..bd2f9530d 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -259,7 +259,7 @@ containers: { } } `, - expErr: `d2/testdata/d2compiler/TestCompile/invalid-fill-pattern.d2:3:19: expected "fill-pattern" to be one of: dots, lines, grain, paper`, + expErr: `d2/testdata/d2compiler/TestCompile/invalid-fill-pattern.d2:3:19: expected "fill-pattern" to be one of: none, dots, lines, grain, paper`, }, { name: "shape_unquoted_hex", diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 31aaf1a03..39394035a 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -1816,6 +1816,7 @@ var LabelPositionsMapping = map[string]label.Position{ } var FillPatterns = []string{ + "none", "dots", "lines", "grain", diff --git a/d2oracle/edit.go b/d2oracle/edit.go index 01a4ca968..9404848a8 100644 --- a/d2oracle/edit.go +++ b/d2oracle/edit.go @@ -20,7 +20,6 @@ import ( "oss.terrastruct.com/d2/d2ir" "oss.terrastruct.com/d2/d2parser" "oss.terrastruct.com/d2/d2target" - "oss.terrastruct.com/d2/d2themes/d2themescatalog" ) type OutsideScopeError struct{} @@ -1297,20 +1296,9 @@ func deleteReserved(g *d2graph.Graph, boardPath []string, baseAST *d2ast.Map, mk if err != nil { return nil, err } - if !deleted { - if imported { - mk.Value = d2ast.MakeValueBox(&d2ast.Null{}) - appendMapKey(baseAST, mk) - } else { - switch id { - // Special cases where a value is set by theme, so is not found as a field - case "fill-pattern": - if g.Theme != nil && g.Theme.ID == d2themescatalog.Origami.ID { - mk.Value = d2ast.MakeValueBox(&d2ast.Null{}) - appendMapKey(baseAST, mk) - } - } - } + if !deleted && imported { + mk.Value = d2ast.MakeValueBox(&d2ast.Null{}) + appendMapKey(baseAST, mk) } continue } diff --git a/d2oracle/edit_test.go b/d2oracle/edit_test.go index c41fa266d..3bb567b13 100644 --- a/d2oracle/edit_test.go +++ b/d2oracle/edit_test.go @@ -18,8 +18,6 @@ import ( "oss.terrastruct.com/d2/d2graph" "oss.terrastruct.com/d2/d2oracle" "oss.terrastruct.com/d2/d2target" - "oss.terrastruct.com/d2/d2themes" - "oss.terrastruct.com/d2/d2themes/d2themescatalog" ) // TODO: make assertions less specific @@ -5697,7 +5695,6 @@ func TestDelete(t *testing.T) { testCases := []struct { name string boardPath []string - theme *d2themes.Theme text string fsTexts map[string]string @@ -7691,7 +7688,6 @@ layers: { } } `, - theme: &d2themescatalog.Origami, boardPath: []string{"x"}, key: `a.style.fill`, exp: `layers: { @@ -7699,44 +7695,6 @@ layers: { a } } -`, - }, - { - name: "delete-theme-set/1", - - text: `layers: { - x: { - a - } -} -`, - theme: &d2themescatalog.Origami, - boardPath: []string{"x"}, - key: `a.style.fill-pattern`, - exp: `layers: { - x: { - a - a.style.fill-pattern: null - } -} -`, - }, - { - name: "delete-theme-set/2", - - text: `layers: { - x: { - a - } -} -`, - boardPath: []string{"x"}, - key: `a.style.fill-pattern`, - exp: `layers: { - x: { - a - } -} `, }, } @@ -7749,7 +7707,6 @@ layers: { et := editTest{ text: tc.text, fsTexts: tc.fsTexts, - theme: tc.theme, testFunc: func(g *d2graph.Graph) (*d2graph.Graph, error) { return d2oracle.Delete(g, tc.boardPath, tc.key) }, @@ -7765,7 +7722,6 @@ layers: { type editTest struct { text string - theme *d2themes.Theme fsTexts map[string]string testFunc func(*d2graph.Graph) (*d2graph.Graph, error) @@ -7793,11 +7749,6 @@ func (tc editTest) run(t *testing.T) { }) assert.Success(t, err) - if tc.theme != nil { - err := g.ApplyTheme(tc.theme.ID) - assert.Success(t, err) - } - g, err = tc.testFunc(g) if tc.expErr != "" { if err == nil { diff --git a/d2themes/element.go b/d2themes/element.go index 2bc52c57e..4cc6d9695 100644 --- a/d2themes/element.go +++ b/d2themes/element.go @@ -215,7 +215,7 @@ func (el *ThemableElement) Render() string { } out += " />" - if el.FillPattern != "" { + if el.FillPattern != "" && el.FillPattern != "none" { patternEl := el.Copy() patternEl.Fill = "" patternEl.Stroke = "" diff --git a/e2etests/testdata/txtar.txt b/e2etests/testdata/txtar.txt index cdcdb0557..8982b8da7 100644 --- a/e2etests/testdata/txtar.txt +++ b/e2etests/testdata/txtar.txt @@ -170,3 +170,14 @@ costumes.monster -> monsters.id a -> b: hi { style.underline: true } + +-- none-fill -- + +vars: { + d2-config: { + # Origami theme code + theme-id: 302 + } +} +a.style.fill-pattern: none +b diff --git a/e2etests/testdata/txtar/none-fill/dagre/board.exp.json b/e2etests/testdata/txtar/none-fill/dagre/board.exp.json new file mode 100644 index 000000000..af4ed577d --- /dev/null +++ b/e2etests/testdata/txtar/none-fill/dagre/board.exp.json @@ -0,0 +1,140 @@ +{ + "name": "", + "config": { + "sketch": null, + "themeID": 302, + "darkThemeID": null, + "pad": null, + "center": null, + "layoutEngine": null + }, + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 0, + "y": 0 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "fillPattern": "none", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 113, + "y": 0 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "fillPattern": "paper", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/txtar/none-fill/dagre/sketch.exp.svg b/e2etests/testdata/txtar/none-fill/dagre/sketch.exp.svg new file mode 100644 index 000000000..a1f528ef1 --- /dev/null +++ b/e2etests/testdata/txtar/none-fill/dagre/sketch.exp.svg @@ -0,0 +1,1160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ab + + + + \ No newline at end of file diff --git a/e2etests/testdata/txtar/none-fill/elk/board.exp.json b/e2etests/testdata/txtar/none-fill/elk/board.exp.json new file mode 100644 index 000000000..444981e85 --- /dev/null +++ b/e2etests/testdata/txtar/none-fill/elk/board.exp.json @@ -0,0 +1,140 @@ +{ + "name": "", + "config": { + "sketch": null, + "themeID": 302, + "darkThemeID": null, + "pad": null, + "center": null, + "layoutEngine": null + }, + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "fillPattern": "none", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 85, + "y": 12 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "fillPattern": "paper", + "stroke": "B1", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/txtar/none-fill/elk/sketch.exp.svg b/e2etests/testdata/txtar/none-fill/elk/sketch.exp.svg new file mode 100644 index 000000000..3eeaac7f5 --- /dev/null +++ b/e2etests/testdata/txtar/none-fill/elk/sketch.exp.svg @@ -0,0 +1,1160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ab + + + + \ No newline at end of file diff --git a/testdata/d2compiler/TestCompile/invalid-fill-pattern.exp.json b/testdata/d2compiler/TestCompile/invalid-fill-pattern.exp.json index 3d31630e8..11cdc33e5 100644 --- a/testdata/d2compiler/TestCompile/invalid-fill-pattern.exp.json +++ b/testdata/d2compiler/TestCompile/invalid-fill-pattern.exp.json @@ -4,7 +4,7 @@ "errs": [ { "range": "d2/testdata/d2compiler/TestCompile/invalid-fill-pattern.d2,2:18:33-2:23:38", - "errmsg": "d2/testdata/d2compiler/TestCompile/invalid-fill-pattern.d2:3:19: expected \"fill-pattern\" to be one of: dots, lines, grain, paper" + "errmsg": "d2/testdata/d2compiler/TestCompile/invalid-fill-pattern.d2:3:19: expected \"fill-pattern\" to be one of: none, dots, lines, grain, paper" } ] } diff --git a/testdata/d2oracle/TestDelete/delete-theme-set.exp.json b/testdata/d2oracle/TestDelete/delete-theme-set.exp.json deleted file mode 100644 index c8472b8cd..000000000 --- a/testdata/d2oracle/TestDelete/delete-theme-set.exp.json +++ /dev/null @@ -1,318 +0,0 @@ -{ - "graph": { - "name": "", - "isFolderOnly": true, - "ast": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,0:0:0-6:0:60", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,0:0:0-5:1:59", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,0:0:0-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,0:8:8-5:1:59", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,1:2:12-4:3:57", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,1:2:12-1:3:13", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,1:2:12-1:3:13", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,1:5:15-4:3:57", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,2:4:21-2:5:22", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,2:4:21-2:5:22", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,2:4:21-2:5:22", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": {} - } - }, - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:4:27-3:30:53", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:4:27-3:24:47", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:4:27-3:5:28", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:6:29-3:11:34", - "value": [ - { - "string": "style", - "raw_string": "style" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:12:35-3:24:47", - "value": [ - { - "string": "fill-pattern", - "raw_string": "fill-pattern" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "null": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:26:49-3:30:53" - } - } - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": null, - "objects": null, - "layers": [ - { - "name": "x", - "isFolderOnly": false, - "ast": { - "range": ",1:0:0-2:0:0", - "nodes": [ - { - "map_key": { - "range": ",0:0:0-0:0:0", - "key": { - "range": ",0:0:0-0:0:0", - "path": [ - { - "unquoted_string": { - "range": ",0:0:0-0:0:0", - "value": [ - { - "string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": ",1:0:0-2:0:0", - "nodes": null - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": null, - "objects": [ - { - "id": "a", - "id_val": "a", - "references": [ - { - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,2:4:21-2:5:22", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,2:4:21-2:5:22", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - }, - { - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:4:27-3:24:47", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:4:27-3:5:28", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:6:29-3:11:34", - "value": [ - { - "string": "style", - "raw_string": "style" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set.d2,3:12:35-3:24:47", - "value": [ - { - "string": "fill-pattern", - "raw_string": "fill-pattern" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "a" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - } - ] - } - ] - }, - "err": "" -} diff --git a/testdata/d2oracle/TestDelete/delete-theme-set/1.exp.json b/testdata/d2oracle/TestDelete/delete-theme-set/1.exp.json deleted file mode 100644 index 3213a0800..000000000 --- a/testdata/d2oracle/TestDelete/delete-theme-set/1.exp.json +++ /dev/null @@ -1,318 +0,0 @@ -{ - "graph": { - "name": "", - "isFolderOnly": true, - "ast": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,0:0:0-6:0:60", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,0:0:0-5:1:59", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,0:0:0-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,0:8:8-5:1:59", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,1:2:12-4:3:57", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,1:2:12-1:3:13", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,1:2:12-1:3:13", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,1:5:15-4:3:57", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,2:4:21-2:5:22", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,2:4:21-2:5:22", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,2:4:21-2:5:22", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": {} - } - }, - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:4:27-3:30:53", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:4:27-3:24:47", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:4:27-3:5:28", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:6:29-3:11:34", - "value": [ - { - "string": "style", - "raw_string": "style" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:12:35-3:24:47", - "value": [ - { - "string": "fill-pattern", - "raw_string": "fill-pattern" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "null": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:26:49-3:30:53" - } - } - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": null, - "objects": null, - "layers": [ - { - "name": "x", - "isFolderOnly": false, - "ast": { - "range": ",1:0:0-2:0:0", - "nodes": [ - { - "map_key": { - "range": ",0:0:0-0:0:0", - "key": { - "range": ",0:0:0-0:0:0", - "path": [ - { - "unquoted_string": { - "range": ",0:0:0-0:0:0", - "value": [ - { - "string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": ",1:0:0-2:0:0", - "nodes": null - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": null, - "objects": [ - { - "id": "a", - "id_val": "a", - "references": [ - { - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,2:4:21-2:5:22", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,2:4:21-2:5:22", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - }, - { - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:4:27-3:24:47", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:4:27-3:5:28", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:6:29-3:11:34", - "value": [ - { - "string": "style", - "raw_string": "style" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/1.d2,3:12:35-3:24:47", - "value": [ - { - "string": "fill-pattern", - "raw_string": "fill-pattern" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "a" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - } - ] - } - ] - }, - "err": "" -} diff --git a/testdata/d2oracle/TestDelete/delete-theme-set/2.exp.json b/testdata/d2oracle/TestDelete/delete-theme-set/2.exp.json deleted file mode 100644 index 9792a747c..000000000 --- a/testdata/d2oracle/TestDelete/delete-theme-set/2.exp.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "graph": { - "name": "", - "isFolderOnly": true, - "ast": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,0:0:0-5:0:29", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,0:0:0-4:1:28", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,0:0:0-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,0:8:8-4:1:28", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,1:2:12-3:3:26", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,1:2:12-1:3:13", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,1:2:12-1:3:13", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,1:5:15-3:3:26", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,2:4:21-2:5:22", - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,2:4:21-2:5:22", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,2:4:21-2:5:22", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": {} - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": null, - "objects": null, - "layers": [ - { - "name": "x", - "isFolderOnly": false, - "ast": { - "range": ",1:0:0-2:0:0", - "nodes": [ - { - "map_key": { - "range": ",0:0:0-0:0:0", - "key": { - "range": ",0:0:0-0:0:0", - "path": [ - { - "unquoted_string": { - "range": ",0:0:0-0:0:0", - "value": [ - { - "string": "a" - } - ] - } - } - ] - }, - "primary": {}, - "value": {} - } - } - ] - }, - "root": { - "id": "", - "id_val": "", - "attributes": { - "label": { - "value": "" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - }, - "edges": null, - "objects": [ - { - "id": "a", - "id_val": "a", - "references": [ - { - "key": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,2:4:21-2:5:22", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2oracle/TestDelete/delete-theme-set/2.d2,2:4:21-2:5:22", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "a" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - } - ] - } - ] - }, - "err": "" -}