svelteplot 0.5.0 → 0.5.1-pr-238.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.
Files changed (55) hide show
  1. package/dist/Mark.svelte.d.ts +5 -4
  2. package/dist/core/Plot.svelte +27 -26
  3. package/dist/helpers/colors.d.ts +1 -1
  4. package/dist/helpers/index.d.ts +2 -2
  5. package/dist/helpers/scales.d.ts +1 -1
  6. package/dist/helpers/typeChecks.d.ts +4 -4
  7. package/dist/marks/Area.svelte.d.ts +5 -4
  8. package/dist/marks/AreaX.svelte.d.ts +6 -5
  9. package/dist/marks/Arrow.svelte.d.ts +5 -4
  10. package/dist/marks/AxisX.svelte.d.ts +6 -5
  11. package/dist/marks/AxisY.svelte.d.ts +6 -5
  12. package/dist/marks/BarX.svelte.d.ts +5 -4
  13. package/dist/marks/BarY.svelte.d.ts +5 -4
  14. package/dist/marks/BollingerX.svelte.d.ts +2 -76
  15. package/dist/marks/BollingerY.svelte.d.ts +2 -76
  16. package/dist/marks/BoxY.svelte.d.ts +6 -68
  17. package/dist/marks/Cell.svelte.d.ts +5 -4
  18. package/dist/marks/CustomMark.svelte.d.ts +2 -83
  19. package/dist/marks/CustomMarkHTML.svelte.d.ts +1 -1
  20. package/dist/marks/DifferenceY.svelte.d.ts +7 -69
  21. package/dist/marks/Dot.svelte.d.ts +5 -4
  22. package/dist/marks/DotX.svelte.d.ts +6 -5
  23. package/dist/marks/DotY.svelte.d.ts +6 -5
  24. package/dist/marks/Geo.svelte.d.ts +5 -4
  25. package/dist/marks/GridX.svelte.d.ts +5 -4
  26. package/dist/marks/GridY.svelte.d.ts +5 -4
  27. package/dist/marks/Line.svelte +2 -2
  28. package/dist/marks/Line.svelte.d.ts +6 -5
  29. package/dist/marks/LineX.svelte.d.ts +7 -6
  30. package/dist/marks/LineY.svelte.d.ts +7 -6
  31. package/dist/marks/Link.svelte.d.ts +5 -4
  32. package/dist/marks/Rect.svelte.d.ts +5 -4
  33. package/dist/marks/RuleX.svelte.d.ts +5 -4
  34. package/dist/marks/RuleY.svelte.d.ts +5 -4
  35. package/dist/marks/Spike.svelte.d.ts +6 -5
  36. package/dist/marks/Text.svelte.d.ts +7 -6
  37. package/dist/marks/TickX.svelte.d.ts +5 -4
  38. package/dist/marks/TickY.svelte.d.ts +5 -4
  39. package/dist/marks/Vector.svelte.d.ts +5 -4
  40. package/dist/marks/helpers/BaseAxisX.svelte +1 -1
  41. package/dist/marks/helpers/BaseAxisY.svelte +1 -1
  42. package/dist/marks/helpers/MarkerPath.svelte.d.ts +2 -164
  43. package/dist/marks/helpers/RectPath.svelte.d.ts +3 -65
  44. package/dist/transforms/bin.js +36 -17
  45. package/dist/transforms/bollinger.d.ts +1 -69
  46. package/dist/transforms/group.d.ts +4 -12
  47. package/dist/transforms/interval.d.ts +2 -128
  48. package/dist/transforms/recordize.d.ts +1 -4
  49. package/dist/transforms/select.d.ts +7 -448
  50. package/dist/transforms/sort.d.ts +3 -254
  51. package/dist/transforms/stack.d.ts +3 -23
  52. package/dist/transforms/window.d.ts +2 -134
  53. package/dist/ui/ExamplesPageList.svelte +63 -0
  54. package/dist/ui/ExamplesPageList.svelte.d.ts +12 -0
  55. package/package.json +129 -128
@@ -1,3 +1,4 @@
1
+ import { recordizeY } from '../transforms/recordize.js';
1
2
  import type { DataRecord, ConstantAccessor, ChannelAccessor } from '../types/index.js';
2
3
  declare class __sveltets_Render<Datum = DataRecord> {
3
4
  props(): Omit<Partial<{
@@ -7,14 +8,14 @@ declare class __sveltets_Render<Datum = DataRecord> {
7
8
  fy: ChannelAccessor<Datum>;
8
9
  dx: ConstantAccessor<number, Datum>;
9
10
  dy: ConstantAccessor<number, Datum>;
10
- dodgeX: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
11
+ dodgeX: recordizeY;
12
+ dodgeY: recordizeY;
12
13
  fill: ChannelAccessor<Datum>;
13
14
  fillOpacity: ConstantAccessor<number, Datum>;
14
- sort: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
15
+ sort: {
15
16
  channel: string;
16
17
  order?: "ascending" | "descending";
17
- } | ConstantAccessor<import("../types/data").RawValue, Datum>;
18
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").RawValue, Datum>;
18
19
  stroke: ChannelAccessor<Datum>;
19
20
  strokeWidth: ConstantAccessor<number, Datum>;
20
21
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -1,4 +1,5 @@
1
1
  import type { ChannelAccessor, DataRecord } from '../types/index.js';
2
+ import { getPlotDefaults } from '../hooks/plotDefaults.js';
2
3
  declare class __sveltets_Render<Datum extends DataRecord> {
3
4
  props(): Omit<Partial<{
4
5
  filter: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/data").RawValue>>;
@@ -7,14 +8,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
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: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
11
+ dodgeX: getPlotDefaults;
12
+ dodgeY: getPlotDefaults;
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: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
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>>;
@@ -73,7 +74,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
73
74
  shape?: "arrow" | "spike" | "arrow-filled" | import("./Vector.svelte").ShapeRenderer;
74
75
  children?: import("svelte").Snippet;
75
76
  canvas?: boolean;
76
- }, "data" | "r" | "length" | "x" | "y" | "rotate"> & {
77
+ }, "r" | "length" | "x" | "y" | "data" | "rotate"> & {
77
78
  data: Datum[];
78
79
  x: ChannelAccessor<Datum>;
79
80
  y: ChannelAccessor<Datum>;
@@ -1,6 +1,7 @@
1
1
  import type * as CSS from 'csstype';
2
2
  import { type Snippet } from 'svelte';
3
3
  import type { DataRecord, ConstantAccessor, ChannelAccessor, LinkableMarkProps } from '../types/index.js';
4
+ import { sort } from '../index.js';
4
5
  declare class __sveltets_Render<Datum extends DataRecord> {
5
6
  props(): Partial<{
6
7
  filter: ConstantAccessor<boolean, Datum>;
@@ -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: import("../transforms/dodge").DodgeXOptions;
13
- dodgeY: import("../transforms/dodge").DodgeYOptions;
13
+ dodgeX: sort;
14
+ dodgeY: sort;
14
15
  fill: ChannelAccessor<Datum>;
15
16
  fillOpacity: ConstantAccessor<number, Datum>;
16
- sort: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
17
+ sort: {
17
18
  channel: string;
18
19
  order?: "ascending" | "descending";
19
- } | ConstantAccessor<import("../types/data").RawValue, Datum>;
20
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").RawValue, Datum>;
20
21
  stroke: ChannelAccessor<Datum>;
21
22
  strokeWidth: ConstantAccessor<number, Datum>;
22
23
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -75,7 +76,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
75
76
  * the font size of the text
76
77
  */
77
78
  fontFamily?: ConstantAccessor<CSS.Property.FontFamily, Datum>;
78
- fontSize?: ConstantAccessor<number | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (string & {}) | "small" | "large" | "medium" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "larger" | "smaller", Datum>;
79
+ fontSize?: ConstantAccessor<number | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (string & {}) | "small" | "medium" | "large" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "larger" | "smaller", Datum>;
79
80
  fontWeight?: ConstantAccessor<CSS.Property.FontWeight, Datum>;
80
81
  fontStyle?: ConstantAccessor<CSS.Property.FontStyle, Datum>;
81
82
  fontVariant?: ConstantAccessor<CSS.Property.FontVariant, Datum>;
@@ -100,7 +101,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
100
101
  * @default 1.2
101
102
  */
102
103
  lineHeight?: ConstantAccessor<number, Datum>;
103
- frameAnchor?: ConstantAccessor<"left" | "right" | "middle" | "top" | "bottom" | "top-left" | "bottom-left" | "top-right" | "bottom-right", Datum>;
104
+ frameAnchor?: ConstantAccessor<"bottom" | "top" | "left" | "right" | "middle" | "top-left" | "bottom-left" | "top-right" | "bottom-right", Datum>;
104
105
  /**
105
106
  * rotate text by angle in degrees
106
107
  */
@@ -1,4 +1,5 @@
1
1
  import type { ChannelAccessor, DataRow, ConstantAccessor } from '../types/index.js';
2
+ import { recordizeX } from '../index.js';
2
3
  declare class __sveltets_Render<Datum extends DataRow> {
3
4
  props(): Omit<Partial<{
4
5
  filter: ConstantAccessor<boolean, Datum>;
@@ -7,14 +8,14 @@ declare class __sveltets_Render<Datum extends DataRow> {
7
8
  fy: ChannelAccessor<Datum>;
8
9
  dx: ConstantAccessor<number, Datum>;
9
10
  dy: ConstantAccessor<number, Datum>;
10
- dodgeX: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
11
+ dodgeX: recordizeX;
12
+ dodgeY: recordizeX;
12
13
  fill: ChannelAccessor<Datum>;
13
14
  fillOpacity: ConstantAccessor<number, Datum>;
14
- sort: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
15
+ sort: {
15
16
  channel: string;
16
17
  order?: "ascending" | "descending";
17
- } | ConstantAccessor<import("../types/data").RawValue, Datum>;
18
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").RawValue, Datum>;
18
19
  stroke: ChannelAccessor<Datum>;
19
20
  strokeWidth: ConstantAccessor<number, Datum>;
20
21
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -1,4 +1,5 @@
1
1
  import type { ChannelAccessor, DataRow, ConstantAccessor } from '../types/index.js';
2
+ import { recordizeY } from '../index.js';
2
3
  declare class __sveltets_Render<Datum extends DataRow> {
3
4
  props(): Omit<Partial<{
4
5
  filter: ConstantAccessor<boolean, Datum>;
@@ -7,14 +8,14 @@ declare class __sveltets_Render<Datum extends DataRow> {
7
8
  fy: ChannelAccessor<Datum>;
8
9
  dx: ConstantAccessor<number, Datum>;
9
10
  dy: ConstantAccessor<number, Datum>;
10
- dodgeX: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
11
+ dodgeX: recordizeY;
12
+ dodgeY: recordizeY;
12
13
  fill: ChannelAccessor<Datum>;
13
14
  fillOpacity: ConstantAccessor<number, Datum>;
14
- sort: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
15
+ sort: {
15
16
  channel: string;
16
17
  order?: "ascending" | "descending";
17
- } | ConstantAccessor<import("../types/data").RawValue, Datum>;
18
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").RawValue, Datum>;
18
19
  stroke: ChannelAccessor<Datum>;
19
20
  strokeWidth: ConstantAccessor<number, Datum>;
20
21
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -4,6 +4,7 @@ export type ShapeRenderer = {
4
4
  };
5
5
  import type { DataRecord, ChannelAccessor } from '../types/index.js';
6
6
  import { type Snippet } from 'svelte';
7
+ import { sort } from '../index.js';
7
8
  declare class __sveltets_Render<Datum extends DataRecord> {
8
9
  props(): Partial<{
9
10
  filter: import("../types/index.js").ConstantAccessor<boolean, Datum>;
@@ -12,14 +13,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
12
13
  fy: ChannelAccessor<Datum>;
13
14
  dx: import("../types/index.js").ConstantAccessor<number, Datum>;
14
15
  dy: import("../types/index.js").ConstantAccessor<number, Datum>;
15
- dodgeX: import("../transforms/dodge.js").DodgeXOptions;
16
- dodgeY: import("../transforms/dodge.js").DodgeYOptions;
16
+ dodgeX: sort;
17
+ dodgeY: sort;
17
18
  fill: ChannelAccessor<Datum>;
18
19
  fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
19
- sort: ((a: import("../types/data.js").RawValue, b: import("../types/data.js").RawValue) => number) | {
20
+ sort: {
20
21
  channel: string;
21
22
  order?: "ascending" | "descending";
22
- } | import("../types/index.js").ConstantAccessor<import("../types/data.js").RawValue, Datum>;
23
+ } | ((a: import("../types/data.js").RawValue, b: import("../types/data.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data.js").RawValue, Datum>;
23
24
  stroke: ChannelAccessor<Datum>;
24
25
  strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
25
26
  strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
@@ -152,7 +152,7 @@
152
152
  </script>
153
153
 
154
154
  <g class="axis-x">
155
- {#each positionedTicks as tick, t (t)}
155
+ {#each positionedTicks as tick, t (tick[RAW_VALUE])}
156
156
  {#if testFilter(tick, options) && !tick.hidden}
157
157
  {@const tickClass_ = resolveProp(tickClass, tick)}
158
158
  {@const tickFontSize_ = +resolveProp(tickFontSize, tick, 10)}
@@ -154,7 +154,7 @@
154
154
  </script>
155
155
 
156
156
  <g class="axis-y">
157
- {#each positionedTicks as tick, t (t)}
157
+ {#each positionedTicks as tick, t (tick[RAW_VALUE])}
158
158
  {#if testFilter(tick, options) && !tick.hidden}
159
159
  {@const tickClass_ = resolveProp(tickClass, tick)}
160
160
  {@const [textStyle, textClass] = resolveStyles(
@@ -1,168 +1,6 @@
1
- import { type MarkerShape } from './Marker.svelte';
2
- import type { ConstantAccessor, DataRecord, Mark, PlotScales } from '../../types/index.js';
1
+ import type { DataRecord } from '../../types/index.js';
3
2
  declare class __sveltets_Render<Datum extends DataRecord> {
4
- props(): Partial<{
5
- filter: ConstantAccessor<boolean, Datum>;
6
- facet: "auto" | "include" | "exclude";
7
- fx: import("../../types/index.js").ChannelAccessor<Datum>;
8
- fy: import("../../types/index.js").ChannelAccessor<Datum>;
9
- dx: ConstantAccessor<number, Datum>;
10
- dy: ConstantAccessor<number, Datum>;
11
- dodgeX: import("../../transforms/dodge").DodgeXOptions;
12
- dodgeY: import("../../transforms/dodge").DodgeYOptions;
13
- fill: import("../../types/index.js").ChannelAccessor<Datum>;
14
- fillOpacity: ConstantAccessor<number, Datum>;
15
- sort: ((a: import("../../types/index.js").RawValue, b: import("../../types/index.js").RawValue) => number) | {
16
- channel: string;
17
- order?: "ascending" | "descending";
18
- } | ConstantAccessor<import("../../types/index.js").RawValue, Datum>;
19
- stroke: import("../../types/index.js").ChannelAccessor<Datum>;
20
- strokeWidth: ConstantAccessor<number, Datum>;
21
- strokeOpacity: ConstantAccessor<number, Datum>;
22
- strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
23
- strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
24
- strokeMiterlimit: ConstantAccessor<number, Datum>;
25
- opacity: import("../../types/index.js").ChannelAccessor<Datum>;
26
- strokeDasharray: ConstantAccessor<string, Datum>;
27
- strokeDashoffset: ConstantAccessor<number, Datum>;
28
- mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
29
- clipPath: string;
30
- imageFilter: ConstantAccessor<string, Datum>;
31
- shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
32
- paintOrder: ConstantAccessor<string, Datum>;
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;
65
- cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
66
- }> & {
67
- /**
68
- * the datum associated with this path, usually the first
69
- * element of the data array group
70
- */
71
- datum: Datum;
72
- /**
73
- * the marker shape to use at the start of the path, defaults to
74
- * circle
75
- */
76
- markerStart?: boolean | MarkerShape;
77
- /**
78
- * the marker shape to use at the middle of the path, defaults to circle
79
- */
80
- markerMid?: boolean | MarkerShape;
81
- /**
82
- * the marker shape to use at the end of the path, defaults to circle
83
- */
84
- markerEnd?: boolean | MarkerShape;
85
- /**
86
- * shorthand for setting all markers
87
- */
88
- marker?: boolean | MarkerShape;
89
- /**
90
- * path string
91
- */
92
- d: string;
93
- style: string;
94
- startOffset: string;
95
- textStyle: string;
96
- textStyleClass?: string | null;
97
- text: string;
98
- transform: string;
99
- color: string;
100
- strokeWidth: ConstantAccessor<number>;
101
- mark: Mark<Partial<{
102
- filter: ConstantAccessor<boolean, Datum>;
103
- facet: "auto" | "include" | "exclude";
104
- fx: import("../../types/index.js").ChannelAccessor<Datum>;
105
- fy: import("../../types/index.js").ChannelAccessor<Datum>;
106
- dx: ConstantAccessor<number, Datum>;
107
- dy: ConstantAccessor<number, Datum>;
108
- dodgeX: import("../../transforms/dodge").DodgeXOptions;
109
- dodgeY: import("../../transforms/dodge").DodgeYOptions;
110
- fill: import("../../types/index.js").ChannelAccessor<Datum>;
111
- fillOpacity: ConstantAccessor<number, Datum>;
112
- sort: ((a: import("../../types/index.js").RawValue, b: import("../../types/index.js").RawValue) => number) | {
113
- channel: string;
114
- order?: "ascending" | "descending";
115
- } | ConstantAccessor<import("../../types/index.js").RawValue, Datum>;
116
- stroke: import("../../types/index.js").ChannelAccessor<Datum>;
117
- strokeWidth: ConstantAccessor<number, Datum>;
118
- strokeOpacity: ConstantAccessor<number, Datum>;
119
- strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
120
- strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
121
- strokeMiterlimit: ConstantAccessor<number, Datum>;
122
- opacity: import("../../types/index.js").ChannelAccessor<Datum>;
123
- strokeDasharray: ConstantAccessor<string, Datum>;
124
- strokeDashoffset: ConstantAccessor<number, Datum>;
125
- mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
126
- clipPath: string;
127
- imageFilter: ConstantAccessor<string, Datum>;
128
- shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
129
- paintOrder: ConstantAccessor<string, Datum>;
130
- onclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
131
- ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
132
- onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
133
- onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
134
- onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
135
- onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
136
- onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
137
- onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
138
- onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
139
- onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
140
- onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
141
- onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
142
- onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
143
- onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
144
- onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
145
- onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
146
- onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
147
- ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
148
- ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
149
- ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
150
- ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
151
- ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
152
- ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
153
- ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
154
- ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
155
- ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
156
- ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
157
- ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
158
- oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
159
- onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
160
- class: string;
161
- style: string;
162
- cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
163
- }>>;
164
- scales: PlotScales;
165
- };
3
+ props(): any;
166
4
  events(): {};
167
5
  slots(): {};
168
6
  bindings(): "";
@@ -1,77 +1,15 @@
1
- import type { BaseRectMarkProps } from '../../types/mark.js';
1
+ import type { BaseMarkProps, BaseRectMarkProps } from '../../types/mark.js';
2
2
  import type { DataRecord, ScaledDataRecord } from '../../types/data.js';
3
3
  import type { UsedScales } from '../../types/index.js';
4
4
  declare class __sveltets_Render<Datum extends DataRecord> {
5
5
  props(): {
6
- datum: ScaledDataRecord<Datum>;
6
+ datum: ScaledDataRecord<Datum_1>;
7
7
  class: string | null;
8
8
  x: number;
9
9
  y: number;
10
10
  width: number;
11
11
  height: number;
12
- options: BaseRectMarkProps<Datum> & Partial<{
13
- filter: import("../../types/index.js").ConstantAccessor<boolean, Datum>;
14
- facet: "auto" | "include" | "exclude";
15
- fx: import("../../types/index.js").ChannelAccessor<Datum>;
16
- fy: import("../../types/index.js").ChannelAccessor<Datum>;
17
- dx: import("../../types/index.js").ConstantAccessor<number, Datum>;
18
- dy: import("../../types/index.js").ConstantAccessor<number, Datum>;
19
- dodgeX: import("../../transforms/dodge.js").DodgeXOptions;
20
- dodgeY: import("../../transforms/dodge.js").DodgeYOptions;
21
- fill: import("../../types/index.js").ChannelAccessor<Datum>;
22
- fillOpacity: import("../../types/index.js").ConstantAccessor<number, Datum>;
23
- sort: ((a: import("../../types/data.js").RawValue, b: import("../../types/data.js").RawValue) => number) | {
24
- channel: string;
25
- order?: "ascending" | "descending";
26
- } | import("../../types/index.js").ConstantAccessor<import("../../types/data.js").RawValue, Datum>;
27
- stroke: import("../../types/index.js").ChannelAccessor<Datum>;
28
- strokeWidth: import("../../types/index.js").ConstantAccessor<number, Datum>;
29
- strokeOpacity: import("../../types/index.js").ConstantAccessor<number, Datum>;
30
- strokeLinejoin: import("../../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
31
- strokeLinecap: import("../../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
32
- strokeMiterlimit: import("../../types/index.js").ConstantAccessor<number, Datum>;
33
- opacity: import("../../types/index.js").ChannelAccessor<Datum>;
34
- strokeDasharray: import("../../types/index.js").ConstantAccessor<string, Datum>;
35
- strokeDashoffset: import("../../types/index.js").ConstantAccessor<number, Datum>;
36
- mixBlendMode: import("../../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
37
- clipPath: string;
38
- imageFilter: import("../../types/index.js").ConstantAccessor<string, Datum>;
39
- shapeRendering: import("../../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
40
- paintOrder: import("../../types/index.js").ConstantAccessor<string, Datum>;
41
- onclick: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
42
- ondblclick: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
43
- onmouseup: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
44
- onmousedown: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
45
- onmouseenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
46
- onmousemove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
47
- onmouseleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
48
- onmouseout: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
49
- onmouseover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
50
- onpointercancel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
51
- onpointerdown: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
52
- onpointerup: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
53
- onpointerenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
54
- onpointerleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
55
- onpointermove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
56
- onpointerover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
57
- onpointerout: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
58
- ondrag: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
59
- ondrop: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
60
- ondragstart: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
61
- ondragenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
62
- ondragleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
63
- ondragover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
64
- ondragend: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
65
- ontouchstart: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
66
- ontouchmove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
67
- ontouchend: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
68
- ontouchcancel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
69
- oncontextmenu: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
70
- onwheel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
71
- class: string;
72
- style: string;
73
- cursor: import("../../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
74
- }>;
12
+ options: BaseRectMarkProps<Datum_1> & BaseMarkProps<Datum_1>;
75
13
  /**
76
14
  * By default, the `inset` property is applied to all four insets. Mark components
77
15
  * can tweak this behavior for insetTop and insetBottom by setting the
@@ -4,6 +4,14 @@ import { bin as d3Bin, extent, thresholdFreedmanDiaconis, thresholdScott, thresh
4
4
  import { reduceOutputs } from '../helpers/reduce.js';
5
5
  import { groupFacetsAndZ } from '../helpers/group.js';
6
6
  import { isDate } from '../helpers/typeChecks.js';
7
+ const CHANNELS = {
8
+ x: Symbol('x'),
9
+ x1: Symbol('x1'),
10
+ x2: Symbol('x2'),
11
+ y: Symbol('y'),
12
+ y1: Symbol('y1'),
13
+ y2: Symbol('y2')
14
+ };
7
15
  const ThresholdGenerators = {
8
16
  auto: thresholdScott,
9
17
  scott: thresholdScott,
@@ -101,11 +109,12 @@ export function bin({ data, ...channels }, options = { thresholds: 'auto', cumul
101
109
  // channels.x is the input
102
110
  binX.value((d) => resolveChannel('x', d, channels));
103
111
  binY.value((d) => resolveChannel('y', d, channels));
112
+ let yThresholds = [];
104
113
  if (interval) {
105
114
  const [xlo, xhi] = extent(data.map((d) => resolveChannel('x', d, channels)));
106
115
  const [ylo, yhi] = extent(data.map((d) => resolveChannel('y', d, channels)));
107
116
  binX.thresholds(maybeInterval(interval).range(xlo, xhi));
108
- binY.thresholds(maybeInterval(interval).range(ylo, yhi));
117
+ binY.thresholds((yThresholds = maybeInterval(interval).range(ylo, yhi)));
109
118
  }
110
119
  else if (thresholds) {
111
120
  // when binning in x and y, we need to ensure we are using consistent thresholds
@@ -114,7 +123,7 @@ export function bin({ data, ...channels }, options = { thresholds: 'auto', cumul
114
123
  : thresholds;
115
124
  binX.thresholds(t);
116
125
  binY.thresholds(t);
117
- const yThresholds = binY(data)
126
+ yThresholds = binY(data)
118
127
  .slice(1)
119
128
  .map((g) => g.x0);
120
129
  binY.thresholds(yThresholds);
@@ -124,12 +133,12 @@ export function bin({ data, ...channels }, options = { thresholds: 'auto', cumul
124
133
  let newChannels = {
125
134
  inset: 0.5,
126
135
  ...channels,
127
- x: '__x',
128
- x1: '__x1',
129
- x2: '__x2',
130
- y: '__y',
131
- y1: '__y1',
132
- y2: '__y2',
136
+ x: CHANNELS.x,
137
+ x1: CHANNELS.x1,
138
+ x2: CHANNELS.x2,
139
+ y: CHANNELS.y,
140
+ y1: CHANNELS.y1,
141
+ y2: CHANNELS.y2,
133
142
  __x_origField: typeof channels.x === 'string' ? channels.x : null,
134
143
  __y_origField: typeof channels.y === 'string' ? channels.y : null
135
144
  };
@@ -141,20 +150,30 @@ export function bin({ data, ...channels }, options = { thresholds: 'auto', cumul
141
150
  const newData = [];
142
151
  binX(data).forEach((groupX) => {
143
152
  const newRecordBaseX = {
144
- __x1: groupX.x0,
145
- __x2: groupX.x1,
146
- __x: isDate(groupX.x0)
153
+ [CHANNELS.x1]: groupX.x0,
154
+ [CHANNELS.x2]: groupX.x1,
155
+ [CHANNELS.x]: isDate(groupX.x0)
147
156
  ? new Date(Math.round((groupX.x0.getTime() + groupX.x1.getTime()) * 0.5))
148
157
  : (groupX.x0 + groupX.x1) * 0.5
149
158
  };
150
- binY(groupX).forEach((groupY) => {
159
+ const [ylo, yhi] = extent(groupX.map((d) => resolveChannel('y', d, channels)));
160
+ const tExtentLo = yThresholds.filter((d) => d < ylo).at(-1);
161
+ const tExtentHi = yThresholds.filter((d) => d > yhi).at(0);
162
+ binY(groupX).forEach((groupY, i) => {
163
+ if (groupY.length === 0)
164
+ return;
165
+ // The first bin.x0 is always equal to the minimum domain value,
166
+ // and the last bin.x1 is always equal to the maximum domain value,
167
+ // therefore we need to align with the thresholds
168
+ const y1 = groupY.x0 === ylo ? tExtentLo : groupY.x0;
169
+ const y2 = groupY.x1 === yhi ? tExtentHi : groupY.x1;
151
170
  const newRecordBaseY = {
152
171
  ...newRecordBaseX,
153
- __y1: groupY.x0,
154
- __y2: groupY.x1,
155
- __y: isDate(groupY.x0)
156
- ? new Date(Math.round((groupY.x0.getTime() + groupY.x1.getTime()) * 0.5))
157
- : (groupY.x0 + groupY.x1) * 0.5
172
+ [CHANNELS.y1]: y1,
173
+ [CHANNELS.y2]: y2,
174
+ [CHANNELS.y]: isDate(y1)
175
+ ? new Date(Math.round((y1.getTime() + y2.getTime()) * 0.5))
176
+ : (y1 + y2) * 0.5
158
177
  };
159
178
  const newGroupChannels = groupFacetsAndZ(groupY, channels, (items, itemGroupProps) => {
160
179
  const newRecord = {