svelteplot 0.3.0 → 0.3.2-pr-113.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 (175) hide show
  1. package/dist/Mark.svelte +25 -27
  2. package/dist/Mark.svelte.d.ts +87 -17
  3. package/dist/Plot.svelte +1 -2
  4. package/dist/Plot.svelte.d.ts +1 -1
  5. package/dist/core/Facet.svelte +1 -1
  6. package/dist/core/Facet.svelte.d.ts +1 -1
  7. package/dist/core/FacetAxes.svelte +1 -1
  8. package/dist/core/FacetGrid.svelte +1 -1
  9. package/dist/core/FacetGrid.svelte.d.ts +1 -1
  10. package/dist/core/Plot.svelte +1 -7
  11. package/dist/core/Plot.svelte.d.ts +1 -1
  12. package/dist/helpers/autoTicks.js +1 -1
  13. package/dist/helpers/colors.d.ts +1 -1
  14. package/dist/helpers/getBaseStyles.d.ts +2 -0
  15. package/dist/helpers/getBaseStyles.js +8 -0
  16. package/dist/helpers/index.d.ts +2 -2
  17. package/dist/helpers/projection.d.ts +1 -1
  18. package/dist/helpers/resolve.d.ts +1 -1
  19. package/dist/helpers/scales.d.ts +1 -1
  20. package/dist/helpers/typeChecks.d.ts +4 -4
  21. package/dist/marks/Area.svelte +14 -17
  22. package/dist/marks/Area.svelte.d.ts +91 -19
  23. package/dist/marks/AreaX.svelte +15 -12
  24. package/dist/marks/AreaX.svelte.d.ts +94 -3
  25. package/dist/marks/AreaY.svelte +15 -15
  26. package/dist/marks/AreaY.svelte.d.ts +94 -3
  27. package/dist/marks/Arrow.svelte +16 -19
  28. package/dist/marks/Arrow.svelte.d.ts +110 -38
  29. package/dist/marks/AxisX.svelte +41 -41
  30. package/dist/marks/AxisX.svelte.d.ts +97 -25
  31. package/dist/marks/AxisY.svelte +40 -40
  32. package/dist/marks/AxisY.svelte.d.ts +98 -27
  33. package/dist/marks/BarX.svelte +28 -30
  34. package/dist/marks/BarX.svelte.d.ts +89 -17
  35. package/dist/marks/BarY.svelte +27 -27
  36. package/dist/marks/BarY.svelte.d.ts +88 -16
  37. package/dist/marks/BollingerX.svelte +21 -16
  38. package/dist/marks/BollingerX.svelte.d.ts +17 -16
  39. package/dist/marks/BollingerY.svelte +21 -16
  40. package/dist/marks/BollingerY.svelte.d.ts +17 -16
  41. package/dist/marks/BoxX.svelte +5 -7
  42. package/dist/marks/BoxX.svelte.d.ts +5 -3
  43. package/dist/marks/BoxY.svelte +13 -16
  44. package/dist/marks/BoxY.svelte.d.ts +41 -28
  45. package/dist/marks/Brush.svelte +27 -30
  46. package/dist/marks/Brush.svelte.d.ts +20 -15
  47. package/dist/marks/BrushX.svelte +9 -7
  48. package/dist/marks/BrushX.svelte.d.ts +5 -2
  49. package/dist/marks/BrushY.svelte +9 -7
  50. package/dist/marks/BrushY.svelte.d.ts +5 -2
  51. package/dist/marks/Cell.svelte +17 -18
  52. package/dist/marks/Cell.svelte.d.ts +80 -8
  53. package/dist/marks/CellX.svelte +12 -8
  54. package/dist/marks/CellX.svelte.d.ts +5 -2
  55. package/dist/marks/CellY.svelte +12 -8
  56. package/dist/marks/CellY.svelte.d.ts +5 -2
  57. package/dist/marks/ColorLegend.svelte +5 -8
  58. package/dist/marks/ColorLegend.svelte.d.ts +2 -2
  59. package/dist/marks/CustomMark.svelte +23 -16
  60. package/dist/marks/CustomMark.svelte.d.ts +17 -14
  61. package/dist/marks/CustomMarkHTML.svelte +20 -18
  62. package/dist/marks/CustomMarkHTML.svelte.d.ts +29 -15
  63. package/dist/marks/DifferenceY.svelte +54 -18
  64. package/dist/marks/DifferenceY.svelte.d.ts +59 -28
  65. package/dist/marks/Dot.svelte +13 -14
  66. package/dist/marks/Dot.svelte.d.ts +84 -12
  67. package/dist/marks/DotX.svelte +9 -9
  68. package/dist/marks/DotX.svelte.d.ts +86 -4
  69. package/dist/marks/DotY.svelte +10 -9
  70. package/dist/marks/DotY.svelte.d.ts +87 -5
  71. package/dist/marks/Frame.svelte +20 -27
  72. package/dist/marks/Frame.svelte.d.ts +24 -10
  73. package/dist/marks/Geo.svelte +22 -15
  74. package/dist/marks/Geo.svelte.d.ts +97 -13
  75. package/dist/marks/Graticule.svelte +16 -19
  76. package/dist/marks/Graticule.svelte.d.ts +3 -3
  77. package/dist/marks/GridX.svelte +5 -8
  78. package/dist/marks/GridX.svelte.d.ts +79 -7
  79. package/dist/marks/GridY.svelte +5 -8
  80. package/dist/marks/GridY.svelte.d.ts +79 -7
  81. package/dist/marks/HTMLTooltip.svelte +9 -14
  82. package/dist/marks/HTMLTooltip.svelte.d.ts +25 -12
  83. package/dist/marks/Line.svelte +24 -29
  84. package/dist/marks/Line.svelte.d.ts +97 -25
  85. package/dist/marks/LineX.svelte +9 -4
  86. package/dist/marks/LineX.svelte.d.ts +99 -3
  87. package/dist/marks/LineY.svelte +11 -5
  88. package/dist/marks/LineY.svelte.d.ts +100 -4
  89. package/dist/marks/Link.svelte +35 -19
  90. package/dist/marks/Link.svelte.d.ts +107 -18
  91. package/dist/marks/Pointer.svelte +13 -18
  92. package/dist/marks/Pointer.svelte.d.ts +34 -21
  93. package/dist/marks/Rect.svelte +19 -19
  94. package/dist/marks/Rect.svelte.d.ts +86 -13
  95. package/dist/marks/RectX.svelte +10 -9
  96. package/dist/marks/RectX.svelte.d.ts +22 -6
  97. package/dist/marks/RectY.svelte +9 -10
  98. package/dist/marks/RectY.svelte.d.ts +22 -6
  99. package/dist/marks/RegressionX.svelte +1 -1
  100. package/dist/marks/RegressionX.svelte.d.ts +1 -1
  101. package/dist/marks/RegressionY.svelte +1 -1
  102. package/dist/marks/RegressionY.svelte.d.ts +1 -1
  103. package/dist/marks/RuleX.svelte +14 -16
  104. package/dist/marks/RuleX.svelte.d.ts +84 -12
  105. package/dist/marks/RuleY.svelte +12 -15
  106. package/dist/marks/RuleY.svelte.d.ts +84 -12
  107. package/dist/marks/Sphere.svelte +6 -7
  108. package/dist/marks/Sphere.svelte.d.ts +3 -2
  109. package/dist/marks/Spike.svelte +17 -9
  110. package/dist/marks/Spike.svelte.d.ts +94 -4
  111. package/dist/marks/SymbolLegend.svelte +1 -1
  112. package/dist/marks/Text.svelte +36 -125
  113. package/dist/marks/Text.svelte.d.ts +101 -20
  114. package/dist/marks/TickX.svelte +12 -13
  115. package/dist/marks/TickX.svelte.d.ts +92 -20
  116. package/dist/marks/TickY.svelte +11 -14
  117. package/dist/marks/TickY.svelte.d.ts +92 -20
  118. package/dist/marks/Vector.svelte +19 -23
  119. package/dist/marks/Vector.svelte.d.ts +93 -21
  120. package/dist/marks/helpers/AreaCanvas.svelte +1 -1
  121. package/dist/marks/helpers/AreaCanvas.svelte.d.ts +1 -1
  122. package/dist/marks/helpers/BaseAxisX.svelte +1 -2
  123. package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -1
  124. package/dist/marks/helpers/BaseAxisY.svelte +2 -3
  125. package/dist/marks/helpers/BaseAxisY.svelte.d.ts +1 -1
  126. package/dist/marks/helpers/CanvasLayer.svelte +1 -1
  127. package/dist/marks/helpers/DotCanvas.svelte +1 -1
  128. package/dist/marks/helpers/DotCanvas.svelte.d.ts +1 -1
  129. package/dist/marks/helpers/GeoCanvas.svelte +1 -1
  130. package/dist/marks/helpers/GeoCanvas.svelte.d.ts +1 -1
  131. package/dist/marks/helpers/LineCanvas.svelte +1 -1
  132. package/dist/marks/helpers/LineCanvas.svelte.d.ts +1 -1
  133. package/dist/marks/helpers/LinearGradientX.svelte +1 -1
  134. package/dist/marks/helpers/LinearGradientX.svelte.d.ts +1 -1
  135. package/dist/marks/helpers/LinearGradientY.svelte +1 -1
  136. package/dist/marks/helpers/LinearGradientY.svelte.d.ts +1 -1
  137. package/dist/marks/helpers/MarkerPath.svelte +1 -1
  138. package/dist/marks/helpers/MarkerPath.svelte.d.ts +1 -41
  139. package/dist/marks/helpers/MultilineText.svelte +158 -0
  140. package/dist/marks/helpers/MultilineText.svelte.d.ts +12 -0
  141. package/dist/marks/helpers/RectPath.svelte +29 -26
  142. package/dist/marks/helpers/RectPath.svelte.d.ts +39 -26
  143. package/dist/marks/helpers/Regression.svelte +7 -2
  144. package/dist/marks/helpers/Regression.svelte.d.ts +2 -5
  145. package/dist/transforms/bollinger.d.ts +1 -66
  146. package/dist/transforms/centroid.d.ts +7 -65
  147. package/dist/transforms/centroid.js +10 -7
  148. package/dist/transforms/group.d.ts +4 -12
  149. package/dist/transforms/interval.d.ts +2 -122
  150. package/dist/transforms/jitter.js +3 -3
  151. package/dist/transforms/map.d.ts +4 -184
  152. package/dist/transforms/normalize.d.ts +3 -123
  153. package/dist/transforms/select.d.ts +7 -427
  154. package/dist/transforms/sort.d.ts +3 -242
  155. package/dist/transforms/window.d.ts +2 -130
  156. package/dist/types/channel.d.ts +11 -0
  157. package/dist/types/channel.js +1 -0
  158. package/dist/types/colorScheme.d.ts +1 -0
  159. package/dist/types/colorScheme.js +1 -0
  160. package/dist/types/data.d.ts +13 -0
  161. package/dist/types/data.js +1 -0
  162. package/dist/types/facet.d.ts +50 -0
  163. package/dist/types/facet.js +1 -0
  164. package/dist/types/index.d.ts +58 -0
  165. package/dist/types/index.js +7 -0
  166. package/dist/types/mark.d.ts +123 -0
  167. package/dist/types/mark.js +1 -0
  168. package/dist/types/plot.d.ts +459 -0
  169. package/dist/types/plot.js +1 -0
  170. package/dist/types/scale.d.ts +143 -0
  171. package/dist/types/scale.js +1 -0
  172. package/dist/types.d.ts +120 -127
  173. package/dist/ui/Slider.svelte +1 -1
  174. package/dist/ui/Slider.svelte.d.ts +1 -1
  175. package/package.json +15 -11
@@ -1,27 +1,99 @@
1
- export type AxisXMarkProps = Omit<BaseMarkProps, 'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target'> & {
2
- data?: RawValue[];
3
- automatic?: boolean;
4
- title?: string;
5
- anchor?: 'top' | 'bottom';
6
- interval?: string | number;
7
- facetAnchor?: 'auto' | 'top-empty' | 'bottom-empty' | 'top' | 'bottom';
8
- labelAnchor?: 'auto' | 'left' | 'center' | 'right';
9
- tickSize?: number;
10
- tickFontSize?: ConstantAccessor<number>;
11
- tickPadding?: number;
12
- tickFormat?: 'auto' | Intl.DateTimeFormatOptions | Intl.NumberFormatOptions | ((d: RawValue) => string);
13
- tickClass?: ConstantAccessor<string>;
14
- /** ticks is a shorthand for defining data, tickCount or interval */
15
- ticks?: number | string | RawValue[];
16
- /** set to false or null to disable tick labels */
17
- text: boolean | null;
18
- /** approximate number of ticks to be generated */
19
- tickCount?: number;
20
- /** approximate number of pixels between generated ticks */
21
- tickSpacing?: number;
22
- };
23
- import type { BaseMarkProps, RawValue, ConstantAccessor } from '../types.js';
1
+ import type { RawValue, ConstantAccessor } from '../types/index.js';
2
+ declare class __sveltets_Render<Datum extends RawValue> {
3
+ props(): Omit<Partial<{
4
+ filter?: ConstantAccessor<boolean, Datum>;
5
+ facet?: "auto" | "include" | "exclude";
6
+ fx: import("../types/channel").ChannelAccessor<Datum>;
7
+ fy: import("../types/channel").ChannelAccessor<Datum>;
8
+ dx: ConstantAccessor<number, Datum>;
9
+ dy: ConstantAccessor<number, Datum>;
10
+ fill: import("../types/channel").ChannelAccessor<Datum>;
11
+ fillOpacity: ConstantAccessor<number, Datum>;
12
+ sort: {
13
+ channel: string;
14
+ order?: "ascending" | "descending";
15
+ } | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
16
+ stroke: import("../types/channel").ChannelAccessor<Datum>;
17
+ strokeWidth: ConstantAccessor<number, Datum>;
18
+ strokeOpacity: ConstantAccessor<number, Datum>;
19
+ strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
20
+ strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
21
+ strokeMiterlimit: ConstantAccessor<number, Datum>;
22
+ opacity: import("../types/channel").ChannelAccessor<Datum>;
23
+ strokeDasharray: ConstantAccessor<string, Datum>;
24
+ strokeDashoffset: ConstantAccessor<number, Datum>;
25
+ mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
26
+ clipPath: string;
27
+ imageFilter: ConstantAccessor<string, Datum>;
28
+ shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
29
+ paintOrder: 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: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
62
+ }>, "fill" | "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
63
+ data?: Datum[] | undefined;
64
+ automatic?: boolean;
65
+ title?: string;
66
+ anchor?: "top" | "bottom";
67
+ interval?: string | number;
68
+ facetAnchor?: "auto" | "top-empty" | "bottom-empty" | "top" | "bottom";
69
+ labelAnchor?: "auto" | "left" | "center" | "right";
70
+ tickSize?: number;
71
+ tickFontSize?: ConstantAccessor<number, Datum>;
72
+ tickPadding?: number;
73
+ tickFormat?: "auto" | Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | ((d: RawValue) => string) | undefined;
74
+ tickClass?: ConstantAccessor<string, Datum>;
75
+ /** ticks is a shorthand for defining data, tickCount or interval */
76
+ ticks?: string | number | Datum[] | undefined;
77
+ /** set to false or null to disable tick labels */
78
+ text: boolean | null;
79
+ /** approximate number of ticks to be generated */
80
+ tickCount?: number;
81
+ /** approximate number of pixels between generated ticks */
82
+ tickSpacing?: number;
83
+ };
84
+ events(): {};
85
+ slots(): {};
86
+ bindings(): "";
87
+ exports(): {};
88
+ }
89
+ interface $$IsomorphicComponent {
90
+ new <Datum extends RawValue>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
91
+ $$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
92
+ } & ReturnType<__sveltets_Render<Datum>['exports']>;
93
+ <Datum extends RawValue>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
94
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
95
+ }
24
96
  /** Renders a horizontal axis with labels and tick marks */
25
- declare const AxisX: import("svelte").Component<AxisXMarkProps, {}, "">;
26
- type AxisX = ReturnType<typeof AxisX>;
97
+ declare const AxisX: $$IsomorphicComponent;
98
+ type AxisX<Datum extends RawValue> = InstanceType<typeof AxisX<Datum>>;
27
99
  export default AxisX;
@@ -1,13 +1,29 @@
1
1
  <!-- @component
2
2
  Renders a vertical axis with labels and tick marks
3
3
  -->
4
- <script module lang="ts">
5
- import type { XOR } from 'ts-essentials';
6
- export type AxisYMarkProps = Omit<
4
+ <script lang="ts" generics="Datum extends RawValue">
5
+ import { getContext } from 'svelte';
6
+ import BaseAxisY from './helpers/BaseAxisY.svelte';
7
+ import Mark from '../Mark.svelte';
8
+ import type {
9
+ PlotContext,
7
10
  BaseMarkProps,
8
- 'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target'
9
- > & {
10
- data?: RawValue[];
11
+ RawValue,
12
+ FacetContext,
13
+ PlotDefaults,
14
+ ChannelName,
15
+ ConstantAccessor
16
+ } from '../types/index.js';
17
+ import autoTimeFormat from '../helpers/autoTimeFormat.js';
18
+ import { autoTicks } from '../helpers/autoTicks.js';
19
+ import { resolveScaledStyles } from '../helpers/resolve.js';
20
+
21
+ interface AxisYMarkProps
22
+ extends Omit<
23
+ BaseMarkProps<Datum>,
24
+ 'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target'
25
+ > {
26
+ data?: Datum[];
11
27
  automatic?: boolean;
12
28
  title?: string;
13
29
  anchor?: 'left' | 'right';
@@ -16,41 +32,23 @@
16
32
  interval?: string | number;
17
33
  labelAnchor?: 'auto' | 'left' | 'center' | 'right';
18
34
  tickSize?: number;
19
- tickFontSize?: ConstantAccessor<number>;
35
+ tickFontSize?: ConstantAccessor<number, Datum>;
20
36
  tickPadding?: number;
21
37
  tickFormat?:
22
38
  | 'auto'
23
39
  | Intl.DateTimeFormatOptions
24
40
  | Intl.NumberFormatOptions
25
41
  | ((d: RawValue) => string);
26
- tickClass?: ConstantAccessor<string>;
42
+ tickClass?: ConstantAccessor<string, Datum>;
27
43
  /** ticks is a shorthand for defining data, tickCount or interval */
28
- ticks?: number | string | RawValue[];
44
+ ticks?: number | string | Datum[];
29
45
  /** set to false or null to disable tick labels */
30
46
  text: boolean | null;
31
47
  /** approximate number of ticks to be generated */
32
48
  tickCount?: number;
33
49
  /** approximate number of pixels between generated ticks */
34
50
  tickSpacing?: number;
35
- };
36
- </script>
37
-
38
- <script lang="ts">
39
- import { getContext } from 'svelte';
40
- import BaseAxisY from './helpers/BaseAxisY.svelte';
41
- import Mark from '../Mark.svelte';
42
- import type {
43
- PlotContext,
44
- BaseMarkProps,
45
- RawValue,
46
- FacetContext,
47
- PlotDefaults,
48
- ChannelName
49
- } from '../types.js';
50
- import autoTimeFormat from '../helpers/autoTimeFormat.js';
51
- import type { ConstantAccessor } from '../types.js';
52
- import { autoTicks } from '../helpers/autoTicks.js';
53
- import { resolveScaledStyles } from '../helpers/resolve.js';
51
+ }
54
52
 
55
53
  let markProps: AxisYMarkProps = $props();
56
54
 
@@ -68,7 +66,8 @@
68
66
  data = Array.isArray(magicTicks) ? magicTicks : [],
69
67
  automatic = false,
70
68
  title,
71
- anchor,
69
+ anchor = 'left',
70
+ class: className,
72
71
  facetAnchor = 'auto',
73
72
  interval = typeof magicTicks === 'string' ? magicTicks : undefined,
74
73
  lineAnchor = 'center',
@@ -189,22 +188,23 @@
189
188
  {/if}
190
189
  {#if showAxis}
191
190
  <BaseAxisY
192
- scaleFn={plot.scales.y.fn}
193
- scaleType={plot.scales.y.type}
194
- tickFormat={useTickFormat}
195
- {ticks}
196
- marginLeft={plot.options.marginLeft}
197
- width={plot.facetWidth}
198
191
  {anchor}
192
+ {className}
199
193
  {lineAnchor}
200
- {tickSize}
201
- {tickPadding}
202
- {tickFontSize}
203
- {tickClass}
204
194
  {options}
195
+ {plot}
205
196
  {text}
197
+ {tickClass}
198
+ {tickFontSize}
199
+ {tickPadding}
200
+ {ticks}
201
+ {tickSize}
202
+ marginLeft={plot.options.marginLeft}
203
+ scaleFn={plot.scales.y.fn}
204
+ scaleType={plot.scales.y.type}
205
+ tickFormat={useTickFormat}
206
206
  title={useTitle}
207
- {plot} />
207
+ width={plot.facetWidth} />
208
208
  {/if}
209
209
  </Mark>
210
210
 
@@ -1,29 +1,100 @@
1
- export type AxisYMarkProps = Omit<BaseMarkProps, 'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target'> & {
2
- data?: RawValue[];
3
- automatic?: boolean;
4
- title?: string;
5
- anchor?: 'left' | 'right';
6
- facetAnchor?: 'auto' | 'left' | 'right' | 'left-empty' | 'right-empty';
7
- lineAnchor?: 'top' | 'center' | 'bottom';
8
- interval?: string | number;
9
- labelAnchor?: 'auto' | 'left' | 'center' | 'right';
10
- tickSize?: number;
11
- tickFontSize?: ConstantAccessor<number>;
12
- tickPadding?: number;
13
- tickFormat?: 'auto' | Intl.DateTimeFormatOptions | Intl.NumberFormatOptions | ((d: RawValue) => string);
14
- tickClass?: ConstantAccessor<string>;
15
- /** ticks is a shorthand for defining data, tickCount or interval */
16
- ticks?: number | string | RawValue[];
17
- /** set to false or null to disable tick labels */
18
- text: boolean | null;
19
- /** approximate number of ticks to be generated */
20
- tickCount?: number;
21
- /** approximate number of pixels between generated ticks */
22
- tickSpacing?: number;
23
- };
24
- import type { BaseMarkProps, RawValue } from '../types.js';
25
- import type { ConstantAccessor } from '../types.js';
1
+ import type { RawValue, ConstantAccessor } from '../types/index.js';
2
+ declare class __sveltets_Render<Datum extends RawValue> {
3
+ props(): Omit<Partial<{
4
+ filter?: ConstantAccessor<boolean, Datum>;
5
+ facet?: "auto" | "include" | "exclude";
6
+ fx: import("../types/channel").ChannelAccessor<Datum>;
7
+ fy: import("../types/channel").ChannelAccessor<Datum>;
8
+ dx: ConstantAccessor<number, Datum>;
9
+ dy: ConstantAccessor<number, Datum>;
10
+ fill: import("../types/channel").ChannelAccessor<Datum>;
11
+ fillOpacity: ConstantAccessor<number, Datum>;
12
+ sort: {
13
+ channel: string;
14
+ order?: "ascending" | "descending";
15
+ } | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
16
+ stroke: import("../types/channel").ChannelAccessor<Datum>;
17
+ strokeWidth: ConstantAccessor<number, Datum>;
18
+ strokeOpacity: ConstantAccessor<number, Datum>;
19
+ strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
20
+ strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
21
+ strokeMiterlimit: ConstantAccessor<number, Datum>;
22
+ opacity: import("../types/channel").ChannelAccessor<Datum>;
23
+ strokeDasharray: ConstantAccessor<string, Datum>;
24
+ strokeDashoffset: ConstantAccessor<number, Datum>;
25
+ mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
26
+ clipPath: string;
27
+ imageFilter: ConstantAccessor<string, Datum>;
28
+ shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
29
+ paintOrder: 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: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
62
+ }>, "fill" | "fillOpacity" | "href" | "target" | "title" | "paintOrder"> & {
63
+ data?: Datum[] | undefined;
64
+ automatic?: boolean;
65
+ title?: string;
66
+ anchor?: "left" | "right";
67
+ facetAnchor?: "auto" | "left" | "right" | "left-empty" | "right-empty";
68
+ lineAnchor?: "top" | "center" | "bottom";
69
+ interval?: string | number;
70
+ labelAnchor?: "auto" | "left" | "center" | "right";
71
+ tickSize?: number;
72
+ tickFontSize?: ConstantAccessor<number, Datum>;
73
+ tickPadding?: number;
74
+ tickFormat?: "auto" | Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | ((d: RawValue) => string) | undefined;
75
+ tickClass?: ConstantAccessor<string, Datum>;
76
+ /** ticks is a shorthand for defining data, tickCount or interval */
77
+ ticks?: string | number | Datum[] | undefined;
78
+ /** set to false or null to disable tick labels */
79
+ text: boolean | null;
80
+ /** approximate number of ticks to be generated */
81
+ tickCount?: number;
82
+ /** approximate number of pixels between generated ticks */
83
+ tickSpacing?: number;
84
+ };
85
+ events(): {};
86
+ slots(): {};
87
+ bindings(): "";
88
+ exports(): {};
89
+ }
90
+ interface $$IsomorphicComponent {
91
+ new <Datum extends RawValue>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
92
+ $$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
93
+ } & ReturnType<__sveltets_Render<Datum>['exports']>;
94
+ <Datum extends RawValue>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
95
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
96
+ }
26
97
  /** Renders a vertical axis with labels and tick marks */
27
- declare const AxisY: import("svelte").Component<AxisYMarkProps, {}, "">;
28
- type AxisY = ReturnType<typeof AxisY>;
98
+ declare const AxisY: $$IsomorphicComponent;
99
+ type AxisY<Datum extends RawValue> = InstanceType<typeof AxisY<Datum>>;
29
100
  export default AxisY;
@@ -2,42 +2,40 @@
2
2
  @component
3
3
  For horizontal bar charts using a band scale as y axis
4
4
  -->
5
- <script module lang="ts">
6
- import type {
7
- PlotContext,
8
- BaseMarkProps,
9
- BaseRectMarkProps,
10
- ChannelAccessor,
11
- LinkableMarkProps,
12
- PlotDefaults
13
- } from '../types.js';
14
-
15
- export type BarXMarkProps = BaseMarkProps &
16
- LinkableMarkProps &
17
- BaseRectMarkProps & {
18
- data: DataRow[];
19
- x?: ChannelAccessor;
20
- x1?: ChannelAccessor;
21
- x2?: ChannelAccessor;
22
- y?: ChannelAccessor;
23
- stack?: StackOptions;
24
- /**
25
- * Converts x into x1/x2 ranges based on the provided interval. Disables the
26
- * implicit stacking
27
- */
28
- interval?: number | string;
29
- };
30
- </script>
5
+ <script lang="ts" generics="Datum extends DataRow">
6
+ interface BarXMarkProps
7
+ extends BaseMarkProps<Datum>,
8
+ LinkableMarkProps<Datum>,
9
+ BaseRectMarkProps<Datum> {
10
+ data: Datum[];
11
+ x?: ChannelAccessor<Datum>;
12
+ x1?: ChannelAccessor<Datum>;
13
+ x2?: ChannelAccessor<Datum>;
14
+ y?: ChannelAccessor<Datum>;
15
+ stack?: StackOptions;
16
+ /**
17
+ * Converts x into x1/x2 ranges based on the provided interval. Disables the
18
+ * implicit stacking
19
+ */
20
+ interval?: number | string;
21
+ }
31
22
 
32
- <script lang="ts">
33
23
  import Mark from '../Mark.svelte';
34
24
  import { getContext } from 'svelte';
35
- import { stackX, recordizeX, intervalX, sort } from '../index.js';
25
+ import { stackX, recordizeX, intervalX, sort } from '..';
36
26
 
37
27
  import type { StackOptions } from '../transforms/stack.js';
38
- import type { DataRow } from '../types.js';
28
+ import type { DataRow } from '../types/index.js';
39
29
  import GroupMultiple from './helpers/GroupMultiple.svelte';
40
30
  import RectPath from './helpers/RectPath.svelte';
31
+ import type {
32
+ PlotContext,
33
+ BaseMarkProps,
34
+ BaseRectMarkProps,
35
+ ChannelAccessor,
36
+ LinkableMarkProps,
37
+ PlotDefaults
38
+ } from '../types/index.js';
41
39
 
42
40
  const DEFAULTS = {
43
41
  fill: 'currentColor',
@@ -48,7 +46,7 @@
48
46
  let markProps: BarXMarkProps = $props();
49
47
 
50
48
  const {
51
- data = [{}],
49
+ data = [{} as Datum],
52
50
  class: className = null,
53
51
  stack,
54
52
  ...options
@@ -1,20 +1,92 @@
1
- import type { BaseMarkProps, BaseRectMarkProps, ChannelAccessor, LinkableMarkProps } from '../types.js';
2
- export type BarXMarkProps = BaseMarkProps & LinkableMarkProps & BaseRectMarkProps & {
3
- data: DataRow[];
4
- x?: ChannelAccessor;
5
- x1?: ChannelAccessor;
6
- x2?: ChannelAccessor;
7
- y?: ChannelAccessor;
8
- stack?: StackOptions;
9
- /**
10
- * Converts x into x1/x2 ranges based on the provided interval. Disables the
11
- * implicit stacking
12
- */
13
- interval?: number | string;
14
- };
15
1
  import type { StackOptions } from '../transforms/stack.js';
16
- import type { DataRow } from '../types.js';
2
+ import type { DataRow } from '../types/index.js';
3
+ import type { BaseRectMarkProps, ChannelAccessor, LinkableMarkProps } from '../types/index.js';
4
+ declare class __sveltets_Render<Datum extends DataRow> {
5
+ props(): Partial<{
6
+ filter?: import("../types/index.js").ConstantAccessor<boolean, Datum>;
7
+ facet?: "auto" | "include" | "exclude";
8
+ fx: ChannelAccessor<Datum>;
9
+ fy: ChannelAccessor<Datum>;
10
+ dx: import("../types/index.js").ConstantAccessor<number, Datum>;
11
+ dy: import("../types/index.js").ConstantAccessor<number, Datum>;
12
+ fill: ChannelAccessor<Datum>;
13
+ fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
14
+ sort: {
15
+ channel: string;
16
+ order?: "ascending" | "descending";
17
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").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 | null;
63
+ cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
64
+ }> & LinkableMarkProps<Datum> & BaseRectMarkProps<Datum> & {
65
+ data: Datum[];
66
+ x?: ChannelAccessor<Datum>;
67
+ x1?: ChannelAccessor<Datum>;
68
+ x2?: ChannelAccessor<Datum>;
69
+ y?: ChannelAccessor<Datum>;
70
+ stack?: StackOptions;
71
+ /**
72
+ * Converts x into x1/x2 ranges based on the provided interval. Disables the
73
+ * implicit stacking
74
+ */
75
+ interval?: number | string;
76
+ };
77
+ events(): {};
78
+ slots(): {};
79
+ bindings(): "";
80
+ exports(): {};
81
+ }
82
+ interface $$IsomorphicComponent {
83
+ new <Datum extends DataRow>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
84
+ $$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
85
+ } & ReturnType<__sveltets_Render<Datum>['exports']>;
86
+ <Datum extends DataRow>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
87
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
88
+ }
17
89
  /** For horizontal bar charts using a band scale as y axis */
18
- declare const BarX: import("svelte").Component<BarXMarkProps, {}, "">;
19
- type BarX = ReturnType<typeof BarX>;
90
+ declare const BarX: $$IsomorphicComponent;
91
+ type BarX<Datum extends DataRow> = InstanceType<typeof BarX<Datum>>;
20
92
  export default BarX;
@@ -2,41 +2,41 @@
2
2
  @component
3
3
  For vertical column charts using a band scale as x axis
4
4
  -->
5
- <script module lang="ts">
6
- import type {
7
- PlotContext,
8
- BaseMarkProps,
9
- BaseRectMarkProps,
10
- ChannelAccessor,
11
- DataRow,
12
- PlotDefaults
13
- } from '../types.js';
14
5
 
15
- export type BarYMarkProps = BaseMarkProps &
16
- LinkableMarkProps &
17
- BaseRectMarkProps & {
18
- data: DataRow[];
19
- x?: ChannelAccessor;
20
- y?: ChannelAccessor;
21
- y1?: ChannelAccessor;
22
- y2?: ChannelAccessor;
23
- stack?: StackOptions;
24
- /**
25
- * Converts y into y1/y2 ranges based on the provided interval. Disables the
26
- * implicit stacking
27
- */
28
- interval?: number | string;
29
- };
30
- </script>
6
+ <script lang="ts" generics="Datum extends DataRow">
7
+ interface BarYMarkProps
8
+ extends BaseMarkProps<Datum>,
9
+ LinkableMarkProps<Datum>,
10
+ BaseRectMarkProps<Datum> {
11
+ data: Datum[];
12
+ x?: ChannelAccessor<Datum>;
13
+ y?: ChannelAccessor<Datum>;
14
+ y1?: ChannelAccessor<Datum>;
15
+ y2?: ChannelAccessor<Datum>;
16
+ stack?: StackOptions;
17
+ /**
18
+ * Converts y into y1/y2 ranges based on the provided interval. Disables the
19
+ * implicit stacking
20
+ */
21
+ interval?: number | string;
22
+ }
31
23
 
32
- <script lang="ts">
33
24
  import Mark from '../Mark.svelte';
34
25
  import { getContext } from 'svelte';
35
- import { intervalY, stackY, recordizeY, sort } from '../index.js';
26
+ import { intervalY, stackY, recordizeY, sort } from '..';
36
27
 
37
28
  import type { StackOptions } from '../transforms/stack.js';
38
29
  import GroupMultiple from './helpers/GroupMultiple.svelte';
39
30
  import RectPath from './helpers/RectPath.svelte';
31
+ import type {
32
+ PlotContext,
33
+ BaseMarkProps,
34
+ BaseRectMarkProps,
35
+ ChannelAccessor,
36
+ DataRow,
37
+ PlotDefaults,
38
+ LinkableMarkProps
39
+ } from '../types/index.js';
40
40
 
41
41
  const { getPlotState } = getContext<PlotContext>('svelteplot');
42
42
  const plot = $derived(getPlotState());