svelteplot 0.8.1 → 0.9.0-pr-309.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 (131) hide show
  1. package/README.md +4 -3
  2. package/dist/Mark.svelte +1 -1
  3. package/dist/Mark.svelte.d.ts +6 -4
  4. package/dist/constants.d.ts +3 -1
  5. package/dist/constants.js +11 -2
  6. package/dist/core/Plot.svelte +4 -4
  7. package/dist/helpers/autoScales.d.ts +1 -1
  8. package/dist/helpers/callWithProps.d.ts +1 -3
  9. package/dist/helpers/callWithProps.js +5 -3
  10. package/dist/helpers/colors.d.ts +9 -12
  11. package/dist/helpers/facets.d.ts +1 -1
  12. package/dist/helpers/getBaseStyles.d.ts +2 -4
  13. package/dist/helpers/index.d.ts +3 -3
  14. package/dist/helpers/projection.js +7 -2
  15. package/dist/helpers/reduce.d.ts +1 -1
  16. package/dist/helpers/scales.d.ts +7 -7
  17. package/dist/helpers/symbols.d.ts +2 -2
  18. package/dist/helpers/time.d.ts +3 -3
  19. package/dist/helpers/typeChecks.d.ts +8 -8
  20. package/dist/hooks/usePlot.svelte.d.ts +51 -0
  21. package/dist/hooks/usePlot.svelte.js +90 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/marks/Area.svelte +3 -5
  25. package/dist/marks/Area.svelte.d.ts +6 -4
  26. package/dist/marks/AreaX.svelte.d.ts +7 -5
  27. package/dist/marks/Arrow.svelte +3 -5
  28. package/dist/marks/Arrow.svelte.d.ts +6 -4
  29. package/dist/marks/AxisX.svelte +2 -3
  30. package/dist/marks/AxisX.svelte.d.ts +7 -5
  31. package/dist/marks/AxisY.svelte +3 -4
  32. package/dist/marks/AxisY.svelte.d.ts +7 -5
  33. package/dist/marks/BarX.svelte +2 -4
  34. package/dist/marks/BarX.svelte.d.ts +6 -4
  35. package/dist/marks/BarY.svelte +2 -4
  36. package/dist/marks/BarY.svelte.d.ts +6 -4
  37. package/dist/marks/BollingerX.svelte.d.ts +2 -76
  38. package/dist/marks/BollingerY.svelte.d.ts +2 -76
  39. package/dist/marks/BoxX.svelte +4 -138
  40. package/dist/marks/BoxY.svelte +20 -137
  41. package/dist/marks/BoxY.svelte.d.ts +6 -64
  42. package/dist/marks/Brush.svelte +3 -3
  43. package/dist/marks/Brush.svelte.d.ts +1 -63
  44. package/dist/marks/Cell.svelte +2 -4
  45. package/dist/marks/Cell.svelte.d.ts +6 -4
  46. package/dist/marks/ColorLegend.svelte +2 -4
  47. package/dist/marks/CustomMark.svelte.d.ts +2 -84
  48. package/dist/marks/CustomMarkHTML.svelte +5 -10
  49. package/dist/marks/DifferenceY.svelte +3 -5
  50. package/dist/marks/DifferenceY.svelte.d.ts +1 -63
  51. package/dist/marks/Dot.svelte +4 -5
  52. package/dist/marks/Dot.svelte.d.ts +6 -4
  53. package/dist/marks/DotX.svelte.d.ts +7 -5
  54. package/dist/marks/DotY.svelte.d.ts +7 -5
  55. package/dist/marks/Frame.svelte +3 -9
  56. package/dist/marks/Frame.svelte.d.ts +7 -5
  57. package/dist/marks/Geo.svelte +5 -5
  58. package/dist/marks/Geo.svelte.d.ts +7 -4
  59. package/dist/marks/GridX.svelte +3 -10
  60. package/dist/marks/GridX.svelte.d.ts +6 -4
  61. package/dist/marks/GridY.svelte +3 -4
  62. package/dist/marks/GridY.svelte.d.ts +6 -4
  63. package/dist/marks/HTMLTooltip.svelte +5 -5
  64. package/dist/marks/Image.svelte.d.ts +2 -75
  65. package/dist/marks/Line.svelte +7 -6
  66. package/dist/marks/Line.svelte.d.ts +6 -4
  67. package/dist/marks/LineX.svelte.d.ts +8 -6
  68. package/dist/marks/LineY.svelte.d.ts +8 -6
  69. package/dist/marks/Link.svelte +2 -4
  70. package/dist/marks/Link.svelte.d.ts +6 -4
  71. package/dist/marks/Pointer.svelte +4 -4
  72. package/dist/marks/Rect.svelte +2 -4
  73. package/dist/marks/Rect.svelte.d.ts +6 -4
  74. package/dist/marks/RectX.svelte +4 -4
  75. package/dist/marks/RectY.svelte +4 -4
  76. package/dist/marks/RuleX.svelte +2 -4
  77. package/dist/marks/RuleX.svelte.d.ts +6 -4
  78. package/dist/marks/RuleY.svelte +2 -4
  79. package/dist/marks/RuleY.svelte.d.ts +6 -4
  80. package/dist/marks/Spike.svelte.d.ts +7 -5
  81. package/dist/marks/SymbolLegend.svelte +2 -4
  82. package/dist/marks/SymbolLegend.svelte.d.ts +17 -2
  83. package/dist/marks/Text.svelte.d.ts +6 -4
  84. package/dist/marks/TickX.svelte +2 -3
  85. package/dist/marks/TickX.svelte.d.ts +6 -4
  86. package/dist/marks/TickY.svelte +2 -3
  87. package/dist/marks/TickY.svelte.d.ts +6 -4
  88. package/dist/marks/Trail.svelte +161 -0
  89. package/dist/marks/Trail.svelte.d.ts +44 -0
  90. package/dist/marks/Vector.svelte +3 -4
  91. package/dist/marks/Vector.svelte.d.ts +6 -4
  92. package/dist/marks/WaffleX.svelte +2 -3
  93. package/dist/marks/WaffleX.svelte.d.ts +2 -85
  94. package/dist/marks/WaffleY.svelte +2 -4
  95. package/dist/marks/WaffleY.svelte.d.ts +2 -83
  96. package/dist/marks/helpers/AreaCanvas.svelte +2 -4
  97. package/dist/marks/helpers/Box.svelte +271 -0
  98. package/dist/marks/helpers/Box.svelte.d.ts +55 -0
  99. package/dist/marks/helpers/CanvasLayer.svelte +2 -4
  100. package/dist/marks/helpers/DotCanvas.svelte +3 -5
  101. package/dist/marks/helpers/GeoCanvas.svelte +2 -4
  102. package/dist/marks/helpers/LineCanvas.svelte +2 -4
  103. package/dist/marks/helpers/LinearGradientX.svelte +3 -4
  104. package/dist/marks/helpers/LinearGradientY.svelte +3 -4
  105. package/dist/marks/helpers/MarkerPath.svelte +4 -5
  106. package/dist/marks/helpers/MarkerPath.svelte.d.ts +2 -102
  107. package/dist/marks/helpers/MultilineText.svelte +4 -4
  108. package/dist/marks/helpers/RectPath.svelte +5 -6
  109. package/dist/marks/helpers/Regression.svelte +4 -8
  110. package/dist/marks/helpers/TrailCanvas.svelte +138 -0
  111. package/dist/marks/helpers/TrailCanvas.svelte.d.ts +40 -0
  112. package/dist/marks/helpers/events.d.ts +2 -2
  113. package/dist/marks/helpers/events.js +4 -4
  114. package/dist/marks/helpers/trail.d.ts +23 -0
  115. package/dist/marks/helpers/trail.js +372 -0
  116. package/dist/marks/index.d.ts +1 -0
  117. package/dist/marks/index.js +1 -0
  118. package/dist/transforms/bollinger.d.ts +1 -69
  119. package/dist/transforms/centroid.d.ts +1 -4
  120. package/dist/transforms/group.d.ts +4 -12
  121. package/dist/transforms/interval.d.ts +2 -128
  122. package/dist/transforms/normalize.d.ts +23 -0
  123. package/dist/transforms/recordize.d.ts +4 -7
  124. package/dist/transforms/select.d.ts +7 -448
  125. package/dist/transforms/sort.d.ts +5 -253
  126. package/dist/transforms/stack.d.ts +3 -23
  127. package/dist/transforms/window.d.ts +2 -134
  128. package/dist/types/mark.d.ts +2 -1
  129. package/dist/types/plot.d.ts +6 -1
  130. package/dist/ui/Spiral.svelte +4 -0
  131. package/package.json +25 -23
@@ -37,9 +37,7 @@
37
37
  inset?: ConstantAccessor<number, Datum>;
38
38
  sweep?: SweepOption;
39
39
  }
40
- import { getContext } from 'svelte';
41
40
  import type {
42
- PlotContext,
43
41
  DataRecord,
44
42
  BaseMarkProps,
45
43
  ConstantAccessor,
@@ -57,6 +55,7 @@
57
55
  import { sort } from '../transforms/sort.js';
58
56
  import { indexData } from '../transforms/recordize.js';
59
57
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
58
+ import { usePlot } from '../hooks/usePlot.svelte.js';
60
59
 
61
60
  let markProps: ArrowMarkProps = $props();
62
61
 
@@ -76,8 +75,7 @@
76
75
  ...markProps
77
76
  });
78
77
 
79
- const { getPlotState } = getContext<PlotContext>('svelteplot');
80
- const plot = $derived(getPlotState());
78
+ const plot = usePlot();
81
79
 
82
80
  const args: ArrowMarkProps = $derived(
83
81
  sort(
@@ -134,7 +132,7 @@
134
132
  <g
135
133
  class={[className]}
136
134
  {@attach addEventHandlers({
137
- getPlotState,
135
+ plot,
138
136
  options,
139
137
  datum: d?.datum
140
138
  })}>
@@ -1,5 +1,6 @@
1
1
  import type { DataRecord, ConstantAccessor, ChannelAccessor, RawValue } from '../types/index.js';
2
2
  import { type SweepOption } from '../helpers/arrowPath.js';
3
+ import { replaceChannels } from '../transforms/rename.js';
3
4
  declare function $$render<Datum extends DataRecord>(): {
4
5
  props: Omit<Partial<{
5
6
  filter: ConstantAccessor<boolean, Datum>;
@@ -8,14 +9,14 @@ declare function $$render<Datum extends DataRecord>(): {
8
9
  fy: ChannelAccessor<Datum>;
9
10
  dx: ConstantAccessor<number, Datum>;
10
11
  dy: ConstantAccessor<number, Datum>;
11
- dodgeX: import("../transforms/dodge.js").DodgeXOptions;
12
- dodgeY: import("../transforms/dodge.js").DodgeYOptions;
12
+ dodgeX: replaceChannels;
13
+ dodgeY: replaceChannels;
13
14
  fill: ChannelAccessor<Datum>;
14
15
  fillOpacity: ConstantAccessor<number, Datum>;
15
- sort: ((a: RawValue, b: RawValue) => number) | {
16
+ sort: {
16
17
  channel: string;
17
18
  order?: "ascending" | "descending";
18
- } | ConstantAccessor<RawValue, Datum>;
19
+ } | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
19
20
  stroke: ChannelAccessor<Datum>;
20
21
  strokeWidth: ConstantAccessor<number, Datum>;
21
22
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -27,6 +28,7 @@ declare function $$render<Datum extends DataRecord>(): {
27
28
  strokeDashoffset: ConstantAccessor<number, Datum>;
28
29
  mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
29
30
  clipPath: string;
31
+ mask: string;
30
32
  imageFilter: ConstantAccessor<string, Datum>;
31
33
  shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
32
34
  paintOrder: ConstantAccessor<string, Datum>;
@@ -6,7 +6,6 @@
6
6
  import Mark from '../Mark.svelte';
7
7
  import BaseAxisX from './helpers/BaseAxisX.svelte';
8
8
  import type {
9
- PlotContext,
10
9
  BaseMarkProps,
11
10
  RawValue,
12
11
  ConstantAccessor,
@@ -19,6 +18,7 @@
19
18
  import { resolveScaledStyles } from '../helpers/resolve.js';
20
19
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
21
20
  import { extent } from 'd3-array';
21
+ import { usePlot } from '../hooks/usePlot.svelte.js';
22
22
 
23
23
  interface AxisXMarkProps extends Omit<
24
24
  BaseMarkProps<Datum>,
@@ -96,8 +96,7 @@
96
96
  ...markProps
97
97
  });
98
98
 
99
- const { getPlotState } = getContext<PlotContext>('svelteplot');
100
- const plot = $derived(getPlotState());
99
+ const plot = usePlot();
101
100
 
102
101
  const autoTickCount = $derived(
103
102
  tickCount != null
@@ -1,5 +1,6 @@
1
1
  import type { RawValue, ConstantAccessor } from '../types/index.js';
2
2
  import type * as CSS from 'csstype';
3
+ import autoTimeFormat from '../helpers/autoTimeFormat.js';
3
4
  declare function $$render<Datum extends RawValue>(): {
4
5
  props: Omit<Partial<{
5
6
  filter: ConstantAccessor<boolean, Datum>;
@@ -8,14 +9,14 @@ declare function $$render<Datum extends RawValue>(): {
8
9
  fy: import("../types/channel").ChannelAccessor<Datum>;
9
10
  dx: ConstantAccessor<number, Datum>;
10
11
  dy: ConstantAccessor<number, Datum>;
11
- dodgeX: import("../transforms/dodge").DodgeXOptions;
12
- dodgeY: import("../transforms/dodge").DodgeYOptions;
12
+ dodgeX: autoTimeFormat;
13
+ dodgeY: autoTimeFormat;
13
14
  fill: import("../types/channel").ChannelAccessor<Datum>;
14
15
  fillOpacity: ConstantAccessor<number, Datum>;
15
- sort: ((a: RawValue, b: RawValue) => number) | {
16
+ sort: {
16
17
  channel: string;
17
18
  order?: "ascending" | "descending";
18
- } | ConstantAccessor<RawValue, Datum>;
19
+ } | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
19
20
  stroke: import("../types/channel").ChannelAccessor<Datum>;
20
21
  strokeWidth: ConstantAccessor<number, Datum>;
21
22
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -27,6 +28,7 @@ declare function $$render<Datum extends RawValue>(): {
27
28
  strokeDashoffset: ConstantAccessor<number, Datum>;
28
29
  mixBlendMode: ConstantAccessor<CSS.Property.MixBlendMode, Datum>;
29
30
  clipPath: string;
31
+ mask: string;
30
32
  imageFilter: ConstantAccessor<string, Datum>;
31
33
  shapeRendering: ConstantAccessor<CSS.Property.ShapeRendering, Datum>;
32
34
  paintOrder: ConstantAccessor<string, Datum>;
@@ -63,7 +65,7 @@ declare function $$render<Datum extends RawValue>(): {
63
65
  class: string;
64
66
  style: string;
65
67
  cursor: ConstantAccessor<CSS.Property.Cursor, Datum>;
66
- }>, "fillOpacity" | "paintOrder" | "href" | "target" | "title"> & {
68
+ }>, "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
67
69
  data?: Datum[];
68
70
  automatic?: boolean;
69
71
  title?: string | false | null;
@@ -6,7 +6,6 @@
6
6
  import BaseAxisY from './helpers/BaseAxisY.svelte';
7
7
  import Mark from '../Mark.svelte';
8
8
  import type {
9
- PlotContext,
10
9
  BaseMarkProps,
11
10
  RawValue,
12
11
  FacetContext,
@@ -18,6 +17,7 @@
18
17
  import { resolveScaledStyles } from '../helpers/resolve.js';
19
18
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
20
19
  import { extent } from 'd3-array';
20
+ import { usePlot } from '../hooks/usePlot.svelte.js';
21
21
 
22
22
  interface AxisYMarkProps extends Omit<
23
23
  BaseMarkProps<Datum>,
@@ -94,8 +94,7 @@
94
94
  ...markProps
95
95
  });
96
96
 
97
- const { getPlotState } = getContext<PlotContext>('svelteplot');
98
- const plot = $derived(getPlotState());
97
+ const plot = usePlot();
99
98
 
100
99
  const autoTickCount = $derived(
101
100
  tickCount != null
@@ -170,7 +169,7 @@
170
169
  : optionsLabel !== undefined
171
170
  ? optionsLabel
172
171
  : plot.scales.y.autoTitle
173
- ? `↑ ${plot.scales.y.autoTitle}${plot.options.y.percent ? ' (%)' : ''}`
172
+ ? `${!plot.options.y.reverse ? '↑' : '↓'} ${plot.scales.y.autoTitle}${plot.options.y.percent ? ' (%)' : ''}`
174
173
  : ''
175
174
  );
176
175
 
@@ -1,4 +1,5 @@
1
1
  import type { RawValue, ConstantAccessor } from '../types/index.js';
2
+ import autoTimeFormat from '../helpers/autoTimeFormat.js';
2
3
  declare function $$render<Datum extends RawValue>(): {
3
4
  props: Omit<Partial<{
4
5
  filter: ConstantAccessor<boolean, Datum>;
@@ -7,14 +8,14 @@ declare function $$render<Datum extends RawValue>(): {
7
8
  fy: import("../types/channel").ChannelAccessor<Datum>;
8
9
  dx: ConstantAccessor<number, Datum>;
9
10
  dy: ConstantAccessor<number, Datum>;
10
- dodgeX: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
11
+ dodgeX: autoTimeFormat;
12
+ dodgeY: autoTimeFormat;
12
13
  fill: import("../types/channel").ChannelAccessor<Datum>;
13
14
  fillOpacity: ConstantAccessor<number, Datum>;
14
- sort: ((a: RawValue, b: RawValue) => number) | {
15
+ sort: {
15
16
  channel: string;
16
17
  order?: "ascending" | "descending";
17
- } | ConstantAccessor<RawValue, Datum>;
18
+ } | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
18
19
  stroke: import("../types/channel").ChannelAccessor<Datum>;
19
20
  strokeWidth: ConstantAccessor<number, Datum>;
20
21
  strokeOpacity: ConstantAccessor<number, Datum>;
@@ -26,6 +27,7 @@ declare function $$render<Datum extends RawValue>(): {
26
27
  strokeDashoffset: ConstantAccessor<number, Datum>;
27
28
  mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
28
29
  clipPath: string;
30
+ mask: string;
29
31
  imageFilter: ConstantAccessor<string, Datum>;
30
32
  shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
31
33
  paintOrder: ConstantAccessor<string, Datum>;
@@ -62,7 +64,7 @@ declare function $$render<Datum extends RawValue>(): {
62
64
  class: string;
63
65
  style: string;
64
66
  cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
65
- }>, "fillOpacity" | "paintOrder" | "href" | "target" | "title"> & {
67
+ }>, "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
66
68
  data?: Datum[];
67
69
  automatic?: boolean;
68
70
  title?: string | false | null;
@@ -19,7 +19,6 @@
19
19
  }
20
20
 
21
21
  import Mark from '../Mark.svelte';
22
- import { getContext } from 'svelte';
23
22
  import { stackX, recordizeX, intervalX, sort } from '../index.js';
24
23
 
25
24
  import type { StackOptions } from '../transforms/stack.js';
@@ -27,13 +26,13 @@
27
26
  import GroupMultiple from './helpers/GroupMultiple.svelte';
28
27
  import RectPath from './helpers/RectPath.svelte';
29
28
  import type {
30
- PlotContext,
31
29
  BaseMarkProps,
32
30
  BaseRectMarkProps,
33
31
  ChannelAccessor,
34
32
  LinkableMarkProps
35
33
  } from '../types/index.js';
36
34
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
35
+ import { usePlot } from '../hooks/usePlot.svelte.js';
37
36
 
38
37
  const DEFAULTS = {
39
38
  fill: 'currentColor',
@@ -50,8 +49,7 @@
50
49
  ...options
51
50
  }: BarXMarkProps = $derived({ ...DEFAULTS, ...markProps });
52
51
 
53
- const { getPlotState } = getContext<PlotContext>('svelteplot');
54
- const plot = $derived(getPlotState());
52
+ const plot = usePlot();
55
53
 
56
54
  const args = $derived(
57
55
  stackX(
@@ -1,3 +1,4 @@
1
+ import { stackX } from '../index.js';
1
2
  import type { StackOptions } from '../transforms/stack.js';
2
3
  import type { DataRow } from '../types/index.js';
3
4
  import type { BaseRectMarkProps, ChannelAccessor, LinkableMarkProps } from '../types/index.js';
@@ -9,14 +10,14 @@ declare function $$render<Datum extends DataRow>(): {
9
10
  fy: ChannelAccessor<Datum>;
10
11
  dx: import("../types/index.js").ConstantAccessor<number, Datum>;
11
12
  dy: import("../types/index.js").ConstantAccessor<number, Datum>;
12
- dodgeX: import("../transforms/dodge").DodgeXOptions;
13
- dodgeY: import("../transforms/dodge").DodgeYOptions;
13
+ dodgeX: stackX;
14
+ dodgeY: stackX;
14
15
  fill: ChannelAccessor<Datum>;
15
16
  fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
16
- sort: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
17
+ sort: {
17
18
  channel: string;
18
19
  order?: "ascending" | "descending";
19
- } | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
20
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Datum>;
20
21
  stroke: ChannelAccessor<Datum>;
21
22
  strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
22
23
  strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
@@ -28,6 +29,7 @@ declare function $$render<Datum extends DataRow>(): {
28
29
  strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
29
30
  mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
30
31
  clipPath: string;
32
+ mask: string;
31
33
  imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
32
34
  shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
33
35
  paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
@@ -20,14 +20,12 @@
20
20
  }
21
21
 
22
22
  import Mark from '../Mark.svelte';
23
- import { getContext } from 'svelte';
24
23
  import { intervalY, stackY, recordizeY, sort } from '../index.js';
25
24
 
26
25
  import type { StackOptions } from '../transforms/stack.js';
27
26
  import GroupMultiple from './helpers/GroupMultiple.svelte';
28
27
  import RectPath from './helpers/RectPath.svelte';
29
28
  import type {
30
- PlotContext,
31
29
  BaseMarkProps,
32
30
  BaseRectMarkProps,
33
31
  ChannelAccessor,
@@ -35,9 +33,9 @@
35
33
  LinkableMarkProps
36
34
  } from '../types/index.js';
37
35
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
36
+ import { usePlot } from '../hooks/usePlot.svelte.js';
38
37
 
39
- const { getPlotState } = getContext<PlotContext>('svelteplot');
40
- const plot = $derived(getPlotState());
38
+ const plot = usePlot();
41
39
 
42
40
  const DEFAULTS = {
43
41
  ...getPlotDefaults().bar,
@@ -1,3 +1,4 @@
1
+ import { intervalY } from '../index.js';
1
2
  import type { StackOptions } from '../transforms/stack.js';
2
3
  import type { BaseRectMarkProps, ChannelAccessor, DataRow, LinkableMarkProps } from '../types/index.js';
3
4
  declare function $$render<Datum extends DataRow>(): {
@@ -8,14 +9,14 @@ declare function $$render<Datum extends DataRow>(): {
8
9
  fy: ChannelAccessor<Datum>;
9
10
  dx: import("../types/index.js").ConstantAccessor<number, Datum>;
10
11
  dy: import("../types/index.js").ConstantAccessor<number, Datum>;
11
- dodgeX: import("../transforms/dodge").DodgeXOptions;
12
- dodgeY: import("../transforms/dodge").DodgeYOptions;
12
+ dodgeX: intervalY;
13
+ dodgeY: intervalY;
13
14
  fill: ChannelAccessor<Datum>;
14
15
  fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
15
- sort: ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | {
16
+ sort: {
16
17
  channel: string;
17
18
  order?: "ascending" | "descending";
18
- } | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Datum>;
19
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Datum>;
19
20
  stroke: ChannelAccessor<Datum>;
20
21
  strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
21
22
  strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
@@ -27,6 +28,7 @@ declare function $$render<Datum extends DataRow>(): {
27
28
  strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
28
29
  mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
29
30
  clipPath: string;
31
+ mask: string;
30
32
  imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
31
33
  shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
32
34
  paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
@@ -1,80 +1,6 @@
1
- import type { ChannelAccessor, DataRecord } from '../types/index.js';
1
+ import type { DataRecord } from '../types/index.js';
2
2
  declare function $$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
- dodgeX: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
12
- fill: ChannelAccessor<Datum>;
13
- fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
14
- sort: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
15
- channel: string;
16
- order?: "ascending" | "descending";
17
- } | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
18
- stroke: ChannelAccessor<Datum>;
19
- strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
20
- strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
21
- strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
22
- strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
23
- strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
24
- opacity: ChannelAccessor<Datum>;
25
- strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
26
- strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
27
- mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
28
- clipPath: string;
29
- imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
30
- shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
31
- paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
32
- onclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
33
- ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
34
- onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
35
- onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
36
- onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
37
- onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
38
- onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
39
- onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
40
- onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
41
- onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
42
- onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
43
- onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
44
- onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
45
- onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
46
- onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
47
- onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
48
- onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
49
- ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
50
- ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
51
- ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
52
- ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
53
- ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
54
- ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
55
- ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
56
- ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
57
- ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
58
- ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
59
- ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
- oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
61
- onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
62
- class: string;
63
- style: string;
64
- cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
65
- }> & {
66
- data: Datum[];
67
- x?: ChannelAccessor<Datum>;
68
- y?: ChannelAccessor<Datum>;
69
- /**
70
- * the window size (the window transform's k option), an integer; defaults to 20
71
- */
72
- n?: number;
73
- /**
74
- * the band radius, a number representing a multiple of standard deviations; defaults to 2
75
- */
76
- k?: number;
77
- };
3
+ props: any;
78
4
  exports: {};
79
5
  bindings: "";
80
6
  slots: {};
@@ -1,80 +1,6 @@
1
- import type { ChannelAccessor, DataRecord } from '../types/index.js';
1
+ import type { DataRecord } from '../types/index.js';
2
2
  declare function $$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
- dodgeX: import("../transforms/dodge").DodgeXOptions;
11
- dodgeY: import("../transforms/dodge").DodgeYOptions;
12
- fill: ChannelAccessor<Datum>;
13
- fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
14
- sort: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
15
- channel: string;
16
- order?: "ascending" | "descending";
17
- } | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Datum>;
18
- stroke: ChannelAccessor<Datum>;
19
- strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
20
- strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
21
- strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
22
- strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
23
- strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
24
- opacity: ChannelAccessor<Datum>;
25
- strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
26
- strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
27
- mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
28
- clipPath: string;
29
- imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
30
- shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
31
- paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
32
- onclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
33
- ondblclick: import("svelte/elements").MouseEventHandler<SVGPathElement>;
34
- onmouseup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
35
- onmousedown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
36
- onmouseenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
37
- onmousemove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
38
- onmouseleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
39
- onmouseout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
40
- onmouseover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
41
- onpointercancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
42
- onpointerdown: import("svelte/elements").MouseEventHandler<SVGPathElement>;
43
- onpointerup: import("svelte/elements").MouseEventHandler<SVGPathElement>;
44
- onpointerenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
45
- onpointerleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
46
- onpointermove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
47
- onpointerover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
48
- onpointerout: import("svelte/elements").MouseEventHandler<SVGPathElement>;
49
- ondrag: import("svelte/elements").MouseEventHandler<SVGPathElement>;
50
- ondrop: import("svelte/elements").MouseEventHandler<SVGPathElement>;
51
- ondragstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
52
- ondragenter: import("svelte/elements").MouseEventHandler<SVGPathElement>;
53
- ondragleave: import("svelte/elements").MouseEventHandler<SVGPathElement>;
54
- ondragover: import("svelte/elements").MouseEventHandler<SVGPathElement>;
55
- ondragend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
56
- ontouchstart: import("svelte/elements").MouseEventHandler<SVGPathElement>;
57
- ontouchmove: import("svelte/elements").MouseEventHandler<SVGPathElement>;
58
- ontouchend: import("svelte/elements").MouseEventHandler<SVGPathElement>;
59
- ontouchcancel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
- oncontextmenu: import("svelte/elements").MouseEventHandler<SVGPathElement>;
61
- onwheel: import("svelte/elements").MouseEventHandler<SVGPathElement>;
62
- class: string;
63
- style: string;
64
- cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
65
- }> & {
66
- data: Datum[];
67
- x?: ChannelAccessor<Datum>;
68
- y?: ChannelAccessor<Datum>;
69
- /**
70
- * the window size (the window transform's k option), an integer; defaults to 20
71
- */
72
- n?: number;
73
- /**
74
- * the band radius, a number representing a multiple of standard deviations; defaults to 2
75
- */
76
- k?: number;
77
- };
3
+ props: any;
78
4
  exports: {};
79
5
  bindings: "";
80
6
  slots: {};