Skip to content

Commit c4669cd

Browse files
author
James Goldie
committed
Tweak Circles example
1 parent 31896f4 commit c4669cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Circles.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
1717
</script>
1818

19-
<!-- we use svelte's in/out transitions for entering and leaving dom elements,
19+
<!-- we use svelte's in/out transitions for entering and exiting dom elements,
2020
and vanilla css transitions for retained elements that change. the
2121
#each block means we create an svg <circle> for each element of data -->
2222
<svg>
2323
{#each data as d, i (i)}
2424
<circle
2525
in:fly="{{y: 100}}" out:fly="{{y: 100}}"
2626
style={"transition: all 1s ease-out"}
27-
cx={15 * i + "%"} cy="50%" r={d}
27+
cx={(15 * i + 10) + "%"} cy="50%" r={d}
2828
fill="black"
2929
/>
3030
{/each}

example.qmd

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sverto:
88
- Circles.svelte
99
---
1010

11-
Here's an example of how to use the included example Svelte component, `Circles.svelte`.
11+
This document shows you how to use a basic example Svelte component called `Circles.svelte`.
1212

1313
Create one using `fileName.default()`, where `fileName` is the file name without `.svelte`:
1414

@@ -44,9 +44,11 @@ viewof selectedDataset =
4444
Now we can update the prop `data` of the visual `myCircles` using:
4545

4646
```{ojs}
47+
//| output: false
4748
myCircles.data = selectedDataset
4849
```
4950

5051
And there you go! 🚀
5152

52-
For more help writing Svelte components, check out the [Svelte tutorial](https://svelte.dev/tutorial/basics).
53+
For more help writing Svelte components, check out the [Svelte tutorial](https://svelte.dev/tutorial/basics) or take look at some of the examples in the [Sverto documentation](https://sverto.jamesgoldie.dev).
54+

0 commit comments

Comments
 (0)