svelteplot 0.4.3 → 0.4.4-pr-105.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/README.md +41 -0
- package/dist/Mark.svelte +5 -2
- package/dist/Mark.svelte.d.ts +2 -1
- package/dist/core/Plot.svelte +1 -0
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/scales.d.ts +1 -1
- package/dist/helpers/scales.js +2 -2
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/marks/Area.svelte.d.ts +2 -1
- package/dist/marks/AreaX.svelte.d.ts +4 -2
- package/dist/marks/AreaY.svelte.d.ts +4 -2
- package/dist/marks/Arrow.svelte.d.ts +2 -1
- package/dist/marks/AxisX.svelte +5 -1
- package/dist/marks/AxisX.svelte.d.ts +11 -7
- package/dist/marks/AxisY.svelte +3 -2
- package/dist/marks/AxisY.svelte.d.ts +9 -7
- package/dist/marks/BarX.svelte.d.ts +3 -2
- package/dist/marks/BarY.svelte +0 -1
- package/dist/marks/BarY.svelte.d.ts +2 -1
- package/dist/marks/BollingerX.svelte.d.ts +2 -73
- package/dist/marks/BollingerY.svelte.d.ts +2 -73
- package/dist/marks/BoxX.svelte +72 -28
- package/dist/marks/BoxY.svelte +88 -38
- package/dist/marks/BoxY.svelte.d.ts +6 -66
- package/dist/marks/Cell.svelte.d.ts +2 -1
- package/dist/marks/ColorLegend.svelte +1 -1
- package/dist/marks/CustomMark.svelte.d.ts +2 -80
- package/dist/marks/DifferenceY.svelte.d.ts +7 -66
- package/dist/marks/Dot.svelte.d.ts +2 -1
- package/dist/marks/DotX.svelte.d.ts +2 -1
- package/dist/marks/DotY.svelte.d.ts +2 -1
- package/dist/marks/Geo.svelte.d.ts +2 -1
- package/dist/marks/GridX.svelte.d.ts +2 -1
- package/dist/marks/GridY.svelte.d.ts +2 -1
- package/dist/marks/Line.svelte.d.ts +4 -3
- package/dist/marks/LineX.svelte.d.ts +4 -2
- package/dist/marks/LineY.svelte.d.ts +4 -2
- package/dist/marks/Link.svelte.d.ts +2 -1
- package/dist/marks/Rect.svelte +0 -7
- package/dist/marks/Rect.svelte.d.ts +2 -1
- package/dist/marks/RuleX.svelte.d.ts +2 -1
- package/dist/marks/RuleY.svelte.d.ts +2 -1
- package/dist/marks/Spike.svelte.d.ts +2 -1
- package/dist/marks/Text.svelte.d.ts +2 -1
- package/dist/marks/TickX.svelte.d.ts +2 -1
- package/dist/marks/TickY.svelte.d.ts +2 -1
- package/dist/marks/Vector.svelte.d.ts +2 -1
- package/dist/marks/helpers/MultilineText.svelte +10 -10
- package/dist/marks/helpers/RectPath.svelte +8 -3
- package/dist/marks/helpers/RectPath.svelte.d.ts +3 -62
- package/dist/transforms/bollinger.d.ts +1 -66
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -122
- package/dist/transforms/recordize.d.ts +1 -4
- package/dist/transforms/rename.d.ts +1 -0
- package/dist/transforms/rename.js +5 -0
- package/dist/transforms/select.d.ts +7 -427
- package/dist/transforms/sort.d.ts +3 -242
- package/dist/transforms/sort.js +13 -1
- package/dist/transforms/stack.d.ts +5 -25
- package/dist/transforms/stack.js +96 -41
- package/dist/transforms/window.d.ts +2 -128
- package/dist/types/mark.d.ts +5 -1
- package/dist/ui/Spiral.svelte +0 -15
- package/package.json +129 -125
package/README.md
CHANGED
|
@@ -5,3 +5,44 @@
|
|
|
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
7
|
<img src="static/logo.png" alt="SveltePlot logo" width="401" />
|
|
8
|
+
|
|
9
|
+
## Development
|
|
10
|
+
|
|
11
|
+
Clone the repo and install dependencies:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone git@github.com:svelteplot/svelteplot.git
|
|
15
|
+
cd svelteplot
|
|
16
|
+
pnpm install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run the development server:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Open http://localhost:5173 in your browser.
|
|
26
|
+
|
|
27
|
+
## Testing
|
|
28
|
+
|
|
29
|
+
Run unit tests:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm lint
|
|
33
|
+
pnpm test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
You should also run the visual regression tests:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm test:visual
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This will generate screenshots and compare them with the expected results.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm vi:report
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
To see the differences side by side you can open http://localhost:5173/\_\_vr/report.html
|
package/dist/Mark.svelte
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
import { getUsedScales, projectXY, projectX, projectY } from './helpers/scales.js';
|
|
41
41
|
import { testFilter, isValid } from './helpers/index.js';
|
|
42
42
|
import { resolveChannel, resolveProp } from './helpers/resolve.js';
|
|
43
|
+
import { RENAME } from './transforms/rename.js';
|
|
43
44
|
|
|
44
45
|
let {
|
|
45
46
|
data = [],
|
|
@@ -258,11 +259,13 @@
|
|
|
258
259
|
if (options?.[channel] != null && out[channel] === undefined) {
|
|
259
260
|
// resolve value
|
|
260
261
|
const value = row[channel];
|
|
262
|
+
// if this channel was renamed, use the original channel for scaling
|
|
263
|
+
const origChannel = options?.[RENAME]?.[channel] || channel;
|
|
261
264
|
const scaled = usedScales[channel]
|
|
262
265
|
? scale === 'x'
|
|
263
|
-
? projectX(
|
|
266
|
+
? projectX(origChannel as 'x' | 'x1' | 'x2', plot.scales, value)
|
|
264
267
|
: scale === 'y'
|
|
265
|
-
? projectY(
|
|
268
|
+
? projectY(origChannel as 'y' | 'y1' | 'y2', plot.scales, value)
|
|
266
269
|
: scale === 'color' && !isValid(value)
|
|
267
270
|
? plot.options.color.unknown
|
|
268
271
|
: plot.scales[scale].fn(value)
|
package/dist/Mark.svelte.d.ts
CHANGED
|
@@ -59,7 +59,8 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
59
59
|
ontouchcancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
60
60
|
oncontextmenu?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
61
61
|
onwheel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
62
|
-
class
|
|
62
|
+
class?: string;
|
|
63
|
+
style?: string;
|
|
63
64
|
cursor: import("./types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
64
65
|
}>> & {
|
|
65
66
|
data?: Datum[] | undefined;
|
package/dist/core/Plot.svelte
CHANGED
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;
|
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;
|
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>>;
|
package/dist/helpers/scales.js
CHANGED
|
@@ -236,7 +236,7 @@ export function inferScaleType(name, dataValues, markTypes) {
|
|
|
236
236
|
if (name === 'symbol')
|
|
237
237
|
return 'ordinal';
|
|
238
238
|
// for positional scales, try to pick a scale that's required by the mark types
|
|
239
|
-
if (
|
|
239
|
+
if (name === 'x' || name === 'y') {
|
|
240
240
|
if (name === 'y' &&
|
|
241
241
|
(markTypes.has('barX') || markTypes.has('tickX') || markTypes.has('cell')))
|
|
242
242
|
return 'band';
|
|
@@ -253,7 +253,7 @@ export function inferScaleType(name, dataValues, markTypes) {
|
|
|
253
253
|
if (dataValues.every(isDateOrNull))
|
|
254
254
|
return 'time';
|
|
255
255
|
if (dataValues.every(isStringOrNull))
|
|
256
|
-
return
|
|
256
|
+
return 'point';
|
|
257
257
|
return 'linear';
|
|
258
258
|
}
|
|
259
259
|
const scaledChannelNames = [
|
|
@@ -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):
|
|
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;
|
|
@@ -59,7 +59,8 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
59
59
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
60
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
61
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
62
|
-
class
|
|
62
|
+
class?: string;
|
|
63
|
+
style?: string;
|
|
63
64
|
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
64
65
|
}> & LinkableMarkProps<Datum> & {
|
|
65
66
|
data: Datum[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renameChannels } from '../transforms/rename.js';
|
|
1
2
|
import type { ChannelAccessor, DataRow } from '../types/index.js';
|
|
2
3
|
declare class __sveltets_Render<Datum extends DataRow> {
|
|
3
4
|
props(): Omit<Partial<{
|
|
@@ -57,7 +58,8 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
57
58
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
59
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
60
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
class
|
|
61
|
+
class?: string;
|
|
62
|
+
style?: string;
|
|
61
63
|
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types/data").RawValue>>;
|
|
62
64
|
}> & import("../types/mark").LinkableMarkProps<Record<string | symbol, import("../types/data").RawValue>> & {
|
|
63
65
|
data: Record<string | symbol, import("../types/data").RawValue>[];
|
|
@@ -71,7 +73,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
71
73
|
sort?: import("../types/index.js").ConstantAccessor<import("../types/data").RawValue> | {
|
|
72
74
|
channel: "stroke" | "fill";
|
|
73
75
|
};
|
|
74
|
-
stack?: Partial<
|
|
76
|
+
stack?: Partial<renameChannels>;
|
|
75
77
|
canvas?: boolean;
|
|
76
78
|
}, "y1" | "y2"> & {
|
|
77
79
|
x?: ChannelAccessor<Datum>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renameChannels } from '../transforms/rename.js';
|
|
1
2
|
import type { ChannelAccessor, DataRow } from '../types/index.js';
|
|
2
3
|
declare class __sveltets_Render<Datum extends DataRow> {
|
|
3
4
|
props(): Omit<Partial<{
|
|
@@ -57,7 +58,8 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
57
58
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
59
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
60
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
class
|
|
61
|
+
class?: string;
|
|
62
|
+
style?: string;
|
|
61
63
|
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types/data").RawValue>>;
|
|
62
64
|
}> & import("../types/mark").LinkableMarkProps<Record<string | symbol, import("../types/data").RawValue>> & {
|
|
63
65
|
data: Record<string | symbol, import("../types/data").RawValue>[];
|
|
@@ -71,7 +73,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
71
73
|
sort?: import("../types/index.js").ConstantAccessor<import("../types/data").RawValue> | {
|
|
72
74
|
channel: "stroke" | "fill";
|
|
73
75
|
};
|
|
74
|
-
stack?: Partial<
|
|
76
|
+
stack?: Partial<renameChannels>;
|
|
75
77
|
canvas?: boolean;
|
|
76
78
|
}, "x1" | "x2"> & {
|
|
77
79
|
x?: ChannelAccessor<Datum>;
|
|
@@ -58,7 +58,8 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
58
58
|
ontouchcancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
59
59
|
oncontextmenu?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
60
60
|
onwheel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
61
|
-
class
|
|
61
|
+
class?: string;
|
|
62
|
+
style?: string;
|
|
62
63
|
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
63
64
|
}>, "fill" | "fillOpacity"> & {
|
|
64
65
|
data: Datum[];
|
package/dist/marks/AxisX.svelte
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
PlotDefaults,
|
|
15
15
|
ChannelName
|
|
16
16
|
} from '../types/index.js';
|
|
17
|
+
import type * as CSS from 'csstype';
|
|
17
18
|
import autoTimeFormat from '../helpers/autoTimeFormat.js';
|
|
18
19
|
import { derived } from 'svelte/store';
|
|
19
20
|
import { autoTicks } from '../helpers/autoTicks.js';
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
interface AxisXMarkProps
|
|
23
24
|
extends Omit<
|
|
24
25
|
BaseMarkProps<Datum>,
|
|
25
|
-
'
|
|
26
|
+
'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target'
|
|
26
27
|
> {
|
|
27
28
|
data?: Datum[];
|
|
28
29
|
automatic?: boolean;
|
|
@@ -49,6 +50,8 @@
|
|
|
49
50
|
tickCount?: number;
|
|
50
51
|
/** approximate number of pixels between generated ticks */
|
|
51
52
|
tickSpacing?: number;
|
|
53
|
+
/** text anchor for axis labels */
|
|
54
|
+
textAnchor?: ConstantAccessor<CSS.Property.TextAnchor, Datum>;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
let markProps: AxisXMarkProps = $props();
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
tickPadding: 3,
|
|
59
62
|
tickFontSize: 11,
|
|
60
63
|
titleFontSize: 11,
|
|
64
|
+
textAnchor: 'middle',
|
|
61
65
|
opacity: 0.8,
|
|
62
66
|
anchor: 'bottom',
|
|
63
67
|
...getContext<PlotDefaults>('svelteplot/_defaults').axis,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RawValue, ConstantAccessor } from '../types/index.js';
|
|
2
|
+
import type * as CSS from 'csstype';
|
|
2
3
|
declare class __sveltets_Render<Datum extends RawValue> {
|
|
3
4
|
props(): Omit<Partial<{
|
|
4
5
|
filter?: ConstantAccessor<boolean, Datum>;
|
|
@@ -16,16 +17,16 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
16
17
|
stroke: import("../types/channel").ChannelAccessor<Datum>;
|
|
17
18
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
18
19
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
19
|
-
strokeLinejoin: ConstantAccessor<
|
|
20
|
-
strokeLinecap: ConstantAccessor<
|
|
20
|
+
strokeLinejoin: ConstantAccessor<CSS.Property.StrokeLinejoin, Datum>;
|
|
21
|
+
strokeLinecap: ConstantAccessor<CSS.Property.StrokeLinecap, Datum>;
|
|
21
22
|
strokeMiterlimit: ConstantAccessor<number, Datum>;
|
|
22
23
|
opacity: import("../types/channel").ChannelAccessor<Datum>;
|
|
23
24
|
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
24
25
|
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
25
|
-
mixBlendMode: ConstantAccessor<
|
|
26
|
+
mixBlendMode: ConstantAccessor<CSS.Property.MixBlendMode, Datum>;
|
|
26
27
|
clipPath: string;
|
|
27
28
|
imageFilter: ConstantAccessor<string, Datum>;
|
|
28
|
-
shapeRendering: ConstantAccessor<
|
|
29
|
+
shapeRendering: ConstantAccessor<CSS.Property.ShapeRendering, Datum>;
|
|
29
30
|
paintOrder: ConstantAccessor<string, Datum>;
|
|
30
31
|
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
31
32
|
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
@@ -57,9 +58,10 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
57
58
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
59
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
60
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
class
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
class?: string;
|
|
62
|
+
style?: string;
|
|
63
|
+
cursor: ConstantAccessor<CSS.Property.Cursor, Datum>;
|
|
64
|
+
}>, "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
|
|
63
65
|
data?: Datum[] | undefined;
|
|
64
66
|
automatic?: boolean;
|
|
65
67
|
title?: string | false | null;
|
|
@@ -81,6 +83,8 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
81
83
|
tickCount?: number;
|
|
82
84
|
/** approximate number of pixels between generated ticks */
|
|
83
85
|
tickSpacing?: number;
|
|
86
|
+
/** text anchor for axis labels */
|
|
87
|
+
textAnchor?: ConstantAccessor<CSS.Property.TextAnchor, Datum>;
|
|
84
88
|
};
|
|
85
89
|
events(): {};
|
|
86
90
|
slots(): {};
|
package/dist/marks/AxisY.svelte
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
ChannelName,
|
|
15
15
|
ConstantAccessor
|
|
16
16
|
} from '../types/index.js';
|
|
17
|
+
import type * as CSS from 'csstype';
|
|
17
18
|
import autoTimeFormat from '../helpers/autoTimeFormat.js';
|
|
18
19
|
import { autoTicks } from '../helpers/autoTicks.js';
|
|
19
20
|
import { resolveScaledStyles } from '../helpers/resolve.js';
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
interface AxisYMarkProps
|
|
22
23
|
extends Omit<
|
|
23
24
|
BaseMarkProps<Datum>,
|
|
24
|
-
'
|
|
25
|
+
'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target'
|
|
25
26
|
> {
|
|
26
27
|
data?: Datum[];
|
|
27
28
|
automatic?: boolean;
|
|
@@ -196,7 +197,7 @@
|
|
|
196
197
|
)}
|
|
197
198
|
x={anchor === 'left' ? 0 : plot.width}
|
|
198
199
|
y={5}
|
|
199
|
-
class="axis-
|
|
200
|
+
class="axis-y-title"
|
|
200
201
|
dominant-baseline="hanging">{useTitle}</text>
|
|
201
202
|
{/if}
|
|
202
203
|
{#if showAxis}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RawValue, ConstantAccessor } from '../types/index.js';
|
|
2
|
+
import type * as CSS from 'csstype';
|
|
2
3
|
declare class __sveltets_Render<Datum extends RawValue> {
|
|
3
4
|
props(): Omit<Partial<{
|
|
4
5
|
filter?: ConstantAccessor<boolean, Datum>;
|
|
@@ -16,16 +17,16 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
16
17
|
stroke: import("../types/channel").ChannelAccessor<Datum>;
|
|
17
18
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
18
19
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
19
|
-
strokeLinejoin: ConstantAccessor<
|
|
20
|
-
strokeLinecap: ConstantAccessor<
|
|
20
|
+
strokeLinejoin: ConstantAccessor<CSS.Property.StrokeLinejoin, Datum>;
|
|
21
|
+
strokeLinecap: ConstantAccessor<CSS.Property.StrokeLinecap, Datum>;
|
|
21
22
|
strokeMiterlimit: ConstantAccessor<number, Datum>;
|
|
22
23
|
opacity: import("../types/channel").ChannelAccessor<Datum>;
|
|
23
24
|
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
24
25
|
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
25
|
-
mixBlendMode: ConstantAccessor<
|
|
26
|
+
mixBlendMode: ConstantAccessor<CSS.Property.MixBlendMode, Datum>;
|
|
26
27
|
clipPath: string;
|
|
27
28
|
imageFilter: ConstantAccessor<string, Datum>;
|
|
28
|
-
shapeRendering: ConstantAccessor<
|
|
29
|
+
shapeRendering: ConstantAccessor<CSS.Property.ShapeRendering, Datum>;
|
|
29
30
|
paintOrder: ConstantAccessor<string, Datum>;
|
|
30
31
|
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
31
32
|
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
@@ -57,9 +58,10 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
57
58
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
59
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
60
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
class
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
class?: string;
|
|
62
|
+
style?: string;
|
|
63
|
+
cursor: ConstantAccessor<CSS.Property.Cursor, Datum>;
|
|
64
|
+
}>, "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
|
|
63
65
|
data?: Datum[] | undefined;
|
|
64
66
|
automatic?: boolean;
|
|
65
67
|
title?: string | false | null;
|
|
@@ -14,7 +14,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
14
14
|
sort: {
|
|
15
15
|
channel: string;
|
|
16
16
|
order?: "ascending" | "descending";
|
|
17
|
-
} | ((a: import("../types/
|
|
17
|
+
} | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Datum>;
|
|
18
18
|
stroke: ChannelAccessor<Datum>;
|
|
19
19
|
strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
20
20
|
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
@@ -59,7 +59,8 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
59
59
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
60
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
61
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
62
|
-
class
|
|
62
|
+
class?: string;
|
|
63
|
+
style?: string;
|
|
63
64
|
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
64
65
|
}> & LinkableMarkProps<Datum> & BaseRectMarkProps<Datum> & {
|
|
65
66
|
data: Datum[];
|
package/dist/marks/BarY.svelte
CHANGED
|
@@ -58,7 +58,8 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
58
58
|
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
59
|
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
60
|
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
|
-
class
|
|
61
|
+
class?: string;
|
|
62
|
+
style?: string;
|
|
62
63
|
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
63
64
|
}> & LinkableMarkProps<Datum> & BaseRectMarkProps<Datum> & {
|
|
64
65
|
data: Datum[];
|
|
@@ -1,77 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DataRecord } from '../types/index.js';
|
|
2
2
|
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
3
|
-
props():
|
|
4
|
-
filter?: import("../types/index.js").ConstantAccessor<boolean, Datum>;
|
|
5
|
-
facet?: "auto" | "include" | "exclude";
|
|
6
|
-
fx: ChannelAccessor<Datum>;
|
|
7
|
-
fy: ChannelAccessor<Datum>;
|
|
8
|
-
dx: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
9
|
-
dy: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
10
|
-
fill: ChannelAccessor<Datum>;
|
|
11
|
-
fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
12
|
-
sort: {
|
|
13
|
-
channel: string;
|
|
14
|
-
order?: "ascending" | "descending";
|
|
15
|
-
} | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
|
|
16
|
-
stroke: ChannelAccessor<Datum>;
|
|
17
|
-
strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
18
|
-
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
19
|
-
strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
20
|
-
strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
21
|
-
strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
22
|
-
opacity: ChannelAccessor<Datum>;
|
|
23
|
-
strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
24
|
-
strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
25
|
-
mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
26
|
-
clipPath: string;
|
|
27
|
-
imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
28
|
-
shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
29
|
-
paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
30
|
-
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
31
|
-
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
32
|
-
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
33
|
-
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
-
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
-
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
-
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
-
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
-
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
-
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
-
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
-
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
-
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
-
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
-
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
-
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
-
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
-
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
-
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
-
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
-
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
-
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
-
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
-
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
-
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
-
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
-
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
-
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
-
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
-
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
class: string | null;
|
|
61
|
-
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
-
}> & {
|
|
63
|
-
data: Datum[];
|
|
64
|
-
x?: ChannelAccessor<Datum>;
|
|
65
|
-
y?: ChannelAccessor<Datum>;
|
|
66
|
-
/**
|
|
67
|
-
* the window size (the window transform's k option), an integer; defaults to 20
|
|
68
|
-
*/
|
|
69
|
-
n?: number;
|
|
70
|
-
/**
|
|
71
|
-
* the band radius, a number representing a multiple of standard deviations; defaults to 2
|
|
72
|
-
*/
|
|
73
|
-
k?: number;
|
|
74
|
-
};
|
|
3
|
+
props(): any;
|
|
75
4
|
events(): {};
|
|
76
5
|
slots(): {};
|
|
77
6
|
bindings(): "";
|
|
@@ -1,77 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DataRecord } from '../types/index.js';
|
|
2
2
|
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
3
|
-
props():
|
|
4
|
-
filter?: import("../types/index.js").ConstantAccessor<boolean, Datum>;
|
|
5
|
-
facet?: "auto" | "include" | "exclude";
|
|
6
|
-
fx: ChannelAccessor<Datum>;
|
|
7
|
-
fy: ChannelAccessor<Datum>;
|
|
8
|
-
dx: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
9
|
-
dy: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
10
|
-
fill: ChannelAccessor<Datum>;
|
|
11
|
-
fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
12
|
-
sort: {
|
|
13
|
-
channel: string;
|
|
14
|
-
order?: "ascending" | "descending";
|
|
15
|
-
} | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
|
|
16
|
-
stroke: ChannelAccessor<Datum>;
|
|
17
|
-
strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
18
|
-
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
19
|
-
strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
20
|
-
strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
21
|
-
strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
22
|
-
opacity: ChannelAccessor<Datum>;
|
|
23
|
-
strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
24
|
-
strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
25
|
-
mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
26
|
-
clipPath: string;
|
|
27
|
-
imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
28
|
-
shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
29
|
-
paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
30
|
-
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
31
|
-
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
32
|
-
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
33
|
-
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
-
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
-
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
-
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
-
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
-
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
-
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
-
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
-
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
-
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
-
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
-
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
-
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
-
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
-
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
-
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
-
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
-
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
-
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
-
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
-
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
-
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
-
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
-
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
-
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
-
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
-
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
class: string | null;
|
|
61
|
-
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
-
}> & {
|
|
63
|
-
data: Datum[];
|
|
64
|
-
x?: ChannelAccessor<Datum>;
|
|
65
|
-
y?: ChannelAccessor<Datum>;
|
|
66
|
-
/**
|
|
67
|
-
* the window size (the window transform's k option), an integer; defaults to 20
|
|
68
|
-
*/
|
|
69
|
-
n?: number;
|
|
70
|
-
/**
|
|
71
|
-
* the band radius, a number representing a multiple of standard deviations; defaults to 2
|
|
72
|
-
*/
|
|
73
|
-
k?: number;
|
|
74
|
-
};
|
|
3
|
+
props(): any;
|
|
75
4
|
events(): {};
|
|
76
5
|
slots(): {};
|
|
77
6
|
bindings(): "";
|