svelteplot 0.4.9 → 0.5.0-pr-233.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.
Files changed (66) hide show
  1. package/dist/Mark.svelte +87 -73
  2. package/dist/Mark.svelte.d.ts +39 -36
  3. package/dist/helpers/colors.d.ts +1 -1
  4. package/dist/helpers/index.d.ts +4 -2
  5. package/dist/helpers/index.js +11 -0
  6. package/dist/helpers/scales.d.ts +1 -1
  7. package/dist/helpers/scales.js +5 -1
  8. package/dist/helpers/typeChecks.d.ts +4 -4
  9. package/dist/marks/Area.svelte.d.ts +39 -36
  10. package/dist/marks/AreaX.svelte.d.ts +40 -37
  11. package/dist/marks/Arrow.svelte.d.ts +39 -36
  12. package/dist/marks/AxisX.svelte +6 -1
  13. package/dist/marks/AxisX.svelte.d.ts +40 -37
  14. package/dist/marks/AxisY.svelte +6 -1
  15. package/dist/marks/AxisY.svelte.d.ts +40 -37
  16. package/dist/marks/BarX.svelte.d.ts +39 -36
  17. package/dist/marks/BarY.svelte.d.ts +39 -36
  18. package/dist/marks/BollingerX.svelte.d.ts +2 -74
  19. package/dist/marks/BollingerY.svelte.d.ts +2 -74
  20. package/dist/marks/BoxY.svelte.d.ts +6 -66
  21. package/dist/marks/Cell.svelte.d.ts +39 -36
  22. package/dist/marks/CustomMark.svelte.d.ts +2 -81
  23. package/dist/marks/CustomMarkHTML.svelte.d.ts +1 -1
  24. package/dist/marks/DifferenceY.svelte.d.ts +7 -67
  25. package/dist/marks/Dot.svelte +1 -1
  26. package/dist/marks/Dot.svelte.d.ts +39 -36
  27. package/dist/marks/DotX.svelte.d.ts +40 -37
  28. package/dist/marks/DotY.svelte.d.ts +40 -37
  29. package/dist/marks/Geo.svelte.d.ts +39 -36
  30. package/dist/marks/GridX.svelte +9 -2
  31. package/dist/marks/GridX.svelte.d.ts +39 -36
  32. package/dist/marks/GridY.svelte +10 -2
  33. package/dist/marks/GridY.svelte.d.ts +39 -36
  34. package/dist/marks/Line.svelte.d.ts +40 -37
  35. package/dist/marks/LineX.svelte.d.ts +41 -38
  36. package/dist/marks/LineY.svelte.d.ts +41 -38
  37. package/dist/marks/Link.svelte.d.ts +39 -36
  38. package/dist/marks/Rect.svelte.d.ts +39 -36
  39. package/dist/marks/RuleX.svelte.d.ts +39 -36
  40. package/dist/marks/RuleY.svelte.d.ts +39 -36
  41. package/dist/marks/Spike.svelte.d.ts +40 -37
  42. package/dist/marks/Text.svelte.d.ts +41 -38
  43. package/dist/marks/TickX.svelte.d.ts +39 -36
  44. package/dist/marks/TickY.svelte.d.ts +39 -36
  45. package/dist/marks/Vector.svelte.d.ts +39 -36
  46. package/dist/marks/helpers/BaseAxisX.svelte +17 -4
  47. package/dist/marks/helpers/BaseAxisX.svelte.d.ts +3 -1
  48. package/dist/marks/helpers/BaseAxisY.svelte +15 -6
  49. package/dist/marks/helpers/BaseAxisY.svelte.d.ts +3 -1
  50. package/dist/marks/helpers/MarkerPath.svelte.d.ts +2 -160
  51. package/dist/marks/helpers/RectPath.svelte.d.ts +3 -63
  52. package/dist/transforms/bollinger.d.ts +1 -67
  53. package/dist/transforms/dodge.d.ts +17 -0
  54. package/dist/transforms/dodge.js +128 -0
  55. package/dist/transforms/group.d.ts +4 -12
  56. package/dist/transforms/interval.d.ts +2 -124
  57. package/dist/transforms/recordize.d.ts +1 -4
  58. package/dist/transforms/select.d.ts +7 -434
  59. package/dist/transforms/sort.d.ts +3 -246
  60. package/dist/transforms/stack.d.ts +3 -23
  61. package/dist/transforms/window.d.ts +2 -130
  62. package/dist/types/index.d.ts +7 -0
  63. package/dist/types/mark.d.ts +37 -34
  64. package/dist/ui/ExamplesPageList.svelte +63 -0
  65. package/dist/ui/ExamplesPageList.svelte.d.ts +12 -0
  66. package/package.json +129 -127
package/dist/Mark.svelte CHANGED
@@ -41,6 +41,7 @@
41
41
  import { testFilter, isValid } from './helpers/index.js';
42
42
  import { resolveChannel, resolveProp } from './helpers/resolve.js';
43
43
  import { RENAME } from './transforms/rename.js';
44
+ import { dodgeX, dodgeY } from './transforms/dodge.js';
44
45
 
45
46
  let {
46
47
  data = [],
@@ -207,85 +208,98 @@
207
208
  * elements to the scales
208
209
  */
209
210
  const scaledData = $derived(
210
- resolvedData.flatMap((row) => {
211
- const out: ScaledDataRecord<Datum> = {
212
- datum: row.datum,
213
- index: row[INDEX],
214
- valid: true
215
- };
216
- // compute dx/dy
217
- out.dx = Number(resolveProp<number>(options.dx, out.datum, 0));
218
- out.dy = Number(resolveProp<number>(options.dy, out.datum, 0));
219
-
220
- // special handling if there's a projection, e.g. a line mark
221
- if (plot.scales.projection && mark.type !== 'geo') {
222
- for (const suffix of ['', '1', '2']) {
223
- if (
224
- options?.[`x${suffix}`] !== undefined &&
225
- options?.[`y${suffix}`] !== undefined
226
- ) {
227
- // we have two-dimensional accessors
228
- // for the x and y channels
229
- const [x, y] =
230
- mark.type === 'line'
231
- ? [row.x, row.y] // line paths are projected later
232
- : projectXY(
233
- plot.scales,
234
- row.x,
235
- row.y,
236
- usedScales.x,
237
- usedScales.y,
238
- suffix
239
- );
240
-
241
- out[`x${suffix}`] = x;
242
- out[`y${suffix}`] = y;
243
- out.valid =
244
- out.valid &&
245
- isValid(row.x) &&
246
- isValid(row.y) &&
247
- isValid(x) &&
248
- isValid(y);
211
+ dodge(
212
+ resolvedData.flatMap((row) => {
213
+ const out: ScaledDataRecord<Datum> = {
214
+ datum: row.datum,
215
+ index: row[INDEX],
216
+ valid: true
217
+ };
218
+ // compute dx/dy
219
+ out.dx = Number(resolveProp<number>(options.dx, out.datum, 0));
220
+ out.dy = Number(resolveProp<number>(options.dy, out.datum, 0));
221
+
222
+ // special handling if there's a projection, e.g. a line mark
223
+ if (plot.scales.projection && mark.type !== 'geo') {
224
+ for (const suffix of ['', '1', '2']) {
225
+ if (
226
+ options?.[`x${suffix}`] !== undefined &&
227
+ options?.[`y${suffix}`] !== undefined
228
+ ) {
229
+ // we have two-dimensional accessors
230
+ // for the x and y channels
231
+ const [x, y] =
232
+ mark.type === 'line'
233
+ ? [row.x, row.y] // line paths are projected later
234
+ : projectXY(
235
+ plot.scales,
236
+ row.x,
237
+ row.y,
238
+ usedScales.x,
239
+ usedScales.y,
240
+ suffix
241
+ );
242
+
243
+ out[`x${suffix}`] = x;
244
+ out[`y${suffix}`] = y;
245
+ out.valid =
246
+ out.valid &&
247
+ isValid(row.x) &&
248
+ isValid(row.y) &&
249
+ isValid(x) &&
250
+ isValid(y);
251
+ }
249
252
  }
250
253
  }
251
- }
252
254
 
253
- // iterate over all scaled channels
254
- for (const [channel, scale] of Object.entries(CHANNEL_SCALE) as [
255
- ScaledChannelName,
256
- ScaleName
257
- ][]) {
258
- // check if the mark has defined an accessor for this channel
259
- if (options?.[channel] != null && out[channel] === undefined) {
260
- // resolve value
261
- const value = row[channel];
262
- // if this channel was renamed, use the original channel for scaling
263
- const origChannel = options?.[RENAME]?.[channel] || channel;
264
- const scaled = usedScales[channel]
265
- ? scale === 'x'
266
- ? projectX(origChannel as 'x' | 'x1' | 'x2', plot.scales, value)
267
- : scale === 'y'
268
- ? projectY(origChannel as 'y' | 'y1' | 'y2', plot.scales, value)
269
- : scale === 'color' && !isValid(value)
270
- ? plot.options.color.unknown
271
- : plot.scales[scale].fn(value)
272
- : value;
273
-
274
- out.valid = out.valid && (scale === 'color' || isValid(value));
275
-
276
- // apply dx/dy transform
277
- out[channel] =
278
- Number.isFinite(scaled) && (scale === 'x' || scale === 'y')
279
- ? scaled + (scale === 'x' ? out.dx : out.dy)
280
- : scaled;
281
- } else if (defaults[channel]) {
282
- out[channel] = defaults[channel];
255
+ // iterate over all scaled channels
256
+ for (const [channel, scale] of Object.entries(CHANNEL_SCALE) as [
257
+ ScaledChannelName,
258
+ ScaleName
259
+ ][]) {
260
+ // check if the mark has defined an accessor for this channel
261
+ if (options?.[channel] != null && out[channel] === undefined) {
262
+ // resolve value
263
+ const value = row[channel];
264
+ // if this channel was renamed, use the original channel for scaling
265
+ const origChannel = options?.[RENAME]?.[channel] || channel;
266
+ const scaled = usedScales[channel]
267
+ ? scale === 'x'
268
+ ? projectX(origChannel as 'x' | 'x1' | 'x2', plot.scales, value)
269
+ : scale === 'y'
270
+ ? projectY(origChannel as 'y' | 'y1' | 'y2', plot.scales, value)
271
+ : scale === 'color' && !isValid(value)
272
+ ? plot.options.color.unknown
273
+ : plot.scales[scale].fn(value)
274
+ : value;
275
+
276
+ out.valid = out.valid && (scale === 'color' || isValid(value));
277
+
278
+ // apply dx/dy transform
279
+ out[channel] =
280
+ Number.isFinite(scaled) && (scale === 'x' || scale === 'y')
281
+ ? scaled + (scale === 'x' ? out.dx : out.dy)
282
+ : scaled;
283
+ } else if (defaults[channel]) {
284
+ out[channel] = defaults[channel];
285
+ }
283
286
  }
284
- }
285
287
 
286
- return [out];
287
- })
288
+ return [out];
289
+ }),
290
+ options
291
+ )
288
292
  );
293
+
294
+ function dodge<T>(data: ScaledDataRecord<Datum>[], options: BaseMarkProps<T>) {
295
+ if (options.dodgeX) {
296
+ return dodgeX({ data, ...options }, plot);
297
+ }
298
+ if (options.dodgeY) {
299
+ return dodgeY({ data, ...options }, plot);
300
+ }
301
+ return data;
302
+ }
289
303
  </script>
290
304
 
291
305
  {#if errors.length}
@@ -1,20 +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
5
  declare class __sveltets_Render<Datum extends DataRecord> {
5
6
  props(): Partial<Partial<{
6
- filter?: import("./types/index.js").ConstantAccessor<boolean, Datum>;
7
- facet?: "auto" | "include" | "exclude";
7
+ filter: import("./types/index.js").ConstantAccessor<boolean, Datum>;
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>;
13
+ dodgeX: CHANNEL_SCALE;
14
+ dodgeY: CHANNEL_SCALE;
12
15
  fill: ChannelAccessor<Datum>;
13
16
  fillOpacity: import("./types/index.js").ConstantAccessor<number, Datum>;
14
- sort: ((a: RawValue, b: RawValue) => number) | {
17
+ sort: {
15
18
  channel: string;
16
19
  order?: "ascending" | "descending";
17
- } | import("./types/index.js").ConstantAccessor<RawValue, Datum>;
20
+ } | ((a: RawValue, b: RawValue) => number) | import("./types/index.js").ConstantAccessor<RawValue, Datum>;
18
21
  stroke: ChannelAccessor<Datum>;
19
22
  strokeWidth: import("./types/index.js").ConstantAccessor<number, Datum>;
20
23
  strokeOpacity: import("./types/index.js").ConstantAccessor<number, Datum>;
@@ -29,38 +32,38 @@ declare class __sveltets_Render<Datum extends DataRecord> {
29
32
  imageFilter: import("./types/index.js").ConstantAccessor<string, Datum>;
30
33
  shapeRendering: import("./types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
31
34
  paintOrder: import("./types/index.js").ConstantAccessor<string, Datum>;
32
- onclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
33
- ondblclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
34
- onmouseup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
35
- onmousedown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
36
- onmouseenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
37
- onmousemove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
38
- onmouseleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
39
- onmouseout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
40
- onmouseover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
41
- onpointercancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
42
- onpointerdown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
43
- onpointerup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
44
- onpointerenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
45
- onpointerleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
46
- onpointermove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
47
- onpointerover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
48
- onpointerout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
49
- ondrag?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
50
- ondrop?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
51
- ondragstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
52
- ondragenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
53
- ondragleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
54
- ondragover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
55
- ondragend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
56
- ontouchstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
57
- ontouchmove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
58
- ontouchend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
59
- ontouchcancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
60
- oncontextmenu?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
61
- onwheel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
62
- class?: string;
63
- style?: string;
35
+ onclick: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
36
+ ondblclick: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
37
+ onmouseup: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
38
+ onmousedown: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
39
+ onmouseenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
40
+ onmousemove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
41
+ onmouseleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
42
+ onmouseout: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
43
+ onmouseover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
44
+ onpointercancel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
45
+ onpointerdown: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
46
+ onpointerup: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
47
+ onpointerenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
48
+ onpointerleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
49
+ onpointermove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
50
+ onpointerover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
51
+ onpointerout: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
52
+ ondrag: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
53
+ ondrop: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
54
+ ondragstart: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
55
+ ondragenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
56
+ ondragleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
57
+ ondragover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
58
+ ondragend: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
59
+ ontouchstart: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
60
+ ontouchmove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
61
+ ontouchend: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
62
+ ontouchcancel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
63
+ oncontextmenu: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
64
+ onwheel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
65
+ class: string;
66
+ style: string;
64
67
  cursor: import("./types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
65
68
  }>> & {
66
69
  data?: Datum[] | undefined;
@@ -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): unknown[] | undefined;
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;
@@ -1,10 +1,11 @@
1
1
  import type { ChannelName, Channels, RawValue } from '../types/index.js';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { TransitionConfig } from 'svelte/transition';
3
4
  /**
4
5
  * Returns first argument that is not null or undefined
5
6
  */
6
- export declare function coalesce(...args: (RawValue | undefined | null)[]): RawValue | null;
7
- export declare function testFilter<T>(datum: T, options: Channels<T>): true | T | null;
7
+ export declare function coalesce(...args: (RawValue | undefined | null)[]): any;
8
+ export declare function testFilter<T>(datum: T, options: Channels<T>): any;
8
9
  export declare function randomId(): string;
9
10
  export declare function isSnippet(value: unknown): value is Snippet;
10
11
  export declare function isValid(value: RawValue | undefined): value is number | Date | string;
@@ -16,3 +17,4 @@ export declare function parseInset(inset: number | string, width: number): numbe
16
17
  export declare function omit<T extends {}, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
17
18
  export declare function identity<T>(x: T): T;
18
19
  export declare const GEOJSON_PREFER_STROKE: Set<string>;
20
+ export declare function noTransition(node: Element): TransitionConfig;
@@ -61,3 +61,14 @@ export function identity(x) {
61
61
  return x;
62
62
  }
63
63
  export const GEOJSON_PREFER_STROKE = new Set(['MultiLineString', 'LineString']);
64
+ export function noTransition(node) {
65
+ node.dispatchEvent(new CustomEvent('introstart'));
66
+ node.dispatchEvent(new CustomEvent('introend'));
67
+ node.dispatchEvent(new CustomEvent('outrostart'));
68
+ node.dispatchEvent(new CustomEvent('outroend'));
69
+ return {
70
+ duration: 0,
71
+ delay: 0,
72
+ css: () => ''
73
+ };
74
+ }
@@ -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: RawValue[] | [undefined, undefined];
18
+ domain: any;
19
19
  range: any;
20
20
  fn: any;
21
21
  skip: Map<ScaledChannelName, Set<symbol>>;
@@ -152,7 +152,11 @@ 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 === 'band' || type === 'point' || type === 'ordinal' || type === 'categorical';
155
+ const isOrdinal = type === 'band' ||
156
+ type === 'point' ||
157
+ type === 'ordinal' ||
158
+ type === 'categorical' ||
159
+ type === 'threshold';
156
160
  if (isOrdinal && sortOrdinalDomain) {
157
161
  valueArr.sort(ascending);
158
162
  }
@@ -1,10 +1,10 @@
1
1
  import type { RawValue } from '../types/index.js';
2
- export declare function isBooleanOrNull(v: RawValue): v is boolean;
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): v is Date | 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): v is string | 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): boolean;
9
+ export declare function isColorOrNull(v: RawValue | null | undefined): any;
10
10
  export declare function isOpacityOrNull(v: RawValue): boolean;
@@ -1,20 +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
5
  declare class __sveltets_Render<Datum extends DataRecord> {
5
6
  props(): Partial<{
6
- filter?: ConstantAccessor<boolean, Datum>;
7
- facet?: "auto" | "include" | "exclude";
7
+ filter: ConstantAccessor<boolean, Datum>;
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>;
13
+ dodgeX: callWithProps;
14
+ dodgeY: callWithProps;
12
15
  fill: ChannelAccessor<Datum>;
13
16
  fillOpacity: ConstantAccessor<number, Datum>;
14
- sort: ((a: RawValue, b: RawValue) => number) | {
17
+ sort: {
15
18
  channel: string;
16
19
  order?: "ascending" | "descending";
17
- } | ConstantAccessor<RawValue, Datum>;
20
+ } | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
18
21
  stroke: ChannelAccessor<Datum>;
19
22
  strokeWidth: ConstantAccessor<number, Datum>;
20
23
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -29,38 +32,38 @@ declare class __sveltets_Render<Datum extends DataRecord> {
29
32
  imageFilter: ConstantAccessor<string, Datum>;
30
33
  shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
31
34
  paintOrder: 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;
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>;
65
+ class: string;
66
+ style: string;
64
67
  cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
65
68
  }> & LinkableMarkProps<Datum> & {
66
69
  data: Datum[];
@@ -1,18 +1,21 @@
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<{
4
- filter?: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/data").RawValue>>;
5
- facet?: "auto" | "include" | "exclude";
5
+ filter: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/data").RawValue>>;
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>>;
11
+ dodgeX: renameChannels;
12
+ dodgeY: renameChannels;
10
13
  fill: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
11
14
  fillOpacity: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
12
- sort: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
15
+ sort: {
13
16
  channel: string;
14
17
  order?: "ascending" | "descending";
15
- } | 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>>;
16
19
  stroke: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
17
20
  strokeWidth: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
18
21
  strokeOpacity: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
@@ -27,38 +30,38 @@ declare class __sveltets_Render<Datum extends DataRow> {
27
30
  imageFilter: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
28
31
  shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Record<string | symbol, import("../types/data").RawValue>>;
29
32
  paintOrder: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
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;
61
- style?: string;
33
+ onclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
34
+ ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
35
+ onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
36
+ onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
37
+ onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
38
+ onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
39
+ onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
40
+ onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
41
+ onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
42
+ onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
43
+ onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
44
+ onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
45
+ onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
46
+ onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
47
+ onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
48
+ onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
49
+ onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
50
+ ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
51
+ ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
52
+ ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
53
+ ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
54
+ ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
55
+ ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
56
+ ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
57
+ ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
58
+ ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
59
+ ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
+ ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
61
+ oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
62
+ onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
63
+ class: string;
64
+ style: string;
62
65
  cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types/data").RawValue>>;
63
66
  }> & import("../types/mark").LinkableMarkProps<Record<string | symbol, import("../types/data").RawValue>> & {
64
67
  data: Record<string | symbol, import("../types/data").RawValue>[];
@@ -72,7 +75,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
72
75
  sort?: import("../types/index.js").ConstantAccessor<import("../types/data").RawValue> | {
73
76
  channel: "stroke" | "fill";
74
77
  };
75
- stack?: Partial<import("../transforms/stack.js").StackOptions>;
78
+ stack?: Partial<renameChannels>;
76
79
  canvas?: boolean;
77
80
  }, "y1" | "y2"> & {
78
81
  x?: ChannelAccessor<Datum>;