@@ -32,7 +32,7 @@ Pointer mark
32
32
lineAnchor="bottom"
33
33
fontWeight="bold"
34
34
dy="-10" />
35
- <Dot {data} x="Date" y="Close" fill />
35
+ <Dot {data} x="Date" y="Close" fill="var(--svp-red)" />
36
36
{/snippet}
37
37
</Pointer>
38
38
</Plot>
@@ -91,8 +91,8 @@ You can create a "crosshair" mark
91
91
y="Close"
92
92
maxDistance={30}>
93
93
{#snippet children({ data })}
94
- <RuleX {data} x="Date" opacity="0.3 " />
95
- <RuleY {data} y="Close" opacity="0.3 " />
94
+ <RuleX {data} x="Date" opacity="0.5" stroke="var(--svp-red) " />
95
+ <RuleY {data} y="Close" opacity="0.5" stroke="var(--svp-red) " />
96
96
<AxisX
97
97
data={data.map((d) => d.Date)}
98
98
tickFormat={(d) => d.getFullYear()} />
@@ -104,7 +104,7 @@ You can create a "crosshair" mark
104
104
</Plot>
105
105
```
106
106
107
- PointerY
107
+ Pointer along the y axis:
108
108
109
109
``` svelte live
110
110
<script>
@@ -124,7 +124,7 @@ PointerY
124
124
<Line data={aapl} x="Date" y="Close" />
125
125
<Pointer data={aapl} y="Close" maxDistance={30}>
126
126
{#snippet children({ data })}
127
- <RuleY {data} y="Close" opacity={0.2} />
127
+ <RuleY {data} y="Close" opacity="0.5" stroke="var(--svp-red)" />
128
128
<Text
129
129
{data}
130
130
fill="currentColor"
@@ -215,7 +215,7 @@ Pointer along the x dimension
215
215
<RuleX
216
216
data={data.length ? [data[0]] : []}
217
217
x="Date"
218
- opacity={0.2} />
218
+ opacity="0.5" stroke="var(--svp-red)" />
219
219
<Text
220
220
{data}
221
221
fill="Symbol"
@@ -349,13 +349,6 @@ You can even put another tiny plot inside the HTML tooltips:
349
349
import { Plot, Dot, HTMLTooltip, BarX } from 'svelteplot';
350
350
import { page } from '$app/state';
351
351
let { penguins } = $derived(page.data.data);
352
-
353
- const speciesImages = {
354
- Adelie: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e3/Hope_Bay-2016-Trinity_Peninsula%E2%80%93Ad%C3%A9lie_penguin_%28Pygoscelis_adeliae%29_04.jpg/346px-Hope_Bay-2016-Trinity_Peninsula%E2%80%93Ad%C3%A9lie_penguin_%28Pygoscelis_adeliae%29_04.jpg',
355
- Chinstrap:
356
- 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/A_chinstrap_penguin_%28Pygoscelis_antarcticus%29_on_Deception_Island_in_Antarctica.jpg/201px-A_chinstrap_penguin_%28Pygoscelis_antarcticus%29_on_Deception_Island_in_Antarctica.jpg',
357
- Gentoo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/00_0304_Gentoo_Penguins.jpg/160px-00_0304_Gentoo_Penguins.jpg'
358
- };
359
352
</script>
360
353
361
354
<Plot grid height={500}>
0 commit comments