File tree Expand file tree Collapse file tree 3 files changed +23
-11
lines changed Expand file tree Collapse file tree 3 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 8
8
9
9
<script lang =" ts" >
10
10
import Vector , { type VectorMarkProps } from ' ./Vector.svelte' ;
11
- let { data = [{}], ... options }: SpikeMarkProps = $props ();
11
+ import type { PlotDefaults } from ' ../types.js' ;
12
+ import { getContext } from ' svelte' ;
13
+
14
+ let markProps: SpikeMarkProps = $props ();
15
+
16
+ const DEFAULTS = {
17
+ fill: ' currentColor' ,
18
+ fillOpacity: 0.3 ,
19
+ strokeWidth: 1 ,
20
+ anchor: ' start' as const ,
21
+ stroke: ' currentColor' ,
22
+ sort: { channel: ' -y' },
23
+ shape: ' spike' as const ,
24
+ ... getContext <PlotDefaults >(' svelteplot/_defaults' ).spike
25
+ };
26
+
27
+ const { data = [{}], ... options }: SpikeMarkProps = $derived ({
28
+ ... DEFAULTS ,
29
+ ... markProps
30
+ });
12
31
</script >
13
32
14
- <Vector
15
- {data }
16
- fill ={options .stroke || ' currentColor' }
17
- fillOpacity ={0.3 }
18
- strokeWidth ={1 }
19
- anchor =" start"
20
- stroke =" currentColor"
21
- sort ={{ channel : ' -y' }}
22
- {...options }
23
- shape =" spike" />
33
+ <Vector {data } {...options } />
Original file line number Diff line number Diff line change 72
72
}} />
73
73
{:else }
74
74
<Frame
75
+ stroke ={false }
75
76
fill =" transparent"
76
77
cursor =" zoom-out"
77
78
onpointerup ={resetZoom } />
Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ Another use case for the Brush mark would be to create a zoomable plot by changi
293
293
{:else}
294
294
<Frame
295
295
fill="transparent"
296
+ stroke="transparent"
296
297
cursor="zoom-out"
297
298
onpointerup={resetZoom} />
298
299
{/if}
You can’t perform that action at this time.
0 commit comments