svelteplot 0.2.9 → 0.2.10-pr-110.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Mark.svelte +5 -4
- package/dist/Plot.svelte +3 -2
- package/dist/core/Plot.svelte +37 -20
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/scales.d.ts +1 -1
- package/dist/helpers/scales.js +9 -1
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/marks/Area.svelte +31 -29
- package/dist/marks/AreaX.svelte +7 -3
- package/dist/marks/AreaX.svelte.d.ts +1 -6
- package/dist/marks/AreaY.svelte +7 -2
- package/dist/marks/AreaY.svelte.d.ts +1 -9
- package/dist/marks/Arrow.svelte +24 -7
- package/dist/marks/AxisX.svelte +24 -21
- package/dist/marks/AxisX.svelte.d.ts +3 -4
- package/dist/marks/AxisY.svelte +23 -20
- package/dist/marks/AxisY.svelte.d.ts +3 -4
- package/dist/marks/BarX.svelte +18 -2
- package/dist/marks/BarX.svelte.d.ts +2 -2
- package/dist/marks/BarY.svelte +18 -3
- package/dist/marks/BarY.svelte.d.ts +2 -2
- package/dist/marks/BollingerX.svelte.d.ts +1 -1
- package/dist/marks/BollingerY.svelte.d.ts +1 -1
- package/dist/marks/BoxX.svelte +23 -9
- package/dist/marks/BoxX.svelte.d.ts +3 -2
- package/dist/marks/BoxY.svelte +20 -10
- package/dist/marks/BoxY.svelte.d.ts +3 -3
- package/dist/marks/Brush.svelte +30 -10
- package/dist/marks/BrushX.svelte +9 -3
- package/dist/marks/BrushX.svelte.d.ts +1 -1
- package/dist/marks/BrushY.svelte +9 -3
- package/dist/marks/BrushY.svelte.d.ts +1 -1
- package/dist/marks/Cell.svelte +17 -2
- package/dist/marks/Cell.svelte.d.ts +2 -2
- package/dist/marks/ColorLegend.svelte +3 -2
- package/dist/marks/Dot.svelte +29 -24
- package/dist/marks/Dot.svelte.d.ts +2 -2
- package/dist/marks/Frame.svelte +24 -4
- package/dist/marks/Frame.svelte.d.ts +2 -2
- package/dist/marks/Geo.svelte +41 -37
- package/dist/marks/Geo.svelte.d.ts +4 -2
- package/dist/marks/Graticule.svelte +14 -5
- package/dist/marks/GridX.svelte +16 -2
- package/dist/marks/GridY.svelte +16 -2
- package/dist/marks/Line.svelte +22 -8
- package/dist/marks/Link.svelte +12 -4
- package/dist/marks/Pointer.svelte +12 -3
- package/dist/marks/Rect.svelte +17 -2
- package/dist/marks/Rect.svelte.d.ts +2 -2
- package/dist/marks/RectX.svelte +16 -2
- package/dist/marks/RectY.svelte +16 -2
- package/dist/marks/RuleX.svelte +15 -2
- package/dist/marks/RuleY.svelte +15 -2
- package/dist/marks/Sphere.svelte +17 -4
- package/dist/marks/Sphere.svelte.d.ts +3 -58
- package/dist/marks/Text.svelte +22 -4
- package/dist/marks/TickX.svelte +15 -2
- package/dist/marks/TickY.svelte +15 -2
- package/dist/marks/Vector.svelte +13 -5
- package/dist/marks/helpers/Anchor.svelte +37 -0
- package/dist/marks/helpers/Anchor.svelte.d.ts +15 -0
- package/dist/marks/helpers/BaseAxisX.svelte +59 -53
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -0
- package/dist/marks/helpers/BaseAxisY.svelte +24 -18
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +1 -0
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +1 -41
- package/dist/marks/helpers/RectPath.svelte +33 -30
- package/dist/marks/helpers/Regression.svelte +1 -1
- package/dist/transforms/bollinger.d.ts +1 -8
- package/dist/transforms/centroid.d.ts +1 -8
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -6
- package/dist/transforms/map.d.ts +4 -10
- package/dist/transforms/normalize.d.ts +2 -6
- package/dist/transforms/select.d.ts +7 -21
- package/dist/transforms/sort.d.ts +5 -17
- package/dist/transforms/sort.js +23 -13
- package/dist/transforms/window.d.ts +2 -14
- package/dist/types.d.ts +251 -78
- package/dist/ui/ExamplesGrid.svelte +1 -1
- package/package.json +121 -120
|
@@ -6,9 +6,9 @@ export type DotMarkProps = BaseMarkProps & {
|
|
|
6
6
|
symbol?: ChannelAccessor | Snippet<[number, string]>;
|
|
7
7
|
canvas?: boolean;
|
|
8
8
|
dotClass?: ConstantAccessor<string>;
|
|
9
|
-
};
|
|
9
|
+
} & LinkableMarkProps;
|
|
10
10
|
import { type Snippet } from 'svelte';
|
|
11
|
-
import type { DataRecord, BaseMarkProps, ConstantAccessor, ChannelAccessor } from '../types.js';
|
|
11
|
+
import type { DataRecord, BaseMarkProps, ConstantAccessor, ChannelAccessor, LinkableMarkProps } from '../types.js';
|
|
12
12
|
/** Creates dots or symbols at specified positions with customizable size and appearance */
|
|
13
13
|
declare const Dot: import("svelte").Component<DotMarkProps, {}, "">;
|
|
14
14
|
type Dot = ReturnType<typeof Dot>;
|
package/dist/marks/Frame.svelte
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
BaseMarkProps,
|
|
8
8
|
'fill' | 'stroke' | 'fillOpacity' | 'strokeOpacity'
|
|
9
9
|
> &
|
|
10
|
+
LinkableMarkProps &
|
|
10
11
|
Omit<
|
|
11
12
|
BaseRectMarkProps,
|
|
12
13
|
'inset' | 'insetLeft' | 'insetRight' | 'insetTop' | 'insetBottom'
|
|
@@ -27,19 +28,38 @@
|
|
|
27
28
|
<script lang="ts">
|
|
28
29
|
import Mark from '../Mark.svelte';
|
|
29
30
|
import { getContext } from 'svelte';
|
|
30
|
-
import type {
|
|
31
|
+
import type {
|
|
32
|
+
PlotContext,
|
|
33
|
+
BaseRectMarkProps,
|
|
34
|
+
LinkableMarkProps,
|
|
35
|
+
PlotDefaults
|
|
36
|
+
} from '../types.js';
|
|
31
37
|
import type { BaseMarkProps } from '../types.js';
|
|
32
38
|
import RectPath from './helpers/RectPath.svelte';
|
|
33
39
|
|
|
34
|
-
let
|
|
40
|
+
let markProps: FrameMarkProps = $props();
|
|
41
|
+
|
|
42
|
+
const DEFAULTS: FrameMarkProps = {
|
|
43
|
+
fill: 'none',
|
|
44
|
+
class: 'frame',
|
|
45
|
+
stroke: 'currentColor',
|
|
46
|
+
fillOpacity: 1,
|
|
47
|
+
strokeOpacity: 1,
|
|
48
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').frame
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const {
|
|
35
52
|
automatic,
|
|
36
|
-
class: className
|
|
53
|
+
class: className,
|
|
37
54
|
fill,
|
|
38
55
|
stroke,
|
|
39
56
|
fillOpacity,
|
|
40
57
|
strokeOpacity,
|
|
41
58
|
...options
|
|
42
|
-
}: FrameMarkProps = $
|
|
59
|
+
}: FrameMarkProps = $derived({
|
|
60
|
+
...DEFAULTS,
|
|
61
|
+
...markProps
|
|
62
|
+
});
|
|
43
63
|
|
|
44
64
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
45
65
|
const plot = $derived(getPlotState());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type FrameMarkProps = Omit<BaseMarkProps, 'fill' | 'stroke' | 'fillOpacity' | 'strokeOpacity'> & Omit<BaseRectMarkProps, 'inset' | 'insetLeft' | 'insetRight' | 'insetTop' | 'insetBottom'> & {
|
|
1
|
+
export type FrameMarkProps = Omit<BaseMarkProps, 'fill' | 'stroke' | 'fillOpacity' | 'strokeOpacity'> & LinkableMarkProps & Omit<BaseRectMarkProps, 'inset' | 'insetLeft' | 'insetRight' | 'insetTop' | 'insetBottom'> & {
|
|
2
2
|
fill: string;
|
|
3
3
|
stroke: string;
|
|
4
4
|
fillOpacity: number;
|
|
@@ -10,7 +10,7 @@ export type FrameMarkProps = Omit<BaseMarkProps, 'fill' | 'stroke' | 'fillOpacit
|
|
|
10
10
|
insetTop?: number;
|
|
11
11
|
insetBottom?: number;
|
|
12
12
|
};
|
|
13
|
-
import type { BaseRectMarkProps } from '../types.js';
|
|
13
|
+
import type { BaseRectMarkProps, LinkableMarkProps } from '../types.js';
|
|
14
14
|
import type { BaseMarkProps } from '../types.js';
|
|
15
15
|
/** Renders a simple frame around the entire plot domain */
|
|
16
16
|
declare const Frame: import("svelte").Component<FrameMarkProps, {}, "">;
|
package/dist/marks/Geo.svelte
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
geoType?: 'sphere' | 'graticule';
|
|
8
8
|
dragRotate: boolean;
|
|
9
9
|
canvas: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* simple browser tooltip to be displayed on mouseover
|
|
12
|
+
*/
|
|
13
|
+
title: ConstantAccessor<string>;
|
|
12
14
|
} & BaseMarkProps &
|
|
13
15
|
LinkableMarkProps;
|
|
14
16
|
</script>
|
|
@@ -20,7 +22,8 @@
|
|
|
20
22
|
PlotContext,
|
|
21
23
|
BaseMarkProps,
|
|
22
24
|
ConstantAccessor,
|
|
23
|
-
LinkableMarkProps
|
|
25
|
+
LinkableMarkProps,
|
|
26
|
+
PlotDefaults
|
|
24
27
|
} from '../types.js';
|
|
25
28
|
import Mark from '../Mark.svelte';
|
|
26
29
|
import { geoPath } from 'd3-geo';
|
|
@@ -31,18 +34,28 @@
|
|
|
31
34
|
import GeoCanvas from './helpers/GeoCanvas.svelte';
|
|
32
35
|
import { recordize } from '../transforms/recordize.js';
|
|
33
36
|
import { GEOJSON_PREFER_STROKE } from '../helpers/index.js';
|
|
37
|
+
import Anchor from './helpers/Anchor.svelte';
|
|
34
38
|
|
|
35
39
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
36
40
|
const plot = $derived(getPlotState());
|
|
37
41
|
|
|
38
|
-
let
|
|
42
|
+
let markProps: GeoMarkProps = $props();
|
|
43
|
+
|
|
44
|
+
const DEFAULTS = {
|
|
45
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').geo
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const {
|
|
39
49
|
data = [{}],
|
|
40
50
|
canvas = false,
|
|
41
51
|
geoType,
|
|
42
52
|
dragRotate,
|
|
43
|
-
class: className =
|
|
53
|
+
class: className = '',
|
|
44
54
|
...options
|
|
45
|
-
}: GeoMarkProps = $
|
|
55
|
+
}: GeoMarkProps = $derived({
|
|
56
|
+
...DEFAULTS,
|
|
57
|
+
...markProps
|
|
58
|
+
});
|
|
46
59
|
|
|
47
60
|
const path = $derived(
|
|
48
61
|
callWithProps(geoPath, [plot.scales.projection], {
|
|
@@ -68,28 +81,6 @@
|
|
|
68
81
|
channels={['fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'r']}
|
|
69
82
|
{...args}>
|
|
70
83
|
{#snippet children({ mark, scaledData, usedScales })}
|
|
71
|
-
{#snippet el(d)}
|
|
72
|
-
{@const title = resolveProp(args.title, d.datum, '')}
|
|
73
|
-
{@const geometry = resolveProp(args.geometry, d.datum, d.datum)}
|
|
74
|
-
{@const [style, styleClass] = resolveStyles(
|
|
75
|
-
plot,
|
|
76
|
-
d,
|
|
77
|
-
args,
|
|
78
|
-
GEOJSON_PREFER_STROKE.has(geometry.type) ? 'stroke' : 'fill',
|
|
79
|
-
usedScales
|
|
80
|
-
)}
|
|
81
|
-
<path
|
|
82
|
-
d={path(geometry)}
|
|
83
|
-
{style}
|
|
84
|
-
class={[styleClass]}
|
|
85
|
-
use:addEventHandlers={{
|
|
86
|
-
getPlotState,
|
|
87
|
-
options: args,
|
|
88
|
-
datum: d.datum
|
|
89
|
-
}}>
|
|
90
|
-
{#if title}<title>{title}</title>{/if}
|
|
91
|
-
</path>
|
|
92
|
-
{/snippet}
|
|
93
84
|
<g
|
|
94
85
|
aria-label="geo"
|
|
95
86
|
class={['geo', geoType && `geo-${geoType}`, className]}
|
|
@@ -99,15 +90,28 @@
|
|
|
99
90
|
{:else}
|
|
100
91
|
{#each scaledData as d, i (i)}
|
|
101
92
|
{#if d.valid}
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
93
|
+
<Anchor {options} datum={d.datum}>
|
|
94
|
+
{@const title = resolveProp(args.title, d.datum, '')}
|
|
95
|
+
{@const geometry = resolveProp(args.geometry, d.datum, d.datum)}
|
|
96
|
+
{@const [style, styleClass] = resolveStyles(
|
|
97
|
+
plot,
|
|
98
|
+
d,
|
|
99
|
+
args,
|
|
100
|
+
GEOJSON_PREFER_STROKE.has(geometry.type) ? 'stroke' : 'fill',
|
|
101
|
+
usedScales
|
|
102
|
+
)}
|
|
103
|
+
<path
|
|
104
|
+
d={path(geometry)}
|
|
105
|
+
{style}
|
|
106
|
+
class={[styleClass]}
|
|
107
|
+
use:addEventHandlers={{
|
|
108
|
+
getPlotState,
|
|
109
|
+
options: args,
|
|
110
|
+
datum: d.datum
|
|
111
|
+
}}>
|
|
112
|
+
{#if title}<title>{title}</title>{/if}
|
|
113
|
+
</path>
|
|
114
|
+
</Anchor>
|
|
111
115
|
{/if}
|
|
112
116
|
{/each}
|
|
113
117
|
{/if}
|
|
@@ -3,8 +3,10 @@ export type GeoMarkProps = {
|
|
|
3
3
|
geoType?: 'sphere' | 'graticule';
|
|
4
4
|
dragRotate: boolean;
|
|
5
5
|
canvas: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* simple browser tooltip to be displayed on mouseover
|
|
8
|
+
*/
|
|
9
|
+
title: ConstantAccessor<string>;
|
|
8
10
|
} & BaseMarkProps & LinkableMarkProps;
|
|
9
11
|
import type { DataRecord, BaseMarkProps, ConstantAccessor, LinkableMarkProps } from '../types.js';
|
|
10
12
|
/** Renders geographical data using projections and GeoJSON geometries */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Renders a geographic graticule grid with customizable step sizes
|
|
3
3
|
-->
|
|
4
4
|
<script module lang="ts">
|
|
5
|
-
import type {
|
|
5
|
+
import type { PlotDefaults, BaseMarkProps } from '../types.js';
|
|
6
6
|
export type GraticuleMarkProps = Omit<
|
|
7
7
|
BaseMarkProps,
|
|
8
8
|
'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target' | 'cursor'
|
|
@@ -17,17 +17,26 @@
|
|
|
17
17
|
import Geo from './Geo.svelte';
|
|
18
18
|
import { geoGraticule } from 'd3-geo';
|
|
19
19
|
import { getContext } from 'svelte';
|
|
20
|
+
import type { PlotDefaults } from '../types.js';
|
|
21
|
+
|
|
22
|
+
let markProps: GraticuleMarkProps = $props();
|
|
20
23
|
|
|
21
24
|
const DEFAULTS = {
|
|
22
|
-
|
|
23
|
-
...getContext<Partial<DefaultOptions>>('svelteplot/defaults')
|
|
25
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').graticule
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
const {
|
|
29
|
+
data = [{}],
|
|
30
|
+
class: className = '',
|
|
31
|
+
...options
|
|
32
|
+
}: GraticuleMarkProps = $derived({
|
|
33
|
+
...DEFAULTS,
|
|
34
|
+
...markProps
|
|
35
|
+
});
|
|
27
36
|
|
|
28
37
|
let graticule = $derived.by(() => {
|
|
29
38
|
const graticule = geoGraticule();
|
|
30
|
-
graticule.stepMinor([stepX || step, stepY || step]);
|
|
39
|
+
graticule.stepMinor([options.stepX || options.step, options.stepY || options.step]);
|
|
31
40
|
return graticule;
|
|
32
41
|
});
|
|
33
42
|
</script>
|
package/dist/marks/GridX.svelte
CHANGED
|
@@ -11,13 +11,27 @@
|
|
|
11
11
|
<script lang="ts">
|
|
12
12
|
import { getContext } from 'svelte';
|
|
13
13
|
import Mark from '../Mark.svelte';
|
|
14
|
-
import type { PlotContext, BaseMarkProps, RawValue } from '../types.js';
|
|
14
|
+
import type { PlotContext, BaseMarkProps, RawValue, PlotDefaults } from '../types.js';
|
|
15
15
|
import { resolveChannel, resolveStyles } from '../helpers/resolve.js';
|
|
16
16
|
import { autoTicks } from '../helpers/autoTicks.js';
|
|
17
17
|
import { testFilter } from '../helpers/index.js';
|
|
18
18
|
import { RAW_VALUE } from '../transforms/recordize.js';
|
|
19
19
|
|
|
20
|
-
let
|
|
20
|
+
let markProps: GridXMarkProps = $props();
|
|
21
|
+
|
|
22
|
+
const DEFAULTS = {
|
|
23
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').grid,
|
|
24
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').gridX
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
data = [],
|
|
29
|
+
automatic = false,
|
|
30
|
+
...options
|
|
31
|
+
}: GridXMarkProps = $derived({
|
|
32
|
+
...DEFAULTS,
|
|
33
|
+
...markProps
|
|
34
|
+
});
|
|
21
35
|
|
|
22
36
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
23
37
|
const plot = $derived(getPlotState());
|
package/dist/marks/GridY.svelte
CHANGED
|
@@ -11,13 +11,27 @@
|
|
|
11
11
|
<script lang="ts">
|
|
12
12
|
import { getContext } from 'svelte';
|
|
13
13
|
import Mark from '../Mark.svelte';
|
|
14
|
-
import type { PlotContext, BaseMarkProps, RawValue } from '../types.js';
|
|
14
|
+
import type { PlotContext, BaseMarkProps, RawValue, PlotDefaults } from '../types.js';
|
|
15
15
|
import { resolveChannel, resolveStyles } from '../helpers/resolve.js';
|
|
16
16
|
import { autoTicks } from '../helpers/autoTicks.js';
|
|
17
17
|
import { testFilter } from '../helpers/index.js';
|
|
18
18
|
import { RAW_VALUE } from '../transforms/recordize.js';
|
|
19
19
|
|
|
20
|
-
let
|
|
20
|
+
let markProps: GridYMarkProps = $props();
|
|
21
|
+
|
|
22
|
+
const DEFAULTS = {
|
|
23
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').grid,
|
|
24
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').gridY
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
data = [],
|
|
29
|
+
automatic = false,
|
|
30
|
+
...options
|
|
31
|
+
}: GridYMarkProps = $derived({
|
|
32
|
+
...DEFAULTS,
|
|
33
|
+
...markProps
|
|
34
|
+
});
|
|
21
35
|
|
|
22
36
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
23
37
|
const plot = $derived(getPlotState());
|
package/dist/marks/Line.svelte
CHANGED
|
@@ -47,22 +47,36 @@
|
|
|
47
47
|
import { pick } from 'es-toolkit';
|
|
48
48
|
import LineCanvas from './helpers/LineCanvas.svelte';
|
|
49
49
|
|
|
50
|
-
import type { RawValue } from '../types.js';
|
|
50
|
+
import type { RawValue, PlotDefaults } from '../types.js';
|
|
51
51
|
import { isValid } from '../helpers/index.js';
|
|
52
52
|
import { sort } from '../transforms/sort.js';
|
|
53
53
|
import { recordizeXY } from '../transforms/recordize.js';
|
|
54
54
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
55
55
|
|
|
56
|
-
let
|
|
56
|
+
let markProps: LineMarkProps = $props();
|
|
57
|
+
|
|
58
|
+
const DEFAULTS: LineMarkProps = {
|
|
59
|
+
curve: 'auto',
|
|
60
|
+
tension: 0,
|
|
61
|
+
canvas: false,
|
|
62
|
+
class: null,
|
|
63
|
+
lineClass: null,
|
|
64
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').line
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const {
|
|
57
68
|
data = [{}],
|
|
58
|
-
curve
|
|
59
|
-
tension
|
|
69
|
+
curve,
|
|
70
|
+
tension,
|
|
60
71
|
text,
|
|
61
|
-
canvas
|
|
62
|
-
class: className
|
|
63
|
-
lineClass
|
|
72
|
+
canvas,
|
|
73
|
+
class: className,
|
|
74
|
+
lineClass,
|
|
64
75
|
...options
|
|
65
|
-
}: LineMarkProps = $
|
|
76
|
+
}: LineMarkProps = $derived({
|
|
77
|
+
...DEFAULTS,
|
|
78
|
+
...markProps
|
|
79
|
+
});
|
|
66
80
|
|
|
67
81
|
const args = $derived(sort(recordizeXY({ data, ...options })));
|
|
68
82
|
|
package/dist/marks/Link.svelte
CHANGED
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
CurveName,
|
|
29
29
|
MarkerOptions,
|
|
30
30
|
RawValue,
|
|
31
|
-
ScaledDataRecord
|
|
31
|
+
ScaledDataRecord,
|
|
32
|
+
PlotDefaults
|
|
32
33
|
} from '../types.js';
|
|
33
34
|
import { resolveChannel, resolveProp, resolveStyles } from '../helpers/resolve.js';
|
|
34
35
|
import { maybeData } from '../helpers/index.js';
|
|
@@ -41,14 +42,21 @@
|
|
|
41
42
|
import { geoPath } from 'd3-geo';
|
|
42
43
|
import { pick } from 'es-toolkit';
|
|
43
44
|
|
|
44
|
-
let
|
|
45
|
+
let markProps: LinkMarkProps = $props();
|
|
46
|
+
const DEFAULTS = {
|
|
47
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').link
|
|
48
|
+
};
|
|
49
|
+
const {
|
|
45
50
|
data = [{}],
|
|
46
51
|
curve = 'auto',
|
|
47
52
|
tension = 0,
|
|
48
53
|
text,
|
|
49
|
-
class: className =
|
|
54
|
+
class: className = '',
|
|
50
55
|
...options
|
|
51
|
-
}: LinkMarkProps = $
|
|
56
|
+
}: LinkMarkProps = $derived({
|
|
57
|
+
...DEFAULTS,
|
|
58
|
+
...markProps
|
|
59
|
+
});
|
|
52
60
|
|
|
53
61
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
54
62
|
let plot = $derived(getPlotState());
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script lang="ts">
|
|
23
23
|
import { getContext, type Snippet } from 'svelte';
|
|
24
|
-
import type { PlotContext } from '../types.js';
|
|
24
|
+
import type { PlotContext, PlotDefaults } from '../types.js';
|
|
25
25
|
import { groups as d3Groups } from 'd3-array';
|
|
26
26
|
|
|
27
27
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
@@ -33,7 +33,13 @@
|
|
|
33
33
|
import isDataRecord from '../helpers/isDataRecord.js';
|
|
34
34
|
import { RAW_VALUE } from '../transforms/recordize.js';
|
|
35
35
|
|
|
36
|
-
let
|
|
36
|
+
let markProps: PointerMarkProps = $props();
|
|
37
|
+
|
|
38
|
+
const DEFAULTS = {
|
|
39
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').pointer
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const {
|
|
37
43
|
data = [{}],
|
|
38
44
|
children,
|
|
39
45
|
x,
|
|
@@ -41,7 +47,10 @@
|
|
|
41
47
|
z,
|
|
42
48
|
maxDistance = 15,
|
|
43
49
|
onupdate = null
|
|
44
|
-
}: PointerMarkProps = $
|
|
50
|
+
}: PointerMarkProps = $derived({
|
|
51
|
+
...DEFAULTS,
|
|
52
|
+
...markProps
|
|
53
|
+
});
|
|
45
54
|
|
|
46
55
|
let selectedData = $state([]);
|
|
47
56
|
|
package/dist/marks/Rect.svelte
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
y2?: ChannelAccessor;
|
|
14
14
|
interval?: number | string;
|
|
15
15
|
} & BaseMarkProps &
|
|
16
|
+
LinkableMarkProps &
|
|
16
17
|
BaseRectMarkProps;
|
|
17
18
|
</script>
|
|
18
19
|
|
|
@@ -25,12 +26,26 @@
|
|
|
25
26
|
DataRecord,
|
|
26
27
|
BaseMarkProps,
|
|
27
28
|
BaseRectMarkProps,
|
|
28
|
-
ChannelAccessor
|
|
29
|
+
ChannelAccessor,
|
|
30
|
+
PlotDefaults
|
|
29
31
|
} from '../types.js';
|
|
30
32
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
31
33
|
import RectPath from './helpers/RectPath.svelte';
|
|
32
34
|
|
|
33
|
-
let
|
|
35
|
+
let markProps: RectMarkProps = $props();
|
|
36
|
+
|
|
37
|
+
const DEFAULTS = {
|
|
38
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rect
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const {
|
|
42
|
+
data = [{}],
|
|
43
|
+
class: className = '',
|
|
44
|
+
...options
|
|
45
|
+
}: RectMarkProps = $derived({
|
|
46
|
+
...DEFAULTS,
|
|
47
|
+
...markProps
|
|
48
|
+
});
|
|
34
49
|
|
|
35
50
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
36
51
|
let plot = $derived(getPlotState());
|
|
@@ -7,9 +7,9 @@ export type RectMarkProps = {
|
|
|
7
7
|
y1?: ChannelAccessor;
|
|
8
8
|
y2?: ChannelAccessor;
|
|
9
9
|
interval?: number | string;
|
|
10
|
-
} & BaseMarkProps & BaseRectMarkProps;
|
|
10
|
+
} & BaseMarkProps & LinkableMarkProps & BaseRectMarkProps;
|
|
11
11
|
import type { DataRecord, BaseMarkProps, BaseRectMarkProps, ChannelAccessor } from '../types.js';
|
|
12
12
|
/** For arbitrary rectangles, requires quantitative x and y scales */
|
|
13
|
-
declare const Rect: import("svelte").Component<
|
|
13
|
+
declare const Rect: import("svelte").Component<any, {}, "">;
|
|
14
14
|
type Rect = ReturnType<typeof Rect>;
|
|
15
15
|
export default Rect;
|
package/dist/marks/RectX.svelte
CHANGED
|
@@ -8,11 +8,25 @@
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import Rect, { type RectMarkProps } from './Rect.svelte';
|
|
10
10
|
import { intervalY, stackX, recordizeX } from '../index.js';
|
|
11
|
-
import type { PlotContext } from '../types.js';
|
|
11
|
+
import type { PlotContext, PlotDefaults } from '../types.js';
|
|
12
12
|
import { getContext } from 'svelte';
|
|
13
13
|
import type { StackOptions } from '../transforms/stack';
|
|
14
14
|
|
|
15
|
-
let
|
|
15
|
+
let markProps: RectXMarkProps = $props();
|
|
16
|
+
|
|
17
|
+
const DEFAULTS = {
|
|
18
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rect,
|
|
19
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rectX
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
data = [{}],
|
|
24
|
+
stack,
|
|
25
|
+
...options
|
|
26
|
+
}: RectXMarkProps = $derived({
|
|
27
|
+
...DEFAULTS,
|
|
28
|
+
...markProps
|
|
29
|
+
});
|
|
16
30
|
|
|
17
31
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
18
32
|
let plot = $derived(getPlotState());
|
package/dist/marks/RectY.svelte
CHANGED
|
@@ -8,11 +8,25 @@
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import Rect, { type RectMarkProps } from './Rect.svelte';
|
|
10
10
|
import { intervalX, stackY, recordizeY } from '../index.js';
|
|
11
|
-
import type { PlotContext } from '../types.js';
|
|
11
|
+
import type { PlotContext, PlotDefaults } from '../types.js';
|
|
12
12
|
import { getContext } from 'svelte';
|
|
13
13
|
import type { StackOptions } from '../transforms/stack';
|
|
14
14
|
|
|
15
|
-
let
|
|
15
|
+
let markProps: RectYMarkProps = $props();
|
|
16
|
+
|
|
17
|
+
const DEFAULTS = {
|
|
18
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rect,
|
|
19
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rectY
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
data = [{}],
|
|
24
|
+
stack,
|
|
25
|
+
...options
|
|
26
|
+
}: RectYMarkProps = $derived({
|
|
27
|
+
...DEFAULTS,
|
|
28
|
+
...markProps
|
|
29
|
+
});
|
|
16
30
|
|
|
17
31
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
18
32
|
const plot = $derived(getPlotState());
|
package/dist/marks/RuleX.svelte
CHANGED
|
@@ -24,10 +24,23 @@
|
|
|
24
24
|
DataRecord,
|
|
25
25
|
BaseMarkProps,
|
|
26
26
|
ConstantAccessor,
|
|
27
|
-
ChannelAccessor
|
|
27
|
+
ChannelAccessor,
|
|
28
|
+
PlotDefaults
|
|
28
29
|
} from '../types.js';
|
|
29
30
|
|
|
30
|
-
let
|
|
31
|
+
let markProps: RuleXMarkProps = $props();
|
|
32
|
+
const DEFAULTS = {
|
|
33
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rule,
|
|
34
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').ruleX
|
|
35
|
+
};
|
|
36
|
+
const {
|
|
37
|
+
data = [{}],
|
|
38
|
+
class: className = '',
|
|
39
|
+
...options
|
|
40
|
+
}: RuleXMarkProps = $derived({
|
|
41
|
+
...DEFAULTS,
|
|
42
|
+
...markProps
|
|
43
|
+
});
|
|
31
44
|
|
|
32
45
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
33
46
|
const plot = $derived(getPlotState());
|
package/dist/marks/RuleY.svelte
CHANGED
|
@@ -24,10 +24,23 @@
|
|
|
24
24
|
DataRecord,
|
|
25
25
|
BaseMarkProps,
|
|
26
26
|
ConstantAccessor,
|
|
27
|
-
ChannelAccessor
|
|
27
|
+
ChannelAccessor,
|
|
28
|
+
PlotDefaults
|
|
28
29
|
} from '../types.js';
|
|
29
30
|
|
|
30
|
-
let
|
|
31
|
+
let markProps: RuleYMarkProps = $props();
|
|
32
|
+
const DEFAULTS = {
|
|
33
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').rule,
|
|
34
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').ruleY
|
|
35
|
+
};
|
|
36
|
+
const {
|
|
37
|
+
data = [{}],
|
|
38
|
+
class: className = '',
|
|
39
|
+
...options
|
|
40
|
+
}: RuleYMarkProps = $derived({
|
|
41
|
+
...DEFAULTS,
|
|
42
|
+
...markProps
|
|
43
|
+
});
|
|
31
44
|
|
|
32
45
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
33
46
|
const plot = $derived(getPlotState());
|
package/dist/marks/Sphere.svelte
CHANGED
|
@@ -2,14 +2,27 @@
|
|
|
2
2
|
Geo mark with Sphere geometry object -->
|
|
3
3
|
|
|
4
4
|
<script module lang="ts">
|
|
5
|
-
import { type BaseMarkProps } from '../types.js';
|
|
6
|
-
export type SphereMarkProps = BaseMarkProps;
|
|
5
|
+
import { type BaseMarkProps, type LinkableMarkProps } from '../types.js';
|
|
6
|
+
export type SphereMarkProps = BaseMarkProps & LinkableMarkProps;
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
10
|
import Geo from './Geo.svelte';
|
|
11
|
+
import { getContext } from 'svelte';
|
|
12
|
+
import type { PlotDefaults } from '../types.js';
|
|
11
13
|
|
|
12
|
-
let
|
|
14
|
+
let markProps: SphereMarkProps = $props();
|
|
15
|
+
const DEFAULTS = {
|
|
16
|
+
...getContext<PlotDefaults>('svelteplot/_defaults').sphere
|
|
17
|
+
};
|
|
18
|
+
const {
|
|
19
|
+
data = [{}],
|
|
20
|
+
class: className = '',
|
|
21
|
+
...options
|
|
22
|
+
}: SphereMarkProps = $derived({
|
|
23
|
+
...DEFAULTS,
|
|
24
|
+
...markProps
|
|
25
|
+
});
|
|
13
26
|
</script>
|
|
14
27
|
|
|
15
|
-
<Geo data
|
|
28
|
+
<Geo {data} {...options} geoType="sphere" />
|