svelteplot 0.3.4 → 0.3.5-pr-121.0
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/constants.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 +3 -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/autoScales.d.ts +1 -1
- package/dist/helpers/autoTicks.d.ts +1 -1
- package/dist/helpers/autoTicks.js +1 -1
- package/dist/helpers/callWithProps.d.ts +1 -1
- package/dist/helpers/colors.d.ts +2 -2
- package/dist/helpers/curves.d.ts +1 -1
- package/dist/helpers/facets.d.ts +1 -1
- package/dist/helpers/getBaseStyles.d.ts +2 -2
- package/dist/helpers/group.d.ts +1 -1
- package/dist/helpers/index.d.ts +3 -3
- package/dist/helpers/isDataRecord.d.ts +1 -1
- package/dist/helpers/isRawValue.d.ts +1 -1
- package/dist/helpers/projection.d.ts +1 -1
- package/dist/helpers/reduce.d.ts +1 -1
- package/dist/helpers/regressionLoess.d.ts +1 -1
- package/dist/helpers/resolve.d.ts +3 -3
- package/dist/helpers/scales.d.ts +2 -2
- package/dist/helpers/typeChecks.d.ts +5 -5
- 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 +60 -56
- package/dist/marks/AxisX.svelte.d.ts +98 -25
- package/dist/marks/AxisY.svelte +73 -54
- package/dist/marks/AxisY.svelte.d.ts +100 -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 +25 -23
- package/dist/marks/Text.svelte.d.ts +101 -25
- 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 +5 -3
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -1
- package/dist/marks/helpers/BaseAxisY.svelte +10 -8
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +3 -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 +1 -1
- package/dist/marks/helpers/MultilineText.svelte.d.ts +1 -1
- 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/marks/helpers/events.d.ts +1 -1
- package/dist/transforms/bin.d.ts +2 -2
- package/dist/transforms/bollinger.d.ts +2 -67
- package/dist/transforms/centroid.d.ts +8 -66
- package/dist/transforms/centroid.js +10 -7
- package/dist/transforms/filter.d.ts +1 -1
- package/dist/transforms/group.d.ts +5 -13
- package/dist/transforms/interval.d.ts +3 -123
- package/dist/transforms/jitter.d.ts +1 -1
- package/dist/transforms/map.d.ts +4 -184
- package/dist/transforms/normalize.d.ts +3 -123
- package/dist/transforms/recordize.d.ts +1 -1
- package/dist/transforms/rename.d.ts +2 -2
- package/dist/transforms/select.d.ts +8 -428
- package/dist/transforms/shift.d.ts +1 -1
- package/dist/transforms/sort.d.ts +4 -243
- package/dist/transforms/stack.d.ts +1 -1
- package/dist/transforms/window.d.ts +3 -131
- 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/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScaleName, ScaleType, ScaledChannelName } from './types.js';
|
|
1
|
+
import type { ScaleName, ScaleType, ScaledChannelName } from './types/index.js';
|
|
2
2
|
export declare const SCALE_TYPES: Record<ScaleName, symbol>;
|
|
3
3
|
export declare const SCALES: ScaleName[];
|
|
4
4
|
export declare const VALID_SCALE_TYPES: Record<ScaleName, Set<ScaleType>>;
|
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';
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
scaleType="band"
|
|
37
37
|
ticks={fxValues}
|
|
38
38
|
tickFormat={(d) => d}
|
|
39
|
+
tickFontSize={11}
|
|
39
40
|
tickSize={0}
|
|
40
41
|
tickPadding={5}
|
|
41
42
|
anchor={plot.options.fx.axis}
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
scaleType="band"
|
|
54
55
|
ticks={fyValues}
|
|
55
56
|
tickFormat={(d) => d}
|
|
57
|
+
tickFontSize={11}
|
|
56
58
|
tickSize={0}
|
|
57
59
|
tickPadding={5}
|
|
58
60
|
anchor={plot.options.fy.axis}
|
|
@@ -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColorScaleOptions, PlotDefaults, PlotOptions, RawValue, ScaleName, ScaleOptions, ScaleType } from '../types.js';
|
|
1
|
+
import type { ColorScaleOptions, PlotDefaults, PlotOptions, RawValue, ScaleName, ScaleOptions, ScaleType } from '../types/index.js';
|
|
2
2
|
export declare function autoScale({ name, type, domain, scaleOptions, plotOptions, plotWidth, plotHeight, plotHasFilledDotMarks, plotDefaults }: {
|
|
3
3
|
name: ScaleName;
|
|
4
4
|
type: ScaleType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { RawValue, ScaleType } from '../types.js';
|
|
1
|
+
import type { RawValue, ScaleType } from '../types/index.js';
|
|
2
2
|
export declare function maybeInterval(interval: null | number | string | (<T>(d: T) => T)): any;
|
|
3
3
|
export declare function autoTicks(type: ScaleType, ticks: RawValue[], interval: string | number | null, domain: RawValue[], scaleFn: any, count: number): any;
|
|
@@ -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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { interpolateBrBG } from 'd3-scale-chromatic';
|
|
2
|
-
import type { ColorScheme } from '../types.js';
|
|
2
|
+
import type { ColorScheme } from '../types/index.js';
|
|
3
3
|
export declare const categoricalSchemes: Map<string, readonly string[]>;
|
|
4
4
|
export declare function isCategoricalScheme(scheme: string): boolean;
|
|
5
5
|
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;
|
package/dist/helpers/curves.d.ts
CHANGED
package/dist/helpers/facets.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GenericMarkOptions, Mark, RawValue } from '../types.js';
|
|
1
|
+
import type { GenericMarkOptions, Mark, RawValue } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* This function tracks which facets are "empty", meaning that they don't contain
|
|
4
4
|
* any "facetted" data points. This can happen when fx and fy are combined and
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Channels } from '../types.js';
|
|
2
|
-
import type { DataRow } from '../types.js';
|
|
1
|
+
import type { Channels } from '../types/index.js';
|
|
2
|
+
import type { DataRow } from '../types/index.js';
|
|
3
3
|
export declare function getBaseStylesObject(datum: DataRow, props: Partial<Channels>): {
|
|
4
4
|
[k: string]: string | number;
|
|
5
5
|
};
|
package/dist/helpers/group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Channels, DataRecord } from '../types.js';
|
|
1
|
+
import type { Channels, DataRecord } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Groups the data by the fx, fy and z channels and calls the reduce function
|
|
4
4
|
* for each group. Returns the new channels to be added in the transform.
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ChannelAccessor, ChannelName, DataRecord, RawValue } from '../types.js';
|
|
1
|
+
import type { ChannelAccessor, ChannelName, DataRecord, RawValue } from '../types/index.js';
|
|
2
2
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DataRecord } from '../types.js';
|
|
1
|
+
import type { DataRecord } from '../types/index.js';
|
|
2
2
|
export default function (value: any): value is DataRecord;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RawValue } from '../types.js';
|
|
1
|
+
import type { RawValue } from '../types/index.js';
|
|
2
2
|
export default function (value: any): value is RawValue;
|
package/dist/helpers/reduce.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChannelName, Channels, DataRecord, DataRow, RawValue } from '../types.js';
|
|
1
|
+
import type { ChannelName, Channels, DataRecord, DataRow, RawValue } from '../types/index.js';
|
|
2
2
|
type ReducerFunc = (group: Iterable<DataRow>) => RawValue;
|
|
3
3
|
type ReducerOption = ReducerName | ReducerFunc;
|
|
4
4
|
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MarkStyleProps, PlotState, ScaledDataRecord } from '../types.js';
|
|
2
|
-
import type { ScaleName, ChannelName, ScaledChannelName, ChannelAccessor, DataRow, RawValue, DataRecord, ConstantAccessor } from '../types.js';
|
|
1
|
+
import type { MarkStyleProps, PlotState, ScaledDataRecord } from '../types/index.js';
|
|
2
|
+
import type { ScaleName, ChannelName, ScaledChannelName, ChannelAccessor, DataRow, RawValue, DataRecord, ConstantAccessor } from '../types/index.js';
|
|
3
3
|
type ChannelAlias = {
|
|
4
4
|
channel: ScaledChannelName;
|
|
5
5
|
};
|
|
@@ -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChannelAccessor, GenericMarkOptions, Mark, MarkType, PlotDefaults, PlotOptions, PlotScales, PlotState, RawValue, ScaleName, ScaleOptions, ScaleType, ScaledChannelName, UsedScales } from '../types.js';
|
|
1
|
+
import type { ChannelAccessor, GenericMarkOptions, Mark, MarkType, PlotDefaults, PlotOptions, PlotScales, PlotState, RawValue, ScaleName, ScaleOptions, ScaleType, ScaledChannelName, UsedScales } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* compute the plot scales
|
|
4
4
|
*/
|
|
@@ -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
|
-
import type { RawValue } from '../types.js';
|
|
2
|
-
export declare function isBooleanOrNull(v: RawValue):
|
|
1
|
+
import type { RawValue } from '../types/index.js';
|
|
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,
|