svelteplot 0.5.1 → 0.5.2-pr-251.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Mark.svelte.d.ts +5 -4
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +22 -0
- package/dist/core/Plot.svelte +7 -2
- package/dist/helpers/autoScales.js +10 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/isRawValue.js +6 -1
- package/dist/helpers/reduce.js +3 -2
- package/dist/helpers/scales.d.ts +2 -1
- package/dist/helpers/scales.js +13 -10
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/marks/Area.svelte +9 -3
- package/dist/marks/Area.svelte.d.ts +6 -4
- package/dist/marks/AreaX.svelte.d.ts +7 -5
- package/dist/marks/Arrow.svelte.d.ts +5 -4
- package/dist/marks/AxisX.svelte.d.ts +6 -5
- package/dist/marks/AxisY.svelte.d.ts +6 -5
- package/dist/marks/BarX.svelte +1 -1
- package/dist/marks/BarX.svelte.d.ts +5 -4
- package/dist/marks/BarY.svelte +1 -1
- package/dist/marks/BarY.svelte.d.ts +5 -4
- package/dist/marks/BollingerX.svelte.d.ts +2 -76
- package/dist/marks/BollingerY.svelte.d.ts +2 -76
- package/dist/marks/BoxX.svelte +13 -1
- package/dist/marks/BoxY.svelte +12 -1
- package/dist/marks/BoxY.svelte.d.ts +6 -68
- package/dist/marks/Cell.svelte.d.ts +5 -4
- package/dist/marks/CustomMark.svelte +9 -3
- package/dist/marks/CustomMark.svelte.d.ts +2 -83
- package/dist/marks/CustomMarkHTML.svelte.d.ts +1 -1
- package/dist/marks/DifferenceY.svelte.d.ts +7 -69
- package/dist/marks/Dot.svelte +6 -1
- package/dist/marks/Dot.svelte.d.ts +5 -4
- package/dist/marks/DotX.svelte.d.ts +6 -5
- package/dist/marks/DotY.svelte.d.ts +6 -5
- package/dist/marks/Geo.svelte.d.ts +5 -4
- package/dist/marks/GridX.svelte.d.ts +5 -4
- package/dist/marks/GridY.svelte.d.ts +5 -4
- package/dist/marks/Image.svelte +76 -0
- package/dist/marks/Image.svelte.d.ts +19 -0
- package/dist/marks/Line.svelte.d.ts +6 -5
- package/dist/marks/LineX.svelte.d.ts +7 -6
- package/dist/marks/LineY.svelte.d.ts +7 -6
- package/dist/marks/Link.svelte.d.ts +5 -4
- package/dist/marks/Rect.svelte +2 -0
- package/dist/marks/Rect.svelte.d.ts +5 -4
- package/dist/marks/RuleX.svelte +5 -1
- package/dist/marks/RuleX.svelte.d.ts +5 -4
- package/dist/marks/RuleY.svelte +6 -1
- package/dist/marks/RuleY.svelte.d.ts +5 -4
- package/dist/marks/Spike.svelte.d.ts +6 -5
- package/dist/marks/Text.svelte.d.ts +7 -6
- package/dist/marks/TickX.svelte +5 -1
- package/dist/marks/TickX.svelte.d.ts +5 -4
- package/dist/marks/TickY.svelte +5 -1
- package/dist/marks/TickY.svelte.d.ts +5 -4
- package/dist/marks/Vector.svelte.d.ts +5 -4
- package/dist/marks/helpers/Anchor.svelte +16 -2
- package/dist/marks/helpers/Anchor.svelte.d.ts +28 -14
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +2 -164
- package/dist/marks/helpers/RectPath.svelte +3 -1
- package/dist/marks/helpers/RectPath.svelte.d.ts +3 -65
- package/dist/marks/index.d.ts +1 -0
- package/dist/marks/index.js +1 -0
- package/dist/transforms/bin.js +46 -26
- package/dist/transforms/bollinger.d.ts +1 -69
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -128
- package/dist/transforms/recordize.d.ts +1 -4
- package/dist/transforms/select.d.ts +7 -448
- package/dist/transforms/sort.d.ts +3 -254
- package/dist/transforms/stack.d.ts +4 -24
- package/dist/transforms/stack.js +9 -3
- package/dist/transforms/window.d.ts +2 -134
- package/dist/types/channel.d.ts +1 -1
- package/dist/types/data.d.ts +1 -1
- package/dist/types/mark.d.ts +1 -1
- package/dist/types/plot.d.ts +13 -1
- package/package.json +129 -128
package/dist/Mark.svelte.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
5
|
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
@@ -9,14 +10,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
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>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ScaleName, ScaleType, ScaledChannelName } from './types/index.js';
|
|
1
|
+
import type { ChannelName, ScaleName, ScaleType, ScaledChannelName } from './types/index.js';
|
|
2
2
|
export declare const SCALE_TYPES: Record<ScaleName, symbol>;
|
|
3
|
+
export declare const ORIGINAL_NAME_KEYS: Record<ChannelName, symbol>;
|
|
3
4
|
export declare const SCALES: ScaleName[];
|
|
4
5
|
export declare const VALID_SCALE_TYPES: Record<ScaleName, Set<ScaleType>>;
|
|
5
6
|
/**
|
package/dist/constants.js
CHANGED
|
@@ -10,6 +10,28 @@ export const SCALE_TYPES = {
|
|
|
10
10
|
fy: Symbol('fy'),
|
|
11
11
|
projection: Symbol('projection')
|
|
12
12
|
};
|
|
13
|
+
export const ORIGINAL_NAME_KEYS = {
|
|
14
|
+
x: Symbol('origName_x'),
|
|
15
|
+
x1: Symbol('origName_x1'),
|
|
16
|
+
x2: Symbol('origName_x2'),
|
|
17
|
+
y: Symbol('origName_y'),
|
|
18
|
+
y1: Symbol('origName_y1'),
|
|
19
|
+
y2: Symbol('origName_y2'),
|
|
20
|
+
fill: Symbol('origName_color'),
|
|
21
|
+
stroke: Symbol('origName_color'),
|
|
22
|
+
opacity: Symbol('origName_opacity'),
|
|
23
|
+
symbol: Symbol('origName_symbol'),
|
|
24
|
+
r: Symbol('origName_r'),
|
|
25
|
+
z: Symbol('origName_z'),
|
|
26
|
+
sort: Symbol('origName_sort'),
|
|
27
|
+
filter: Symbol('origName_filter'),
|
|
28
|
+
interval: Symbol('origName_interval'),
|
|
29
|
+
length: Symbol('origName_length'),
|
|
30
|
+
fx: Symbol('origName_fx'),
|
|
31
|
+
fy: Symbol('origName_fy'),
|
|
32
|
+
fillOpacity: Symbol('origName_opacity'),
|
|
33
|
+
strokeOpacity: Symbol('origName_opacity')
|
|
34
|
+
};
|
|
13
35
|
export const SCALES = [
|
|
14
36
|
'x',
|
|
15
37
|
'y',
|
package/dist/core/Plot.svelte
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
margin: 'auto',
|
|
66
66
|
colorScheme: 'turbo',
|
|
67
67
|
unknown: '#cccccc99',
|
|
68
|
-
|
|
68
|
+
sortOrdinalDomains: true,
|
|
69
69
|
categoricalColorScheme: 'observable10',
|
|
70
70
|
pointScaleHeight: 18,
|
|
71
71
|
bandScaleHeight: 30,
|
|
@@ -365,7 +365,12 @@
|
|
|
365
365
|
initialOpts: Partial<PlotOptions>,
|
|
366
366
|
opts: PlotOptionsParameters
|
|
367
367
|
): PlotOptions {
|
|
368
|
-
return mergeDeep<PlotOptions>(
|
|
368
|
+
return mergeDeep<PlotOptions>(
|
|
369
|
+
{},
|
|
370
|
+
{ sortOrdinalDomains: DEFAULTS.sortOrdinalDomains },
|
|
371
|
+
smartDefaultPlotOptions(opts),
|
|
372
|
+
initialOpts
|
|
373
|
+
);
|
|
369
374
|
}
|
|
370
375
|
|
|
371
376
|
function maybeMargin(
|
|
@@ -79,7 +79,16 @@ export function autoScale({ name, type, domain, scaleOptions, plotOptions, plotW
|
|
|
79
79
|
...(type === 'band' || type === 'point'
|
|
80
80
|
? {
|
|
81
81
|
align: scaleOptions.align,
|
|
82
|
-
|
|
82
|
+
...(type === 'point'
|
|
83
|
+
? {
|
|
84
|
+
// point scales don't have paddingInner/Outer, only padding
|
|
85
|
+
padding: maybeNumber(coalesce(scaleOptions.padding, plotOptions.padding, 0.15))
|
|
86
|
+
}
|
|
87
|
+
: {
|
|
88
|
+
// padding: maybeNumber(coalesce(scaleOptions.padding, plotOptions.padding, 0.15)),
|
|
89
|
+
paddingInner: maybeNumber(coalesce(scaleOptions.paddingInner, scaleOptions.padding, plotOptions.padding, 0.15)),
|
|
90
|
+
paddingOuter: maybeNumber(coalesce(scaleOptions.paddingOuter, scaleOptions.padding, plotOptions.padding, 0.15))
|
|
91
|
+
})
|
|
83
92
|
}
|
|
84
93
|
: {})
|
|
85
94
|
};
|
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;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { isDate } from './typeChecks.js';
|
|
2
2
|
export default function (value) {
|
|
3
3
|
const t = typeof value;
|
|
4
|
-
return t === 'string' ||
|
|
4
|
+
return (t === 'string' ||
|
|
5
|
+
t === 'number' ||
|
|
6
|
+
t === 'boolean' ||
|
|
7
|
+
t === 'object' ||
|
|
8
|
+
isDate(value) ||
|
|
9
|
+
t === null);
|
|
5
10
|
}
|
package/dist/helpers/reduce.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { min, max, mode, sum, mean, median, variance, deviation, quantile } from 'd3-array';
|
|
2
2
|
import { resolveChannel } from './resolve.js';
|
|
3
3
|
import { POSITION_CHANNELS } from './index.js';
|
|
4
|
+
import { ORIGINAL_NAME_KEYS } from '../constants.js';
|
|
4
5
|
const niceReduceNames = {
|
|
5
6
|
count: 'Frequency',
|
|
6
7
|
deviation: 'Standard Deviation',
|
|
@@ -72,10 +73,10 @@ export function reduceOutputs(newDatum, data, options, outputs, channels, newCha
|
|
|
72
73
|
if (typeof channels[k] === 'string') {
|
|
73
74
|
// the named reducer is applied to a column name, so we can use a combination
|
|
74
75
|
// of both as axis labels, e.g. MEAN(weight)
|
|
75
|
-
newChannels[
|
|
76
|
+
newChannels[ORIGINAL_NAME_KEYS[k]] = `${reducerName} ( ${channels[k]} )`;
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
|
-
newChannels[
|
|
79
|
+
newChannels[ORIGINAL_NAME_KEYS[k]] = reducerName;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
}
|
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>>;
|
|
@@ -40,3 +40,4 @@ export declare function looksLikeANumber(input: string | number): boolean;
|
|
|
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 "point" | "ordinal" | "band" | "categorical" | "threshold";
|
package/dist/helpers/scales.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extent, ascending } from 'd3-array';
|
|
2
2
|
import { isColorOrNull, isDate, isDateOrNull, isNumberOrNull, isNumberOrNullOrNaN, isStringOrNull } from './typeChecks.js';
|
|
3
|
-
import { CHANNEL_SCALE, VALID_SCALE_TYPES } from '../constants.js';
|
|
3
|
+
import { CHANNEL_SCALE, ORIGINAL_NAME_KEYS, VALID_SCALE_TYPES } from '../constants.js';
|
|
4
4
|
import { isSymbolOrNull } from './typeChecks.js';
|
|
5
5
|
import { resolveProp, toChannelOption } from './resolve.js';
|
|
6
6
|
import isDataRecord from './isDataRecord.js';
|
|
@@ -48,7 +48,7 @@ export function createScale(name, scaleOptions, marks, plotOptions, plotWidth, p
|
|
|
48
48
|
let manualActiveMarks = 0;
|
|
49
49
|
const propNames = new Set();
|
|
50
50
|
const uniqueScaleProps = new Set();
|
|
51
|
-
let sortOrdinalDomain = true;
|
|
51
|
+
let sortOrdinalDomain = plotOptions.sortOrdinalDomains ?? true;
|
|
52
52
|
for (const mark of marks) {
|
|
53
53
|
// we only sort the scale domain alphabetically, if none of the
|
|
54
54
|
// marks that map to it are using the `sort` transform. Note that
|
|
@@ -126,9 +126,9 @@ export function createScale(name, scaleOptions, marks, plotOptions, plotWidth, p
|
|
|
126
126
|
}
|
|
127
127
|
// special handling of marks using the stackX/stackY transform
|
|
128
128
|
if ((name === 'x' || name === 'y') &&
|
|
129
|
-
mark.options[
|
|
130
|
-
!mark.options[
|
|
131
|
-
propNames.add(mark.options[
|
|
129
|
+
mark.options[ORIGINAL_NAME_KEYS[name]] &&
|
|
130
|
+
!mark.options[ORIGINAL_NAME_KEYS[name]].startsWith('__')) {
|
|
131
|
+
propNames.add(mark.options[ORIGINAL_NAME_KEYS[name]]);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
@@ -152,11 +152,7 @@ export function createScale(name, scaleOptions, marks, plotOptions, plotWidth, p
|
|
|
152
152
|
throw new Error(`Invalid scale type ${type} for scale
|
|
153
153
|
${name}. Valid types are ${[...VALID_SCALE_TYPES[name]].join(', ')}`);
|
|
154
154
|
}
|
|
155
|
-
const isOrdinal = type
|
|
156
|
-
type === 'point' ||
|
|
157
|
-
type === 'ordinal' ||
|
|
158
|
-
type === 'categorical' ||
|
|
159
|
-
type === 'threshold';
|
|
155
|
+
const isOrdinal = isOrdinalScale(type);
|
|
160
156
|
if (isOrdinal && sortOrdinalDomain) {
|
|
161
157
|
valueArr.sort(ascending);
|
|
162
158
|
}
|
|
@@ -351,3 +347,10 @@ export function projectY(channel, scales, value) {
|
|
|
351
347
|
? scales.y.fn.bandwidth()
|
|
352
348
|
: 0));
|
|
353
349
|
}
|
|
350
|
+
export function isOrdinalScale(scaleType) {
|
|
351
|
+
return (scaleType === 'band' ||
|
|
352
|
+
scaleType === 'point' ||
|
|
353
|
+
scaleType === 'ordinal' ||
|
|
354
|
+
scaleType === 'categorical' ||
|
|
355
|
+
scaleType === 'threshold');
|
|
356
|
+
}
|
|
@@ -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;
|
package/dist/marks/Area.svelte
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
sort?: ConstantAccessor<RawValue> | { channel: 'stroke' | 'fill' };
|
|
15
15
|
stack?: Partial<StackOptions>;
|
|
16
16
|
canvas?: boolean;
|
|
17
|
+
areaClass?: ConstantAccessor<string, Datum>;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
import Mark from '../Mark.svelte';
|
|
@@ -37,7 +38,6 @@
|
|
|
37
38
|
ChannelAccessor,
|
|
38
39
|
ScaledDataRecord,
|
|
39
40
|
LinkableMarkProps,
|
|
40
|
-
PlotDefaults,
|
|
41
41
|
RawValue
|
|
42
42
|
} from '../types/index.js';
|
|
43
43
|
import type { StackOptions } from '../transforms/stack.js';
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
curve = 'linear' as CurveName,
|
|
60
60
|
tension = 0,
|
|
61
61
|
class: className = '',
|
|
62
|
+
areaClass,
|
|
62
63
|
canvas = false,
|
|
63
64
|
...options
|
|
64
65
|
}: AreaMarkProps = $derived({ ...DEFAULTS, ...markProps });
|
|
@@ -114,13 +115,14 @@
|
|
|
114
115
|
{data}
|
|
115
116
|
channels={['x1', 'x2', 'y1', 'y2', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity']}
|
|
116
117
|
required={['x1', 'y1']}
|
|
118
|
+
{...markProps}
|
|
117
119
|
{...options}>
|
|
118
120
|
{#snippet children({ mark, usedScales, scaledData })}
|
|
119
121
|
{@const grouped = groupAndSort(scaledData)}
|
|
120
122
|
{#if canvas}
|
|
121
123
|
<AreaCanvas groupedAreaData={grouped} {mark} {usedScales} {areaPath} />
|
|
122
124
|
{:else}
|
|
123
|
-
<GroupMultiple length={grouped.length}>
|
|
125
|
+
<GroupMultiple class={className} length={grouped.length}>
|
|
124
126
|
{#each grouped as areaData, i (i)}
|
|
125
127
|
{@const datum = areaData[0]}
|
|
126
128
|
{#if areaData.length > 0}
|
|
@@ -134,7 +136,11 @@
|
|
|
134
136
|
usedScales
|
|
135
137
|
)}
|
|
136
138
|
<path
|
|
137
|
-
class={[
|
|
139
|
+
class={[
|
|
140
|
+
'area',
|
|
141
|
+
resolveProp(areaClass, areaData[0].datum),
|
|
142
|
+
styleClass
|
|
143
|
+
]}
|
|
138
144
|
clip-path={options.clipPath}
|
|
139
145
|
d={areaPath(areaData)}
|
|
140
146
|
{@attach addEventHandlers({
|
|
@@ -1,4 +1,5 @@
|
|
|
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
5
|
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
@@ -9,14 +10,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
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>;
|
|
@@ -78,6 +79,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
78
79
|
};
|
|
79
80
|
stack?: Partial<StackOptions>;
|
|
80
81
|
canvas?: boolean;
|
|
82
|
+
areaClass?: ConstantAccessor<string, Datum>;
|
|
81
83
|
};
|
|
82
84
|
events(): {};
|
|
83
85
|
slots(): {};
|
|
@@ -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<{
|
|
@@ -7,14 +8,14 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
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,8 +75,9 @@ 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;
|
|
80
|
+
areaClass?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
|
|
79
81
|
}, "y1" | "y2"> & {
|
|
80
82
|
x?: ChannelAccessor<Datum>;
|
|
81
83
|
y?: ChannelAccessor<Datum>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DataRecord, ConstantAccessor, ChannelAccessor, RawValue } from '../types/index.js';
|
|
2
2
|
import { type SweepOption } from '../helpers/arrowPath.js';
|
|
3
|
+
import { replaceChannels } from '../transforms/rename.js';
|
|
3
4
|
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
4
5
|
props(): Omit<Partial<{
|
|
5
6
|
filter: ConstantAccessor<boolean, Datum>;
|
|
@@ -8,14 +9,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
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>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RawValue, ConstantAccessor } from '../types/index.js';
|
|
2
2
|
import type * as CSS from 'csstype';
|
|
3
|
+
import autoTimeFormat from '../helpers/autoTimeFormat.js';
|
|
3
4
|
declare class __sveltets_Render<Datum extends RawValue> {
|
|
4
5
|
props(): Omit<Partial<{
|
|
5
6
|
filter: ConstantAccessor<boolean, Datum>;
|
|
@@ -8,14 +9,14 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
8
9
|
fy: import("../types/channel").ChannelAccessor<Datum>;
|
|
9
10
|
dx: ConstantAccessor<number, Datum>;
|
|
10
11
|
dy: ConstantAccessor<number, Datum>;
|
|
11
|
-
dodgeX:
|
|
12
|
-
dodgeY:
|
|
12
|
+
dodgeX: autoTimeFormat;
|
|
13
|
+
dodgeY: autoTimeFormat;
|
|
13
14
|
fill: import("../types/channel").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: import("../types/channel").ChannelAccessor<Datum>;
|
|
20
21
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
21
22
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
@@ -63,7 +64,7 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
63
64
|
class: string;
|
|
64
65
|
style: string;
|
|
65
66
|
cursor: ConstantAccessor<CSS.Property.Cursor, Datum>;
|
|
66
|
-
}>, "fillOpacity" | "
|
|
67
|
+
}>, "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
|
|
67
68
|
data?: Datum[] | undefined;
|
|
68
69
|
automatic?: boolean;
|
|
69
70
|
title?: string | false | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RawValue, ConstantAccessor } from '../types/index.js';
|
|
2
|
+
import autoTimeFormat from '../helpers/autoTimeFormat.js';
|
|
2
3
|
declare class __sveltets_Render<Datum extends RawValue> {
|
|
3
4
|
props(): Omit<Partial<{
|
|
4
5
|
filter: ConstantAccessor<boolean, Datum>;
|
|
@@ -7,14 +8,14 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
7
8
|
fy: import("../types/channel").ChannelAccessor<Datum>;
|
|
8
9
|
dx: ConstantAccessor<number, Datum>;
|
|
9
10
|
dy: ConstantAccessor<number, Datum>;
|
|
10
|
-
dodgeX:
|
|
11
|
-
dodgeY:
|
|
11
|
+
dodgeX: autoTimeFormat;
|
|
12
|
+
dodgeY: autoTimeFormat;
|
|
12
13
|
fill: import("../types/channel").ChannelAccessor<Datum>;
|
|
13
14
|
fillOpacity: ConstantAccessor<number, Datum>;
|
|
14
|
-
sort:
|
|
15
|
+
sort: {
|
|
15
16
|
channel: string;
|
|
16
17
|
order?: "ascending" | "descending";
|
|
17
|
-
} | ConstantAccessor<RawValue, Datum>;
|
|
18
|
+
} | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
|
|
18
19
|
stroke: import("../types/channel").ChannelAccessor<Datum>;
|
|
19
20
|
strokeWidth: ConstantAccessor<number, Datum>;
|
|
20
21
|
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
@@ -62,7 +63,7 @@ declare class __sveltets_Render<Datum extends RawValue> {
|
|
|
62
63
|
class: string;
|
|
63
64
|
style: string;
|
|
64
65
|
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
65
|
-
}>, "fillOpacity" | "
|
|
66
|
+
}>, "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
|
|
66
67
|
data?: Datum[] | undefined;
|
|
67
68
|
automatic?: boolean;
|
|
68
69
|
title?: string | false | null;
|
package/dist/marks/BarX.svelte
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { stackX } from '../index.js';
|
|
1
2
|
import type { StackOptions } from '../transforms/stack.js';
|
|
2
3
|
import type { DataRow } from '../types/index.js';
|
|
3
4
|
import type { BaseRectMarkProps, ChannelAccessor, LinkableMarkProps } from '../types/index.js';
|
|
@@ -9,14 +10,14 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
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: stackX;
|
|
14
|
+
dodgeY: stackX;
|
|
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<import("../types/
|
|
20
|
+
} | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").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>;
|
package/dist/marks/BarY.svelte
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { intervalY } from '../index.js';
|
|
1
2
|
import type { StackOptions } from '../transforms/stack.js';
|
|
2
3
|
import type { BaseRectMarkProps, ChannelAccessor, DataRow, LinkableMarkProps } from '../types/index.js';
|
|
3
4
|
declare class __sveltets_Render<Datum extends DataRow> {
|
|
@@ -8,14 +9,14 @@ declare class __sveltets_Render<Datum extends DataRow> {
|
|
|
8
9
|
fy: ChannelAccessor<Datum>;
|
|
9
10
|
dx: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
10
11
|
dy: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
11
|
-
dodgeX:
|
|
12
|
-
dodgeY:
|
|
12
|
+
dodgeX: intervalY;
|
|
13
|
+
dodgeY: intervalY;
|
|
13
14
|
fill: ChannelAccessor<Datum>;
|
|
14
15
|
fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
15
|
-
sort:
|
|
16
|
+
sort: {
|
|
16
17
|
channel: string;
|
|
17
18
|
order?: "ascending" | "descending";
|
|
18
|
-
} | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Datum>;
|
|
19
|
+
} | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Datum>;
|
|
19
20
|
stroke: ChannelAccessor<Datum>;
|
|
20
21
|
strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
21
22
|
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
@@ -1,80 +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
|
-
dodgeX: import("../transforms/dodge").DodgeXOptions;
|
|
11
|
-
dodgeY: import("../transforms/dodge").DodgeYOptions;
|
|
12
|
-
fill: ChannelAccessor<Datum>;
|
|
13
|
-
fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
14
|
-
sort: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
15
|
-
channel: string;
|
|
16
|
-
order?: "ascending" | "descending";
|
|
17
|
-
} | import("../types/index.js").ConstantAccessor<import("../types/index.js").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").MouseEventHandler<SVGPathElement>;
|
|
33
|
-
ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
-
onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
-
onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
-
onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
-
onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
-
onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
-
onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
-
onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
-
onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
-
onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
-
onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
-
onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
-
onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
-
onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
-
onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
-
onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
-
ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
-
ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
-
ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
-
ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
-
ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
-
ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
-
ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
-
ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
-
ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
-
ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
-
ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
-
oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
|
-
onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
62
|
-
class: string;
|
|
63
|
-
style: string;
|
|
64
|
-
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
65
|
-
}> & {
|
|
66
|
-
data: Datum[];
|
|
67
|
-
x?: ChannelAccessor<Datum>;
|
|
68
|
-
y?: ChannelAccessor<Datum>;
|
|
69
|
-
/**
|
|
70
|
-
* the window size (the window transform's k option), an integer; defaults to 20
|
|
71
|
-
*/
|
|
72
|
-
n?: number;
|
|
73
|
-
/**
|
|
74
|
-
* the band radius, a number representing a multiple of standard deviations; defaults to 2
|
|
75
|
-
*/
|
|
76
|
-
k?: number;
|
|
77
|
-
};
|
|
3
|
+
props(): any;
|
|
78
4
|
events(): {};
|
|
79
5
|
slots(): {};
|
|
80
6
|
bindings(): "";
|