svelteplot 0.7.0 → 0.7.1-pr-278.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/LICENSE.md +19 -1
- package/README.md +1 -1
- package/dist/Mark.svelte.d.ts +48 -40
- package/dist/constants.d.ts +1 -1
- package/dist/helpers/colors.d.ts +9 -12
- package/dist/helpers/data.d.ts +1 -0
- package/dist/helpers/data.js +1 -1
- package/dist/helpers/facets.d.ts +1 -1
- package/dist/helpers/getBaseStyles.d.ts +2 -4
- package/dist/helpers/index.d.ts +3 -3
- package/dist/helpers/index.js +1 -2
- package/dist/helpers/reduce.d.ts +1 -1
- package/dist/helpers/scales.d.ts +7 -7
- package/dist/helpers/symbols.d.ts +2 -2
- package/dist/helpers/time.d.ts +3 -3
- package/dist/helpers/time.js +1 -1
- package/dist/helpers/typeChecks.d.ts +8 -8
- package/dist/marks/Area.svelte.d.ts +16 -8
- package/dist/marks/AreaX.svelte.d.ts +17 -9
- package/dist/marks/Arrow.svelte.d.ts +47 -39
- package/dist/marks/AxisX.svelte +14 -9
- package/dist/marks/AxisX.svelte.d.ts +21 -13
- package/dist/marks/AxisY.svelte +14 -9
- package/dist/marks/AxisY.svelte.d.ts +20 -12
- package/dist/marks/BarX.svelte +1 -3
- package/dist/marks/BarX.svelte.d.ts +16 -8
- package/dist/marks/BarY.svelte +1 -3
- package/dist/marks/BarY.svelte.d.ts +16 -8
- package/dist/marks/BollingerX.svelte.d.ts +11 -78
- package/dist/marks/BollingerY.svelte.d.ts +11 -78
- package/dist/marks/BoxY.svelte +4 -2
- package/dist/marks/BoxY.svelte.d.ts +13 -68
- package/dist/marks/Brush.svelte +12 -13
- package/dist/marks/Brush.svelte.d.ts +58 -31
- package/dist/marks/Cell.svelte +1 -3
- package/dist/marks/Cell.svelte.d.ts +46 -38
- package/dist/marks/CustomMark.svelte.d.ts +11 -86
- package/dist/marks/CustomMarkHTML.svelte.d.ts +15 -8
- package/dist/marks/DifferenceY.svelte.d.ts +11 -66
- package/dist/marks/Dot.svelte.d.ts +47 -39
- package/dist/marks/DotX.svelte.d.ts +17 -9
- package/dist/marks/DotY.svelte.d.ts +17 -9
- package/dist/marks/Frame.svelte +2 -1
- package/dist/marks/Frame.svelte.d.ts +85 -17
- package/dist/marks/Geo.svelte.d.ts +47 -39
- package/dist/marks/Graticule.svelte +4 -5
- package/dist/marks/GridX.svelte.d.ts +17 -9
- package/dist/marks/GridY.svelte.d.ts +17 -9
- package/dist/marks/HTMLTooltip.svelte.d.ts +14 -7
- package/dist/marks/Image.svelte.d.ts +11 -77
- package/dist/marks/Line.svelte +1 -1
- package/dist/marks/Line.svelte.d.ts +47 -39
- package/dist/marks/LineX.svelte.d.ts +18 -10
- package/dist/marks/LineY.svelte.d.ts +18 -10
- package/dist/marks/Link.svelte.d.ts +46 -38
- package/dist/marks/Pointer.svelte.d.ts +13 -6
- package/dist/marks/Rect.svelte +1 -3
- package/dist/marks/Rect.svelte.d.ts +16 -8
- package/dist/marks/RectX.svelte.d.ts +10 -3
- package/dist/marks/RectY.svelte.d.ts +10 -3
- package/dist/marks/RuleX.svelte.d.ts +17 -9
- package/dist/marks/RuleY.svelte.d.ts +17 -9
- package/dist/marks/Sphere.svelte +1 -2
- package/dist/marks/Spike.svelte +4 -5
- package/dist/marks/Spike.svelte.d.ts +17 -9
- package/dist/marks/Text.svelte.d.ts +23 -15
- package/dist/marks/TickX.svelte.d.ts +16 -8
- package/dist/marks/TickY.svelte.d.ts +16 -8
- package/dist/marks/Vector.svelte.d.ts +46 -38
- package/dist/marks/WaffleX.svelte +1 -3
- package/dist/marks/WaffleX.svelte.d.ts +11 -87
- package/dist/marks/WaffleY.svelte +1 -3
- package/dist/marks/WaffleY.svelte.d.ts +11 -85
- package/dist/marks/helpers/Anchor.svelte.d.ts +15 -8
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +11 -166
- package/dist/marks/helpers/RectPath.svelte.d.ts +13 -68
- package/dist/marks/helpers/canvas.js +1 -1
- package/dist/marks/helpers/waffle.d.ts +6 -0
- package/dist/marks/helpers/waffle.js +6 -38
- package/dist/transforms/bollinger.d.ts +1 -69
- package/dist/transforms/centroid.d.ts +1 -4
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.js +1 -1
- package/dist/transforms/interval.d.ts +2 -128
- package/dist/transforms/normalize.d.ts +18 -0
- package/dist/transforms/normalize.js +45 -0
- package/dist/transforms/recordize.d.ts +4 -7
- package/dist/transforms/select.d.ts +7 -448
- package/dist/transforms/sort.d.ts +5 -253
- package/dist/transforms/stack.d.ts +3 -23
- package/dist/transforms/window.d.ts +2 -134
- package/dist/ui/ExamplesGrid.svelte +19 -3
- package/dist/ui/ExamplesPagePreview.svelte +149 -0
- package/dist/ui/ExamplesPagePreview.svelte.d.ts +12 -0
- package/dist/ui/isDark.svelte.d.ts +6 -0
- package/dist/ui/isDark.svelte.js +10 -0
- package/package.json +140 -128
package/LICENSE.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
Copyright 2024, Gregor Aisch
|
|
1
|
+
Copyright 2024-2025, Gregor Aisch
|
|
2
2
|
|
|
3
3
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
4
|
|
|
5
5
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Portions of this library have been ported from Observable Plot, which is covered by the following license:
|
|
10
|
+
|
|
11
|
+
Copyright 2020-2025 Observable, Inc.
|
|
12
|
+
|
|
13
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
14
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
15
|
+
and this permission notice appear in all copies.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
19
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
21
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
22
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
23
|
+
THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
SveltePlot is a visualization framework based on the [layered grammar of graphics](https://vita.had.co.nz/papers/layered-grammar.html) ideas. It's API is heavily inspired by [Observable Plot](https://github.com/observablehq/plot). Created by Gregor Aisch.
|
|
6
6
|
|
|
7
|
-
<img src="static/logo.
|
|
7
|
+
<img src="static/logo.svg" alt="SveltePlot logo" width="401" />
|
|
8
8
|
|
|
9
9
|
## Development
|
|
10
10
|
|
package/dist/Mark.svelte.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
+
import { CHANNEL_SCALE } from './constants.js';
|
|
2
3
|
import type { ScaledChannelName, MarkType, DataRecord, ChannelAccessor, ScaleName, RawValue, ScaledDataRecord, ScaleType } from './types/index.js';
|
|
3
4
|
import { getUsedScales } from './helpers/scales.js';
|
|
4
|
-
declare
|
|
5
|
-
props
|
|
5
|
+
declare function $$render<Datum extends DataRecord>(): {
|
|
6
|
+
props: Partial<Partial<{
|
|
6
7
|
filter: import("./types/index.js").ConstantAccessor<boolean, Datum>;
|
|
7
8
|
facet: "auto" | "include" | "exclude";
|
|
8
9
|
fx: ChannelAccessor<Datum>;
|
|
9
10
|
fy: ChannelAccessor<Datum>;
|
|
10
11
|
dx: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
11
12
|
dy: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
12
|
-
dodgeX:
|
|
13
|
-
dodgeY:
|
|
13
|
+
dodgeX: CHANNEL_SCALE;
|
|
14
|
+
dodgeY: CHANNEL_SCALE;
|
|
14
15
|
fill: ChannelAccessor<Datum>;
|
|
15
16
|
fillOpacity: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
16
|
-
sort:
|
|
17
|
+
sort: {
|
|
17
18
|
channel: string;
|
|
18
19
|
order?: "ascending" | "descending";
|
|
19
|
-
} | import("./types/index.js").ConstantAccessor<RawValue, Datum>;
|
|
20
|
+
} | ((a: RawValue, b: RawValue) => number) | import("./types/index.js").ConstantAccessor<RawValue, Datum>;
|
|
20
21
|
stroke: ChannelAccessor<Datum>;
|
|
21
22
|
strokeWidth: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
22
23
|
strokeOpacity: import("./types/index.js").ConstantAccessor<number, Datum>;
|
|
@@ -31,41 +32,41 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
31
32
|
imageFilter: import("./types/index.js").ConstantAccessor<string, Datum>;
|
|
32
33
|
shapeRendering: import("./types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
33
34
|
paintOrder: import("./types/index.js").ConstantAccessor<string, Datum>;
|
|
34
|
-
onclick: import("svelte/elements
|
|
35
|
-
ondblclick: import("svelte/elements
|
|
36
|
-
onmouseup: import("svelte/elements
|
|
37
|
-
onmousedown: import("svelte/elements
|
|
38
|
-
onmouseenter: import("svelte/elements
|
|
39
|
-
onmousemove: import("svelte/elements
|
|
40
|
-
onmouseleave: import("svelte/elements
|
|
41
|
-
onmouseout: import("svelte/elements
|
|
42
|
-
onmouseover: import("svelte/elements
|
|
43
|
-
onpointercancel: import("svelte/elements
|
|
44
|
-
onpointerdown: import("svelte/elements
|
|
45
|
-
onpointerup: import("svelte/elements
|
|
46
|
-
onpointerenter: import("svelte/elements
|
|
47
|
-
onpointerleave: import("svelte/elements
|
|
48
|
-
onpointermove: import("svelte/elements
|
|
49
|
-
onpointerover: import("svelte/elements
|
|
50
|
-
onpointerout: import("svelte/elements
|
|
51
|
-
ondrag: import("svelte/elements
|
|
52
|
-
ondrop: import("svelte/elements
|
|
53
|
-
ondragstart: import("svelte/elements
|
|
54
|
-
ondragenter: import("svelte/elements
|
|
55
|
-
ondragleave: import("svelte/elements
|
|
56
|
-
ondragover: import("svelte/elements
|
|
57
|
-
ondragend: import("svelte/elements
|
|
58
|
-
ontouchstart: import("svelte/elements
|
|
59
|
-
ontouchmove: import("svelte/elements
|
|
60
|
-
ontouchend: import("svelte/elements
|
|
61
|
-
ontouchcancel: import("svelte/elements
|
|
62
|
-
oncontextmenu: import("svelte/elements
|
|
63
|
-
onwheel: import("svelte/elements
|
|
35
|
+
onclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
|
+
ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
62
|
+
ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
63
|
+
oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
64
|
+
onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
64
65
|
class: string;
|
|
65
66
|
style: string;
|
|
66
67
|
cursor: import("./types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
67
68
|
}>> & {
|
|
68
|
-
data?: Datum[]
|
|
69
|
+
data?: Datum[];
|
|
69
70
|
automatic?: boolean;
|
|
70
71
|
type: MarkType;
|
|
71
72
|
channels?: ScaledChannelName[];
|
|
@@ -75,11 +76,18 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
75
76
|
mark: any;
|
|
76
77
|
usedScales: ReturnType<typeof getUsedScales>;
|
|
77
78
|
scaledData: ScaledDataRecord<Datum>[];
|
|
78
|
-
}]
|
|
79
|
+
}]>;
|
|
79
80
|
defaults?: Partial<Record<ScaledChannelName, RawValue>>;
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
exports: {};
|
|
83
|
+
bindings: "";
|
|
84
|
+
slots: {};
|
|
85
|
+
events: {};
|
|
86
|
+
};
|
|
87
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
88
|
+
props(): ReturnType<typeof $$render<Datum>>['props'];
|
|
89
|
+
events(): ReturnType<typeof $$render<Datum>>['events'];
|
|
90
|
+
slots(): ReturnType<typeof $$render<Datum>>['slots'];
|
|
83
91
|
bindings(): "";
|
|
84
92
|
exports(): {};
|
|
85
93
|
}
|
package/dist/constants.d.ts
CHANGED
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { interpolateBrBG } from 'd3-scale-chromatic';
|
|
2
1
|
import type { ColorScheme } from '../types/index.js';
|
|
3
|
-
export declare const categoricalSchemes:
|
|
4
|
-
export declare function isCategoricalScheme(scheme: string):
|
|
5
|
-
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function isDivergingScheme(scheme: string): boolean;
|
|
13
|
-
export {};
|
|
2
|
+
export declare const categoricalSchemes: any;
|
|
3
|
+
export declare function isCategoricalScheme(scheme: string): any;
|
|
4
|
+
export declare function isOrdinalScheme(scheme: ColorScheme): any;
|
|
5
|
+
export declare function ordinalScheme(scheme: string): any;
|
|
6
|
+
export declare function ordinalRange(scheme: string, length: number): any;
|
|
7
|
+
export declare function maybeBooleanRange(domain: boolean[], scheme?: string): any[] | undefined;
|
|
8
|
+
export declare function isQuantitativeScheme(scheme: string): any;
|
|
9
|
+
export declare function quantitativeScheme(scheme: string): any;
|
|
10
|
+
export declare function isDivergingScheme(scheme: string): any;
|
package/dist/helpers/data.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
export declare function loadCSV(fetch: Fetch, dataset: string): Promise<any[]>;
|
|
2
3
|
export declare function loadJSON(fetch: Fetch, dataset: string): Promise<any>;
|
|
3
4
|
/**
|
|
4
5
|
* helper function used in the SveltePlot docs to load example datasets
|
package/dist/helpers/data.js
CHANGED
package/dist/helpers/facets.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ import type { GenericMarkOptions, Mark, RawValue } from '../types/index.js';
|
|
|
9
9
|
* @param fyValues y facet domain
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
|
-
export declare function getEmptyFacets(marks: Mark<GenericMarkOptions>[], fxValues: RawValue[], fyValues: RawValue[]):
|
|
12
|
+
export declare function getEmptyFacets(marks: Mark<GenericMarkOptions>[], fxValues: RawValue[], fyValues: RawValue[]): any;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Channels } from '../types/index.js';
|
|
2
2
|
import type { DataRow } from '../types/index.js';
|
|
3
|
-
export declare function getBaseStylesObject(datum: DataRow, props: Partial<Channels>):
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export default function (datum: DataRow, props: Partial<Channels>): string;
|
|
3
|
+
export declare function getBaseStylesObject(datum: DataRow, props: Partial<Channels>): any;
|
|
4
|
+
export default function (datum: DataRow, props: Partial<Channels>): any;
|
|
7
5
|
export declare function maybeToPixel(cssKey: string, value: string | number): string | number;
|
|
8
6
|
export declare function maybeFromPixel(value: string | number): string | number;
|
|
9
7
|
export declare function maybeFromRem(value: string | number, rootFontSize?: number): string | number;
|
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<T>(datum: T, options: Channels<T>):
|
|
6
|
+
export declare function coalesce(...args: (RawValue | undefined | null)[]): any;
|
|
7
|
+
export declare function testFilter<T>(datum: T, options: Channels<T>): 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;
|
|
@@ -15,4 +15,4 @@ export declare const POSITION_CHANNELS: Set<ChannelName>;
|
|
|
15
15
|
export declare function parseInset(inset: number | string, width: number): number;
|
|
16
16
|
export declare function omit<T extends {}, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
|
|
17
17
|
export declare function identity<T>(x: T): T;
|
|
18
|
-
export declare const GEOJSON_PREFER_STROKE:
|
|
18
|
+
export declare const GEOJSON_PREFER_STROKE: any;
|
package/dist/helpers/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { resolveProp } from './resolve.js';
|
|
2
2
|
import { isDate } from './typeChecks.js';
|
|
3
|
-
import { RAW_VALUE } from '../transforms/recordize.js';
|
|
4
3
|
/**
|
|
5
4
|
* Returns first argument that is not null or undefined
|
|
6
5
|
*/
|
|
@@ -31,7 +30,7 @@ export function isObject(option) {
|
|
|
31
30
|
// doesn't work with Proxies
|
|
32
31
|
return (typeof option === 'object' && !isDate(option) && !Array.isArray(option) && option !== null);
|
|
33
32
|
}
|
|
34
|
-
const NUMERIC = /^[+-]?(
|
|
33
|
+
const NUMERIC = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
35
34
|
export function maybeNumber(value) {
|
|
36
35
|
if (typeof value === 'number' && Number.isFinite(value))
|
|
37
36
|
return value;
|
package/dist/helpers/reduce.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ type ReducerOption = ReducerName | ReducerFunc;
|
|
|
4
4
|
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
5
5
|
export type ReducerPercentile = (`p${Digit}${Digit}` & Record<never, never>) | 'p25' | 'p50' | 'p75';
|
|
6
6
|
export type ReducerName = 'count' | 'deviation' | 'difference' | 'first' | 'last' | 'max' | 'mean' | 'median' | 'min' | 'mode' | 'ratio' | 'sum' | 'variance' | ReducerPercentile;
|
|
7
|
-
export declare const Reducer:
|
|
7
|
+
export declare const Reducer: any;
|
|
8
8
|
export declare function mayberReducer(r: ReducerOption): ReducerFunc;
|
|
9
9
|
export declare function reduceOutputs(newDatum: DataRecord, data: DataRecord[], options: Record<ChannelName, ReducerOption>, outputs: Iterable<ChannelName>, channels: Channels, newChannels: Channels): void;
|
|
10
10
|
export {};
|
package/dist/helpers/scales.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericMarkOptions, Mark, MarkType, PlotDefaults, PlotOptions, PlotScales, PlotState, RawValue, ScaleName, ScaleOptions, ScaleType, UsedScales } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* compute the plot scales
|
|
4
4
|
*/
|
|
@@ -8,19 +8,19 @@ export declare function createScale<T extends ScaleOptions>(name: ScaleName, sca
|
|
|
8
8
|
domain: number[];
|
|
9
9
|
range: number[];
|
|
10
10
|
fn: (() => string) | (() => number);
|
|
11
|
-
skip:
|
|
11
|
+
skip: any;
|
|
12
12
|
isDummy: boolean;
|
|
13
13
|
manualActiveMarks?: undefined;
|
|
14
14
|
uniqueScaleProps?: undefined;
|
|
15
15
|
autoTitle?: undefined;
|
|
16
16
|
} | {
|
|
17
17
|
type: ScaleType;
|
|
18
|
-
domain:
|
|
18
|
+
domain: any;
|
|
19
19
|
range: any;
|
|
20
20
|
fn: any;
|
|
21
|
-
skip:
|
|
21
|
+
skip: any;
|
|
22
22
|
manualActiveMarks: number;
|
|
23
|
-
uniqueScaleProps:
|
|
23
|
+
uniqueScaleProps: any;
|
|
24
24
|
autoTitle: string | null;
|
|
25
25
|
isDummy?: undefined;
|
|
26
26
|
};
|
|
@@ -36,8 +36,8 @@ export declare function inferScaleType(name: ScaleName, dataValues: RawValue[],
|
|
|
36
36
|
* not. That's what this function is used for.
|
|
37
37
|
*/
|
|
38
38
|
export declare function getUsedScales(plot: PlotState, options: GenericMarkOptions, mark: Mark<GenericMarkOptions>): UsedScales;
|
|
39
|
-
export declare function looksLikeANumber(input: string | number):
|
|
39
|
+
export declare function looksLikeANumber(input: string | number): any;
|
|
40
40
|
export declare function projectXY(scales: PlotScales, x: RawValue, y: RawValue, useXScale?: boolean, useYScale?: boolean): [number, number];
|
|
41
41
|
export declare function projectX(channel: 'x' | 'x1' | 'x2', scales: PlotScales, value: RawValue): number;
|
|
42
42
|
export declare function projectY(channel: 'y' | 'y1' | 'y2', scales: PlotScales, value: RawValue): number;
|
|
43
|
-
export declare function isOrdinalScale(scaleType: ScaleType): scaleType is "
|
|
43
|
+
export declare function isOrdinalScale(scaleType: ScaleType): scaleType is "point" | "ordinal" | "band" | "categorical" | "threshold";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SymbolType } from 'd3-shape';
|
|
2
2
|
export declare const sqrt3: number;
|
|
3
3
|
export declare const sqrt4_3: number;
|
|
4
|
-
export declare function isSymbol(value: string | SymbolType):
|
|
5
|
-
export declare function maybeSymbol(symbol: SymbolType | string):
|
|
4
|
+
export declare function isSymbol(value: string | SymbolType): any;
|
|
5
|
+
export declare function maybeSymbol(symbol: SymbolType | string): any;
|
package/dist/helpers/time.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const durations:
|
|
2
|
-
export declare const intervalDuration:
|
|
3
|
-
export declare const intervalType:
|
|
1
|
+
export declare const durations: any;
|
|
2
|
+
export declare const intervalDuration: any;
|
|
3
|
+
export declare const intervalType: any;
|
|
4
4
|
export declare function parseTimeInterval(input: string): [string, number];
|
|
5
5
|
export declare function maybeTimeInterval(input: string): any;
|
|
6
6
|
export declare function maybeUtcInterval(input: string): any;
|
package/dist/helpers/time.js
CHANGED
|
@@ -157,7 +157,7 @@ export function parseTimeInterval(input) {
|
|
|
157
157
|
if (name.endsWith('s'))
|
|
158
158
|
name = name.slice(0, -1); // drop plural
|
|
159
159
|
let period = 1;
|
|
160
|
-
const match = /^(
|
|
160
|
+
const match = /^(\d+)\s+/.exec(name);
|
|
161
161
|
if (match) {
|
|
162
162
|
name = name.slice(match[0].length);
|
|
163
163
|
period = +match[1];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { RawValue } from '../types/index.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):
|
|
5
|
-
export declare function isNumberOrNull(v: RawValue | null | undefined):
|
|
6
|
-
export declare function isNumberOrNullOrNaN(v: RawValue | null | undefined):
|
|
7
|
-
export declare function isStringOrNull(v: RawValue | null | undefined):
|
|
8
|
-
export declare function isSymbolOrNull(v: RawValue | null | undefined):
|
|
9
|
-
export declare function isColorOrNull(v: RawValue | null | undefined):
|
|
10
|
-
export declare function isOpacityOrNull(v: RawValue):
|
|
4
|
+
export declare function isDateOrNull(v: RawValue | null | undefined): boolean;
|
|
5
|
+
export declare function isNumberOrNull(v: RawValue | null | undefined): any;
|
|
6
|
+
export declare function isNumberOrNullOrNaN(v: RawValue | null | undefined): any;
|
|
7
|
+
export declare function isStringOrNull(v: RawValue | null | undefined): boolean;
|
|
8
|
+
export declare function isSymbolOrNull(v: RawValue | null | undefined): any;
|
|
9
|
+
export declare function isColorOrNull(v: RawValue | null | undefined): any;
|
|
10
|
+
export declare function isOpacityOrNull(v: RawValue): any;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { type CurveFactory } from 'd3-shape';
|
|
2
|
+
import callWithProps from '../helpers/callWithProps.js';
|
|
2
3
|
import type { CurveName, DataRecord, ConstantAccessor, ChannelAccessor, LinkableMarkProps, RawValue } from '../types/index.js';
|
|
3
4
|
import type { StackOptions } from '../transforms/stack.js';
|
|
4
|
-
declare
|
|
5
|
-
props
|
|
5
|
+
declare function $$render<Datum extends DataRecord>(): {
|
|
6
|
+
props: Partial<{
|
|
6
7
|
filter: ConstantAccessor<boolean, Datum>;
|
|
7
8
|
facet: "auto" | "include" | "exclude";
|
|
8
9
|
fx: ChannelAccessor<Datum>;
|
|
9
10
|
fy: ChannelAccessor<Datum>;
|
|
10
11
|
dx: ConstantAccessor<number, Datum>;
|
|
11
12
|
dy: ConstantAccessor<number, Datum>;
|
|
12
|
-
dodgeX:
|
|
13
|
-
dodgeY:
|
|
13
|
+
dodgeX: callWithProps;
|
|
14
|
+
dodgeY: callWithProps;
|
|
14
15
|
fill: ChannelAccessor<Datum>;
|
|
15
16
|
fillOpacity: ConstantAccessor<number, Datum>;
|
|
16
|
-
sort:
|
|
17
|
+
sort: {
|
|
17
18
|
channel: string;
|
|
18
19
|
order?: "ascending" | "descending";
|
|
19
|
-
} | ConstantAccessor<RawValue, Datum>;
|
|
20
|
+
} | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
|
|
20
21
|
stroke: ChannelAccessor<Datum>;
|
|
21
22
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
22
23
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
@@ -80,8 +81,15 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
80
81
|
canvas?: boolean;
|
|
81
82
|
areaClass?: ConstantAccessor<string, Datum>;
|
|
82
83
|
};
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
exports: {};
|
|
85
|
+
bindings: "";
|
|
86
|
+
slots: {};
|
|
87
|
+
events: {};
|
|
88
|
+
};
|
|
89
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
90
|
+
props(): ReturnType<typeof $$render<Datum>>['props'];
|
|
91
|
+
events(): ReturnType<typeof $$render<Datum>>['events'];
|
|
92
|
+
slots(): ReturnType<typeof $$render<Datum>>['slots'];
|
|
85
93
|
bindings(): "";
|
|
86
94
|
exports(): {};
|
|
87
95
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
import { renameChannels } from '../transforms/rename.js';
|
|
1
2
|
import type { ChannelAccessor, DataRow } from '../types/index.js';
|
|
2
|
-
declare
|
|
3
|
-
props
|
|
3
|
+
declare function $$render<Datum extends DataRow>(): {
|
|
4
|
+
props: Omit<Partial<{
|
|
4
5
|
filter: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/data").RawValue>>;
|
|
5
6
|
facet: "auto" | "include" | "exclude";
|
|
6
7
|
fx: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
|
|
7
8
|
fy: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
|
|
8
9
|
dx: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
|
|
9
10
|
dy: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
|
|
10
|
-
dodgeX:
|
|
11
|
-
dodgeY:
|
|
11
|
+
dodgeX: renameChannels;
|
|
12
|
+
dodgeY: renameChannels;
|
|
12
13
|
fill: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
|
|
13
14
|
fillOpacity: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
|
|
14
|
-
sort:
|
|
15
|
+
sort: {
|
|
15
16
|
channel: string;
|
|
16
17
|
order?: "ascending" | "descending";
|
|
17
|
-
} | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Record<string | symbol, import("../types/data").RawValue>>;
|
|
18
|
+
} | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Record<string | symbol, import("../types/data").RawValue>>;
|
|
18
19
|
stroke: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
|
|
19
20
|
strokeWidth: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
|
|
20
21
|
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
|
|
@@ -74,15 +75,22 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
74
75
|
sort?: import("../types/index.js").ConstantAccessor<import("../types/data").RawValue> | {
|
|
75
76
|
channel: "stroke" | "fill";
|
|
76
77
|
};
|
|
77
|
-
stack?: Partial<
|
|
78
|
+
stack?: Partial<renameChannels>;
|
|
78
79
|
canvas?: boolean;
|
|
79
80
|
areaClass?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
|
|
80
81
|
}, "y1" | "y2"> & {
|
|
81
82
|
x?: ChannelAccessor<Datum>;
|
|
82
83
|
y?: ChannelAccessor<Datum>;
|
|
83
84
|
};
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
exports: {};
|
|
86
|
+
bindings: "";
|
|
87
|
+
slots: {};
|
|
88
|
+
events: {};
|
|
89
|
+
};
|
|
90
|
+
declare class __sveltets_Render<Datum extends DataRow> {
|
|
91
|
+
props(): ReturnType<typeof $$render<Datum>>['props'];
|
|
92
|
+
events(): ReturnType<typeof $$render<Datum>>['events'];
|
|
93
|
+
slots(): ReturnType<typeof $$render<Datum>>['slots'];
|
|
86
94
|
bindings(): "";
|
|
87
95
|
exports(): {};
|
|
88
96
|
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { DataRecord, ConstantAccessor, ChannelAccessor, RawValue } from '../types/index.js';
|
|
2
2
|
import { type SweepOption } from '../helpers/arrowPath.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { replaceChannels } from '../transforms/rename.js';
|
|
4
|
+
declare function $$render<Datum extends DataRecord>(): {
|
|
5
|
+
props: Omit<Partial<{
|
|
5
6
|
filter: ConstantAccessor<boolean, Datum>;
|
|
6
7
|
facet: "auto" | "include" | "exclude";
|
|
7
8
|
fx: ChannelAccessor<Datum>;
|
|
8
9
|
fy: ChannelAccessor<Datum>;
|
|
9
10
|
dx: ConstantAccessor<number, Datum>;
|
|
10
11
|
dy: ConstantAccessor<number, Datum>;
|
|
11
|
-
dodgeX:
|
|
12
|
-
dodgeY:
|
|
12
|
+
dodgeX: replaceChannels;
|
|
13
|
+
dodgeY: replaceChannels;
|
|
13
14
|
fill: ChannelAccessor<Datum>;
|
|
14
15
|
fillOpacity: ConstantAccessor<number, Datum>;
|
|
15
|
-
sort:
|
|
16
|
+
sort: {
|
|
16
17
|
channel: string;
|
|
17
18
|
order?: "ascending" | "descending";
|
|
18
|
-
} | ConstantAccessor<RawValue, Datum>;
|
|
19
|
+
} | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
|
|
19
20
|
stroke: ChannelAccessor<Datum>;
|
|
20
21
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
21
22
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
@@ -30,36 +31,36 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
30
31
|
imageFilter: ConstantAccessor<string, Datum>;
|
|
31
32
|
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
32
33
|
paintOrder: ConstantAccessor<string, Datum>;
|
|
33
|
-
onclick: import("svelte/elements
|
|
34
|
-
ondblclick: import("svelte/elements
|
|
35
|
-
onmouseup: import("svelte/elements
|
|
36
|
-
onmousedown: import("svelte/elements
|
|
37
|
-
onmouseenter: import("svelte/elements
|
|
38
|
-
onmousemove: import("svelte/elements
|
|
39
|
-
onmouseleave: import("svelte/elements
|
|
40
|
-
onmouseout: import("svelte/elements
|
|
41
|
-
onmouseover: import("svelte/elements
|
|
42
|
-
onpointercancel: import("svelte/elements
|
|
43
|
-
onpointerdown: import("svelte/elements
|
|
44
|
-
onpointerup: import("svelte/elements
|
|
45
|
-
onpointerenter: import("svelte/elements
|
|
46
|
-
onpointerleave: import("svelte/elements
|
|
47
|
-
onpointermove: import("svelte/elements
|
|
48
|
-
onpointerover: import("svelte/elements
|
|
49
|
-
onpointerout: import("svelte/elements
|
|
50
|
-
ondrag: import("svelte/elements
|
|
51
|
-
ondrop: import("svelte/elements
|
|
52
|
-
ondragstart: import("svelte/elements
|
|
53
|
-
ondragenter: import("svelte/elements
|
|
54
|
-
ondragleave: import("svelte/elements
|
|
55
|
-
ondragover: import("svelte/elements
|
|
56
|
-
ondragend: import("svelte/elements
|
|
57
|
-
ontouchstart: import("svelte/elements
|
|
58
|
-
ontouchmove: import("svelte/elements
|
|
59
|
-
ontouchend: import("svelte/elements
|
|
60
|
-
ontouchcancel: import("svelte/elements
|
|
61
|
-
oncontextmenu: import("svelte/elements
|
|
62
|
-
onwheel: import("svelte/elements
|
|
34
|
+
onclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
|
+
ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
62
|
+
oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
63
|
+
onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
63
64
|
class: string;
|
|
64
65
|
style: string;
|
|
65
66
|
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
@@ -75,7 +76,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
75
76
|
/**
|
|
76
77
|
* the bend angle, in degrees; defaults to 0°; true for 22.5°
|
|
77
78
|
*/
|
|
78
|
-
bend?:
|
|
79
|
+
bend?: ConstantAccessor<number, Datum> | true;
|
|
79
80
|
/**
|
|
80
81
|
* the arrowhead angle, in degrees; defaults to 60°
|
|
81
82
|
*/
|
|
@@ -98,8 +99,15 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
98
99
|
inset?: ConstantAccessor<number, Datum>;
|
|
99
100
|
sweep?: SweepOption;
|
|
100
101
|
};
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
exports: {};
|
|
103
|
+
bindings: "";
|
|
104
|
+
slots: {};
|
|
105
|
+
events: {};
|
|
106
|
+
};
|
|
107
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
108
|
+
props(): ReturnType<typeof $$render<Datum>>['props'];
|
|
109
|
+
events(): ReturnType<typeof $$render<Datum>>['events'];
|
|
110
|
+
slots(): ReturnType<typeof $$render<Datum>>['slots'];
|
|
103
111
|
bindings(): "";
|
|
104
112
|
exports(): {};
|
|
105
113
|
}
|