svelteplot 0.3.1 → 0.3.2-pr-113.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/Mark.svelte +25 -27
- package/dist/Mark.svelte.d.ts +87 -17
- package/dist/Plot.svelte +1 -2
- package/dist/Plot.svelte.d.ts +1 -1
- package/dist/core/Facet.svelte +1 -1
- package/dist/core/Facet.svelte.d.ts +1 -1
- package/dist/core/FacetAxes.svelte +1 -1
- package/dist/core/FacetGrid.svelte +1 -1
- package/dist/core/FacetGrid.svelte.d.ts +1 -1
- package/dist/core/Plot.svelte +1 -1
- package/dist/core/Plot.svelte.d.ts +1 -1
- package/dist/helpers/autoTicks.js +1 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/getBaseStyles.d.ts +2 -0
- package/dist/helpers/getBaseStyles.js +8 -0
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/projection.d.ts +1 -1
- package/dist/helpers/resolve.d.ts +1 -1
- package/dist/helpers/scales.d.ts +1 -1
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/marks/Area.svelte +14 -17
- package/dist/marks/Area.svelte.d.ts +91 -19
- package/dist/marks/AreaX.svelte +15 -12
- package/dist/marks/AreaX.svelte.d.ts +94 -3
- package/dist/marks/AreaY.svelte +15 -15
- package/dist/marks/AreaY.svelte.d.ts +94 -3
- package/dist/marks/Arrow.svelte +16 -19
- package/dist/marks/Arrow.svelte.d.ts +110 -38
- package/dist/marks/AxisX.svelte +41 -41
- package/dist/marks/AxisX.svelte.d.ts +97 -25
- package/dist/marks/AxisY.svelte +40 -40
- package/dist/marks/AxisY.svelte.d.ts +98 -27
- package/dist/marks/BarX.svelte +28 -30
- package/dist/marks/BarX.svelte.d.ts +89 -17
- package/dist/marks/BarY.svelte +27 -27
- package/dist/marks/BarY.svelte.d.ts +88 -16
- package/dist/marks/BollingerX.svelte +21 -16
- package/dist/marks/BollingerX.svelte.d.ts +17 -16
- package/dist/marks/BollingerY.svelte +21 -16
- package/dist/marks/BollingerY.svelte.d.ts +17 -16
- package/dist/marks/BoxX.svelte +5 -7
- package/dist/marks/BoxX.svelte.d.ts +5 -3
- package/dist/marks/BoxY.svelte +13 -16
- package/dist/marks/BoxY.svelte.d.ts +41 -28
- package/dist/marks/Brush.svelte +27 -30
- package/dist/marks/Brush.svelte.d.ts +20 -15
- package/dist/marks/BrushX.svelte +9 -7
- package/dist/marks/BrushX.svelte.d.ts +5 -2
- package/dist/marks/BrushY.svelte +9 -7
- package/dist/marks/BrushY.svelte.d.ts +5 -2
- package/dist/marks/Cell.svelte +17 -18
- package/dist/marks/Cell.svelte.d.ts +80 -8
- package/dist/marks/CellX.svelte +12 -8
- package/dist/marks/CellX.svelte.d.ts +5 -2
- package/dist/marks/CellY.svelte +12 -8
- package/dist/marks/CellY.svelte.d.ts +5 -2
- package/dist/marks/ColorLegend.svelte +5 -8
- package/dist/marks/ColorLegend.svelte.d.ts +2 -2
- package/dist/marks/CustomMark.svelte +23 -16
- package/dist/marks/CustomMark.svelte.d.ts +17 -14
- package/dist/marks/CustomMarkHTML.svelte +20 -18
- package/dist/marks/CustomMarkHTML.svelte.d.ts +29 -15
- package/dist/marks/DifferenceY.svelte +54 -18
- package/dist/marks/DifferenceY.svelte.d.ts +59 -28
- package/dist/marks/Dot.svelte +13 -14
- package/dist/marks/Dot.svelte.d.ts +84 -12
- package/dist/marks/DotX.svelte +9 -9
- package/dist/marks/DotX.svelte.d.ts +86 -4
- package/dist/marks/DotY.svelte +10 -9
- package/dist/marks/DotY.svelte.d.ts +87 -5
- package/dist/marks/Frame.svelte +20 -27
- package/dist/marks/Frame.svelte.d.ts +24 -10
- package/dist/marks/Geo.svelte +22 -15
- package/dist/marks/Geo.svelte.d.ts +97 -13
- package/dist/marks/Graticule.svelte +16 -19
- package/dist/marks/Graticule.svelte.d.ts +3 -3
- package/dist/marks/GridX.svelte +5 -8
- package/dist/marks/GridX.svelte.d.ts +79 -7
- package/dist/marks/GridY.svelte +5 -8
- package/dist/marks/GridY.svelte.d.ts +79 -7
- package/dist/marks/HTMLTooltip.svelte +9 -14
- package/dist/marks/HTMLTooltip.svelte.d.ts +25 -12
- package/dist/marks/Line.svelte +24 -29
- package/dist/marks/Line.svelte.d.ts +97 -25
- package/dist/marks/LineX.svelte +9 -4
- package/dist/marks/LineX.svelte.d.ts +99 -3
- package/dist/marks/LineY.svelte +11 -5
- package/dist/marks/LineY.svelte.d.ts +100 -4
- package/dist/marks/Link.svelte +35 -19
- package/dist/marks/Link.svelte.d.ts +107 -18
- package/dist/marks/Pointer.svelte +13 -18
- package/dist/marks/Pointer.svelte.d.ts +34 -21
- package/dist/marks/Rect.svelte +19 -19
- package/dist/marks/Rect.svelte.d.ts +86 -13
- package/dist/marks/RectX.svelte +10 -9
- package/dist/marks/RectX.svelte.d.ts +22 -6
- package/dist/marks/RectY.svelte +9 -10
- package/dist/marks/RectY.svelte.d.ts +22 -6
- package/dist/marks/RegressionX.svelte +1 -1
- package/dist/marks/RegressionX.svelte.d.ts +1 -1
- package/dist/marks/RegressionY.svelte +1 -1
- package/dist/marks/RegressionY.svelte.d.ts +1 -1
- package/dist/marks/RuleX.svelte +14 -16
- package/dist/marks/RuleX.svelte.d.ts +84 -12
- package/dist/marks/RuleY.svelte +12 -15
- package/dist/marks/RuleY.svelte.d.ts +84 -12
- package/dist/marks/Sphere.svelte +6 -7
- package/dist/marks/Sphere.svelte.d.ts +3 -2
- package/dist/marks/Spike.svelte +17 -9
- package/dist/marks/Spike.svelte.d.ts +94 -4
- package/dist/marks/SymbolLegend.svelte +1 -1
- package/dist/marks/Text.svelte +36 -125
- package/dist/marks/Text.svelte.d.ts +101 -20
- package/dist/marks/TickX.svelte +12 -13
- package/dist/marks/TickX.svelte.d.ts +92 -20
- package/dist/marks/TickY.svelte +11 -14
- package/dist/marks/TickY.svelte.d.ts +92 -20
- package/dist/marks/Vector.svelte +19 -23
- package/dist/marks/Vector.svelte.d.ts +93 -21
- package/dist/marks/helpers/AreaCanvas.svelte +1 -1
- package/dist/marks/helpers/AreaCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/BaseAxisX.svelte +1 -2
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -1
- package/dist/marks/helpers/BaseAxisY.svelte +2 -3
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +1 -1
- package/dist/marks/helpers/CanvasLayer.svelte +1 -1
- package/dist/marks/helpers/DotCanvas.svelte +1 -1
- package/dist/marks/helpers/DotCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/GeoCanvas.svelte +1 -1
- package/dist/marks/helpers/GeoCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/LineCanvas.svelte +1 -1
- package/dist/marks/helpers/LineCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/LinearGradientX.svelte +1 -1
- package/dist/marks/helpers/LinearGradientX.svelte.d.ts +1 -1
- package/dist/marks/helpers/LinearGradientY.svelte +1 -1
- package/dist/marks/helpers/LinearGradientY.svelte.d.ts +1 -1
- package/dist/marks/helpers/MarkerPath.svelte +1 -1
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +1 -41
- package/dist/marks/helpers/MultilineText.svelte +158 -0
- package/dist/marks/helpers/MultilineText.svelte.d.ts +12 -0
- package/dist/marks/helpers/RectPath.svelte +29 -26
- package/dist/marks/helpers/RectPath.svelte.d.ts +39 -26
- package/dist/marks/helpers/Regression.svelte +7 -2
- package/dist/marks/helpers/Regression.svelte.d.ts +2 -5
- package/dist/transforms/bollinger.d.ts +1 -66
- package/dist/transforms/centroid.d.ts +7 -65
- package/dist/transforms/centroid.js +10 -7
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -122
- package/dist/transforms/map.d.ts +4 -184
- package/dist/transforms/normalize.d.ts +3 -123
- package/dist/transforms/select.d.ts +7 -427
- package/dist/transforms/sort.d.ts +3 -242
- package/dist/transforms/window.d.ts +2 -130
- package/dist/types/channel.d.ts +11 -0
- package/dist/types/channel.js +1 -0
- package/dist/types/colorScheme.d.ts +1 -0
- package/dist/types/colorScheme.js +1 -0
- package/dist/types/data.d.ts +13 -0
- package/dist/types/data.js +1 -0
- package/dist/types/facet.d.ts +50 -0
- package/dist/types/facet.js +1 -0
- package/dist/types/index.d.ts +58 -0
- package/dist/types/index.js +7 -0
- package/dist/types/mark.d.ts +123 -0
- package/dist/types/mark.js +1 -0
- package/dist/types/plot.d.ts +459 -0
- package/dist/types/plot.js +1 -0
- package/dist/types/scale.d.ts +143 -0
- package/dist/types/scale.js +1 -0
- package/dist/types.d.ts +120 -127
- package/package.json +125 -120
package/dist/Mark.svelte
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
1
|
+
<script lang="ts" generics="Datum extends DataRecord">
|
|
2
|
+
interface MarkProps extends Partial<BaseMarkProps<Datum>> {
|
|
3
|
+
data?: Datum[];
|
|
4
|
+
automatic?: boolean;
|
|
5
|
+
type: MarkType;
|
|
6
|
+
channels?: ScaledChannelName[];
|
|
7
|
+
required?: ScaledChannelName[];
|
|
8
|
+
requiredScales?: Partial<Record<ScaleName, ScaleType[]>>;
|
|
9
|
+
children?: Snippet<
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
mark: Mark<GenericMarkOptions>;
|
|
13
|
+
usedScales: ReturnType<typeof getUsedScales>;
|
|
14
|
+
scaledData: ScaledDataRecord[];
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
>;
|
|
18
|
+
defaults?: Partial<Record<ScaledChannelName, RawValue>>;
|
|
19
|
+
}
|
|
3
20
|
|
|
21
|
+
import { getContext, untrack, type Snippet } from 'svelte';
|
|
4
22
|
import { CHANNEL_SCALE, INDEX } from './constants.js';
|
|
5
23
|
import type {
|
|
6
24
|
ScaledChannelName,
|
|
@@ -17,32 +35,12 @@
|
|
|
17
35
|
ResolvedDataRecord,
|
|
18
36
|
ScaledDataRecord,
|
|
19
37
|
ScaleType
|
|
20
|
-
} from './types.js';
|
|
38
|
+
} from './types/index.js';
|
|
21
39
|
import { isEqual } from 'es-toolkit';
|
|
22
40
|
import { getUsedScales, projectXY, projectX, projectY } from './helpers/scales.js';
|
|
23
41
|
import { testFilter, isValid } from './helpers/index.js';
|
|
24
42
|
import { resolveChannel, resolveProp } from './helpers/resolve.js';
|
|
25
43
|
|
|
26
|
-
type MarkProps = {
|
|
27
|
-
data?: DataRecord[];
|
|
28
|
-
automatic?: boolean;
|
|
29
|
-
type: MarkType;
|
|
30
|
-
channels?: ScaledChannelName[];
|
|
31
|
-
required?: ScaledChannelName[];
|
|
32
|
-
requiredScales?: Partial<Record<ScaleName, ScaleType[]>>;
|
|
33
|
-
children?: Snippet<
|
|
34
|
-
[
|
|
35
|
-
{
|
|
36
|
-
mark: Mark<GenericMarkOptions>;
|
|
37
|
-
usedScales: ReturnType<typeof getUsedScales>;
|
|
38
|
-
scaledData: ScaledDataRecord[];
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
>;
|
|
42
|
-
defaults?: Partial<Record<ScaledChannelName, RawValue>>;
|
|
43
|
-
} & Partial<Record<ChannelName, ChannelAccessor>> &
|
|
44
|
-
Partial<BaseMarkProps>;
|
|
45
|
-
|
|
46
44
|
let {
|
|
47
45
|
data = [],
|
|
48
46
|
children,
|
|
@@ -134,13 +132,13 @@
|
|
|
134
132
|
const { getTestFacet } = getContext<FacetContext>('svelteplot/facet');
|
|
135
133
|
const testFacet = $derived(getTestFacet());
|
|
136
134
|
|
|
137
|
-
const resolvedData: ResolvedDataRecord[] = $derived(
|
|
135
|
+
const resolvedData: ResolvedDataRecord<Datum>[] = $derived(
|
|
138
136
|
data
|
|
139
137
|
.map((d, i) => ({ ...d, [INDEX]: i }))
|
|
140
138
|
.flatMap((row) => {
|
|
141
|
-
const channels = options as Record<ChannelName, ChannelAccessor
|
|
139
|
+
const channels = options as Record<ChannelName, ChannelAccessor<Datum>>;
|
|
142
140
|
if (!testFacet(row, channels) || !testFilter(row, channels)) return [];
|
|
143
|
-
const out: ResolvedDataRecord = {
|
|
141
|
+
const out: ResolvedDataRecord<Datum> = {
|
|
144
142
|
datum: row
|
|
145
143
|
};
|
|
146
144
|
for (const [channel] of Object.entries(CHANNEL_SCALE) as [
|
|
@@ -208,7 +206,7 @@
|
|
|
208
206
|
*/
|
|
209
207
|
const scaledData = $derived(
|
|
210
208
|
resolvedData.flatMap((row) => {
|
|
211
|
-
const out: ScaledDataRecord = {
|
|
209
|
+
const out: ScaledDataRecord<Datum> = {
|
|
212
210
|
datum: row.datum,
|
|
213
211
|
valid: true
|
|
214
212
|
};
|
package/dist/Mark.svelte.d.ts
CHANGED
|
@@ -1,22 +1,92 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
-
import type { ScaledChannelName, MarkType, DataRecord,
|
|
2
|
+
import type { ScaledChannelName, MarkType, DataRecord, ChannelAccessor, ScaleName, RawValue, ScaledDataRecord, ScaleType } from './types/index.js';
|
|
3
3
|
import { getUsedScales } from './helpers/scales.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
5
|
+
props(): Partial<Partial<{
|
|
6
|
+
filter?: import("./types/index.js").ConstantAccessor<boolean, Datum>;
|
|
7
|
+
facet?: "auto" | "include" | "exclude";
|
|
8
|
+
fx: ChannelAccessor<Datum>;
|
|
9
|
+
fy: ChannelAccessor<Datum>;
|
|
10
|
+
dx: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
11
|
+
dy: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
12
|
+
fill: ChannelAccessor<Datum>;
|
|
13
|
+
fillOpacity: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
14
|
+
sort: {
|
|
15
|
+
channel: string;
|
|
16
|
+
order?: "ascending" | "descending";
|
|
17
|
+
} | ((a: RawValue, b: RawValue) => number) | import("./types/index.js").ConstantAccessor<RawValue, Datum>;
|
|
18
|
+
stroke: ChannelAccessor<Datum>;
|
|
19
|
+
strokeWidth: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
20
|
+
strokeOpacity: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
21
|
+
strokeLinejoin: import("./types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
22
|
+
strokeLinecap: import("./types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
23
|
+
strokeMiterlimit: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
24
|
+
opacity: ChannelAccessor<Datum>;
|
|
25
|
+
strokeDasharray: import("./types/index.js").ConstantAccessor<string, Datum>;
|
|
26
|
+
strokeDashoffset: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
27
|
+
mixBlendMode: import("./types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
28
|
+
clipPath: string;
|
|
29
|
+
imageFilter: import("./types/index.js").ConstantAccessor<string, Datum>;
|
|
30
|
+
shapeRendering: import("./types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
31
|
+
paintOrder: import("./types/index.js").ConstantAccessor<string, Datum>;
|
|
32
|
+
onclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
33
|
+
ondblclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
34
|
+
onmouseup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
onmousedown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmouseenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmousemove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmouseleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onmouseout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onmouseover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onpointercancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onpointerdown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointerup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointerenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointermove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
onpointerover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
onpointerout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
ondrag?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
ondrop?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondragstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondragenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ondragover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ondragend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ontouchstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ontouchmove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
ontouchend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
ontouchcancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
oncontextmenu?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
61
|
+
onwheel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
62
|
+
class: string | null;
|
|
63
|
+
cursor: import("./types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
64
|
+
}>> & {
|
|
65
|
+
data?: Datum[] | undefined;
|
|
66
|
+
automatic?: boolean;
|
|
67
|
+
type: MarkType;
|
|
68
|
+
channels?: ScaledChannelName[];
|
|
69
|
+
required?: ScaledChannelName[];
|
|
70
|
+
requiredScales?: Partial<Record<ScaleName, ScaleType[]>>;
|
|
71
|
+
children?: Snippet<[{
|
|
72
|
+
mark: any;
|
|
14
73
|
usedScales: ReturnType<typeof getUsedScales>;
|
|
15
74
|
scaledData: ScaledDataRecord[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
75
|
+
}]> | undefined;
|
|
76
|
+
defaults?: Partial<Record<ScaledChannelName, RawValue>>;
|
|
77
|
+
};
|
|
78
|
+
events(): {};
|
|
79
|
+
slots(): {};
|
|
80
|
+
bindings(): "";
|
|
81
|
+
exports(): {};
|
|
82
|
+
}
|
|
83
|
+
interface $$IsomorphicComponent {
|
|
84
|
+
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']>> & {
|
|
85
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
86
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
87
|
+
<Datum extends DataRecord>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
88
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
89
|
+
}
|
|
90
|
+
declare const Mark: $$IsomorphicComponent;
|
|
91
|
+
type Mark<Datum extends DataRecord> = InstanceType<typeof Mark<Datum>>;
|
|
22
92
|
export default Mark;
|
package/dist/Plot.svelte
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<script lang="ts">
|
|
13
13
|
import Plot from './core/Plot.svelte';
|
|
14
14
|
|
|
15
|
-
import type { PlotDefaults, PlotOptions } from './types.js';
|
|
15
|
+
import type { PlotDefaults, PlotOptions } from './types/index.js';
|
|
16
16
|
|
|
17
17
|
// implicit marks
|
|
18
18
|
import AxisX from './marks/AxisX.svelte';
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
import { autoScale, autoScaleColor } from './helpers/autoScales.js';
|
|
29
29
|
import { namedProjection } from './helpers/autoProjection.js';
|
|
30
30
|
import { isObject } from './helpers/index.js';
|
|
31
|
-
import { getContext } from 'svelte';
|
|
32
31
|
|
|
33
32
|
let {
|
|
34
33
|
header: userHeader,
|
package/dist/Plot.svelte.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plot from './core/Plot.svelte';
|
|
2
|
-
import type { PlotOptions } from './types.js';
|
|
2
|
+
import type { PlotOptions } from './types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The Plot component is the container for plots. It collects the marks with
|
|
5
5
|
* their data and channels and computes the shared scales.
|
package/dist/core/Facet.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { setContext, type Snippet } from 'svelte';
|
|
3
3
|
import { resolveChannel } from '../helpers/resolve.js';
|
|
4
|
-
import type { BaseMarkProps, DataRecord, RawValue } from '../types.js';
|
|
4
|
+
import type { BaseMarkProps, DataRecord, RawValue } from '../types/index.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
fx,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { getContext } from 'svelte';
|
|
7
|
-
import type { PlotContext } from '../types.js';
|
|
7
|
+
import type { PlotContext } from '../types/index.js';
|
|
8
8
|
import { scaleBand } from 'd3-scale';
|
|
9
9
|
import BaseAxisX from '../marks/helpers/BaseAxisX.svelte';
|
|
10
10
|
import BaseAxisY from '../marks/helpers/BaseAxisY.svelte';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
-->
|
|
6
6
|
<script lang="ts">
|
|
7
7
|
import { getContext, type Snippet } from 'svelte';
|
|
8
|
-
import type { PlotContext, GenericMarkOptions, Mark } from '../types.js';
|
|
8
|
+
import type { PlotContext, GenericMarkOptions, Mark } from '../types/index.js';
|
|
9
9
|
import { scaleBand } from 'd3-scale';
|
|
10
10
|
import Facet from './Facet.svelte';
|
|
11
11
|
import { getEmptyFacets } from '../helpers/facets.js';
|
package/dist/core/Plot.svelte
CHANGED
|
@@ -35,7 +35,7 @@ export function autoTicks(type, ticks, interval, domain, scaleFn, count) {
|
|
|
35
35
|
if (interval) {
|
|
36
36
|
const [lo, hi] = extent(domain);
|
|
37
37
|
const I = maybeInterval(interval, type);
|
|
38
|
-
return I.range(lo, I.offset(hi));
|
|
38
|
+
return I.range(lo, I.offset(hi)).filter((d) => d >= lo && d <= hi);
|
|
39
39
|
}
|
|
40
40
|
return typeof scaleFn.ticks === 'function' ? scaleFn.ticks(count) : [];
|
|
41
41
|
}
|
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type SchemeGetter = (n: number) => readonly string[];
|
|
|
6
6
|
export declare function isOrdinalScheme(scheme: ColorScheme): boolean;
|
|
7
7
|
export declare function ordinalScheme(scheme: string): SchemeGetter | undefined;
|
|
8
8
|
export declare function ordinalRange(scheme: string, length: number): readonly string[] | undefined;
|
|
9
|
-
export declare function maybeBooleanRange(domain: boolean[], scheme?: string):
|
|
9
|
+
export declare function maybeBooleanRange(domain: boolean[], scheme?: string): any[] | undefined;
|
|
10
10
|
export declare function isQuantitativeScheme(scheme: string): boolean;
|
|
11
11
|
export declare function quantitativeScheme(scheme: string): typeof interpolateBrBG | undefined;
|
|
12
12
|
export declare function isDivergingScheme(scheme: string): boolean;
|
|
@@ -5,3 +5,5 @@ export declare function getBaseStylesObject(datum: DataRow, props: Partial<Chann
|
|
|
5
5
|
};
|
|
6
6
|
export default function (datum: DataRow, props: Partial<Channels>): string;
|
|
7
7
|
export declare function maybeToPixel(cssKey: string, value: string | number): string | number;
|
|
8
|
+
export declare function maybeFromPixel(value: string | number): string | number;
|
|
9
|
+
export declare function maybeFromRem(value: string | number, rootFontSize?: number): string | number;
|
|
@@ -41,3 +41,11 @@ export function maybeToPixel(cssKey, value) {
|
|
|
41
41
|
}
|
|
42
42
|
return value;
|
|
43
43
|
}
|
|
44
|
+
export function maybeFromPixel(value) {
|
|
45
|
+
return typeof value === 'string' && value.endsWith('px') ? +value.slice(0, -2) : value;
|
|
46
|
+
}
|
|
47
|
+
export function maybeFromRem(value, rootFontSize = 16) {
|
|
48
|
+
return typeof value === 'string' && value.endsWith('rem')
|
|
49
|
+
? +value.slice(0, -3) * rootFontSize
|
|
50
|
+
: value;
|
|
51
|
+
}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { Snippet } from 'svelte';
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns first argument that is not null or undefined
|
|
5
5
|
*/
|
|
6
|
-
export declare function coalesce(...args: (RawValue | undefined | null)[]):
|
|
7
|
-
export declare function testFilter(datum: DataRecord, options: Record<ChannelName, ChannelAccessor>):
|
|
6
|
+
export declare function coalesce(...args: (RawValue | undefined | null)[]): any;
|
|
7
|
+
export declare function testFilter(datum: DataRecord, options: Record<ChannelName, ChannelAccessor>): any;
|
|
8
8
|
export declare function randomId(): string;
|
|
9
9
|
export declare function isSnippet(value: unknown): value is Snippet;
|
|
10
10
|
export declare function isValid(value: RawValue | undefined): value is number | Date | string;
|
|
@@ -10,7 +10,7 @@ type ChannelOptions = {
|
|
|
10
10
|
channel?: ScaledChannelName | null;
|
|
11
11
|
};
|
|
12
12
|
export declare function toChannelOption(name: ScaledChannelName, channel: ChannelAccessor | ChannelAlias): ChannelOptions;
|
|
13
|
-
export declare function resolveChannel(channel: ChannelName, datum: DataRow
|
|
13
|
+
export declare function resolveChannel<T>(channel: ChannelName, datum: DataRow<T>, channels: Partial<Record<ChannelName, ChannelAccessor<T> | ChannelAlias>>): RawValue;
|
|
14
14
|
export declare function resolveScaledStyleProps(datum: DataRecord, channels: Partial<Record<ScaledChannelName, ChannelAccessor>>, useScale: Record<ScaledChannelName, boolean>, plot: PlotState, defaultColorProp?: 'fill' | 'stroke' | null): any;
|
|
15
15
|
export declare function resolveScaledStyles(datum: DataRecord, channels: Partial<Record<ScaledChannelName, ChannelAccessor> & {
|
|
16
16
|
style: string;
|
package/dist/helpers/scales.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function createScale<T extends ScaleOptions>(name: ScaleName, sca
|
|
|
15
15
|
autoTitle?: undefined;
|
|
16
16
|
} | {
|
|
17
17
|
type: ScaleType;
|
|
18
|
-
domain:
|
|
18
|
+
domain: any;
|
|
19
19
|
range: any;
|
|
20
20
|
fn: any;
|
|
21
21
|
skip: Map<ScaledChannelName, Set<symbol>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { RawValue } from '../types.js';
|
|
2
|
-
export declare function isBooleanOrNull(v: RawValue):
|
|
2
|
+
export declare function isBooleanOrNull(v: RawValue): boolean;
|
|
3
3
|
export declare function isDate(v: RawValue): v is Date;
|
|
4
|
-
export declare function isDateOrNull(v: RawValue | null | undefined):
|
|
4
|
+
export declare function isDateOrNull(v: RawValue | null | undefined): boolean;
|
|
5
5
|
export declare function isNumberOrNull(v: RawValue | null | undefined): boolean;
|
|
6
6
|
export declare function isNumberOrNullOrNaN(v: RawValue | null | undefined): boolean;
|
|
7
|
-
export declare function isStringOrNull(v: RawValue | null | undefined):
|
|
7
|
+
export declare function isStringOrNull(v: RawValue | null | undefined): boolean;
|
|
8
8
|
export declare function isSymbolOrNull(v: RawValue | null | undefined): boolean;
|
|
9
|
-
export declare function isColorOrNull(v: RawValue | null | undefined):
|
|
9
|
+
export declare function isColorOrNull(v: RawValue | null | undefined): any;
|
|
10
10
|
export declare function isOpacityOrNull(v: RawValue): boolean;
|
package/dist/marks/Area.svelte
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
<!-- @component
|
|
2
2
|
Creates an area chart with filled regions between two x-y value pairs
|
|
3
3
|
-->
|
|
4
|
-
<script
|
|
5
|
-
|
|
6
|
-
data:
|
|
7
|
-
x1?: ChannelAccessor
|
|
8
|
-
x2?: ChannelAccessor
|
|
9
|
-
y1?: ChannelAccessor
|
|
10
|
-
y2?: ChannelAccessor
|
|
11
|
-
z?: ChannelAccessor
|
|
4
|
+
<script lang="ts" generics="Datum extends DataRecord">
|
|
5
|
+
interface AreaMarkProps extends BaseMarkProps<Datum>, LinkableMarkProps<Datum> {
|
|
6
|
+
data: Datum[];
|
|
7
|
+
x1?: ChannelAccessor<Datum>;
|
|
8
|
+
x2?: ChannelAccessor<Datum>;
|
|
9
|
+
y1?: ChannelAccessor<Datum>;
|
|
10
|
+
y2?: ChannelAccessor<Datum>;
|
|
11
|
+
z?: ChannelAccessor<Datum>;
|
|
12
12
|
curve?: CurveName | CurveFactory;
|
|
13
13
|
tension?: number;
|
|
14
14
|
sort?: ConstantAccessor<RawValue> | { channel: 'stroke' | 'fill' };
|
|
15
15
|
stack?: Partial<StackOptions>;
|
|
16
16
|
canvas?: boolean;
|
|
17
|
-
}
|
|
18
|
-
LinkableMarkProps;
|
|
19
|
-
</script>
|
|
17
|
+
}
|
|
20
18
|
|
|
21
|
-
<script lang="ts">
|
|
22
19
|
import Mark from '../Mark.svelte';
|
|
23
20
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
24
21
|
import { getContext } from 'svelte';
|
|
@@ -41,23 +38,23 @@
|
|
|
41
38
|
ScaledDataRecord,
|
|
42
39
|
LinkableMarkProps,
|
|
43
40
|
PlotDefaults
|
|
44
|
-
} from '../types.js';
|
|
45
|
-
import type { RawValue } from '../types.js';
|
|
41
|
+
} from '../types/index.js';
|
|
42
|
+
import type { RawValue } from '../types/index.js';
|
|
46
43
|
import type { StackOptions } from '../transforms/stack.js';
|
|
47
44
|
|
|
48
45
|
let markProps: AreaMarkProps = $props();
|
|
49
46
|
|
|
50
47
|
const DEFAULTS = {
|
|
51
48
|
fill: 'currentColor',
|
|
52
|
-
curve: 'linear',
|
|
49
|
+
curve: 'linear' as CurveName,
|
|
53
50
|
tension: 0,
|
|
54
51
|
...getContext<PlotDefaults>('svelteplot/_defaults').area
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
const {
|
|
58
|
-
data,
|
|
55
|
+
data = [{} as Datum],
|
|
59
56
|
/** the curve */
|
|
60
|
-
curve = 'linear',
|
|
57
|
+
curve = 'linear' as CurveName,
|
|
61
58
|
tension = 0,
|
|
62
59
|
class: className = '',
|
|
63
60
|
canvas = false,
|
|
@@ -1,23 +1,95 @@
|
|
|
1
|
-
export type AreaMarkProps = {
|
|
2
|
-
data: DataRecord[];
|
|
3
|
-
x1?: ChannelAccessor;
|
|
4
|
-
x2?: ChannelAccessor;
|
|
5
|
-
y1?: ChannelAccessor;
|
|
6
|
-
y2?: ChannelAccessor;
|
|
7
|
-
z?: ChannelAccessor;
|
|
8
|
-
curve?: CurveName | CurveFactory;
|
|
9
|
-
tension?: number;
|
|
10
|
-
sort?: ConstantAccessor<RawValue> | {
|
|
11
|
-
channel: 'stroke' | 'fill';
|
|
12
|
-
};
|
|
13
|
-
stack?: Partial<StackOptions>;
|
|
14
|
-
canvas?: boolean;
|
|
15
|
-
} & BaseMarkProps & LinkableMarkProps;
|
|
16
1
|
import { type CurveFactory } from 'd3-shape';
|
|
17
|
-
import type { CurveName, DataRecord,
|
|
18
|
-
import type { RawValue } from '../types.js';
|
|
2
|
+
import type { CurveName, DataRecord, ConstantAccessor, ChannelAccessor, LinkableMarkProps } from '../types/index.js';
|
|
3
|
+
import type { RawValue } from '../types/index.js';
|
|
19
4
|
import type { StackOptions } from '../transforms/stack.js';
|
|
5
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
6
|
+
props(): Partial<{
|
|
7
|
+
filter?: ConstantAccessor<boolean, Datum>;
|
|
8
|
+
facet?: "auto" | "include" | "exclude";
|
|
9
|
+
fx: ChannelAccessor<Datum>;
|
|
10
|
+
fy: ChannelAccessor<Datum>;
|
|
11
|
+
dx: ConstantAccessor<number, Datum>;
|
|
12
|
+
dy: ConstantAccessor<number, Datum>;
|
|
13
|
+
fill: ChannelAccessor<Datum>;
|
|
14
|
+
fillOpacity: ConstantAccessor<number, Datum>;
|
|
15
|
+
sort: {
|
|
16
|
+
channel: string;
|
|
17
|
+
order?: "ascending" | "descending";
|
|
18
|
+
} | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").RawValue, Datum>;
|
|
19
|
+
stroke: ChannelAccessor<Datum>;
|
|
20
|
+
strokeWidth: ConstantAccessor<number, Datum>;
|
|
21
|
+
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
22
|
+
strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
23
|
+
strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
24
|
+
strokeMiterlimit: ConstantAccessor<number, Datum>;
|
|
25
|
+
opacity: ChannelAccessor<Datum>;
|
|
26
|
+
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
27
|
+
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
28
|
+
mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
29
|
+
clipPath: string;
|
|
30
|
+
imageFilter: ConstantAccessor<string, Datum>;
|
|
31
|
+
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
32
|
+
paintOrder: ConstantAccessor<string, Datum>;
|
|
33
|
+
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
+
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
|
+
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
62
|
+
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
63
|
+
class: string | null;
|
|
64
|
+
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
65
|
+
}> & LinkableMarkProps<Datum> & {
|
|
66
|
+
data: Datum[];
|
|
67
|
+
x1?: ChannelAccessor<Datum>;
|
|
68
|
+
x2?: ChannelAccessor<Datum>;
|
|
69
|
+
y1?: ChannelAccessor<Datum>;
|
|
70
|
+
y2?: ChannelAccessor<Datum>;
|
|
71
|
+
z?: ChannelAccessor<Datum>;
|
|
72
|
+
curve?: CurveName | CurveFactory;
|
|
73
|
+
tension?: number;
|
|
74
|
+
sort?: ConstantAccessor<RawValue> | {
|
|
75
|
+
channel: "stroke" | "fill";
|
|
76
|
+
};
|
|
77
|
+
stack?: Partial<StackOptions>;
|
|
78
|
+
canvas?: boolean;
|
|
79
|
+
};
|
|
80
|
+
events(): {};
|
|
81
|
+
slots(): {};
|
|
82
|
+
bindings(): "";
|
|
83
|
+
exports(): {};
|
|
84
|
+
}
|
|
85
|
+
interface $$IsomorphicComponent {
|
|
86
|
+
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']>> & {
|
|
87
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
88
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
89
|
+
<Datum extends DataRecord>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
90
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
91
|
+
}
|
|
20
92
|
/** Creates an area chart with filled regions between two x-y value pairs */
|
|
21
|
-
declare const Area:
|
|
22
|
-
type Area =
|
|
93
|
+
declare const Area: $$IsomorphicComponent;
|
|
94
|
+
type Area<Datum extends DataRecord> = InstanceType<typeof Area<Datum>>;
|
|
23
95
|
export default Area;
|
package/dist/marks/AreaX.svelte
CHANGED
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
Creates a horizontal area chart with x value and baseline. Areas are implicitly
|
|
3
3
|
stacked horizontally if just the x channel is defined.
|
|
4
4
|
-->
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
|
|
5
|
+
<script lang="ts" generics="Datum extends DataRow">
|
|
6
|
+
interface AreaXMarkProps extends Omit<ComponentProps<typeof Area>, 'y1' | 'y2'> {
|
|
7
|
+
x?: ChannelAccessor<Datum>;
|
|
8
|
+
y?: ChannelAccessor<Datum>;
|
|
9
|
+
}
|
|
10
|
+
import Area from './Area.svelte';
|
|
7
11
|
import { renameChannels } from '../transforms/rename.js';
|
|
8
12
|
import { stackX } from '../transforms/stack.js';
|
|
9
13
|
import { recordizeX } from '../transforms/recordize.js';
|
|
10
|
-
import type { ChannelAccessor, PlotDefaults } from '../types.js';
|
|
11
|
-
import { getContext } from 'svelte';
|
|
14
|
+
import type { ChannelAccessor, DataRow, PlotDefaults } from '../types/index.js';
|
|
15
|
+
import { getContext, type ComponentProps } from 'svelte';
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
x?: ChannelAccessor;
|
|
15
|
-
y?: ChannelAccessor;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
let markProps: AreaMarkProps = $props();
|
|
17
|
+
let markProps: AreaXMarkProps = $props();
|
|
19
18
|
|
|
20
19
|
const DEFAULTS = getContext<PlotDefaults>('svelteplot/_defaults').areaX;
|
|
21
20
|
|
|
22
|
-
const { data, stack, ...options }:
|
|
21
|
+
const { data, stack, ...options }: AreaXMarkProps = $derived({
|
|
22
|
+
...(markProps.x == undefined ? { x1: 0, x2: 0 } : {}),
|
|
23
|
+
...DEFAULTS,
|
|
24
|
+
...markProps
|
|
25
|
+
});
|
|
23
26
|
|
|
24
27
|
const args = $derived(
|
|
25
|
-
renameChannels<
|
|
28
|
+
renameChannels<AreaXMarkProps>(
|
|
26
29
|
stackX(recordizeX({ data, ...options, y1: null, y2: null }), stack),
|
|
27
30
|
{ y: 'y1' }
|
|
28
31
|
)
|