diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md
index d3d05ccab..e71dbb04e 100644
--- a/ci/release/changelogs/next.md
+++ b/ci/release/changelogs/next.md
@@ -15,6 +15,7 @@
- All font styles in sketch mode use a consistent font-family [#1463](https://github.com/terrastruct/d2/pull/1463)
- Tooltip and link icons are now positioned on shape border [#1466](https://github.com/terrastruct/d2/pull/1466)
- Tooltip and link icons are always rendered over shapes [#1467](https://github.com/terrastruct/d2/pull/1467)
+- Boards with no objects are considered folders [#1504](https://github.com/terrastruct/d2/pull/1504)
#### Bugfixes ⛑️
diff --git a/d2compiler/compile.go b/d2compiler/compile.go
index 486e886b1..7c9e60ccc 100644
--- a/d2compiler/compile.go
+++ b/d2compiler/compile.go
@@ -92,6 +92,9 @@ func (c *compiler) compileBoard(g *d2graph.Graph, ir *d2ir.Map) *d2graph.Graph {
g.IsFolderOnly = true
}
}
+ if len(g.Objects) == 0 {
+ g.IsFolderOnly = true
+ }
return g
}
diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go
index 959defbf2..a713c3622 100644
--- a/d2compiler/compile_test.go
+++ b/d2compiler/compile_test.go
@@ -2832,6 +2832,21 @@ layers: {
assert.False(t, g.Layers[1].Scenarios[1].IsFolderOnly)
},
},
+ {
+ name: "isFolderOnly-shapes",
+ run: func(t *testing.T) {
+ g, _ := assertCompile(t, `
+direction: right
+
+steps: {
+ 1: {
+ RJ
+ }
+}
+`, "")
+ assert.True(t, g.IsFolderOnly)
+ },
+ },
{
name: "scenarios_edge_index",
run: func(t *testing.T) {
diff --git a/e2etests-cli/main_test.go b/e2etests-cli/main_test.go
index 5f036cd61..d955e351f 100644
--- a/e2etests-cli/main_test.go
+++ b/e2etests-cli/main_test.go
@@ -74,8 +74,6 @@ func TestCLI_E2E(t *testing.T) {
writeFile(t, dir, "empty-layer.d2", `layers: { x: {} }`)
err := runTestMain(t, ctx, dir, env, "empty-layer.d2")
assert.Success(t, err)
-
- assert.TestdataDir(t, filepath.Join(dir, "empty-layer"))
},
},
{
diff --git a/e2etests/testdata/sanity/empty/dagre/board.exp.json b/e2etests/testdata/sanity/empty/dagre/board.exp.json
index 193d4edf8..8c31d7ff3 100644
--- a/e2etests/testdata/sanity/empty/dagre/board.exp.json
+++ b/e2etests/testdata/sanity/empty/dagre/board.exp.json
@@ -1,6 +1,6 @@
{
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"fontFamily": "SourceSansPro",
"shapes": [],
"connections": [],
diff --git a/e2etests/testdata/sanity/empty/dagre/sketch.exp.svg b/e2etests/testdata/sanity/empty/dagre/sketch.exp.svg
index 34a4045c9..19d8c4fc6 100644
--- a/e2etests/testdata/sanity/empty/dagre/sketch.exp.svg
+++ b/e2etests/testdata/sanity/empty/dagre/sketch.exp.svg
@@ -1,4 +1,4 @@
-
\ No newline at end of file
+ .d2-121760133 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>
\ No newline at end of file
diff --git a/e2etests/testdata/sanity/empty/elk/board.exp.json b/e2etests/testdata/sanity/empty/elk/board.exp.json
index 193d4edf8..8c31d7ff3 100644
--- a/e2etests/testdata/sanity/empty/elk/board.exp.json
+++ b/e2etests/testdata/sanity/empty/elk/board.exp.json
@@ -1,6 +1,6 @@
{
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"fontFamily": "SourceSansPro",
"shapes": [],
"connections": [],
diff --git a/e2etests/testdata/sanity/empty/elk/sketch.exp.svg b/e2etests/testdata/sanity/empty/elk/sketch.exp.svg
index 34a4045c9..19d8c4fc6 100644
--- a/e2etests/testdata/sanity/empty/elk/sketch.exp.svg
+++ b/e2etests/testdata/sanity/empty/elk/sketch.exp.svg
@@ -1,4 +1,4 @@
-
-
-
-
\ No newline at end of file
+ .d2-121760133 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>
\ No newline at end of file
diff --git a/e2etests/testdata/stable/complex-layers/dagre/board.exp.json b/e2etests/testdata/stable/complex-layers/dagre/board.exp.json
index 67a45d48e..3f1c76ab7 100644
--- a/e2etests/testdata/stable/complex-layers/dagre/board.exp.json
+++ b/e2etests/testdata/stable/complex-layers/dagre/board.exp.json
@@ -602,7 +602,7 @@
},
{
"name": "repair",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"fontFamily": "SourceSansPro",
"shapes": [],
"connections": [],
diff --git a/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg b/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg
index 0474a0e98..b190f7fe8 100644
--- a/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg
+++ b/e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg
@@ -100,132 +100,119 @@
0%, 0.000000% {
opacity: 0;
}
- 0.000000%, 9.990000% {
+ 0.000000%, 11.100000% {
opacity: 1;
}
- 10.000000%, 100% {
+ 11.111111%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-1 {
- 0%, 9.990000% {
+ 0%, 11.100000% {
opacity: 0;
}
- 10.000000%, 19.990000% {
+ 11.111111%, 22.211111% {
opacity: 1;
}
- 20.000000%, 100% {
+ 22.222222%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-2 {
- 0%, 19.990000% {
+ 0%, 22.211111% {
opacity: 0;
}
- 20.000000%, 29.990000% {
+ 22.222222%, 33.322222% {
opacity: 1;
}
- 30.000000%, 100% {
+ 33.333333%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-3 {
- 0%, 29.990000% {
+ 0%, 33.322222% {
opacity: 0;
}
- 30.000000%, 39.990000% {
+ 33.333333%, 44.433333% {
opacity: 1;
}
- 40.000000%, 100% {
+ 44.444444%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-4 {
- 0%, 39.990000% {
+ 0%, 44.433333% {
opacity: 0;
}
- 40.000000%, 49.990000% {
+ 44.444444%, 55.544444% {
opacity: 1;
}
- 50.000000%, 100% {
+ 55.555556%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-5 {
- 0%, 49.990000% {
+ 0%, 55.544444% {
opacity: 0;
}
- 50.000000%, 59.990000% {
+ 55.555556%, 66.655556% {
opacity: 1;
}
- 60.000000%, 100% {
+ 66.666667%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-6 {
- 0%, 59.990000% {
+ 0%, 66.655556% {
opacity: 0;
}
- 60.000000%, 69.990000% {
+ 66.666667%, 77.766667% {
opacity: 1;
}
- 70.000000%, 100% {
+ 77.777778%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-7 {
- 0%, 69.990000% {
+ 0%, 77.766667% {
opacity: 0;
}
- 70.000000%, 79.990000% {
+ 77.777778%, 88.877778% {
opacity: 1;
}
- 80.000000%, 100% {
+ 88.888889%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-393299205-8 {
- 0%, 79.990000% {
+ 0%, 88.877778% {
opacity: 0;
}
- 80.000000%, 89.990000% {
+ 88.888889%, 100.000000% {
opacity: 1;
}
- 90.000000%, 100% {
- opacity: 0;
- }
-}@keyframes d2Transition-d2-393299205-9 {
- 0%, 89.990000% {
- opacity: 0;
- }
- 90.000000%, 100.000000% {
- opacity: 1;
- }
-}]]>windowroofgarage
+}]]>windowroofgarage
-blindsglass
+blindsglass
-shinglesstarlinkutility hookup
+shinglesstarlinkutility hookup
-toolsvehicles
+toolsvehicles
-
-
-
-find contractorscraigslistfacebook
+find contractorscraigslistfacebook
-find contractorssolicit quotescraigslistfacebook
+find contractorssolicit quotescraigslistfacebook
-find contractorssolicit quotesobtain quotesnegotiatecraigslistfacebook
+find contractorssolicit quotesobtain quotesnegotiatecraigslistfacebook
@@ -233,7 +220,7 @@
-find contractorssolicit quotesobtain quotesnegotiatebook the best bidcraigslistfacebook
+find contractorssolicit quotesobtain quotesnegotiatebook the best bidcraigslistfacebook
@@ -242,7 +229,7 @@
-windowroofgaragewaterrainthunder
+windowroofgaragewaterrainthunder
diff --git a/e2etests/testdata/stable/complex-layers/elk/board.exp.json b/e2etests/testdata/stable/complex-layers/elk/board.exp.json
index 277381b1d..cd538c972 100644
--- a/e2etests/testdata/stable/complex-layers/elk/board.exp.json
+++ b/e2etests/testdata/stable/complex-layers/elk/board.exp.json
@@ -602,7 +602,7 @@
},
{
"name": "repair",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"fontFamily": "SourceSansPro",
"shapes": [],
"connections": [],
diff --git a/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg b/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg
index ccbc3ffac..712a5936c 100644
--- a/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg
+++ b/e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg
@@ -100,132 +100,119 @@
0%, 0.000000% {
opacity: 0;
}
- 0.000000%, 9.990000% {
+ 0.000000%, 11.100000% {
opacity: 1;
}
- 10.000000%, 100% {
+ 11.111111%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-1 {
- 0%, 9.990000% {
+ 0%, 11.100000% {
opacity: 0;
}
- 10.000000%, 19.990000% {
+ 11.111111%, 22.211111% {
opacity: 1;
}
- 20.000000%, 100% {
+ 22.222222%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-2 {
- 0%, 19.990000% {
+ 0%, 22.211111% {
opacity: 0;
}
- 20.000000%, 29.990000% {
+ 22.222222%, 33.322222% {
opacity: 1;
}
- 30.000000%, 100% {
+ 33.333333%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-3 {
- 0%, 29.990000% {
+ 0%, 33.322222% {
opacity: 0;
}
- 30.000000%, 39.990000% {
+ 33.333333%, 44.433333% {
opacity: 1;
}
- 40.000000%, 100% {
+ 44.444444%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-4 {
- 0%, 39.990000% {
+ 0%, 44.433333% {
opacity: 0;
}
- 40.000000%, 49.990000% {
+ 44.444444%, 55.544444% {
opacity: 1;
}
- 50.000000%, 100% {
+ 55.555556%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-5 {
- 0%, 49.990000% {
+ 0%, 55.544444% {
opacity: 0;
}
- 50.000000%, 59.990000% {
+ 55.555556%, 66.655556% {
opacity: 1;
}
- 60.000000%, 100% {
+ 66.666667%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-6 {
- 0%, 59.990000% {
+ 0%, 66.655556% {
opacity: 0;
}
- 60.000000%, 69.990000% {
+ 66.666667%, 77.766667% {
opacity: 1;
}
- 70.000000%, 100% {
+ 77.777778%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-7 {
- 0%, 69.990000% {
+ 0%, 77.766667% {
opacity: 0;
}
- 70.000000%, 79.990000% {
+ 77.777778%, 88.877778% {
opacity: 1;
}
- 80.000000%, 100% {
+ 88.888889%, 100% {
opacity: 0;
}
}@keyframes d2Transition-d2-659664847-8 {
- 0%, 79.990000% {
+ 0%, 88.877778% {
opacity: 0;
}
- 80.000000%, 89.990000% {
+ 88.888889%, 100.000000% {
opacity: 1;
}
- 90.000000%, 100% {
- opacity: 0;
- }
-}@keyframes d2Transition-d2-659664847-9 {
- 0%, 89.990000% {
- opacity: 0;
- }
- 90.000000%, 100.000000% {
- opacity: 1;
- }
-}]]>windowroofgarage
+}]]>windowroofgarage
-blindsglass
+blindsglass
-shinglesstarlinkutility hookup
+shinglesstarlinkutility hookup
-toolsvehicles
+toolsvehicles
-
-
-
-find contractorscraigslistfacebook
+find contractorscraigslistfacebook
-find contractorssolicit quotescraigslistfacebook
+find contractorssolicit quotescraigslistfacebook
-find contractorssolicit quotesobtain quotesnegotiatecraigslistfacebook
+find contractorssolicit quotesobtain quotesnegotiatecraigslistfacebook
@@ -233,7 +220,7 @@
-find contractorssolicit quotesobtain quotesnegotiatebook the best bidcraigslistfacebook
+find contractorssolicit quotesobtain quotesnegotiatebook the best bidcraigslistfacebook
@@ -242,7 +229,7 @@
-windowroofgaragewaterrainthunder
+windowroofgaragewaterrainthunder
diff --git a/testdata/d2compiler/TestCompile/root_direction.exp.json b/testdata/d2compiler/TestCompile/root_direction.exp.json
index 98ba30eda..a61670cdc 100644
--- a/testdata/d2compiler/TestCompile/root_direction.exp.json
+++ b/testdata/d2compiler/TestCompile/root_direction.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/root_direction.d2,0:0:0-0:16:16",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile/root_sequence.exp.json b/testdata/d2compiler/TestCompile/root_sequence.exp.json
index 353ce9a61..4fa6ad4a8 100644
--- a/testdata/d2compiler/TestCompile/root_sequence.exp.json
+++ b/testdata/d2compiler/TestCompile/root_sequence.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/root_sequence.d2,0:0:0-1:0:24",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.exp.json b/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.exp.json
new file mode 100644
index 000000000..3205a49da
--- /dev/null
+++ b/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.exp.json
@@ -0,0 +1,287 @@
+{
+ "graph": {
+ "name": "",
+ "isFolderOnly": true,
+ "ast": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,0:0:0-8:0:48",
+ "nodes": [
+ {
+ "map_key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,1:0:1-1:16:17",
+ "key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,1:0:1-1:9:10",
+ "path": [
+ {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,1:0:1-1:9:10",
+ "value": [
+ {
+ "string": "direction",
+ "raw_string": "direction"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "primary": {},
+ "value": {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,1:11:12-1:16:17",
+ "value": [
+ {
+ "string": "right",
+ "raw_string": "right"
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "map_key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,3:0:19-7:1:47",
+ "key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,3:0:19-3:5:24",
+ "path": [
+ {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,3:0:19-3:5:24",
+ "value": [
+ {
+ "string": "steps",
+ "raw_string": "steps"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "primary": {},
+ "value": {
+ "map": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,3:7:26-7:1:47",
+ "nodes": [
+ {
+ "map_key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,4:2:30-6:3:45",
+ "key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,4:2:30-4:3:31",
+ "path": [
+ {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,4:2:30-4:3:31",
+ "value": [
+ {
+ "string": "1",
+ "raw_string": "1"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "primary": {},
+ "value": {
+ "map": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,4:5:33-6:3:45",
+ "nodes": [
+ {
+ "map_key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,5:4:39-5:6:41",
+ "key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,5:4:39-5:6:41",
+ "path": [
+ {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,5:4:39-5:6:41",
+ "value": [
+ {
+ "string": "RJ",
+ "raw_string": "RJ"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "primary": {},
+ "value": {}
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ },
+ "root": {
+ "id": "",
+ "id_val": "",
+ "attributes": {
+ "label": {
+ "value": ""
+ },
+ "labelDimensions": {
+ "width": 0,
+ "height": 0
+ },
+ "style": {},
+ "near_key": null,
+ "shape": {
+ "value": ""
+ },
+ "direction": {
+ "value": "right"
+ },
+ "constraint": null
+ },
+ "zIndex": 0
+ },
+ "edges": null,
+ "objects": null,
+ "steps": [
+ {
+ "name": "1",
+ "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": "direction"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "primary": {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,1:11:12-1:16:17",
+ "value": [
+ {
+ "string": "right",
+ "raw_string": "right"
+ }
+ ]
+ }
+ },
+ "value": {}
+ }
+ },
+ {
+ "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": "RJ"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "primary": {},
+ "value": {}
+ }
+ }
+ ]
+ },
+ "root": {
+ "id": "",
+ "id_val": "",
+ "attributes": {
+ "label": {
+ "value": ""
+ },
+ "labelDimensions": {
+ "width": 0,
+ "height": 0
+ },
+ "style": {},
+ "near_key": null,
+ "shape": {
+ "value": ""
+ },
+ "direction": {
+ "value": "right"
+ },
+ "constraint": null
+ },
+ "zIndex": 0
+ },
+ "edges": null,
+ "objects": [
+ {
+ "id": "RJ",
+ "id_val": "RJ",
+ "references": [
+ {
+ "key": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,5:4:39-5:6:41",
+ "path": [
+ {
+ "unquoted_string": {
+ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly-shapes.d2,5:4:39-5:6:41",
+ "value": [
+ {
+ "string": "RJ",
+ "raw_string": "RJ"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "key_path_index": 0,
+ "map_key_edge_index": -1
+ }
+ ],
+ "attributes": {
+ "label": {
+ "value": "RJ"
+ },
+ "labelDimensions": {
+ "width": 0,
+ "height": 0
+ },
+ "style": {},
+ "near_key": null,
+ "shape": {
+ "value": "rectangle"
+ },
+ "direction": {
+ "value": ""
+ },
+ "constraint": null
+ },
+ "zIndex": 0
+ }
+ ]
+ }
+ ]
+ },
+ "err": null
+}
diff --git a/testdata/d2compiler/TestCompile2/nulls/basic/shape.exp.json b/testdata/d2compiler/TestCompile2/nulls/basic/shape.exp.json
index 4f2c2fd5c..ec5030e90 100644
--- a/testdata/d2compiler/TestCompile2/nulls/basic/shape.exp.json
+++ b/testdata/d2compiler/TestCompile2/nulls/basic/shape.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/nulls/basic/shape.d2,0:0:0-3:0:11",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile2/nulls/multiboard/scenario.exp.json b/testdata/d2compiler/TestCompile2/nulls/multiboard/scenario.exp.json
index 9a3a10c59..821e51b86 100644
--- a/testdata/d2compiler/TestCompile2/nulls/multiboard/scenario.exp.json
+++ b/testdata/d2compiler/TestCompile2/nulls/multiboard/scenario.exp.json
@@ -189,7 +189,7 @@
"scenarios": [
{
"name": "a",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": ",1:0:0-2:0:0",
"nodes": null
diff --git a/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json
index c8ad77b4c..7f72e74ba 100644
--- a/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json
+++ b/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,0:0:0-15:0:135",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json
index bda871992..4306c2469 100644
--- a/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json
+++ b/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,0:0:0-10:0:62",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json
index 30b160ed8..6dcdda361 100644
--- a/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json
+++ b/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,0:0:0-23:0:196",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json
index 86ad2c0cb..1ade3446e 100644
--- a/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json
+++ b/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,0:0:0-13:0:109",
"nodes": [
diff --git a/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json
index 1da21aa14..b529b2127 100644
--- a/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json
+++ b/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,0:0:0-10:0:65",
"nodes": [
diff --git a/testdata/d2oracle/TestDelete/class_refs.exp.json b/testdata/d2oracle/TestDelete/class_refs.exp.json
index 965ae6c65..600314149 100644
--- a/testdata/d2oracle/TestDelete/class_refs.exp.json
+++ b/testdata/d2oracle/TestDelete/class_refs.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2oracle/TestDelete/class_refs.d2,0:0:0-0:0:0",
"nodes": null
diff --git a/testdata/d2oracle/TestDelete/flat.exp.json b/testdata/d2oracle/TestDelete/flat.exp.json
index f40d4a886..bf68210d1 100644
--- a/testdata/d2oracle/TestDelete/flat.exp.json
+++ b/testdata/d2oracle/TestDelete/flat.exp.json
@@ -1,7 +1,7 @@
{
"graph": {
"name": "",
- "isFolderOnly": false,
+ "isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2oracle/TestDelete/flat.d2,0:0:0-0:0:0",
"nodes": null