Create new
Bindings
Transitions
Animations
Easing
Component composition
Context API
Special elements
Module context
Debugging
Miscellaneous
App.svelte
LineChart.svelte
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
›
⌄
⌄
⌄
⌄
⌄
⌄
<script>
import Chart from './LineChart.svelte';
</script>
<div class="grid">
<div style="width: 33.3%; height: 33.3%"><Chart/></div>
<div style="width: 66.6%; height: 33.3%"><Chart/></div>
<div style="width: 33.3%; height: 66.6%"><Chart/></div>
<div style="width: 66.6%; height: 66.6%"><Chart/></div>
</div>
<style>
:global(body) {
padding: 0;
}
.grid {
width: 100vw;
height: 100vh;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 1fr);
}
.grid div {
position: relative;
float: left;
box-sizing: border-box;
}
</style>
fetching https://unpkg.com/svelte@5.20.5/src/internal/client/index.js
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
›
⌄
import 'svelte/internal/disclose-version';
import 'svelte/internal/flags/legacy';
import * as $ from 'svelte/internal/client';
import Chart from './LineChart.svelte';
var root = $.template(`<div class="grid svelte-abndcf"><div style="width: 33.3%; height: 33.3%" class="svelte-abndcf"><!></div> <div style="width: 66.6%; height: 33.3%" class="svelte-abndcf"><!></div> <div style="width: 33.3%; height: 66.6%" class="svelte-abndcf"><!></div> <div style="width: 66.6%; height: 66.6%" class="svelte-abndcf"><!></div></div>`);
export default function App($$anchor) {
var div = root();
var div_1 = $.child(div);
var node = $.child(div_1);
Chart(node, {});
$.reset(div_1);
var div_2 = $.sibling(div_1, 2);
var node_1 = $.child(div_2);
Chart(node_1, {});
$.reset(div_2);
var div_3 = $.sibling(div_2, 2);
var node_2 = $.child(div_3);
Chart(node_2, {});
$.reset(div_3);
var div_4 = $.sibling(div_3, 2);
var node_3 = $.child(div_4);
Chart(node_3, {});
$.reset(div_4);
$.reset(div);
$.append($$anchor, div);
}
result = svelte.compile(source, {
generate: ,
});99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
body {
padding: 0;
}
.grid.svelte-abndcf {
width: 100vw;
height: 100vh;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 1fr);
}
.grid.svelte-abndcf div:where(.svelte-abndcf) {
position: relative;
float: left;
box-sizing: border-box;
}
Root {
css: StyleSheet {...}
- type: "StyleSheet"
- start: 316
- end: 573
- attributes: []
children: [...] (3)
Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 325
- end: 338
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 325
- end: 338
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
PseudoClassSelector {...}
- type: "PseudoClassSelector"
- name: "global"
args: SelectorList {...}
- type: "SelectorList"
- start: 333
- end: 337
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 333
- end: 337
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
TypeSelector {...}
- type: "TypeSelector"
- name: "body"
- start: 333
- end: 337
}
]- start: 333
- end: 337
}
]
}
]
}- start: 325
- end: 338
}
]- start: 325
- end: 338
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 339
- end: 357
children: [...] (1)
Declaration {...}
- type: "Declaration"
- start: 343
- end: 353
- property: "padding"
- value: "0"
}
]
}- start: 325
- end: 357
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 361
- end: 366
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 361
- end: 366
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "grid"
- start: 361
- end: 366
}
]- start: 361
- end: 366
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 367
- end: 483
children: [...] (4)
Declaration {...}
- type: "Declaration"
- start: 371
- end: 383
- property: "width"
- value: "100vw"
} Declaration {...}
- type: "Declaration"
- start: 387
- end: 400
- property: "height"
- value: "100vh"
} Declaration {...}
- type: "Declaration"
- start: 404
- end: 441
- property: "grid-template-columns"
- value: "repeat(3, 1fr)"
} Declaration {...}
- type: "Declaration"
- start: 445
- end: 479
- property: "grid-template-rows"
- value: "repeat(3, 1fr)"
}
]
}- start: 361
- end: 483
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 487
- end: 496
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 487
- end: 496
children: [...] (2)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "grid"
- start: 487
- end: 492
}
]- start: 487
- end: 492
} RelativeSelector {...}
- type: "RelativeSelector"
combinator: Combinator {...}
- type: "Combinator"
- name: " "
- start: 492
- end: 493
}selectors: [...] (1)
TypeSelector {...}
- type: "TypeSelector"
- name: "div"
- start: 493
- end: 496
}
]- start: 492
- end: 496
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 497
- end: 564
children: [...] (3)
Declaration {...}
- type: "Declaration"
- start: 501
- end: 519
- property: "position"
- value: "relative"
} Declaration {...}
- type: "Declaration"
- start: 523
- end: 534
- property: "float"
- value: "left"
} Declaration {...}
- type: "Declaration"
- start: 538
- end: 560
- property: "box-sizing"
- value: "border-box"
}
]
}- start: 487
- end: 564
}
]content: {...}
- start: 323
- end: 565
- styles: "\n\t:global(body) {\n\t\tpadding: 0;\n\t}\n\t\n\t.grid {\n\t\twidth: 100vw;\n\t\theight: 100vh;\n\t\tgrid-template-columns: repeat(3, 1fr);\n\t\tgrid-template-rows: repeat(3, 1fr);\n\t}\n\t\n\t.grid div {\n\t\tposition: relative;\n\t\tfloat: left;\n\t\tbox-sizing: border-box;\n\t}\n"
- comment: null
}
}- js: []
- start: 61
- end: 314
- type: "Root"
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 59
- end: 61
- raw: "\n\n"
- data: "\n\n"
} RegularElement {...}
- type: "RegularElement"
- start: 61
- end: 314
- name: "div"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 66
- end: 78
- name: "class"
value: [...] (1)
Text {...}
- start: 73
- end: 77
- type: "Text"
- raw: "grid"
- data: "grid"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (9)
Text {...}
- type: "Text"
- start: 79
- end: 81
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 81
- end: 136
- name: "div"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 86
- end: 121
- name: "style"
value: [...] (1)
Text {...}
- start: 93
- end: 120
- type: "Text"
- raw: "width: 33.3%; height: 33.3%"
- data: "width: 33.3%; height: 33.3%"
}
]
} 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: [...] (1)
Component {...}
- type: "Component"
- start: 122
- end: 130
- name: "Chart"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
- nodes: []
}
}
]
}
} Text {...}
- type: "Text"
- start: 136
- end: 138
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 138
- end: 193
- name: "div"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 143
- end: 178
- name: "style"
value: [...] (1)
Text {...}
- start: 150
- end: 177
- type: "Text"
- raw: "width: 66.6%; height: 33.3%"
- data: "width: 66.6%; height: 33.3%"
}
]
} 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: [...] (1)
Component {...}
- type: "Component"
- start: 179
- end: 187
- name: "Chart"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
- nodes: []
}
}
]
}
} Text {...}
- type: "Text"
- start: 193
- end: 195
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 195
- end: 250
- name: "div"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 200
- end: 235
- name: "style"
value: [...] (1)
Text {...}
- start: 207
- end: 234
- type: "Text"
- raw: "width: 33.3%; height: 66.6%"
- data: "width: 33.3%; height: 66.6%"
}
]
} 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: [...] (1)
Component {...}
- type: "Component"
- start: 236
- end: 244
- name: "Chart"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
- nodes: []
}
}
]
}
} Text {...}
- type: "Text"
- start: 250
- end: 252
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 252
- end: 307
- name: "div"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 257
- end: 292
- name: "style"
value: [...] (1)
Text {...}
- start: 264
- end: 291
- type: "Text"
- raw: "width: 66.6%; height: 66.6%"
- data: "width: 66.6%; height: 66.6%"
}
]
} 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: [...] (1)
Component {...}
- type: "Component"
- start: 293
- end: 301
- name: "Chart"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
- nodes: []
}
}
]
}
} Text {...}
- type: "Text"
- start: 307
- end: 308
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 314
- end: 316
- raw: "\n\n"
- data: "\n\n"
}
]
}- options: null
instance: Script {...}
- type: "Script"
- start: 0
- end: 59
- context: "default"
content: Program {...}
- type: "Program"
- start: 8
- end: 50
loc: {...}
start: {...}
- line: 1
- column: 0
}end: {...}
- line: 3
- column: 0
}
}body: [...] (1)
ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 10
- end: 49
loc: {...}
start: {...}
- line: 2
- column: 1
}end: {...}
- line: 2
- column: 40
}
}specifiers: [...] (1)
ImportDefaultSpecifier {...}
- type: "ImportDefaultSpecifier"
- start: 17
- end: 22
loc: {...}
start: {...}
- line: 2
- column: 8
}end: {...}
- line: 2
- column: 13
}
}local: Identifier {...}
- type: "Identifier"
- start: 17
- end: 22
loc: {...}
start: {...}
- line: 2
- column: 8
}end: {...}
- line: 2
- column: 13
}
}- name: "Chart"
}
}
]source: Literal {...}
- type: "Literal"
- start: 28
- end: 48
loc: {...}
start: {...}
- line: 2
- column: 19
}end: {...}
- line: 2
- column: 39
}
}- value: "./LineChart.svelte"
- raw: "'./LineChart.svelte'"
}
}
]- sourceType: "module"
}- attributes: []
}
}
The AST is not public API and may change at any point in time