svelteplot 0.4.7 → 0.4.8-pr-222.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/dist/core/Plot.svelte +54 -31
- 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/typeChecks.d.ts +4 -4
- package/dist/hooks/plotDefaults.d.ts +3 -0
- package/dist/hooks/plotDefaults.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/marks/Area.svelte +2 -1
- package/dist/marks/AreaX.svelte +4 -3
- package/dist/marks/AreaX.svelte.d.ts +2 -1
- package/dist/marks/AreaY.svelte +4 -5
- package/dist/marks/Arrow.svelte +3 -2
- package/dist/marks/AxisX.svelte +3 -4
- package/dist/marks/AxisX.svelte.d.ts +1 -1
- package/dist/marks/AxisY.svelte +3 -4
- package/dist/marks/AxisY.svelte.d.ts +6 -7
- package/dist/marks/BarX.svelte +4 -4
- package/dist/marks/BarX.svelte.d.ts +1 -1
- package/dist/marks/BarY.svelte +3 -3
- package/dist/marks/BollingerX.svelte.d.ts +2 -74
- package/dist/marks/BollingerY.svelte.d.ts +2 -74
- package/dist/marks/BoxX.svelte +4 -4
- package/dist/marks/BoxY.svelte +4 -4
- package/dist/marks/BoxY.svelte.d.ts +1 -0
- package/dist/marks/Brush.svelte +13 -7
- package/dist/marks/Brush.svelte.d.ts +10 -1
- package/dist/marks/BrushX.svelte +4 -4
- package/dist/marks/BrushY.svelte +4 -4
- package/dist/marks/Cell.svelte +3 -4
- package/dist/marks/ColorLegend.svelte +5 -4
- package/dist/marks/CustomMark.svelte.d.ts +2 -81
- package/dist/marks/DifferenceY.svelte +3 -3
- package/dist/marks/DifferenceY.svelte.d.ts +7 -67
- package/dist/marks/Dot.svelte +2 -2
- package/dist/marks/Frame.svelte +2 -2
- package/dist/marks/Geo.svelte +2 -2
- package/dist/marks/Graticule.svelte +3 -3
- package/dist/marks/GridX.svelte +3 -3
- package/dist/marks/GridY.svelte +4 -9
- package/dist/marks/Line.svelte +3 -2
- package/dist/marks/Line.svelte.d.ts +2 -2
- package/dist/marks/LineX.svelte.d.ts +2 -1
- package/dist/marks/LineY.svelte.d.ts +2 -1
- package/dist/marks/Link.svelte +3 -3
- package/dist/marks/Pointer.svelte +3 -3
- package/dist/marks/Rect.svelte +2 -3
- package/dist/marks/RectX.svelte +4 -3
- package/dist/marks/RectY.svelte +4 -3
- package/dist/marks/RuleX.svelte +3 -3
- package/dist/marks/RuleY.svelte +4 -4
- package/dist/marks/Sphere.svelte +2 -2
- package/dist/marks/Spike.svelte +4 -3
- package/dist/marks/Text.svelte +4 -4
- package/dist/marks/TickX.svelte +3 -3
- package/dist/marks/TickY.svelte +4 -4
- package/dist/marks/Vector.svelte +3 -3
- package/dist/marks/helpers/CanvasLayer.svelte +1 -1
- package/dist/marks/helpers/Marker.svelte +2 -1
- package/dist/marks/helpers/MarkerPath.svelte +4 -4
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +17 -2
- package/dist/marks/helpers/RectPath.svelte.d.ts +3 -63
- package/dist/transforms/bollinger.d.ts +1 -67
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -124
- package/dist/transforms/recordize.d.ts +1 -4
- package/dist/transforms/select.d.ts +7 -434
- package/dist/transforms/sort.d.ts +3 -246
- package/dist/transforms/stack.d.ts +3 -23
- package/dist/transforms/window.d.ts +2 -130
- package/dist/types/plot.d.ts +15 -8
- package/package.json +128 -127
- package/dist/marks/AreaY.svelte.d.ts +0 -99
package/dist/marks/Line.svelte
CHANGED
|
@@ -42,11 +42,12 @@
|
|
|
42
42
|
import { pick } from 'es-toolkit';
|
|
43
43
|
import LineCanvas from './helpers/LineCanvas.svelte';
|
|
44
44
|
|
|
45
|
-
import type { RawValue
|
|
45
|
+
import type { RawValue } from '../types/index.js';
|
|
46
46
|
import { isValid } from '../helpers/index.js';
|
|
47
47
|
import { sort } from '../transforms/sort.js';
|
|
48
48
|
import { recordizeXY } from '../transforms/recordize.js';
|
|
49
49
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
50
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
50
51
|
|
|
51
52
|
let markProps: LineMarkProps = $props();
|
|
52
53
|
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
canvas: false,
|
|
57
58
|
class: null,
|
|
58
59
|
lineClass: null,
|
|
59
|
-
...
|
|
60
|
+
...getPlotDefaults().line
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
const {
|
|
@@ -14,7 +14,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
14
14
|
sort: {
|
|
15
15
|
channel: string;
|
|
16
16
|
order?: "ascending" | "descending";
|
|
17
|
-
} | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
|
|
17
|
+
} | ((a: import("../types/data.js").RawValue, b: import("../types/data.js").RawValue) => number) | ConstantAccessor<import("../types/data.js").RawValue, Datum>;
|
|
18
18
|
stroke: ChannelAccessor<Datum>;
|
|
19
19
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
20
20
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
@@ -72,7 +72,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
72
72
|
outlineStrokeOpacity?: number;
|
|
73
73
|
curve?: CurveName | CurveFactory | "auto";
|
|
74
74
|
tension?: number;
|
|
75
|
-
sort?: ConstantAccessor<RawValue,
|
|
75
|
+
sort?: ConstantAccessor<RawValue, Datum_1> | {
|
|
76
76
|
channel: "stroke" | "fill";
|
|
77
77
|
};
|
|
78
78
|
text?: ConstantAccessor<string, Datum>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { recordizeX } from '../index.js';
|
|
1
2
|
import type { DataRow } from '../index.js';
|
|
2
3
|
declare class __sveltets_Render<Datum extends DataRow> {
|
|
3
4
|
props(): Omit<import("../types").MarkerOptions & Partial<{
|
|
@@ -70,7 +71,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
70
71
|
outlineStrokeOpacity?: number;
|
|
71
72
|
curve?: import("../types").CurveName | import("d3-shape").CurveFactory | "auto";
|
|
72
73
|
tension?: number;
|
|
73
|
-
sort?: import("../types").ConstantAccessor<
|
|
74
|
+
sort?: import("../types").ConstantAccessor<recordizeX, Datum_1> | {
|
|
74
75
|
channel: "stroke" | "fill";
|
|
75
76
|
};
|
|
76
77
|
text?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { recordizeY } from '../index.js';
|
|
1
2
|
import type { DataRow } from '../index.js';
|
|
2
3
|
declare class __sveltets_Render<Datum extends DataRow> {
|
|
3
4
|
props(): Omit<import("../types").MarkerOptions & Partial<{
|
|
@@ -70,7 +71,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
70
71
|
outlineStrokeOpacity?: number;
|
|
71
72
|
curve?: import("../types").CurveName | import("d3-shape").CurveFactory | "auto";
|
|
72
73
|
tension?: number;
|
|
73
|
-
sort?: import("../types").ConstantAccessor<
|
|
74
|
+
sort?: import("../types").ConstantAccessor<recordizeY, Datum_1> | {
|
|
74
75
|
channel: "stroke" | "fill";
|
|
75
76
|
};
|
|
76
77
|
text?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
|
package/dist/marks/Link.svelte
CHANGED
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
CurveName,
|
|
45
45
|
MarkerOptions,
|
|
46
46
|
RawValue,
|
|
47
|
-
ScaledDataRecord
|
|
48
|
-
PlotDefaults
|
|
47
|
+
ScaledDataRecord
|
|
49
48
|
} from '../types/index.js';
|
|
50
49
|
import { resolveChannel, resolveProp, resolveStyles } from '../helpers/resolve.js';
|
|
51
50
|
import Mark from '../Mark.svelte';
|
|
@@ -58,10 +57,11 @@
|
|
|
58
57
|
import { pick } from 'es-toolkit';
|
|
59
58
|
import { sort } from '../transforms/sort.js';
|
|
60
59
|
import { indexData } from '../transforms/recordize.js';
|
|
60
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
61
61
|
|
|
62
62
|
let markProps: LinkMarkProps = $props();
|
|
63
63
|
const DEFAULTS = {
|
|
64
|
-
...
|
|
64
|
+
...getPlotDefaults().link
|
|
65
65
|
};
|
|
66
66
|
const {
|
|
67
67
|
data = [{} as Datum],
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
import { getContext, type Snippet } from 'svelte';
|
|
27
|
-
import type { ChannelAccessor, DataRow, PlotContext
|
|
28
|
-
import { groups as d3Groups } from 'd3-array';
|
|
27
|
+
import type { ChannelAccessor, DataRow, PlotContext } from '../types/index.js';
|
|
29
28
|
import { resolveChannel } from '../helpers/resolve.js';
|
|
30
29
|
import { quadtree } from 'd3-quadtree';
|
|
31
30
|
import { projectXY } from '../helpers/scales.js';
|
|
32
31
|
import isDataRecord from '../helpers/isDataRecord.js';
|
|
33
32
|
import { indexData, RAW_VALUE } from '../transforms/recordize.js';
|
|
34
33
|
import { groupFacetsAndZ } from '../helpers/group.js';
|
|
34
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
35
35
|
|
|
36
36
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
37
37
|
const plot = $derived(getPlotState());
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
let markProps: PointerMarkProps = $props();
|
|
43
43
|
|
|
44
44
|
const DEFAULTS = {
|
|
45
|
-
...
|
|
45
|
+
...getPlotDefaults().pointer
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const {
|
package/dist/marks/Rect.svelte
CHANGED
|
@@ -26,17 +26,16 @@
|
|
|
26
26
|
BaseMarkProps,
|
|
27
27
|
BaseRectMarkProps,
|
|
28
28
|
ChannelAccessor,
|
|
29
|
-
PlotDefaults,
|
|
30
29
|
LinkableMarkProps
|
|
31
30
|
} from '../types/index.js';
|
|
32
31
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
33
32
|
import RectPath from './helpers/RectPath.svelte';
|
|
34
|
-
import {
|
|
33
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
35
34
|
|
|
36
35
|
let markProps: RectMarkProps = $props();
|
|
37
36
|
|
|
38
37
|
const DEFAULTS = {
|
|
39
|
-
...
|
|
38
|
+
...getPlotDefaults().rect
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
const {
|
package/dist/marks/RectX.svelte
CHANGED
|
@@ -9,15 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
import Rect from './Rect.svelte';
|
|
11
11
|
import { intervalY, stackX, recordizeX } from '../index.js';
|
|
12
|
-
import type { DataRecord, PlotContext
|
|
12
|
+
import type { DataRecord, PlotContext } from '../types/index.js';
|
|
13
13
|
import { getContext, type ComponentProps } from 'svelte';
|
|
14
14
|
import type { StackOptions } from '../transforms/stack.js';
|
|
15
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
15
16
|
|
|
16
17
|
let markProps: RectXMarkProps = $props();
|
|
17
18
|
|
|
18
19
|
const DEFAULTS = {
|
|
19
|
-
...
|
|
20
|
-
...
|
|
20
|
+
...getPlotDefaults().rect,
|
|
21
|
+
...getPlotDefaults().rectX
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const {
|
package/dist/marks/RectY.svelte
CHANGED
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
}
|
|
8
8
|
import Rect from './Rect.svelte';
|
|
9
9
|
import { intervalX, stackY, recordizeY } from '../index.js';
|
|
10
|
-
import type { DataRecord, PlotContext
|
|
10
|
+
import type { DataRecord, PlotContext } from '../types/index.js';
|
|
11
11
|
import { getContext, type ComponentProps } from 'svelte';
|
|
12
12
|
import type { StackOptions } from '../transforms/stack.js';
|
|
13
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
13
14
|
|
|
14
15
|
let markProps: RectYMarkProps = $props();
|
|
15
16
|
|
|
16
17
|
const DEFAULTS = {
|
|
17
|
-
...
|
|
18
|
-
...
|
|
18
|
+
...getPlotDefaults().rect,
|
|
19
|
+
...getPlotDefaults().rectY
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
const {
|
package/dist/marks/RuleX.svelte
CHANGED
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
BaseMarkProps,
|
|
23
23
|
ConstantAccessor,
|
|
24
24
|
ChannelAccessor,
|
|
25
|
-
PlotDefaults,
|
|
26
25
|
RawValue
|
|
27
26
|
} from '../types/index.js';
|
|
27
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
28
28
|
|
|
29
29
|
let markProps: RuleXMarkProps = $props();
|
|
30
30
|
const DEFAULTS = {
|
|
31
|
-
...
|
|
32
|
-
...
|
|
31
|
+
...getPlotDefaults().rule,
|
|
32
|
+
...getPlotDefaults().ruleX
|
|
33
33
|
};
|
|
34
34
|
const {
|
|
35
35
|
data = [{} as Datum],
|
package/dist/marks/RuleY.svelte
CHANGED
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
DataRecord,
|
|
22
22
|
BaseMarkProps,
|
|
23
23
|
ConstantAccessor,
|
|
24
|
-
ChannelAccessor
|
|
25
|
-
PlotDefaults
|
|
24
|
+
ChannelAccessor
|
|
26
25
|
} from '../types/index.js';
|
|
26
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
27
27
|
|
|
28
28
|
let markProps: RuleYMarkProps = $props();
|
|
29
29
|
const DEFAULTS = {
|
|
30
|
-
...
|
|
31
|
-
...
|
|
30
|
+
...getPlotDefaults().rule,
|
|
31
|
+
...getPlotDefaults().ruleY
|
|
32
32
|
};
|
|
33
33
|
const {
|
|
34
34
|
data = [{} as Datum],
|
package/dist/marks/Sphere.svelte
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
extends BaseMarkProps<GeoJSON.GeoJsonObject>,
|
|
7
7
|
LinkableMarkProps<GeoJSON.GeoJsonObject> {}
|
|
8
8
|
|
|
9
|
-
import { getContext } from 'svelte';
|
|
10
9
|
import Geo from './Geo.svelte';
|
|
11
10
|
import type { BaseMarkProps, LinkableMarkProps, PlotDefaults } from '../types/index.js';
|
|
11
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
12
12
|
|
|
13
13
|
let markProps: SphereMarkProps = $props();
|
|
14
14
|
|
|
15
15
|
const DEFAULTS = {
|
|
16
|
-
...
|
|
16
|
+
...getPlotDefaults().sphere
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const { ...options }: SphereMarkProps = $derived({
|
package/dist/marks/Spike.svelte
CHANGED
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
rotate?: ChannelAccessor<Datum>;
|
|
17
17
|
}
|
|
18
18
|
import Vector from './Vector.svelte';
|
|
19
|
-
import type { ChannelAccessor, DataRecord
|
|
20
|
-
import {
|
|
19
|
+
import type { ChannelAccessor, DataRecord } from '../types/index.js';
|
|
20
|
+
import { type ComponentProps } from 'svelte';
|
|
21
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
21
22
|
|
|
22
23
|
let markProps: SpikeMarkProps = $props();
|
|
23
24
|
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
stroke: 'currentColor',
|
|
30
31
|
sort: { channel: '-y' },
|
|
31
32
|
shape: 'spike' as const,
|
|
32
|
-
...
|
|
33
|
+
...getPlotDefaults().spike
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
const { data = [{} as Datum], ...options }: SpikeMarkProps = $derived({
|
package/dist/marks/Text.svelte
CHANGED
|
@@ -56,22 +56,22 @@
|
|
|
56
56
|
rotate?: ConstantAccessor<number, Datum>;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
import {
|
|
59
|
+
import { type Snippet } from 'svelte';
|
|
60
60
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
61
61
|
import type {
|
|
62
62
|
DataRecord,
|
|
63
63
|
BaseMarkProps,
|
|
64
64
|
ConstantAccessor,
|
|
65
65
|
ChannelAccessor,
|
|
66
|
-
PlotDefaults,
|
|
67
66
|
LinkableMarkProps
|
|
68
67
|
} from '../types/index.js';
|
|
69
|
-
import { resolveProp
|
|
68
|
+
import { resolveProp } from '../helpers/resolve.js';
|
|
70
69
|
import Mark from '../Mark.svelte';
|
|
71
70
|
import { sort } from '../index.js';
|
|
72
71
|
|
|
73
72
|
import MultilineText from './helpers/MultilineText.svelte';
|
|
74
73
|
import { indexData } from '../transforms/recordize';
|
|
74
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
75
75
|
|
|
76
76
|
const DEFAULTS = {
|
|
77
77
|
fontSize: 12,
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
frameAnchor: 'middle' as const,
|
|
81
81
|
lineHeight: 1.1,
|
|
82
82
|
rotate: 0,
|
|
83
|
-
...
|
|
83
|
+
...getPlotDefaults().text
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
let markProps: TextMarkProps = $props();
|
package/dist/marks/TickX.svelte
CHANGED
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
ChannelAccessor,
|
|
31
31
|
DataRow,
|
|
32
32
|
FacetContext,
|
|
33
|
-
PlotDefaults,
|
|
34
33
|
ConstantAccessor
|
|
35
34
|
} from '../types/index.js';
|
|
36
35
|
import { recordizeX } from '../index.js';
|
|
37
36
|
import { projectX, projectY } from '../helpers/scales.js';
|
|
38
37
|
import { isValid } from '../helpers/index.js';
|
|
39
38
|
import { testFilter, parseInset } from '../helpers/index.js';
|
|
39
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
40
40
|
|
|
41
41
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
42
42
|
let plot = $derived(getPlotState());
|
|
43
43
|
|
|
44
44
|
let markProps: TickXMarkProps = $props();
|
|
45
45
|
const DEFAULTS = {
|
|
46
|
-
...
|
|
47
|
-
...
|
|
46
|
+
...getPlotDefaults().tick,
|
|
47
|
+
...getPlotDefaults().tickX
|
|
48
48
|
};
|
|
49
49
|
const {
|
|
50
50
|
data = [{}],
|
package/dist/marks/TickY.svelte
CHANGED
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
ChannelAccessor,
|
|
30
30
|
DataRow,
|
|
31
31
|
FacetContext,
|
|
32
|
-
ConstantAccessor
|
|
33
|
-
PlotDefaults
|
|
32
|
+
ConstantAccessor
|
|
34
33
|
} from '../types/index.js';
|
|
35
34
|
import { recordizeY } from '../index.js';
|
|
36
35
|
import { projectX, projectY } from '../helpers/scales.js';
|
|
37
36
|
import { isValid } from '../helpers/index.js';
|
|
38
37
|
import { testFilter, parseInset } from '../helpers/index.js';
|
|
38
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
39
39
|
|
|
40
40
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
41
41
|
let plot = $derived(getPlotState());
|
|
42
42
|
|
|
43
43
|
let markProps: TickYMarkProps = $props();
|
|
44
44
|
const DEFAULTS = {
|
|
45
|
-
...
|
|
46
|
-
...
|
|
45
|
+
...getPlotDefaults().tick,
|
|
46
|
+
...getPlotDefaults().tickY
|
|
47
47
|
};
|
|
48
48
|
const {
|
|
49
49
|
data = [{}],
|
package/dist/marks/Vector.svelte
CHANGED
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
DataRecord,
|
|
34
34
|
BaseMarkProps,
|
|
35
35
|
ChannelAccessor,
|
|
36
|
-
FacetContext
|
|
37
|
-
PlotDefaults
|
|
36
|
+
FacetContext
|
|
38
37
|
} from '../types/index.js';
|
|
39
38
|
|
|
40
39
|
import { getContext, type Snippet } from 'svelte';
|
|
@@ -47,6 +46,7 @@
|
|
|
47
46
|
import { isValid } from '../helpers/index.js';
|
|
48
47
|
import { addEventHandlers } from './helpers/events.js';
|
|
49
48
|
import { indexData } from '../transforms/recordize.js';
|
|
49
|
+
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
50
50
|
|
|
51
51
|
const defaultRadius = 3.5;
|
|
52
52
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
let markProps: VectorMarkProps = $props();
|
|
60
60
|
const DEFAULTS = {
|
|
61
|
-
...
|
|
61
|
+
...getPlotDefaults().vector
|
|
62
62
|
};
|
|
63
63
|
const {
|
|
64
64
|
data = [{}],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
|
-
import type { PlotContext } from '../../
|
|
3
|
+
import type { PlotContext } from '../../types/plot';
|
|
4
4
|
import { devicePixelRatio } from 'svelte/reactivity/window';
|
|
5
5
|
import { MediaQuery } from 'svelte/reactivity';
|
|
6
6
|
import type { Attachment } from 'svelte/attachments';
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
18
|
import { getContext } from 'svelte';
|
|
19
|
+
import { getPlotDefaults } from '../../hooks/plotDefaults';
|
|
19
20
|
|
|
20
21
|
type MarkerProps = {
|
|
21
22
|
id: string;
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
71
|
|
|
71
|
-
const defaultDotRadius =
|
|
72
|
+
const defaultDotRadius = getPlotDefaults().markerDotRadius;
|
|
72
73
|
|
|
73
74
|
const markerColors = $derived({
|
|
74
75
|
fill: 'none',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@component
|
|
3
3
|
Helper component for paths with markers and optional text along the path.
|
|
4
4
|
-->
|
|
5
|
-
<script lang="ts">
|
|
5
|
+
<script lang="ts" generics="Datum extends DataRecord">
|
|
6
6
|
import Marker, { type MarkerShape } from './Marker.svelte';
|
|
7
7
|
import { isSnippet, randomId } from '../../helpers/index.js';
|
|
8
8
|
import { resolveProp } from '../../helpers/resolve.js';
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
import { addEventHandlers } from './events.js';
|
|
18
18
|
import { getContext } from 'svelte';
|
|
19
19
|
|
|
20
|
-
type MarkerPathProps = BaseMarkProps & {
|
|
20
|
+
type MarkerPathProps = BaseMarkProps<Datum> & {
|
|
21
21
|
/**
|
|
22
22
|
* the datum associated with this path, usually the first
|
|
23
23
|
* element of the data array group
|
|
24
24
|
*/
|
|
25
|
-
datum:
|
|
25
|
+
datum: Datum;
|
|
26
26
|
/**
|
|
27
27
|
* the marker shape to use at the start of the path, defaults to
|
|
28
28
|
* circle
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
transform: string;
|
|
53
53
|
color: string;
|
|
54
54
|
strokeWidth: ConstantAccessor<number>;
|
|
55
|
-
mark: Mark<BaseMarkProps
|
|
55
|
+
mark: Mark<BaseMarkProps<Datum>>;
|
|
56
56
|
scales: PlotScales;
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import type { DataRecord } from '../../types/index.js';
|
|
2
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
3
|
+
props(): any;
|
|
4
|
+
events(): {};
|
|
5
|
+
slots(): {};
|
|
6
|
+
bindings(): "";
|
|
7
|
+
exports(): {};
|
|
8
|
+
}
|
|
9
|
+
interface $$IsomorphicComponent {
|
|
10
|
+
new <Datum extends DataRecord>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
|
|
11
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
12
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
13
|
+
<Datum extends DataRecord>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
14
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
15
|
+
}
|
|
1
16
|
/** Helper component for paths with markers and optional text along the path. */
|
|
2
|
-
declare const MarkerPath:
|
|
3
|
-
type MarkerPath =
|
|
17
|
+
declare const MarkerPath: $$IsomorphicComponent;
|
|
18
|
+
type MarkerPath<Datum extends DataRecord> = InstanceType<typeof MarkerPath<Datum>>;
|
|
4
19
|
export default MarkerPath;
|
|
@@ -1,75 +1,15 @@
|
|
|
1
|
-
import type { BaseRectMarkProps } from '../../types/mark.js';
|
|
1
|
+
import type { BaseMarkProps, BaseRectMarkProps } from '../../types/mark.js';
|
|
2
2
|
import type { DataRecord, ScaledDataRecord } from '../../types/data.js';
|
|
3
3
|
import type { UsedScales } from '../../types/index.js';
|
|
4
4
|
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
5
5
|
props(): {
|
|
6
|
-
datum: ScaledDataRecord<
|
|
6
|
+
datum: ScaledDataRecord<Datum_1>;
|
|
7
7
|
class: string | null;
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
|
-
options: BaseRectMarkProps<
|
|
13
|
-
filter?: import("../../types/index.js").ConstantAccessor<boolean, Datum>;
|
|
14
|
-
facet?: "auto" | "include" | "exclude";
|
|
15
|
-
fx: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
16
|
-
fy: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
17
|
-
dx: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
18
|
-
dy: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
19
|
-
fill: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
20
|
-
fillOpacity: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
21
|
-
sort: {
|
|
22
|
-
channel: string;
|
|
23
|
-
order?: "ascending" | "descending";
|
|
24
|
-
} | ((a: import("../../types/data.js").RawValue, b: import("../../types/data.js").RawValue) => number) | import("../../types/index.js").ConstantAccessor<import("../../types/data.js").RawValue, Datum>;
|
|
25
|
-
stroke: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
26
|
-
strokeWidth: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
27
|
-
strokeOpacity: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
28
|
-
strokeLinejoin: import("../../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
29
|
-
strokeLinecap: import("../../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
30
|
-
strokeMiterlimit: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
31
|
-
opacity: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
32
|
-
strokeDasharray: import("../../types/index.js").ConstantAccessor<string, Datum>;
|
|
33
|
-
strokeDashoffset: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
34
|
-
mixBlendMode: import("../../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
35
|
-
clipPath: string;
|
|
36
|
-
imageFilter: import("../../types/index.js").ConstantAccessor<string, Datum>;
|
|
37
|
-
shapeRendering: import("../../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
38
|
-
paintOrder: import("../../types/index.js").ConstantAccessor<string, Datum>;
|
|
39
|
-
onclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
40
|
-
ondblclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
41
|
-
onmouseup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
42
|
-
onmousedown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
43
|
-
onmouseenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
44
|
-
onmousemove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
45
|
-
onmouseleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
46
|
-
onmouseout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
47
|
-
onmouseover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
48
|
-
onpointercancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
49
|
-
onpointerdown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
50
|
-
onpointerup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
51
|
-
onpointerenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
52
|
-
onpointerleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
53
|
-
onpointermove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
54
|
-
onpointerover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
55
|
-
onpointerout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
56
|
-
ondrag?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
57
|
-
ondrop?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
58
|
-
ondragstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
59
|
-
ondragenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
ondragleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
61
|
-
ondragover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
62
|
-
ondragend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
63
|
-
ontouchstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
64
|
-
ontouchmove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
65
|
-
ontouchend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
66
|
-
ontouchcancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
67
|
-
oncontextmenu?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
68
|
-
onwheel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
69
|
-
class?: string;
|
|
70
|
-
style?: string;
|
|
71
|
-
cursor: import("../../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
72
|
-
}>;
|
|
12
|
+
options: BaseRectMarkProps<Datum_1> & BaseMarkProps<Datum_1>;
|
|
73
13
|
/**
|
|
74
14
|
* By default, the `inset` property is applied to all four insets. Mark components
|
|
75
15
|
* can tweak this behavior for insetTop and insetBottom by setting the
|
|
@@ -11,70 +11,4 @@ export type BollingerOptions = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function bollingerX(args: TransformArg<DataRecord>, options?: BollingerOptions): TransformArg<DataRecord>;
|
|
13
13
|
export declare function bollingerY(args: TransformArg<DataRecord>, options?: BollingerOptions): TransformArg<DataRecord>;
|
|
14
|
-
export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions):
|
|
15
|
-
filter?: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
16
|
-
facet?: "auto" | "include" | "exclude" | undefined;
|
|
17
|
-
fx?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
18
|
-
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
19
|
-
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
20
|
-
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
21
|
-
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
22
|
-
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
23
|
-
sort?: {
|
|
24
|
-
channel: string;
|
|
25
|
-
order?: "ascending" | "descending";
|
|
26
|
-
} | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
27
|
-
stroke?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
28
|
-
strokeWidth?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
29
|
-
strokeOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
30
|
-
strokeLinejoin?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
31
|
-
strokeLinecap?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
32
|
-
strokeMiterlimit?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
33
|
-
opacity?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
34
|
-
strokeDasharray?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
35
|
-
strokeDashoffset?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
36
|
-
mixBlendMode?: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
37
|
-
clipPath?: string | undefined;
|
|
38
|
-
imageFilter?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
39
|
-
shapeRendering?: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
40
|
-
paintOrder?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
41
|
-
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
42
|
-
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
43
|
-
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
44
|
-
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
45
|
-
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
46
|
-
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
47
|
-
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
48
|
-
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
49
|
-
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
50
|
-
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
51
|
-
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
52
|
-
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
53
|
-
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
54
|
-
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
55
|
-
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
56
|
-
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
57
|
-
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
58
|
-
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
59
|
-
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
60
|
-
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
61
|
-
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
62
|
-
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
63
|
-
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
64
|
-
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
65
|
-
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
66
|
-
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
67
|
-
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
68
|
-
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
69
|
-
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
70
|
-
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
71
|
-
class?: string | undefined;
|
|
72
|
-
style?: string | undefined;
|
|
73
|
-
cursor?: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
74
|
-
data: {
|
|
75
|
-
__x: import("../types/index.js").RawValue;
|
|
76
|
-
__lo: number;
|
|
77
|
-
__avg: number;
|
|
78
|
-
__hi: number;
|
|
79
|
-
}[];
|
|
80
|
-
};
|
|
14
|
+
export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions): any;
|