Create new
Bindings
Transitions
Animations
Easing
Component composition
Context API
Special elements
Module context
Debugging
Miscellaneous
App.svelte
Queue.js
Stack.js
tree_data.js
tree_traversing.js
runes
This component is not in runes mode.
To enable runes mode, either start using runes in your code, or add the following to the top of your component:
<svelte:options runes />
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
<script>
import { fly } from "svelte/transition";
import { writable } from "svelte/store";
import { BFS, DFS } from "./tree_traversing.js"
import { treeData as tree, visualisedTree } from "./tree_data.js";
const collectionByBFS = writable([]);
const collectionByDFS = writable([]);
// you can observe iterations within you browser console (dev tools)
// console.info(visualisedTree);
// console.info(JSON.stringify(tree, undefined, 4))
$: $collectionByBFS.length != 0 ? console.log("BFS iterration:", $collectionByBFS) : null;
$: $collectionByDFS.length != 0 ? console.log("DFS iterration:", $collectionByDFS) : null;
</script>
<div class="split left">
<div class="centered">
<button on:click|preventDefault={() => BFS(tree, collectionByBFS)}>
BFS Traversing
</button>
{#each $collectionByBFS as item, index}
<p in:fly="{{ y: -200, delay: index * 800 }}">
{item}
</p>
{/each}
</div>
</div>
<div class="split right">
<div class="centered">
<button on:click|preventDefault={() => DFS(tree, collectionByDFS)}>
DFS Traversing
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
⌄
import 'svelte/internal/disclose-version';
import 'svelte/internal/flags/legacy';
import * as $ from 'svelte/internal/client';
import { fly } from "svelte/transition";
import { writable } from "svelte/store";
import { BFS, DFS } from "./tree_traversing.js";
import { treeData as tree, visualisedTree } from "./tree_data.js";
var root_1 = $.template(`<p class="svelte-nvjwv1"> </p>`);
var root_2 = $.template(`<p class="svelte-nvjwv1"> </p>`);
var root = $.template(`<div class="split left svelte-nvjwv1"><div class="centered svelte-nvjwv1"><button>BFS Traversing</button> <!></div></div> <div class="split right svelte-nvjwv1"><div class="centered svelte-nvjwv1"><button>DFS Traversing</button> <!></div></div>`, 1);
export default function App($$anchor, $$props) {
$.push($$props, false);
const [$$stores, $$cleanup] = $.setup_stores();
const $collectionByBFS = () => $.store_get(collectionByBFS, '$collectionByBFS', $$stores);
const $collectionByDFS = () => $.store_get(collectionByDFS, '$collectionByDFS', $$stores);
const collectionByBFS = writable([]);
const collectionByDFS = writable([]);
$.legacy_pre_effect(() => ($collectionByBFS()), () => {
$collectionByBFS().length != 0 ? console.log("BFS iterration:", $collectionByBFS()) : null;
});
$.legacy_pre_effect(() => ($collectionByDFS()), () => {
$collectionByDFS().length != 0 ? console.log("DFS iterration:", $collectionByDFS()) : null;
});
$.legacy_pre_effect_reset();
$.init();
var fragment = root();
var div = $.first_child(fragment);
var div_1 = $.child(div);
var button = $.child(div_1);
result = svelte.compile(source, {
generate: ,
});99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
›
.split.svelte-nvjwv1 {
height: 100%;
width: 50%;
position: fixed;
padding-top: 20px;
}
.left.svelte-nvjwv1 {
left: 0;
background-color: lightblue;
}
.right.svelte-nvjwv1 {
right: 0;
background-color: lightgreen;
}
.centered.svelte-nvjwv1 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.centered.svelte-nvjwv1 p:where(.svelte-nvjwv1) {
width: 150px;
border-radius: 50%;
}
Root {
css: StyleSheet {...}
- type: "StyleSheet"
- start: 1223
- end: 1611
- attributes: []
children: [...] (5)
Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1232
- end: 1238
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1232
- end: 1238
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "split"
- start: 1232
- end: 1238
}
]- start: 1232
- end: 1238
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1239
- end: 1313
children: [...] (4)
Declaration {...}
- type: "Declaration"
- start: 1243
- end: 1255
- property: "height"
- value: "100%"
} Declaration {...}
- type: "Declaration"
- start: 1259
- end: 1269
- property: "width"
- value: "50%"
} Declaration {...}
- type: "Declaration"
- start: 1273
- end: 1288
- property: "position"
- value: "fixed"
} Declaration {...}
- type: "Declaration"
- start: 1292
- end: 1309
- property: "padding-top"
- value: "20px"
}
]
}- start: 1232
- end: 1313
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1315
- end: 1320
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1315
- end: 1320
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "left"
- start: 1315
- end: 1320
}
]- start: 1315
- end: 1320
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1321
- end: 1367
children: [...] (2)
Declaration {...}
- type: "Declaration"
- start: 1325
- end: 1332
- property: "left"
- value: "0"
} Declaration {...}
- type: "Declaration"
- start: 1336
- end: 1363
- property: "background-color"
- value: "lightblue"
}
]
}- start: 1315
- end: 1367
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1369
- end: 1375
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1369
- end: 1375
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "right"
- start: 1369
- end: 1375
}
]- start: 1369
- end: 1375
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1376
- end: 1424
children: [...] (2)
Declaration {...}
- type: "Declaration"
- start: 1380
- end: 1388
- property: "right"
- value: "0"
} Declaration {...}
- type: "Declaration"
- start: 1392
- end: 1420
- property: "background-color"
- value: "lightgreen"
}
]
}- start: 1369
- end: 1424
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1426
- end: 1435
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1426
- end: 1435
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "centered"
- start: 1426
- end: 1435
}
]- start: 1426
- end: 1435
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1436
- end: 1545
children: [...] (5)
Declaration {...}
- type: "Declaration"
- start: 1440
- end: 1458
- property: "position"
- value: "absolute"
} Declaration {...}
- type: "Declaration"
- start: 1462
- end: 1470
- property: "top"
- value: "50%"
} Declaration {...}
- type: "Declaration"
- start: 1474
- end: 1483
- property: "left"
- value: "50%"
} Declaration {...}
- type: "Declaration"
- start: 1487
- end: 1519
- property: "transform"
- value: "translate(-50%, -50%)"
} Declaration {...}
- type: "Declaration"
- start: 1523
- end: 1541
- property: "text-align"
- value: "center"
}
]
}- start: 1426
- end: 1545
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1547
- end: 1558
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1547
- end: 1558
children: [...] (2)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "centered"
- start: 1547
- end: 1556
}
]- start: 1547
- end: 1556
} RelativeSelector {...}
- type: "RelativeSelector"
combinator: Combinator {...}
- type: "Combinator"
- name: " "
- start: 1556
- end: 1557
}selectors: [...] (1)
TypeSelector {...}
- type: "TypeSelector"
- name: "p"
- start: 1557
- end: 1558
}
]- start: 1556
- end: 1558
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1559
- end: 1601
children: [...] (2)
Declaration {...}
- type: "Declaration"
- start: 1563
- end: 1575
- property: "width"
- value: "150px"
} Declaration {...}
- type: "Declaration"
- start: 1579
- end: 1597
- property: "border-radius"
- value: "50%"
}
]
}- start: 1547
- end: 1601
}
]content: {...}
- start: 1230
- end: 1603
- styles: "\n\t.split {\n\t\theight: 100%;\n\t\twidth: 50%;\n\t\tposition: fixed;\n\t\tpadding-top: 20px;\n\t}\n\t.left {\n\t\tleft: 0;\n\t\tbackground-color: lightblue;\n\t}\n\t.right {\n\t\tright: 0;\n\t\tbackground-color: lightgreen;\n\t}\n\t.centered {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\ttext-align: center;\n\t}\n\t.centered p {\n\t\twidth: 150px;\n\t\tborder-radius: 50%;\n\t}\t\n"
- comment: null
}
}- js: []
- start: 649
- end: 1221
- type: "Root"
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 647
- end: 649
- raw: "\n\n"
- data: "\n\n"
} RegularElement {...}
- type: "RegularElement"
- start: 649
- end: 934
- name: "div"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 654
- end: 672
- name: "class"
value: [...] (1)
Text {...}
- start: 661
- end: 671
- type: "Text"
- raw: "split left"
- data: "split left"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 673
- end: 676
- raw: "\t\n\t"
- data: "\t\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 676
- end: 927
- name: "div"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 681
- end: 697
- name: "class"
value: [...] (1)
Text {...}
- start: 688
- end: 696
- type: "Text"
- raw: "centered"
- data: "centered"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 698
- end: 701
- raw: "\n\t\t"
- data: "\n\t\t"
} RegularElement {...}
- type: "RegularElement"
- start: 701
- end: 798
- name: "button"
attributes: [...] (1)
OnDirective {...}
- start: 709
- end: 767
- type: "OnDirective"
- name: "click"
expression: ArrowFunctionExpression {...}
- type: "ArrowFunctionExpression"
- start: 734
- end: 766
loc: {...}
start: {...}
- line: 22
- column: 35
}end: {...}
- line: 22
- column: 67
}
}- id: null
- expression: true
- generator: false
- async: false
- params: []
body: CallExpression {...}
- type: "CallExpression"
- start: 740
- end: 766
loc: {...}
start: {...}
- line: 22
- column: 41
}end: {...}
- line: 22
- column: 67
}
}callee: Identifier {...}
- type: "Identifier"
- start: 740
- end: 743
loc: {...}
start: {...}
- line: 22
- column: 41
}end: {...}
- line: 22
- column: 44
}
}- name: "BFS"
}arguments: [...] (2)
Identifier {...}
- type: "Identifier"
- start: 744
- end: 748
loc: {...}
start: {...}
- line: 22
- column: 45
}end: {...}
- line: 22
- column: 49
}
}- name: "tree"
} Identifier {...}
- type: "Identifier"
- start: 750
- end: 765
loc: {...}
start: {...}
- line: 22
- column: 51
}end: {...}
- line: 22
- column: 66
}
}- name: "collectionByBFS"
}
]- optional: false
}
}modifiers: [...] (1)
- "preventDefault"
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- type: "Text"
- start: 768
- end: 789
- raw: "BFS Traversing"
- data: "BFS Traversing"
}
]
}
} Text {...}
- type: "Text"
- start: 798
- end: 801
- raw: " "
- data: " "
} EachBlock {...}
- type: "EachBlock"
- start: 801
- end: 919
expression: Identifier {...}
- type: "Identifier"
- start: 808
- end: 824
loc: {...}
start: {...}
- line: 25
- column: 9
}end: {...}
- line: 25
- column: 25
}
}- name: "$collectionByBFS"
}body: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 840
- end: 844
- raw: "\n\t\t\t"
- data: "\n\t\t\t"
} RegularElement {...}
- type: "RegularElement"
- start: 844
- end: 909
- name: "p"
attributes: [...] (2)
TransitionDirective {...}
- start: 847
- end: 889
- type: "TransitionDirective"
- name: "fly"
expression: ObjectExpression {...}
- type: "ObjectExpression"
- start: 856
- end: 887
loc: {...}
start: {...}
- line: 26
- column: 15
}end: {...}
- line: 26
- column: 46
}
}properties: [...] (2)
Property {...}
- type: "Property"
- start: 858
- end: 865
loc: {...}
start: {...}
- line: 26
- column: 17
}end: {...}
- line: 26
- column: 24
}
}- method: false
- shorthand: false
- computed: false
key: Identifier {...}
- type: "Identifier"
- start: 858
- end: 859
loc: {...}
start: {...}
- line: 26
- column: 17
}end: {...}
- line: 26
- column: 18
}
}- name: "y"
}value: UnaryExpression {...}
- type: "UnaryExpression"
- start: 861
- end: 865
loc: {...}
start: {...}
- line: 26
- column: 20
}end: {...}
- line: 26
- column: 24
}
}- operator: "-"
- prefix: true
argument: Literal {...}
- type: "Literal"
- start: 862
- end: 865
loc: {...}
start: {...}
- line: 26
- column: 21
}end: {...}
- line: 26
- column: 24
}
}- value: 200
- raw: "200"
}
}- kind: "init"
} Property {...}
- type: "Property"
- start: 867
- end: 885
loc: {...}
start: {...}
- line: 26
- column: 26
}end: {...}
- line: 26
- column: 44
}
}- method: false
- shorthand: false
- computed: false
key: Identifier {...}
- type: "Identifier"
- start: 867
- end: 872
loc: {...}
start: {...}
- line: 26
- column: 26
}end: {...}
- line: 26
- column: 31
}
}- name: "delay"
}value: BinaryExpression {...}
- type: "BinaryExpression"
- start: 874
- end: 885
loc: {...}
start: {...}
- line: 26
- column: 33
}end: {...}
- line: 26
- column: 44
}
}left: Identifier {...}
- type: "Identifier"
- start: 874
- end: 879
loc: {...}
start: {...}
- line: 26
- column: 33
}end: {...}
- line: 26
- column: 38
}
}- name: "index"
}- operator: "*"
right: Literal {...}
- type: "Literal"
- start: 882
- end: 885
loc: {...}
start: {...}
- line: 26
- column: 41
}end: {...}
- line: 26
- column: 44
}
}- value: 800
- raw: "800"
}
}- kind: "init"
}
]
}- modifiers: []
- intro: true
- outro: false
} Attribute {...}
- type: "Attribute"
- start: -1
- end: -1
- name: "class"
value: [...] (1)
Text {...}
- type: "Text"
- data: ""
- raw: ""
- start: -1
- end: -1
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 890
- end: 895
- raw: "\n\t\t\t\t"
- data: "\n\t\t\t\t"
} ExpressionTag {...}
- type: "ExpressionTag"
- start: 895
- end: 901
expression: Identifier {...}
- type: "Identifier"
- start: 896
- end: 900
loc: {...}
start: {...}
- line: 27
- column: 5
}end: {...}
- line: 27
- column: 9
}
}- name: "item"
}
} Text {...}
- type: "Text"
- start: 901
- end: 905
- raw: "\n\t\t\t"
- data: "\n\t\t\t"
}
]
}
} Text {...}
- type: "Text"
- start: 909
- end: 912
- raw: "\n\t\t"
- data: "\n\t\t"
}
]
}context: Identifier {...}
- type: "Identifier"
- name: "item"
- start: 828
loc: {...}
start: {...}
- line: 25
- column: 29
- character: 828
}end: {...}
- line: 25
- column: 33
- character: 832
}
}- end: 832
- typeAnnotation: undefined
}- index: "index"
- key: undefined
} Text {...}
- type: "Text"
- start: 919
- end: 921
- raw: "\n\t"
- data: "\n\t"
}
]
}
} Text {...}
- type: "Text"
- start: 927
- end: 928
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 934
- end: 936
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 936
- end: 1221
- name: "div"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 941
- end: 960
- name: "class"
value: [...] (1)
Text {...}
- start: 948
- end: 959
- type: "Text"
- raw: "split right"
- data: "split right"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 961
- end: 963
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 963
- end: 1214
- name: "div"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 968
- end: 984
- name: "class"
value: [...] (1)
Text {...}
- start: 975
- end: 983
- type: "Text"
- raw: "centered"
- data: "centered"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 985
- end: 988
- raw: "\n\t\t"
- data: "\n\t\t"
} RegularElement {...}
- type: "RegularElement"
- start: 988
- end: 1085
- name: "button"
attributes: [...] (1)
OnDirective {...}
- start: 996
- end: 1054
- type: "OnDirective"
- name: "click"
expression: ArrowFunctionExpression {...}
- type: "ArrowFunctionExpression"
- start: 1021
- end: 1053
loc: {...}
start: {...}
- line: 35
- column: 35
}end: {...}
- line: 35
- column: 67
}
}- id: null
- expression: true
- generator: false
- async: false
- params: []
body: CallExpression {...}
- type: "CallExpression"
- start: 1027
- end: 1053
loc: {...}
start: {...}
- line: 35
- column: 41
}end: {...}
- line: 35
- column: 67
}
}callee: Identifier {...}
- type: "Identifier"
- start: 1027
- end: 1030
loc: {...}
start: {...}
- line: 35
- column: 41
}end: {...}
- line: 35
- column: 44
}
}- name: "DFS"
}arguments: [...] (2)
Identifier {...}
- type: "Identifier"
- start: 1031
- end: 1035
loc: {...}
start: {...}
- line: 35
- column: 45
}end: {...}
- line: 35
- column: 49
}
}- name: "tree"
} Identifier {...}
- type: "Identifier"
- start: 1037
- end: 1052
loc: {...}
start: {...}
- line: 35
- column: 51
}end: {...}
- line: 35
- column: 66
}
}- name: "collectionByDFS"
}
]- optional: false
}
}modifiers: [...] (1)
- "preventDefault"
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- type: "Text"
- start: 1055
- end: 1076
- raw: "DFS Traversing"
- data: "DFS Traversing"
}
]
}
} Text {...}
- type: "Text"
- start: 1085
- end: 1088
- raw: " "
- data: " "
} EachBlock {...}
- type: "EachBlock"
- start: 1088
- end: 1206
expression: Identifier {...}
- type: "Identifier"
- start: 1095
- end: 1111
loc: {...}
start: {...}
- line: 38
- column: 9
}end: {...}
- line: 38
- column: 25
}
}- name: "$collectionByDFS"
}body: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1127
- end: 1131
- raw: "\n\t\t\t"
- data: "\n\t\t\t"
} RegularElement {...}
- type: "RegularElement"
- start: 1131
- end: 1196
- name: "p"
attributes: [...] (2)
TransitionDirective {...}
- start: 1134
- end: 1176
- type: "TransitionDirective"
- name: "fly"
expression: ObjectExpression {...}
- type: "ObjectExpression"
- start: 1143
- end: 1174
loc: {...}
start: {...}
- line: 39
- column: 15
}end: {...}
- line: 39
- column: 46
}
}properties: [...] (2)
Property {...}
- type: "Property"
- start: 1145
- end: 1152
loc: {...}
start: {...}
- line: 39
- column: 17
}end: {...}
- line: 39
- column: 24
}
}- method: false
- shorthand: false
- computed: false
key: Identifier {...}
- type: "Identifier"
- start: 1145
- end: 1146
loc: {...}
start: {...}
- line: 39
- column: 17
}end: {...}
- line: 39
- column: 18
}
}- name: "y"
}value: UnaryExpression {...}
- type: "UnaryExpression"
- start: 1148
- end: 1152
loc: {...}
start: {...}
- line: 39
- column: 20
}end: {...}
- line: 39
- column: 24
}
}- operator: "-"
- prefix: true
argument: Literal {...}
- type: "Literal"
- start: 1149
- end: 1152
loc: {...}
start: {...}
- line: 39
- column: 21
}end: {...}
- line: 39
- column: 24
}
}- value: 200
- raw: "200"
}
}- kind: "init"
} Property {...}
- type: "Property"
- start: 1154
- end: 1172
loc: {...}
start: {...}
- line: 39
- column: 26
}end: {...}
- line: 39
- column: 44
}
}- method: false
- shorthand: false
- computed: false
key: Identifier {...}
- type: "Identifier"
- start: 1154
- end: 1159
loc: {...}
start: {...}
- line: 39
- column: 26
}end: {...}
- line: 39
- column: 31
}
}- name: "delay"
}value: BinaryExpression {...}
- type: "BinaryExpression"
- start: 1161
- end: 1172
loc: {...}
start: {...}
- line: 39
- column: 33
}end: {...}
- line: 39
- column: 44
}
}left: Identifier {...}
- type: "Identifier"
- start: 1161
- end: 1166
loc: {...}
start: {...}
- line: 39
- column: 33
}end: {...}
- line: 39
- column: 38
}
}- name: "index"
}- operator: "*"
right: Literal {...}
- type: "Literal"
- start: 1169
- end: 1172
loc: {...}
start: {...}
- line: 39
- column: 41
}end: {...}
- line: 39
- column: 44
}
}- value: 800
- raw: "800"
}
}- kind: "init"
}
]
}- modifiers: []
- intro: true
- outro: false
} Attribute {...}
- type: "Attribute"
- start: -1
- end: -1
- name: "class"
value: [...] (1)
Text {...}
- type: "Text"
- data: ""
- raw: ""
- start: -1
- end: -1
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1177
- end: 1182
- raw: "\n\t\t\t\t"
- data: "\n\t\t\t\t"
} ExpressionTag {...}
- type: "ExpressionTag"
- start: 1182
- end: 1188
expression: Identifier {...}
- type: "Identifier"
- start: 1183
- end: 1187
loc: {...}
start: {...}
- line: 40
- column: 5
}end: {...}
- line: 40
- column: 9
}
}- name: "item"
}
} Text {...}
- type: "Text"
- start: 1188
- end: 1192
- raw: "\n\t\t\t"
- data: "\n\t\t\t"
}
]
}
} Text {...}
- type: "Text"
- start: 1196
- end: 1199
- raw: "\n\t\t"
- data: "\n\t\t"
}
]
}context: Identifier {...}
- type: "Identifier"
- name: "item"
- start: 1115
loc: {...}
start: {...}
- line: 38
- column: 29
- character: 1115
}end: {...}
- line: 38
- column: 33
- character: 1119
}
}- end: 1119
- typeAnnotation: undefined
}- index: "index"
- key: undefined
} Text {...}
- type: "Text"
- start: 1206
- end: 1208
- raw: "\n\t"
- data: "\n\t"
}
]
}
} Text {...}
- type: "Text"
- start: 1214
- end: 1215
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 1221
- end: 1223
- raw: "\n\n"
- data: "\n\n"
}
]
}- options: null
instance: Script {...}
- type: "Script"
- start: 0
- end: 647
- context: "default"
content: Program {...}
- type: "Program"
- start: 8
- end: 638
loc: {...}
start: {...}
- line: 1
- column: 0
}end: {...}
- line: 18
- column: 0
}
}body: [...] (8)
ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 10
- end: 50
loc: {...}
start: {...}
- line: 2
- column: 1
}end: {...}
- line: 2
- column: 41
}
}specifiers: [...] (1)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 19
- end: 22
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 13
}
}imported: Identifier {...}
- type: "Identifier"
- start: 19
- end: 22
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 13
}
}- name: "fly"
}local: Identifier {...}
- type: "Identifier"
- start: 19
- end: 22
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 13
}
}- name: "fly"
}
}
]source: Literal {...}
- type: "Literal"
- start: 30
- end: 49
loc: {...}
start: {...}
- line: 2
- column: 21
}end: {...}
- line: 2
- column: 40
}
}- value: "svelte/transition"
- raw: "\"svelte/transition\""
}
} ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 52
- end: 92
loc: {...}
start: {...}
- line: 3
- column: 1
}end: {...}
- line: 3
- column: 41
}
}specifiers: [...] (1)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 61
- end: 69
loc: {...}
start: {...}
- line: 3
- column: 10
}end: {...}
- line: 3
- column: 18
}
}imported: Identifier {...}
- type: "Identifier"
- start: 61
- end: 69
loc: {...}
start: {...}
- line: 3
- column: 10
}end: {...}
- line: 3
- column: 18
}
}- name: "writable"
}local: Identifier {...}
- type: "Identifier"
- start: 61
- end: 69
loc: {...}
start: {...}
- line: 3
- column: 10
}end: {...}
- line: 3
- column: 18
}
}- name: "writable"
}
}
]source: Literal {...}
- type: "Literal"
- start: 77
- end: 91
loc: {...}
start: {...}
- line: 3
- column: 26
}end: {...}
- line: 3
- column: 40
}
}- value: "svelte/store"
- raw: "\"svelte/store\""
}
} ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 96
- end: 143
loc: {...}
start: {...}
- line: 5
- column: 1
}end: {...}
- line: 5
- column: 48
}
}specifiers: [...] (2)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 105
- end: 108
loc: {...}
start: {...}
- line: 5
- column: 10
}end: {...}
- line: 5
- column: 13
}
}imported: Identifier {...}
- type: "Identifier"
- start: 105
- end: 108
loc: {...}
start: {...}
- line: 5
- column: 10
}end: {...}
- line: 5
- column: 13
}
}- name: "BFS"
}local: Identifier {...}
- type: "Identifier"
- start: 105
- end: 108
loc: {...}
start: {...}
- line: 5
- column: 10
}end: {...}
- line: 5
- column: 13
}
}- name: "BFS"
}
} ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 110
- end: 113
loc: {...}
start: {...}
- line: 5
- column: 15
}end: {...}
- line: 5
- column: 18
}
}imported: Identifier {...}
- type: "Identifier"
- start: 110
- end: 113
loc: {...}
start: {...}
- line: 5
- column: 15
}end: {...}
- line: 5
- column: 18
}
}- name: "DFS"
}local: Identifier {...}
- type: "Identifier"
- start: 110
- end: 113
loc: {...}
start: {...}
- line: 5
- column: 15
}end: {...}
- line: 5
- column: 18
}
}- name: "DFS"
}
}
]source: Literal {...}
- type: "Literal"
- start: 121
- end: 143
loc: {...}
start: {...}
- line: 5
- column: 26
}end: {...}
- line: 5
- column: 48
}
}- value: "./tree_traversing.js"
- raw: "\"./tree_traversing.js\""
}
} ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 146
- end: 212
loc: {...}
start: {...}
- line: 7
- column: 1
}end: {...}
- line: 7
- column: 67
}
}specifiers: [...] (2)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 155
- end: 171
loc: {...}
start: {...}
- line: 7
- column: 10
}end: {...}
- line: 7
- column: 26
}
}imported: Identifier {...}
- type: "Identifier"
- start: 155
- end: 163
loc: {...}
start: {...}
- line: 7
- column: 10
}end: {...}
- line: 7
- column: 18
}
}- name: "treeData"
}local: Identifier {...}
- type: "Identifier"
- start: 167
- end: 171
loc: {...}
start: {...}
- line: 7
- column: 22
}end: {...}
- line: 7
- column: 26
}
}- name: "tree"
}
} ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 173
- end: 187
loc: {...}
start: {...}
- line: 7
- column: 28
}end: {...}
- line: 7
- column: 42
}
}imported: Identifier {...}
- type: "Identifier"
- start: 173
- end: 187
loc: {...}
start: {...}
- line: 7
- column: 28
}end: {...}
- line: 7
- column: 42
}
}- name: "visualisedTree"
}local: Identifier {...}
- type: "Identifier"
- start: 173
- end: 187
loc: {...}
start: {...}
- line: 7
- column: 28
}end: {...}
- line: 7
- column: 42
}
}- name: "visualisedTree"
}
}
]source: Literal {...}
- type: "Literal"
- start: 195
- end: 211
loc: {...}
start: {...}
- line: 7
- column: 50
}end: {...}
- line: 7
- column: 66
}
}- value: "./tree_data.js"
- raw: "\"./tree_data.js\""
}
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 215
- end: 252
loc: {...}
start: {...}
- line: 9
- column: 1
}end: {...}
- line: 9
- column: 38
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 221
- end: 251
loc: {...}
start: {...}
- line: 9
- column: 7
}end: {...}
- line: 9
- column: 37
}
}id: Identifier {...}
- type: "Identifier"
- start: 221
- end: 236
loc: {...}
start: {...}
- line: 9
- column: 7
}end: {...}
- line: 9
- column: 22
}
}- name: "collectionByBFS"
}init: CallExpression {...}
- type: "CallExpression"
- start: 239
- end: 251
loc: {...}
start: {...}
- line: 9
- column: 25
}end: {...}
- line: 9
- column: 37
}
}callee: Identifier {...}
- type: "Identifier"
- start: 239
- end: 247
loc: {...}
start: {...}
- line: 9
- column: 25
}end: {...}
- line: 9
- column: 33
}
}- name: "writable"
}arguments: [...] (1)
ArrayExpression {...}
- type: "ArrayExpression"
- start: 248
- end: 250
loc: {...}
start: {...}
- line: 9
- column: 34
}end: {...}
- line: 9
- column: 36
}
}- elements: []
}
]- optional: false
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 254
- end: 291
loc: {...}
start: {...}
- line: 10
- column: 1
}end: {...}
- line: 10
- column: 38
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 260
- end: 290
loc: {...}
start: {...}
- line: 10
- column: 7
}end: {...}
- line: 10
- column: 37
}
}id: Identifier {...}
- type: "Identifier"
- start: 260
- end: 275
loc: {...}
start: {...}
- line: 10
- column: 7
}end: {...}
- line: 10
- column: 22
}
}- name: "collectionByDFS"
}init: CallExpression {...}
- type: "CallExpression"
- start: 278
- end: 290
loc: {...}
start: {...}
- line: 10
- column: 25
}end: {...}
- line: 10
- column: 37
}
}callee: Identifier {...}
- type: "Identifier"
- start: 278
- end: 286
loc: {...}
start: {...}
- line: 10
- column: 25
}end: {...}
- line: 10
- column: 33
}
}- name: "writable"
}arguments: [...] (1)
ArrayExpression {...}
- type: "ArrayExpression"
- start: 287
- end: 289
loc: {...}
start: {...}
- line: 10
- column: 34
}end: {...}
- line: 10
- column: 36
}
}- elements: []
}
]- optional: false
}
}
]- kind: "const"
} LabeledStatement {...}
- type: "LabeledStatement"
- start: 455
- end: 545
loc: {...}
start: {...}
- line: 16
- column: 1
}end: {...}
- line: 16
- column: 91
}
}body: ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 458
- end: 545
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 91
}
}expression: ConditionalExpression {...}
- type: "ConditionalExpression"
- start: 458
- end: 544
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 90
}
}test: BinaryExpression {...}
- type: "BinaryExpression"
- start: 458
- end: 486
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 32
}
}left: MemberExpression {...}
- type: "MemberExpression"
- start: 458
- end: 481
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 27
}
}object: Identifier {...}
- type: "Identifier"
- start: 458
- end: 474
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 20
}
}- name: "$collectionByBFS"
}property: Identifier {...}
- type: "Identifier"
- start: 475
- end: 481
loc: {...}
start: {...}
- line: 16
- column: 21
}end: {...}
- line: 16
- column: 27
}
}- name: "length"
}- computed: false
- optional: false
}- operator: "!="
right: Literal {...}
- type: "Literal"
- start: 485
- end: 486
loc: {...}
start: {...}
- line: 16
- column: 31
}end: {...}
- line: 16
- column: 32
}
}- value: 0
- raw: "0"
}
}consequent: CallExpression {...}
- type: "CallExpression"
- start: 489
- end: 537
loc: {...}
start: {...}
- line: 16
- column: 35
}end: {...}
- line: 16
- column: 83
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 489
- end: 500
loc: {...}
start: {...}
- line: 16
- column: 35
}end: {...}
- line: 16
- column: 46
}
}object: Identifier {...}
- type: "Identifier"
- start: 489
- end: 496
loc: {...}
start: {...}
- line: 16
- column: 35
}end: {...}
- line: 16
- column: 42
}
}- name: "console"
}property: Identifier {...}
- type: "Identifier"
- start: 497
- end: 500
loc: {...}
start: {...}
- line: 16
- column: 43
}end: {...}
- line: 16
- column: 46
}
}- name: "log"
}- computed: false
- optional: false
}arguments: [...] (2)
Literal {...}
- type: "Literal"
- start: 501
- end: 518
loc: {...}
start: {...}
- line: 16
- column: 47
}end: {...}
- line: 16
- column: 64
}
}- value: "BFS iterration:"
- raw: "\"BFS iterration:\""
} Identifier {...}
- type: "Identifier"
- start: 520
- end: 536
loc: {...}
start: {...}
- line: 16
- column: 66
}end: {...}
- line: 16
- column: 82
}
}- name: "$collectionByBFS"
}
]- optional: false
}alternate: Literal {...}
- type: "Literal"
- start: 540
- end: 544
loc: {...}
start: {...}
- line: 16
- column: 86
}end: {...}
- line: 16
- column: 90
}
}- value: null
- raw: "null"
}
}
}label: Identifier {...}
- type: "Identifier"
- start: 455
- end: 456
loc: {...}
start: {...}
- line: 16
- column: 1
}end: {...}
- line: 16
- column: 2
}
}- name: "$"
}leadingComments: [...] (3)
Line {...}
- type: "Line"
- value: " you can observe iterations within you browser console (dev tools)\t"
- start: 295
- end: 364
} Line {...}
- type: "Line"
- value: " \tconsole.info(visualisedTree);"
- start: 365
- end: 398
} Line {...}
- type: "Line"
- value: " \tconsole.info(JSON.stringify(tree, undefined, 4))"
- start: 399
- end: 451
}
]
} LabeledStatement {...}
- type: "LabeledStatement"
- start: 547
- end: 637
loc: {...}
start: {...}
- line: 17
- column: 1
}end: {...}
- line: 17
- column: 91
}
}body: ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 550
- end: 637
loc: {...}
start: {...}
- line: 17
- column: 4
}end: {...}
- line: 17
- column: 91
}
}expression: ConditionalExpression {...}
- type: "ConditionalExpression"
- start: 550
- end: 636
loc: {...}
start: {...}
- line: 17
- column: 4
}end: {...}
- line: 17
- column: 90
}
}test: BinaryExpression {...}
- type: "BinaryExpression"
- start: 550
- end: 578
loc: {...}
start: {...}
- line: 17
- column: 4
}end: {...}
- line: 17
- column: 32
}
}left: MemberExpression {...}
- type: "MemberExpression"
- start: 550
- end: 573
loc: {...}
start: {...}
- line: 17
- column: 4
}end: {...}
- line: 17
- column: 27
}
}object: Identifier {...}
- type: "Identifier"
- start: 550
- end: 566
loc: {...}
start: {...}
- line: 17
- column: 4
}end: {...}
- line: 17
- column: 20
}
}- name: "$collectionByDFS"
}property: Identifier {...}
- type: "Identifier"
- start: 567
- end: 573
loc: {...}
start: {...}
- line: 17
- column: 21
}end: {...}
- line: 17
- column: 27
}
}- name: "length"
}- computed: false
- optional: false
}- operator: "!="
right: Literal {...}
- type: "Literal"
- start: 577
- end: 578
loc: {...}
start: {...}
- line: 17
- column: 31
}end: {...}
- line: 17
- column: 32
}
}- value: 0
- raw: "0"
}
}consequent: CallExpression {...}
- type: "CallExpression"
- start: 581
- end: 629
loc: {...}
start: {...}
- line: 17
- column: 35
}end: {...}
- line: 17
- column: 83
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 581
- end: 592
loc: {...}
start: {...}
- line: 17
- column: 35
}end: {...}
- line: 17
- column: 46
}
}object: Identifier {...}
- type: "Identifier"
- start: 581
- end: 588
loc: {...}
start: {...}
- line: 17
- column: 35
}end: {...}
- line: 17
- column: 42
}
}- name: "console"
}property: Identifier {...}
- type: "Identifier"
- start: 589
- end: 592
loc: {...}
start: {...}
- line: 17
- column: 43
}end: {...}
- line: 17
- column: 46
}
}- name: "log"
}- computed: false
- optional: false
}arguments: [...] (2)
Literal {...}
- type: "Literal"
- start: 593
- end: 610
loc: {...}
start: {...}
- line: 17
- column: 47
}end: {...}
- line: 17
- column: 64
}
}- value: "DFS iterration:"
- raw: "\"DFS iterration:\""
} Identifier {...}
- type: "Identifier"
- start: 612
- end: 628
loc: {...}
start: {...}
- line: 17
- column: 66
}end: {...}
- line: 17
- column: 82
}
}- name: "$collectionByDFS"
}
]- optional: false
}alternate: Literal {...}
- type: "Literal"
- start: 632
- end: 636
loc: {...}
start: {...}
- line: 17
- column: 86
}end: {...}
- line: 17
- column: 90
}
}- value: null
- raw: "null"
}
}
}label: Identifier {...}
- type: "Identifier"
- start: 547
- end: 548
loc: {...}
start: {...}
- line: 17
- column: 1
}end: {...}
- line: 17
- column: 2
}
}- name: "$"
}
}
]- sourceType: "module"
}- attributes: []
}
}
The AST is not public API and may change at any point in time