svelteplot 0.3.6 → 0.3.7-pr-131.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 (37) hide show
  1. package/dist/Mark.svelte +1 -1
  2. package/dist/Mark.svelte.d.ts +1 -1
  3. package/dist/core/Plot.svelte +14 -1
  4. package/dist/helpers/arrowPath.js +3 -3
  5. package/dist/helpers/colors.d.ts +1 -1
  6. package/dist/helpers/index.d.ts +2 -5
  7. package/dist/helpers/scales.d.ts +1 -1
  8. package/dist/helpers/typeChecks.d.ts +4 -4
  9. package/dist/marks/AreaX.svelte.d.ts +2 -1
  10. package/dist/marks/AreaY.svelte.d.ts +2 -1
  11. package/dist/marks/AxisX.svelte.d.ts +1 -1
  12. package/dist/marks/AxisY.svelte.d.ts +1 -1
  13. package/dist/marks/BarX.svelte.d.ts +1 -1
  14. package/dist/marks/BollingerX.svelte.d.ts +2 -73
  15. package/dist/marks/BollingerY.svelte.d.ts +2 -73
  16. package/dist/marks/BoxY.svelte.d.ts +6 -65
  17. package/dist/marks/CustomMark.svelte +46 -27
  18. package/dist/marks/CustomMark.svelte.d.ts +2 -71
  19. package/dist/marks/DifferenceY.svelte.d.ts +7 -66
  20. package/dist/marks/Line.svelte.d.ts +2 -2
  21. package/dist/marks/LineX.svelte.d.ts +2 -1
  22. package/dist/marks/LineY.svelte.d.ts +2 -1
  23. package/dist/marks/helpers/BaseAxisY.svelte +0 -2
  24. package/dist/transforms/bollinger.d.ts +1 -66
  25. package/dist/transforms/bollinger.js +3 -3
  26. package/dist/transforms/group.d.ts +4 -12
  27. package/dist/transforms/interval.d.ts +2 -122
  28. package/dist/transforms/map.d.ts +4 -184
  29. package/dist/transforms/normalize.d.ts +3 -123
  30. package/dist/transforms/select.d.ts +7 -427
  31. package/dist/transforms/sort.d.ts +3 -242
  32. package/dist/transforms/window.d.ts +2 -130
  33. package/dist/types/channel.d.ts +1 -0
  34. package/dist/types/data.d.ts +4 -2
  35. package/dist/types/mark.d.ts +1 -1
  36. package/dist/types/plot.d.ts +6 -1
  37. package/package.json +126 -125
package/dist/Mark.svelte CHANGED
@@ -11,7 +11,7 @@
11
11
  {
12
12
  mark: Mark<GenericMarkOptions>;
13
13
  usedScales: ReturnType<typeof getUsedScales>;
14
- scaledData: ScaledDataRecord[];
14
+ scaledData: ScaledDataRecord<Datum>[];
15
15
  }
16
16
  ]
17
17
  >;
@@ -71,7 +71,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
71
71
  children?: Snippet<[{
72
72
  mark: any;
73
73
  usedScales: ReturnType<typeof getUsedScales>;
74
- scaledData: ScaledDataRecord[];
74
+ scaledData: ScaledDataRecord<Datum>[];
75
75
  }]> | undefined;
76
76
  defaults?: Partial<Record<ScaledChannelName, RawValue>>;
77
77
  };
@@ -519,7 +519,20 @@
519
519
  {/if}
520
520
  </FacetGrid>
521
521
  </svg>
522
- {#if overlay}<div class="plot-overlay">{@render overlay?.()}</div>{/if}
522
+ {#if overlay}<div class="plot-overlay">
523
+ {@render overlay?.({
524
+ width,
525
+ height,
526
+ options: plotOptions,
527
+ scales: plotState.scales,
528
+ mapXY,
529
+ hasProjection,
530
+ hasExplicitAxisX,
531
+ hasExplicitAxisY,
532
+ hasExplicitGridX,
533
+ hasExplicitGridY
534
+ })}
535
+ </div>{/if}
523
536
  </div>
524
537
  {#if footer}
525
538
  <figcaption class="plot-footer">
@@ -53,16 +53,16 @@ export function arrowPath(x1, y1, x2, y2, insetStart, insetEnd, headAngle, headL
53
53
  if (insetEnd) {
54
54
  const [x, y] = circleCircleIntersect([cx, cy, r], [x2, y2, insetEnd], sign * Math.sign(insetEnd));
55
55
  lineAngle += Math.atan2(y - cy, x - cx) - Math.atan2(y2 - cy, x2 - cx);
56
- (x2 = x), (y2 = y);
56
+ ((x2 = x), (y2 = y));
57
57
  }
58
58
  }
59
59
  else {
60
60
  // For inset straight arrows, offset along the straight line.
61
61
  const dx = x2 - x1, dy = y2 - y1, d = Math.hypot(dx, dy);
62
62
  if (insetStart)
63
- (x1 += (dx / d) * insetStart), (y1 += (dy / d) * insetStart);
63
+ ((x1 += (dx / d) * insetStart), (y1 += (dy / d) * insetStart));
64
64
  if (insetEnd)
65
- (x2 -= (dx / d) * insetEnd), (y2 -= (dy / d) * insetEnd);
65
+ ((x2 -= (dx / d) * insetEnd), (y2 -= (dy / d) * insetEnd));
66
66
  }
67
67
  }
68
68
  // The angle of the arrow as it approaches the endpoint, and the
@@ -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;
@@ -3,11 +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)[]): RawValue | null;
7
- export declare function testFilter(datum: DataRecord, options: Record<ChannelName, ChannelAccessor>): string | number | boolean | symbol | Date | {
8
- value: import("../types/index.js").ChannelValue<Record<string | symbol, RawValue>>;
9
- scale: boolean | null;
10
- } | null;
6
+ export declare function coalesce(...args: (RawValue | undefined | null)[]): any;
7
+ export declare function testFilter(datum: DataRecord, options: Record<ChannelName, ChannelAccessor>): any;
11
8
  export declare function randomId(): string;
12
9
  export declare function isSnippet(value: unknown): value is Snippet;
13
10
  export declare function isValid(value: RawValue | undefined): value is number | Date | string;
@@ -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>>;
@@ -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,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<{
@@ -71,7 +72,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
71
72
  sort?: import("../types/index.js").ConstantAccessor<import("../types/data").RawValue> | {
72
73
  channel: "stroke" | "fill";
73
74
  };
74
- stack?: Partial<import("../transforms/stack.js").StackOptions>;
75
+ stack?: Partial<renameChannels>;
75
76
  canvas?: boolean;
76
77
  }, "y1" | "y2"> & {
77
78
  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<{
@@ -71,7 +72,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
71
72
  sort?: import("../types/index.js").ConstantAccessor<import("../types/data").RawValue> | {
72
73
  channel: "stroke" | "fill";
73
74
  };
74
- stack?: Partial<import("../transforms/stack.js").StackOptions>;
75
+ stack?: Partial<renameChannels>;
75
76
  canvas?: boolean;
76
77
  }, "x1" | "x2"> & {
77
78
  x?: ChannelAccessor<Datum>;
@@ -59,7 +59,7 @@ declare class __sveltets_Render<Datum extends RawValue> {
59
59
  onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
60
  class: string | null;
61
61
  cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
62
- }>, "fill" | "fillOpacity" | "href" | "target" | "paintOrder" | "title"> & {
62
+ }>, "fill" | "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
63
63
  data?: Datum[] | undefined;
64
64
  automatic?: boolean;
65
65
  title?: string | false | null;
@@ -59,7 +59,7 @@ declare class __sveltets_Render<Datum extends RawValue> {
59
59
  onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
60
  class: string | null;
61
61
  cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
62
- }>, "fill" | "fillOpacity" | "href" | "target" | "paintOrder" | "title"> & {
62
+ }>, "fill" | "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
63
63
  data?: Datum[] | undefined;
64
64
  automatic?: boolean;
65
65
  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/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
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>;
@@ -1,77 +1,6 @@
1
- import type { ChannelAccessor, DataRecord } from '../types/index.js';
1
+ import type { DataRecord } from '../types/index.js';
2
2
  declare class __sveltets_Render<Datum extends DataRecord> {
3
- props(): Partial<{
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 { ChannelAccessor, DataRecord } from '../types/index.js';
1
+ import type { DataRecord } from '../types/index.js';
2
2
  declare class __sveltets_Render<Datum extends DataRecord> {
3
- props(): Partial<{
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,88 +1,29 @@
1
1
  import type { ChannelAccessor, DataRecord } from '../types/index.js';
2
2
  declare class __sveltets_Render<Datum extends DataRecord> {
3
- props(): Pick<Partial<{
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
- }>, "class"> & {
3
+ props(): Pick<BaseMarkProps<Datum_1>, "class"> & {
63
4
  data: Datum[];
64
5
  x: ChannelAccessor;
65
6
  y: ChannelAccessor;
66
7
  /**
67
8
  * Options for the rule marks that represent the min/max range
68
9
  */
69
- rule: Record<string, ChannelAccessor<Datum>>;
10
+ rule: Record<string, ChannelAccessor<Datum_1>>;
70
11
  /**
71
12
  * Options for the bar marks that represent the IQR range
72
13
  */
73
- bar: Record<string, ChannelAccessor<Datum>>;
14
+ bar: Record<string, ChannelAccessor<Datum_1>>;
74
15
  /**
75
16
  * Options for the tick marks that represent the median
76
17
  */
77
- tickMedian: boolean | Record<string, ChannelAccessor<Datum>>;
18
+ tickMedian: Record<string, ChannelAccessor<Datum_1>> | boolean;
78
19
  /**
79
20
  * Options for the tick marks that represent the min/max range
80
21
  */
81
- tickMinMax: boolean | Record<string, ChannelAccessor<Datum>>;
22
+ tickMinMax: Record<string, ChannelAccessor<Datum_1>> | boolean;
82
23
  /**
83
24
  * Options for the dot marks that represent the outliers
84
25
  */
85
- dot: Record<string, ChannelAccessor<Datum>>;
26
+ dot: Record<string, ChannelAccessor<Datum_1>>;
86
27
  };
87
28
  events(): {};
88
29
  slots(): {};
@@ -4,10 +4,18 @@
4
4
  -->
5
5
  <script lang="ts" generics="Datum extends DataRecord">
6
6
  interface CustomMarkProps extends BaseMarkProps<Datum> {
7
- data: Datum[];
7
+ data?: Datum[];
8
8
  x?: ChannelAccessor<Datum>;
9
+ x1?: ChannelAccessor<Datum>;
10
+ x2?: ChannelAccessor<Datum>;
9
11
  y?: ChannelAccessor<Datum>;
10
- children: Snippet<[{ datum: Datum; x: number; y: number }]>;
12
+ y1?: ChannelAccessor<Datum>;
13
+ y2?: ChannelAccessor<Datum>;
14
+ r?: ChannelAccessor<Datum>;
15
+ mark?: Snippet<
16
+ [{ record: ScaledDataRecord<Datum>; index: number; usedScales: UsedScales }]
17
+ >;
18
+ marks?: Snippet<[{ records: ScaledDataRecord<Datum>[]; usedScales: UsedScales }]>;
11
19
  }
12
20
 
13
21
  import { getContext } from 'svelte';
@@ -15,36 +23,47 @@
15
23
  PlotContext,
16
24
  DataRecord,
17
25
  ChannelAccessor,
18
- BaseMarkProps
26
+ BaseMarkProps,
27
+ ScaledDataRecord,
28
+ UsedScales,
29
+ ScaledChannelName
19
30
  } from '../types/index.js';
20
31
  import type { Snippet } from 'svelte';
32
+ import { sort } from '../index.js';
21
33
 
22
- const { getPlotState } = getContext<PlotContext>('svelteplot');
23
- let plot = $derived(getPlotState());
34
+ import Mark from '../Mark.svelte';
24
35
 
25
- import { resolveChannel } from '../helpers/resolve.js';
26
- import { projectXY } from '../helpers/scales.js';
27
- import { isValid } from '../helpers/index.js';
28
- import GroupMultiple from './helpers/GroupMultiple.svelte';
36
+ let { data = [{} as Datum], mark, marks, ...options }: CustomMarkProps = $props();
29
37
 
30
- let {
31
- data = [{} as Datum],
32
- x,
33
- y,
34
- children,
35
- class: className = null
36
- }: CustomMarkProps = $props();
38
+ const args = $derived(sort({ data, ...options })) as CustomMarkProps;
39
+
40
+ const channels: ScaledChannelName[] = [
41
+ 'x',
42
+ 'x1',
43
+ 'x2',
44
+ 'y',
45
+ 'y1',
46
+ 'y2',
47
+ 'r',
48
+ 'fill',
49
+ 'stroke',
50
+ 'opacity',
51
+ 'fillOpacity',
52
+ 'strokeOpacity'
53
+ ];
37
54
  </script>
38
55
 
39
- <GroupMultiple class="g-custom-mark {className || ''}" length={className ? 2 : data.length}>
40
- {#each data as datum, i (i)}
41
- {@const x_ = resolveChannel<Datum>('x', datum, { x, y })}
42
- {@const y_ = resolveChannel<Datum>('y', datum, { x, y })}
43
- {#if isValid(x_) && isValid(y_)}
44
- {@const [px, py] = projectXY(plot.scales, x_, y_)}
45
- <g transform="translate({px}, {py})">
46
- {@render children({ datum, x: px, y: py })}
47
- </g>
56
+ <Mark type="custom" required={[]} channels={channels.filter((d) => !!options[d])} {...args}>
57
+ {#snippet children({ scaledData, usedScales })}
58
+ {#if marks}
59
+ {@render marks({ records: scaledData.filter((d) => d.valid), usedScales })}
60
+ {/if}
61
+ {#if mark}
62
+ {#each scaledData as datum, i (i)}
63
+ {#if datum.valid}
64
+ {@render mark({ record: datum, index: i, usedScales })}
65
+ {/if}
66
+ {/each}
48
67
  {/if}
49
- {/each}
50
- </GroupMultiple>
68
+ {/snippet}
69
+ </Mark>
@@ -1,75 +1,6 @@
1
- import type { DataRecord, ChannelAccessor } from '../types/index.js';
2
- import type { Snippet } from 'svelte';
1
+ import type { DataRecord } from '../types/index.js';
3
2
  declare class __sveltets_Render<Datum extends DataRecord> {
4
- props(): Partial<{
5
- filter?: import("../types/index.js").ConstantAccessor<boolean, Datum>;
6
- facet?: "auto" | "include" | "exclude";
7
- fx: ChannelAccessor<Datum>;
8
- fy: ChannelAccessor<Datum>;
9
- dx: import("../types/index.js").ConstantAccessor<number, Datum>;
10
- dy: import("../types/index.js").ConstantAccessor<number, Datum>;
11
- fill: ChannelAccessor<Datum>;
12
- fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
13
- sort: {
14
- channel: string;
15
- order?: "ascending" | "descending";
16
- } | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
17
- stroke: ChannelAccessor<Datum>;
18
- strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
19
- strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
20
- strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
21
- strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
22
- strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
23
- opacity: ChannelAccessor<Datum>;
24
- strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
25
- strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
26
- mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
27
- clipPath: string;
28
- imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
29
- shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
30
- paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
31
- onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
32
- ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
33
- onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
34
- onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
35
- onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
36
- onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
37
- onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
38
- onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
39
- onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
40
- onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
41
- onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
42
- onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
43
- onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
44
- onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
45
- onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
46
- onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
47
- onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
48
- ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
49
- ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
50
- ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
51
- ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
52
- ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
53
- ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
54
- ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
55
- ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
56
- ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
57
- ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
58
- ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
59
- oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
- onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
61
- class: string | null;
62
- cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
63
- }> & {
64
- data: Datum[];
65
- x?: ChannelAccessor<Datum>;
66
- y?: ChannelAccessor<Datum>;
67
- children: Snippet<[{
68
- datum: Datum;
69
- x: number;
70
- y: number;
71
- }]>;
72
- };
3
+ props(): any;
73
4
  events(): {};
74
5
  slots(): {};
75
6
  bindings(): "";