layerchart 2.0.0-next.1 → 2.0.0-next.11

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 (275) hide show
  1. package/dist/actions/movable.d.ts +28 -0
  2. package/dist/actions/movable.js +91 -0
  3. package/dist/components/AnnotationLine.svelte +143 -0
  4. package/dist/components/AnnotationLine.svelte.d.ts +30 -0
  5. package/dist/components/AnnotationPoint.svelte +119 -0
  6. package/dist/components/AnnotationPoint.svelte.d.ts +34 -0
  7. package/dist/components/AnnotationRange.svelte +147 -0
  8. package/dist/components/AnnotationRange.svelte.d.ts +40 -0
  9. package/dist/components/Arc.svelte +344 -151
  10. package/dist/components/Arc.svelte.d.ts +138 -0
  11. package/dist/components/Area.svelte +165 -149
  12. package/dist/components/Area.svelte.d.ts +45 -0
  13. package/dist/components/Axis.svelte +320 -179
  14. package/dist/components/Axis.svelte.d.ts +127 -0
  15. package/dist/components/Bar.svelte +166 -107
  16. package/dist/components/Bar.svelte.d.ts +51 -0
  17. package/dist/components/Bars.svelte +56 -67
  18. package/dist/components/Bars.svelte.d.ts +27 -0
  19. package/dist/components/Blur.svelte +42 -12
  20. package/dist/components/Blur.svelte.d.ts +23 -21
  21. package/dist/components/Bounds.svelte +49 -19
  22. package/dist/components/Bounds.svelte.d.ts +24 -50
  23. package/dist/components/BrushContext.svelte +296 -168
  24. package/dist/components/BrushContext.svelte.d.ts +97 -65
  25. package/dist/components/Calendar.svelte +116 -59
  26. package/dist/components/Calendar.svelte.d.ts +50 -31
  27. package/dist/components/Chart.svelte +1289 -398
  28. package/dist/components/Chart.svelte.d.ts +535 -410
  29. package/dist/components/ChartClipPath.svelte +37 -15
  30. package/dist/components/ChartClipPath.svelte.d.ts +21 -19
  31. package/dist/components/Circle.svelte +124 -85
  32. package/dist/components/Circle.svelte.d.ts +52 -0
  33. package/dist/components/CircleClipPath.svelte +76 -16
  34. package/dist/components/CircleClipPath.svelte.d.ts +46 -0
  35. package/dist/components/ClipPath.svelte +71 -21
  36. package/dist/components/ClipPath.svelte.d.ts +40 -27
  37. package/dist/components/ColorRamp.svelte +75 -9
  38. package/dist/components/ColorRamp.svelte.d.ts +37 -19
  39. package/dist/components/ComputedStyles.svelte +17 -5
  40. package/dist/components/ComputedStyles.svelte.d.ts +11 -19
  41. package/dist/components/Connector.svelte +149 -0
  42. package/dist/components/Connector.svelte.d.ts +51 -0
  43. package/dist/components/Dagre.svelte +211 -122
  44. package/dist/components/Dagre.svelte.d.ts +119 -56
  45. package/dist/components/ForceSimulation.svelte +215 -90
  46. package/dist/components/ForceSimulation.svelte.d.ts +82 -35
  47. package/dist/components/Frame.svelte +33 -13
  48. package/dist/components/Frame.svelte.d.ts +13 -17
  49. package/dist/components/GeoCircle.svelte +29 -16
  50. package/dist/components/GeoCircle.svelte.d.ts +22 -24
  51. package/dist/components/GeoContext.svelte +113 -72
  52. package/dist/components/GeoContext.svelte.d.ts +49 -41
  53. package/dist/components/GeoEdgeFade.svelte +49 -13
  54. package/dist/components/GeoEdgeFade.svelte.d.ts +17 -19
  55. package/dist/components/GeoPath.svelte +157 -127
  56. package/dist/components/GeoPath.svelte.d.ts +48 -36
  57. package/dist/components/GeoPoint.svelte +52 -20
  58. package/dist/components/GeoPoint.svelte.d.ts +25 -22
  59. package/dist/components/GeoSpline.svelte +75 -26
  60. package/dist/components/GeoSpline.svelte.d.ts +29 -20
  61. package/dist/components/GeoTile.svelte +100 -49
  62. package/dist/components/GeoTile.svelte.d.ts +38 -23
  63. package/dist/components/GeoVisible.svelte +17 -9
  64. package/dist/components/GeoVisible.svelte.d.ts +10 -18
  65. package/dist/components/Graticule.svelte +30 -14
  66. package/dist/components/Graticule.svelte.d.ts +11 -52
  67. package/dist/components/Grid.svelte +230 -117
  68. package/dist/components/Grid.svelte.d.ts +71 -0
  69. package/dist/components/Group.svelte +173 -106
  70. package/dist/components/Group.svelte.d.ts +81 -0
  71. package/dist/components/Highlight.svelte +410 -308
  72. package/dist/components/Highlight.svelte.d.ts +107 -0
  73. package/dist/components/Hull.svelte +97 -46
  74. package/dist/components/Hull.svelte.d.ts +40 -30
  75. package/dist/components/Labels.svelte +127 -47
  76. package/dist/components/Labels.svelte.d.ts +70 -27
  77. package/dist/components/Legend.svelte +374 -190
  78. package/dist/components/Legend.svelte.d.ts +95 -44
  79. package/dist/components/Line.svelte +163 -125
  80. package/dist/components/Line.svelte.d.ts +75 -0
  81. package/dist/components/LinearGradient.svelte +153 -78
  82. package/dist/components/LinearGradient.svelte.d.ts +66 -31
  83. package/dist/components/Link.svelte +160 -104
  84. package/dist/components/Link.svelte.d.ts +54 -0
  85. package/dist/components/Marker.svelte +100 -39
  86. package/dist/components/Marker.svelte.d.ts +59 -27
  87. package/dist/components/MarkerWrapper.svelte +35 -0
  88. package/dist/components/MarkerWrapper.svelte.d.ts +18 -0
  89. package/dist/components/MonthPath.svelte +65 -20
  90. package/dist/components/MonthPath.svelte.d.ts +23 -17
  91. package/dist/components/MotionPath.svelte +80 -24
  92. package/dist/components/MotionPath.svelte.d.ts +46 -27
  93. package/dist/components/Pack.svelte +53 -17
  94. package/dist/components/Pack.svelte.d.ts +42 -21
  95. package/dist/components/Partition.svelte +64 -22
  96. package/dist/components/Partition.svelte.d.ts +49 -26
  97. package/dist/components/Pattern.svelte +297 -11
  98. package/dist/components/Pattern.svelte.d.ts +103 -19
  99. package/dist/components/Pie.svelte +122 -76
  100. package/dist/components/Pie.svelte.d.ts +65 -51
  101. package/dist/components/Point.svelte +20 -9
  102. package/dist/components/Point.svelte.d.ts +16 -20
  103. package/dist/components/Points.svelte +148 -137
  104. package/dist/components/Points.svelte.d.ts +45 -34
  105. package/dist/components/RadialGradient.svelte +148 -77
  106. package/dist/components/RadialGradient.svelte.d.ts +69 -31
  107. package/dist/components/Rect.svelte +121 -102
  108. package/dist/components/Rect.svelte.d.ts +36 -0
  109. package/dist/components/RectClipPath.svelte +82 -18
  110. package/dist/components/RectClipPath.svelte.d.ts +55 -0
  111. package/dist/components/Rule.svelte +107 -63
  112. package/dist/components/Rule.svelte.d.ts +40 -19
  113. package/dist/components/Sankey.svelte +132 -55
  114. package/dist/components/Sankey.svelte.d.ts +61 -31
  115. package/dist/components/Spline.svelte +281 -218
  116. package/dist/components/Spline.svelte.d.ts +95 -0
  117. package/dist/components/Text.svelte +463 -197
  118. package/dist/components/Text.svelte.d.ts +136 -0
  119. package/dist/components/Threshold.svelte +48 -16
  120. package/dist/components/Threshold.svelte.d.ts +29 -31
  121. package/dist/components/TileImage.svelte +103 -30
  122. package/dist/components/TileImage.svelte.d.ts +48 -23
  123. package/dist/components/TransformContext.svelte +365 -171
  124. package/dist/components/TransformControls.svelte +50 -26
  125. package/dist/components/TransformControls.svelte.d.ts +27 -19
  126. package/dist/components/Tree.svelte +74 -33
  127. package/dist/components/Tree.svelte.d.ts +42 -30
  128. package/dist/components/Treemap.svelte +119 -42
  129. package/dist/components/Treemap.svelte.d.ts +75 -27
  130. package/dist/components/Voronoi.svelte +153 -103
  131. package/dist/components/Voronoi.svelte.d.ts +42 -41
  132. package/dist/components/charts/ArcChart.svelte +464 -0
  133. package/dist/components/charts/ArcChart.svelte.d.ts +90 -0
  134. package/dist/components/charts/AreaChart.svelte +444 -393
  135. package/dist/components/charts/AreaChart.svelte.d.ts +61 -0
  136. package/dist/components/charts/BarChart.svelte +463 -389
  137. package/dist/components/charts/BarChart.svelte.d.ts +76 -0
  138. package/dist/components/charts/ChartAnnotations.svelte +37 -0
  139. package/dist/components/charts/ChartAnnotations.svelte.d.ts +10 -0
  140. package/dist/components/charts/DefaultTooltip.svelte +60 -0
  141. package/dist/components/charts/DefaultTooltip.svelte.d.ts +10 -0
  142. package/dist/components/charts/LineChart.svelte +366 -315
  143. package/dist/components/charts/LineChart.svelte.d.ts +53 -0
  144. package/dist/components/charts/PieChart.svelte +458 -316
  145. package/dist/components/charts/PieChart.svelte.d.ts +137 -353
  146. package/dist/components/charts/ScatterChart.svelte +332 -296
  147. package/dist/components/charts/ScatterChart.svelte.d.ts +39 -0
  148. package/dist/components/charts/index.d.ts +8 -0
  149. package/dist/components/charts/index.js +7 -0
  150. package/dist/components/charts/types.d.ts +253 -0
  151. package/dist/components/charts/utils.svelte.d.ts +30 -0
  152. package/dist/components/charts/utils.svelte.js +59 -0
  153. package/dist/components/index.d.ts +76 -4
  154. package/dist/components/index.js +76 -5
  155. package/dist/components/layout/Canvas.svelte +347 -171
  156. package/dist/components/layout/Canvas.svelte.d.ts +110 -55
  157. package/dist/components/layout/Html.svelte +82 -42
  158. package/dist/components/layout/Html.svelte.d.ts +39 -28
  159. package/dist/components/layout/Layer.svelte +39 -0
  160. package/dist/components/layout/Layer.svelte.d.ts +17 -0
  161. package/dist/components/layout/Svg.svelte +122 -70
  162. package/dist/components/layout/Svg.svelte.d.ts +53 -34
  163. package/dist/components/layout/WebGL.svelte +135 -0
  164. package/dist/components/layout/WebGL.svelte.d.ts +50 -0
  165. package/dist/components/tooltip/Tooltip.svelte +253 -78
  166. package/dist/components/tooltip/Tooltip.svelte.d.ts +149 -31
  167. package/dist/components/tooltip/TooltipContext.svelte +426 -271
  168. package/dist/components/tooltip/TooltipContext.svelte.d.ts +86 -55
  169. package/dist/components/tooltip/TooltipHeader.svelte +100 -11
  170. package/dist/components/tooltip/TooltipHeader.svelte.d.ts +43 -23
  171. package/dist/components/tooltip/TooltipItem.svelte +167 -27
  172. package/dist/components/tooltip/TooltipItem.svelte.d.ts +63 -31
  173. package/dist/components/tooltip/TooltipList.svelte +22 -3
  174. package/dist/components/tooltip/TooltipList.svelte.d.ts +6 -17
  175. package/dist/components/tooltip/TooltipSeparator.svelte +27 -1
  176. package/dist/components/tooltip/TooltipSeparator.svelte.d.ts +6 -15
  177. package/dist/components/tooltip/index.d.ts +6 -0
  178. package/dist/components/tooltip/index.js +6 -0
  179. package/dist/components/tooltip/tooltipMetaContext.d.ts +79 -0
  180. package/dist/components/tooltip/tooltipMetaContext.js +139 -0
  181. package/dist/components/types.d.ts +1 -0
  182. package/dist/components/types.js +1 -0
  183. package/dist/docs/Blockquote.svelte +3 -1
  184. package/dist/docs/Blockquote.svelte.d.ts +5 -16
  185. package/dist/docs/Code.svelte +20 -12
  186. package/dist/docs/Code.svelte.d.ts +12 -22
  187. package/dist/docs/ConnectorSweepMenuField.svelte +17 -0
  188. package/dist/docs/ConnectorSweepMenuField.svelte.d.ts +7 -0
  189. package/dist/docs/ConnectorTypeMenuField.svelte +17 -0
  190. package/dist/docs/ConnectorTypeMenuField.svelte.d.ts +7 -0
  191. package/dist/docs/CurveMenuField.svelte +14 -3
  192. package/dist/docs/CurveMenuField.svelte.d.ts +9 -18
  193. package/dist/docs/GeoDebug.svelte +47 -42
  194. package/dist/docs/GeoDebug.svelte.d.ts +4 -16
  195. package/dist/docs/Header1.svelte +4 -2
  196. package/dist/docs/Header1.svelte.d.ts +5 -18
  197. package/dist/docs/Json.svelte +11 -3
  198. package/dist/docs/Json.svelte.d.ts +9 -17
  199. package/dist/docs/Layout.svelte +10 -7
  200. package/dist/docs/Layout.svelte.d.ts +5 -15
  201. package/dist/docs/Link.svelte +7 -3
  202. package/dist/docs/Link.svelte.d.ts +5 -27
  203. package/dist/docs/PathDataMenuField.svelte +14 -10
  204. package/dist/docs/PathDataMenuField.svelte.d.ts +8 -18
  205. package/dist/docs/Preview.svelte +20 -7
  206. package/dist/docs/Preview.svelte.d.ts +12 -22
  207. package/dist/docs/TilesetField.svelte +20 -19
  208. package/dist/docs/TilesetField.svelte.d.ts +6 -19
  209. package/dist/docs/TransformDebug.svelte +5 -6
  210. package/dist/docs/TransformDebug.svelte.d.ts +18 -14
  211. package/dist/docs/ViewSourceButton.svelte +7 -4
  212. package/dist/docs/ViewSourceButton.svelte.d.ts +8 -18
  213. package/dist/types/d3-shape-extentions.d.ts +7 -0
  214. package/dist/utils/afterTick.d.ts +5 -0
  215. package/dist/utils/afterTick.js +8 -0
  216. package/dist/utils/arcText.svelte.d.ts +57 -0
  217. package/dist/utils/arcText.svelte.js +262 -0
  218. package/dist/utils/array.d.ts +9 -1
  219. package/dist/utils/array.js +13 -0
  220. package/dist/utils/attributes.d.ts +29 -0
  221. package/dist/utils/attributes.js +40 -0
  222. package/dist/utils/canvas.js +47 -10
  223. package/dist/utils/chart.d.ts +78 -0
  224. package/dist/utils/chart.js +512 -0
  225. package/dist/utils/color.d.ts +1 -0
  226. package/dist/utils/color.js +8 -0
  227. package/dist/utils/common.d.ts +3 -5
  228. package/dist/utils/common.js +3 -2
  229. package/dist/utils/connectorUtils.d.ts +21 -0
  230. package/dist/utils/connectorUtils.js +111 -0
  231. package/dist/utils/createId.d.ts +7 -0
  232. package/dist/utils/createId.js +9 -0
  233. package/dist/utils/debug.d.ts +1 -0
  234. package/dist/utils/debug.js +84 -0
  235. package/dist/utils/filterObject.d.ts +9 -0
  236. package/dist/utils/filterObject.js +12 -0
  237. package/dist/utils/graph/dagre.d.ts +34 -0
  238. package/dist/utils/graph/dagre.js +78 -0
  239. package/dist/utils/graph/dagre.test.d.ts +1 -0
  240. package/dist/utils/{graph.test.js → graph/dagre.test.js} +19 -33
  241. package/dist/utils/graph/sankey.d.ts +28 -0
  242. package/dist/utils/{graph.js → graph/sankey.js} +13 -41
  243. package/dist/utils/index.d.ts +3 -1
  244. package/dist/utils/index.js +3 -1
  245. package/dist/utils/key.svelte.d.ts +3 -0
  246. package/dist/utils/key.svelte.js +11 -0
  247. package/dist/utils/legendPayload.d.ts +7 -0
  248. package/dist/utils/legendPayload.js +8 -0
  249. package/dist/utils/motion.svelte.d.ts +140 -0
  250. package/dist/utils/motion.svelte.js +180 -0
  251. package/dist/utils/motion.test.d.ts +1 -0
  252. package/dist/utils/motion.test.js +213 -0
  253. package/dist/utils/{rect.d.ts → rect.svelte.d.ts} +7 -4
  254. package/dist/utils/rect.svelte.js +105 -0
  255. package/dist/utils/scales.svelte.d.ts +91 -0
  256. package/dist/utils/scales.svelte.js +201 -0
  257. package/dist/utils/stack.d.ts +2 -3
  258. package/dist/utils/stack.js +1 -1
  259. package/dist/utils/string.js +87 -0
  260. package/dist/utils/ticks.d.ts +9 -3
  261. package/dist/utils/ticks.js +122 -147
  262. package/dist/utils/ticks.test.d.ts +1 -0
  263. package/dist/utils/ticks.test.js +57 -0
  264. package/dist/utils/types.d.ts +81 -0
  265. package/package.json +28 -24
  266. package/dist/components/ChartContext.svelte +0 -295
  267. package/dist/components/ChartContext.svelte.d.ts +0 -139
  268. package/dist/components/TransformContext.svelte.d.ts +0 -158
  269. package/dist/stores/motionStore.d.ts +0 -30
  270. package/dist/stores/motionStore.js +0 -62
  271. package/dist/utils/graph.d.ts +0 -37
  272. package/dist/utils/rect.js +0 -107
  273. package/dist/utils/scales.d.ts +0 -66
  274. package/dist/utils/scales.js +0 -136
  275. /package/dist/{utils/graph.test.d.ts → components/charts/types.js} +0 -0
@@ -1,415 +1,540 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- export declare const renderContextKey: unique symbol;
3
- type RenderContext = 'canvas' | 'svg' | 'html';
4
- /** Get render context. Useful to conditionally render components based on the render context. */
5
- export declare function getRenderContext(): RenderContext;
6
- /** Set by Canavs, Html, or Svg render/layout component */
7
- export declare function setRenderContext(context: RenderContext): void;
1
+ import { type Accessor } from '../utils/common.js';
2
+ import { type AnyScale, type DomainType } from '../utils/scales.svelte.js';
3
+ import type { AxisKey, BaseRange, DataType, Extents, Nice, Padding, PaddingArray, XRangeWithScale, YRangeWithScale } from '../utils/types.js';
4
+ import { type ComponentProps, type Snippet } from 'svelte';
5
+ import GeoContext, { type GeoContextValue } from './GeoContext.svelte';
6
+ import TooltipContext, { type TooltipContextValue } from './tooltip/TooltipContext.svelte';
8
7
  import type { HierarchyNode } from 'd3-hierarchy';
9
8
  import type { SankeyGraph } from 'd3-sankey';
10
- import TransformContext from './TransformContext.svelte';
11
- import { type Accessor } from '../utils/common.js';
12
- import { type AnyScale, type DomainType } from '../utils/scales.js';
13
- declare class __sveltets_Render<TData> {
14
- props(): {
15
- /** Whether this chart should be rendered server side. @default false */
16
- ssr?: boolean;
17
- /** Whether to allow pointer events via CSS. Set this to `false` to set `pointer-events: none;` on all components, disabling all mouse interaction. @default true */
18
- pointerEvents?: boolean;
19
- /** Determine the positioning of the wrapper div. Set this to `'absolute'` when you want to stack cakes. @default 'relative' */
20
- position?: string;
21
- /** If `true`, set all scale ranges to `[0, 100]`. Ranges reversed via `xReverse`, `yReverse`, `zReverse` or `rReverse` props will continue to be reversed as usual. @default false */
22
- percentRange?: boolean;
23
- /** Override the automated width. */
24
- width?: number;
25
- /** Override the automated height. */
26
- height?: number;
27
- /** The bound container width. */
28
- containerWidth?: number;
29
- /**The bound container height. */
30
- containerHeight?: number;
31
- /** The .layercake-container `<div>` tag. Useful for bindings. */
32
- element?: HTMLDivElement;
33
- /** If `data` is not a flat array of objects and you want to use any of the scales, set a flat version of the data via the `flatData` prop. */
34
- data?: SankeyGraph<any, any> | HierarchyNode<TData> | TData[] | undefined;
35
- /** A flat version of data. */
36
- flatData?: any[];
37
- /** The x accessor. The key in each row of data that corresponds to the x-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
38
- x?: Accessor<TData>;
39
- /** The y accessor. The key in each row of data that corresponds to the y-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
40
- y?: Accessor<TData>;
41
- /** The z accessor. The key in each row of data that corresponds to the z-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
42
- z?: Accessor<TData>;
43
- /** The r accessor. The key in each row of data that corresponds to the r-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
44
- r?: Accessor<TData>;
45
- /** The x1 accessor. The key in each row of data that corresponds to the x1-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
46
- x1?: Accessor<TData>;
47
- /** The y1 accessor. The key in each row of data that corresponds to the y1-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
48
- y1?: Accessor<TData>;
49
- /** The c (color) accessor. The key in each row of data that corresponds to the color. This can be a string or an accessor function. This property gets converted to a function when you access it through the context. */
50
- c?: Accessor<TData>;
51
- /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
52
- xDomain?: DomainType;
53
- /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
54
- yDomain?: DomainType;
55
- /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
56
- zDomain?: DomainType;
57
- /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
58
- rDomain?: DomainType;
59
- /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
60
- x1Domain?: DomainType;
61
- /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
62
- y1Domain?: DomainType;
63
- /** Set the list of color values. */
64
- cDomain?: DomainType;
65
- /** Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the x domain. @default false */
66
- xNice?: boolean | number;
67
- /** Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the y domain. @default false */
68
- yNice?: boolean | number;
69
- /** Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the z domain. @default false */
70
- zNice?: boolean | number;
71
- /** Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the r domain. @default false */
72
- rNice?: boolean | number;
73
- /** Assign a pixel value to add to the min or max of the scale. This will increase the scales domain by the scale unit equivalent of the provided pixels. */
74
- xPadding?: [number, number];
75
- /** Assign a pixel value to add to the min or max of the scale. This will increase the scales domain by the scale unit equivalent of the provided pixels. */
76
- yPadding?: [number, number];
77
- /** Assign a pixel value to add to the min or max of the scale. This will increase the scales domain by the scale unit equivalent of the provided pixels. */
78
- zPadding?: [number, number];
79
- /** Assign a pixel value to add to the min or max of the scale. This will increase the scales domain by the scale unit equivalent of the provided pixels. */
80
- rPadding?: [number, number];
81
- /** The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleLinear */
82
- xScale?: AnyScale;
83
- /** The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleLinear */
84
- yScale?: AnyScale;
85
- /** The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleLinear */
86
- zScale?: AnyScale;
87
- /** The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleSqrt */
88
- rScale?: AnyScale;
89
- /** The D3 scale that should be used for the x1-dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleLinear */
90
- x1Scale?: AnyScale;
91
- /** The D3 scale that should be used for the y1-dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleLinear */
92
- y1Scale?: AnyScale;
93
- /** The D3 scale that should be used for the color dimension. Pass in an instantiated D3 scale if you want to override the default or you want to extra options. @default scaleOrdinal */
94
- cScale?: AnyScale;
95
- /** Override the default x range of `[0, width]` by setting an array or function with argument `({ width, height})` that returns an array. Setting this prop overrides `xReverse`. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
96
- xRange?: string[] | number[] | ((args: {
97
- width: number;
98
- height: number;
99
- }) => number[] | string[]) | undefined;
100
- /** Override the default y range of `[0, height]` by setting an array or function with argument `({ width, height})` that returns an array. Setting this prop overrides `yReverse`. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
101
- yRange?: string[] | number[] | ((args: {
102
- width: number;
103
- height: number;
104
- }) => number[] | string[]) | undefined;
105
- /** Override the default z range of `[0, width]` by setting an array or function with argument `({ width, height})` that returns an array. Setting this prop overrides `zReverse`. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
106
- zRange?: string[] | number[] | ((args: {
107
- width: number;
108
- height: number;
109
- }) => number[] | string[]) | undefined;
110
- /** Override the default r range of `[1, 25]` by setting an array or function with argument `({ width, height})` that returns an array. Setting this prop overrides `rReverse`. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
111
- rRange?: string[] | number[] | ((args: {
112
- width: number;
113
- height: number;
114
- }) => number[] | string[]) | undefined;
115
- /** Set the x1 range by setting an array or function with argument `({ xScale, width, height})` that returns an array. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
116
- x1Range?: string[] | number[] | ((args: {
117
- xScale: AnyScale;
118
- width: number;
119
- height: number;
120
- }) => number[] | string[]) | undefined;
121
- /** Set the y1 range by setting an array or function with argument `({ yScale, width, height})` that returns an array. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
122
- y1Range?: string[] | number[] | ((args: {
123
- yScale: AnyScale;
124
- width: number;
125
- height: number;
126
- }) => number[] | string[]) | undefined;
127
- /** Override the default y1 range of `[0, width]` by setting an array or function with argument `({ yScale, width, height})` that returns an array. Setting this prop overrides `x1Reverse`. This can also be a list of numbers or strings for scales with discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales). */
128
- cRange?: string[] | readonly string[];
129
- /** Reverse the default x range. By default this is `false` and the range is `[0, width]`. Ignored if you set the xRange prop. @default false */
130
- xReverse?: boolean;
131
- /** Reverse the default y range. By default this is `true` and the range is `[height, 0]` unless using an ordinal scale with a `.bandwidth` method for `yScale`. Ignored if you set the `yRange` prop. @default true */
132
- yReverse?: boolean;
133
- /** Reverse the default z range. By default this is `false` and the range is `[0, width]`. Ignored if you set the zRange prop. @default false */
134
- zReverse?: boolean;
135
- /** Reverse the default r range. By default this is `false` and the range is `[1, 25]`. Ignored if you set the rRange prop. @default false */
136
- rReverse?: boolean;
137
- /** Only used when scale is ordinal. Set whether the calculated unique items come back sorted. */
138
- xDomainSort?: boolean;
139
- /** Only used when scale is ordinal. Set whether the calculated unique items come back sorted. */
140
- yDomainSort?: boolean;
141
- /** Only used when scale is ordinal. Set whether the calculated unique items come back sorted. */
142
- zDomainSort?: boolean;
143
- /** Only used when scale is ordinal. Set whether the calculated unique items come back sorted. */
144
- rDomainSort?: boolean;
145
- /** The amount of padding to put around your chart. It operates like CSS box-sizing: border-box; where values are subtracted from the parent container's width and height, the same as a [D3 margin convention](https://bl.ocks.org/mbostock/3019563). */
146
- padding?: {
147
- top?: Number;
148
- right?: Number;
149
- bottom?: Number;
150
- left?: Number;
151
- } | undefined;
152
- /** Manually set the extents of the x, y or r scale as a two-dimensional array of the min and max you want. Setting values here will skip any dynamic extent calculation of the data for that dimension. */
153
- extents?: {
154
- x?: [min: Number, max: Number];
155
- y?: [min: Number, max: Number];
156
- r?: [min: Number, max: Number];
157
- z?: [min: Number, max: Number];
158
- } | undefined;
159
- /** Any extra configuration values you want available on the LayerCake context. This could be useful for color lookups or additional constants. */
160
- custom?: Record<string, any>;
161
- /** Enable debug printing to the console. Useful to inspect your scales and dimensions. */
162
- debug?: boolean;
163
- /** Show warnings in the console. */
164
- verbose?: boolean;
165
- /** x value guaranteed to be visible in xDomain. Useful with optional negative values since `xDomain={[0, null]}` would ignore negative values */
166
- xBaseline?: number | null;
167
- /** y value guaranteed to be visible in yDomain. Useful with optional negative values since `yDomain={[0, null]}` would ignore negative values */
168
- yBaseline?: number | null;
169
- /** Use radial instead of cartesian coordinates, mapping `x` to `angle` and `y`` to radial. Radial lines are positioned relative to the origin, use transform (ex. `<Group center>`) to change the origin */
170
- radial?: boolean;
171
- /** Props passed to GeoContext */
172
- geo?: Partial<{
173
- projection?: (() => import("d3-geo").GeoProjection) | undefined;
174
- fitGeojson?: import("d3-geo").GeoPermissibleObjects | undefined;
175
- fixedAspectRatio?: number | undefined;
176
- clipAngle?: number | undefined;
177
- clipExtent?: [[number, number], [number, number]] | undefined;
178
- rotate?: {
179
- yaw: number;
180
- pitch: number;
181
- roll: number;
182
- } | undefined;
183
- scale?: number | undefined;
184
- translate?: [number, number] | undefined;
185
- center?: [number, number] | undefined;
186
- applyTransform?: ("scale" | "translate" | "rotate")[];
187
- reflectX?: boolean | undefined;
188
- reflectY?: boolean | undefined;
189
- geo?: import("svelte/store").Writable<import("d3-geo").GeoProjection>;
190
- }> | undefined;
191
- /** Exposed via bind: to support `bind:geoProjection` for external access */
192
- geoProjection?: import("svelte/store").Writable<import("d3-geo").GeoProjection> | undefined;
193
- /** Props passed to TooltipContext */
194
- tooltip?: boolean | Partial<{
195
- mode?: "manual" | "bisect-x" | "bisect-y" | "band" | "bisect-band" | "bounds" | "voronoi" | "quadtree";
196
- findTooltipData?: "closest" | "left" | "right";
197
- raiseTarget?: boolean;
198
- locked?: boolean;
199
- radius?: number;
200
- debug?: boolean;
201
- onclick?: (e: MouseEvent, { data }: {
202
- data: any;
203
- }) => any;
204
- tooltip?: import("svelte/store").Writable<{
205
- x: number;
206
- y: number;
207
- data: any;
208
- show: (e: PointerEvent, tooltipData?: any) => void;
209
- hide: () => void;
210
- mode: "manual" | "bisect-x" | "bisect-y" | "band" | "bisect-band" | "bounds" | "voronoi" | "quadtree";
211
- }>;
212
- hideDelay?: number;
213
- }> | undefined;
214
- /** Exposed via bind: to support `bind:tooltipContext` for external access (ex. `tooltipContext.data) */
215
- tooltipContext?: import("svelte/store").Writable<{
216
- x: number;
217
- y: number;
218
- data: any;
219
- show: (e: PointerEvent, tooltipData?: any) => void;
220
- hide: () => void;
221
- mode: "manual" | "bisect-x" | "bisect-y" | "band" | "bisect-band" | "bounds" | "voronoi" | "quadtree";
222
- }> | undefined;
223
- /** Props passed to TransformContext */
224
- transform?: Partial<{
225
- mode?: "none" | "canvas" | "manual";
226
- spring?: boolean | Parameters<typeof import("../stores/motionStore").motionStore>[1]["spring"];
227
- tweened?: boolean | Parameters<typeof import("../stores/motionStore").motionStore>[1]["tweened"];
228
- processTranslate?: (x: number, y: number, deltaX: number, deltaY: number) => {
229
- x: number;
230
- y: number;
231
- };
232
- disablePointer?: boolean;
233
- initialScrollMode?: "none" | "scale" | "translate";
234
- clickDistance?: number;
235
- ondragstart?: (() => void) | undefined;
236
- ondragend?: (() => void) | undefined;
237
- ontransform?: ((e: {
238
- scale: number;
239
- translate: {
240
- x: number;
241
- y: number;
242
- };
243
- }) => void) | undefined;
244
- initialTranslate?: {
245
- x: number;
246
- y: number;
247
- } | undefined;
248
- translate?: import("svelte/motion").Spring<{
249
- x: number;
250
- y: number;
251
- }> | import("svelte/motion").Tweened<{
252
- x: number;
253
- y: number;
254
- }> | import("svelte/store").Writable<{
255
- x: number;
256
- y: number;
257
- }>;
258
- initialScale?: number | undefined;
259
- scale?: import("svelte/store").Writable<number> | import("svelte/motion").Spring<number> | import("svelte/motion").Tweened<number>;
260
- setScrollMode?: (mode: "none" | "scale" | "translate") => void;
261
- reset?: () => void;
262
- zoomIn?: () => void;
263
- zoomOut?: () => void;
264
- translateCenter?: () => void;
265
- zoomTo?: (center: {
266
- x: number;
267
- y: number;
268
- }, rect?: {
269
- width: number;
270
- height: number;
271
- }) => void;
272
- setTranslate?: (point: {
273
- x: number;
274
- y: number;
275
- }, options?: import("../stores/motionStore").MotionOptions) => void;
276
- setScale?: (value: number, options?: import("../stores/motionStore").MotionOptions) => void;
277
- }> | undefined;
278
- /** Expose to support `bind:transformContext` for imperative control (`transformContext.translate(...)`) */
279
- transformContext?: TransformContext;
280
- /** Props passed to BrushContext */
281
- brush?: boolean | Partial<{
282
- axis?: "x" | "y" | "both";
283
- handleSize?: number;
284
- resetOnEnd?: boolean;
285
- xDomain?: DomainType;
286
- yDomain?: DomainType;
287
- mode?: "integrated" | "separated";
288
- disabled?: boolean;
289
- range?: Partial<import("svelte/elements").HTMLAttributes<HTMLDivElement>> | undefined;
290
- handle?: Partial<import("svelte/elements").HTMLAttributes<HTMLDivElement>> | undefined;
291
- classes?: {
292
- root?: string;
293
- frame?: string;
294
- range?: string;
295
- handle?: string;
296
- labels?: string;
297
- };
298
- onchange?: (detail: {
299
- xDomain?: DomainType;
300
- yDomain?: DomainType;
301
- }) => void;
302
- onbrushstart?: (detail: {
303
- xDomain?: DomainType;
304
- yDomain
305
- /** Exposed via bind: to support `bind:brushContext` for external access (ex. `brushContext.xDomain) */
306
- ?: DomainType;
307
- }) => void;
308
- onbrushend?: (detail: {
309
- xDomain?: DomainType;
310
- yDomain?: DomainType;
311
- }) => void;
312
- onreset?: (detail: {
313
- xDomain?: DomainType;
314
- yDomain?: DomainType;
315
- }) => void;
316
- brush?: import("svelte/store").Writable<import("./BrushContext.svelte").BrushContextValue>;
317
- }> | undefined;
318
- /** Exposed via bind: to support `bind:brushContext` for external access (ex. `brushContext.xDomain) */
319
- brushContext?: import("svelte/store").Writable<import("./BrushContext.svelte").BrushContextValue> | undefined;
320
- onresize?: ((e: import("./ChartContext.svelte").ChartResizeDetail) => void) | undefined;
321
- ondragstart?: (() => void) | undefined;
322
- ondragend?: (() => void) | undefined;
323
- ontransform?: ((e: {
324
- scale: number;
325
- translate: {
326
- x: number;
327
- y: number;
328
- };
329
- }) => void) | undefined;
330
- };
331
- events(): {} & {
332
- [evt: string]: CustomEvent<any>;
333
- };
334
- slots(): {
335
- default: {
336
- aspectRatio: number;
337
- containerHeight: number;
338
- containerWidth: number;
339
- height: number;
340
- width: number;
341
- element: Element | undefined;
342
- projection: import("d3-geo").GeoProjection;
343
- transform: {
344
- scale: number;
345
- setScale: (value: number, options?: import("../stores/motionStore").MotionOptions) => void;
346
- translate: {
347
- x: number;
348
- y: number;
349
- };
350
- setTranslate: (point: {
351
- x: number;
352
- y: number;
353
- }, options?: import("../stores/motionStore").MotionOptions) => void;
354
- zoomTo: (center: {
355
- x: number;
356
- y: number;
357
- }, rect?: {
358
- width: number;
359
- height: number;
360
- }) => void;
361
- reset: () => void;
362
- };
363
- tooltip: {
364
- x: number;
365
- y: number;
366
- data: any;
367
- show: (e: PointerEvent, tooltipData?: any) => void;
368
- hide: () => void;
369
- mode: "manual" | "bisect-x" | "bisect-y" | "band" | "bisect-band" | "bounds" | "voronoi" | "quadtree";
370
- };
371
- brush: import("./BrushContext.svelte").BrushContextValue;
372
- x: Function;
373
- xScale: any;
374
- xGet: any;
375
- y: Function;
376
- yScale: any;
377
- yGet: any;
378
- z: Function;
379
- zScale: any;
380
- zGet: any;
381
- r: Function;
382
- rScale: any;
383
- rGet: any;
384
- x1: (d: any) => any;
385
- x1Scale: AnyScale<any, any, any, any> | null;
386
- x1Get: Function;
387
- y1: (d: any) => any;
388
- y1Scale: AnyScale<any, any, any, any> | null;
389
- y1Get: Function;
390
- c: (d: any) => any;
391
- cScale: AnyScale<any, any, any, any> | null;
392
- cGet: Function;
393
- padding: {
394
- top: number;
395
- right: number;
396
- bottom: number;
397
- left: number;
398
- } & {
399
- top?: number;
400
- right?: number;
401
- bottom?: number;
402
- left?: number;
403
- };
404
- data: unknown[] | SankeyGraph<any, any> | HierarchyNode<unknown>;
405
- flatData: import("svelte/store").Readable<unknown[] | SankeyGraph<any, any> | HierarchyNode<unknown>>;
406
- config: any;
407
- };
9
+ import TransformContext, { type TransformContextValue } from './TransformContext.svelte';
10
+ import BrushContext, { type BrushContextValue } from './BrushContext.svelte';
11
+ export type ChartResizeDetail = {
12
+ width: number;
13
+ height: number;
14
+ containerWidth: number;
15
+ containerHeight: number;
16
+ };
17
+ export type PreservedChartConfig<T, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale> = Pick<ChartPropsWithoutHTML<T, XScale, YScale>, 'x' | 'y' | 'z' | 'r' | 'c' | 'x1' | 'y1' | 'xRange' | 'yRange' | 'cDomain' | 'zDomain' | 'xDomain' | 'yDomain' | 'rDomain' | 'x1Domain' | 'y1Domain' | 'zRange' | 'rRange' | 'cRange' | 'x1Range' | 'y1Range'>;
18
+ export type ChartContextValue<T = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale> = {
19
+ activeGetters: Record<AxisKey, (d: T) => any>;
20
+ width: number;
21
+ height: number;
22
+ percentRange: boolean;
23
+ aspectRatio: number;
24
+ containerRef: HTMLElement | undefined;
25
+ containerWidth: number;
26
+ containerHeight: number;
27
+ config: PreservedChartConfig<T, XScale, YScale>;
28
+ x: (d: T) => any;
29
+ y: (d: T) => any;
30
+ z: (d: T) => any;
31
+ r: (d: T) => any;
32
+ x1: (d: T) => any;
33
+ y1: (d: T) => any;
34
+ c: (d: T) => any;
35
+ data: DataType<T>;
36
+ xNice: Nice;
37
+ yNice: Nice;
38
+ zNice: Nice;
39
+ rNice: Nice;
40
+ xDomainSort: boolean;
41
+ yDomainSort: boolean;
42
+ zDomainSort: boolean;
43
+ rDomainSort: boolean;
44
+ xReverse: boolean;
45
+ yReverse: boolean;
46
+ zReverse: boolean;
47
+ rReverse: boolean;
48
+ xPadding: PaddingArray;
49
+ yPadding: PaddingArray;
50
+ zPadding: PaddingArray;
51
+ rPadding: PaddingArray;
52
+ padding: Padding;
53
+ flatData: T[];
54
+ extents: Extents;
55
+ xDomain: number[];
56
+ yDomain: number[];
57
+ zDomain: DomainType;
58
+ rDomain: DomainType;
59
+ cDomain: DomainType;
60
+ x1Domain: DomainType;
61
+ y1Domain: DomainType;
62
+ xRange: any[];
63
+ yRange: any[];
64
+ zRange: any[];
65
+ rRange: any[];
66
+ cRange: readonly string[] | string[] | undefined;
67
+ x1Range: XRangeWithScale<XScale> | undefined;
68
+ y1Range: YRangeWithScale<YScale> | undefined;
69
+ meta: Record<string, any>;
70
+ xScale: AnyScale;
71
+ yScale: AnyScale;
72
+ zScale: AnyScale;
73
+ rScale: AnyScale;
74
+ cScale: AnyScale | null;
75
+ x1Scale: AnyScale | null;
76
+ y1Scale: AnyScale | null;
77
+ yGet: (d: T) => any;
78
+ xGet: (d: T) => any;
79
+ zGet: (d: T) => any;
80
+ rGet: (d: T) => any;
81
+ cGet: (d: T) => any;
82
+ x1Get: (d: T) => any;
83
+ y1Get: (d: T) => any;
84
+ radial: boolean;
85
+ tooltip: TooltipContextValue<T>;
86
+ geo: GeoContextValue;
87
+ brush: BrushContextValue;
88
+ transform: TransformContextValue;
89
+ };
90
+ export type LayerChartInternalMeta = {
91
+ /**
92
+ * The current chart type.
93
+ * The default is `'default'` which is any chart being composed
94
+ * that isn't a "simplified chart".
95
+ */
96
+ type: 'default' | 'simplified-area' | 'simplified-bar' | 'simplified-line' | 'simplified-pie' | 'simplified-scatter';
97
+ };
98
+ export declare function getChartContext<T, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale>(): ChartContextValue<T, XScale, YScale>;
99
+ export declare function setChartContext<T, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale>(context: ChartContextValue<T, XScale, YScale>): ChartContextValue<T, XScale, YScale>;
100
+ export type RenderContext = 'svg' | 'canvas' | 'html';
101
+ export declare function getRenderContext(): RenderContext;
102
+ export declare function setRenderContext(context: RenderContext): RenderContext;
103
+ export type ChartPropsWithoutHTML<T, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale> = {
104
+ /**
105
+ * Whether this chart should be rendered server side
106
+ *
107
+ * @default false
108
+ */
109
+ ssr?: boolean;
110
+ /**
111
+ * Whether to allow pointer events via CSS.
112
+ * Set this to `false` to set `pointer-events: none;` on all components, disabling
113
+ * all mouse interactions.
114
+ *
115
+ * @default true
116
+ */
117
+ pointerEvents?: boolean;
118
+ /**
119
+ * Determine the positioning of the wrapper div.
120
+ * Set this to `'absolute'` when you want to stack layers.
121
+ *
122
+ * @default 'relative'
123
+ */
124
+ position?: string;
125
+ /**
126
+ * If `true`, set all scale ranges to `[0, 100]`.
127
+ * Ranges reversed via `xReverse`, `yReverse`, or `rReverse` props will
128
+ * continue to be reversed as usual.
129
+ * @default false
130
+ */
131
+ percentRange?: boolean;
132
+ /**
133
+ * A bindable reference to the root container element.
134
+ */
135
+ ref?: HTMLElement;
136
+ /**
137
+ * If `data` is not a flat array of objects and you want to use any of the scales, set a flat
138
+ * version of the data via the `flatData` prop.
139
+ */
140
+ data?: T[] | readonly T[] | HierarchyNode<T> | SankeyGraph<any, any>;
141
+ /**
142
+ * A flat version of data.
143
+ */
144
+ flatData?: T[] | readonly T[] | HierarchyNode<T> | SankeyGraph<any, any>;
145
+ /**
146
+ * The x accessor. The key in each row of data that corresponds to the x-field. This can be a
147
+ * string, an accessor function, a number or an array of any combination of those types. This
148
+ * property gets converted to a function when you access it through the context.
149
+ */
150
+ x?: Accessor<T>;
151
+ /**
152
+ * The y accessor. The key in each row of data that corresponds to the y-field. This can be a
153
+ * string, an accessor function, a number or an array of any combination of those types. This
154
+ * property gets converted to a function when you access it through the context.
155
+ */
156
+ y?: Accessor<T>;
157
+ /**
158
+ * The z accessor. The key in each row of data that corresponds to the z-field. This can be a
159
+ * string, an accessor function, a number or an array of any combination of those types. This
160
+ * property gets converted to a function when you access it through the context.
161
+ */
162
+ z?: Accessor<T>;
163
+ /**
164
+ * The r accessor. The key in each row of data that corresponds to the r-field. This can be a
165
+ * string, an accessor function, a number or an array of any combination of those types. This
166
+ * property gets converted to a function when you access it through the context.
167
+ */
168
+ r?: Accessor<T>;
169
+ /**
170
+ * The x1 accessor. The key in each row of data that corresponds to the x1-field. This can be a
171
+ * string, an accessor function, a number or an array of any combination of those types. This
172
+ * property gets converted to a function when you access it through the context.
173
+ */
174
+ x1?: Accessor<T>;
175
+ /**
176
+ * The y1 accessor. The key in each row of data that corresponds to the y1-field. This can be
177
+ * a string, an accessor function, a number or an array of any combination of those types. This
178
+ * property gets converted to a function when you access it through the context.
179
+ */
180
+ y1?: Accessor<T>;
181
+ /**
182
+ * The c (color) accessor. The key in each row of data that corresponds to the color. This can
183
+ * be a string or an accessor function. This property gets converted to a function when you
184
+ * access it through the context.
185
+ */
186
+ c?: Accessor<T>;
187
+ /**
188
+ * Set a min or max. For linear scales, if you want to inherit the value from the data's
189
+ * extent, set that value to `null`. This value can also be an array because sometimes your
190
+ * scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of
191
+ * discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales),
192
+ * useful for color series. Set it to a function that receives the computed domain and lets you
193
+ * return a modified domain, useful for sorting values.
194
+ */
195
+ xDomain?: DomainType;
196
+ /**
197
+ * Set a min or max. For linear scales, if you want to inherit the value from the data's
198
+ * extent, set that value to `null`. This value can also be an array because sometimes your
199
+ * scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of
200
+ * discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales),
201
+ * useful for color series. Set it to a function that receives the computed domain and lets you
202
+ * return a modified domain, useful for sorting values.
203
+ */
204
+ yDomain?: DomainType;
205
+ /**
206
+ * Set a min or max. For linear scales, if you want to inherit the value from the data's
207
+ * extent, set that value to `null`. This value can also be an array because sometimes your
208
+ * scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of
209
+ * discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales),
210
+ * useful for color series. Set it to a function that receives the computed domain and lets you
211
+ * return a modified domain, useful for sorting values.
212
+ */
213
+ zDomain?: DomainType;
214
+ /**
215
+ * Set a min or max. For linear scales, if you want to inherit the value from the data's
216
+ * extent, set that value to `null`. This value can also be an array because sometimes your
217
+ * scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of
218
+ * discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales),
219
+ * useful for color series. Set it to a function that receives the computed domain and lets you
220
+ * return a modified domain, useful for sorting values.
221
+ */
222
+ rDomain?: DomainType;
223
+ /**
224
+ * Set a min or max. For linear scales, if you want to inherit the value from the data's
225
+ * extent, set that value to `null`. This value can also be an array because sometimes your
226
+ * scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of
227
+ * discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales),
228
+ * useful for color series. Set it to a function that receives the computed domain and lets you
229
+ * return a modified domain, useful for sorting values.
230
+ */
231
+ x1Domain?: DomainType;
232
+ /**
233
+ * Set a min or max. For linear scales, if you want to inherit the value from the data's
234
+ * extent, set that value to `null`. This value can also be an array because sometimes your
235
+ * scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of
236
+ * discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales),
237
+ * useful for color series. Set it to a function that receives the computed domain and lets you
238
+ * return a modified domain, useful for sorting values.
239
+ */
240
+ y1Domain?: DomainType;
241
+ /**
242
+ * Set the list of color values.
243
+ */
244
+ cDomain?: DomainType;
245
+ /**
246
+ * Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the x domain.
247
+ * @default false
248
+ */
249
+ xNice?: Nice;
250
+ /**
251
+ * Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the y domain.
252
+ * @default false
253
+ */
254
+ yNice?: Nice;
255
+ /**
256
+ * Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the z domain.
257
+ * @default false
258
+ */
259
+ zNice?: Nice;
260
+ /**
261
+ * Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the r domain.
262
+ * @default false
263
+ */
264
+ rNice?: Nice;
265
+ /**
266
+ * Assign a pixel value to add to the min or max of the scale. This will increase the scales
267
+ * domain by the scale unit equivalent of the provided pixels.
268
+ */
269
+ xPadding?: PaddingArray;
270
+ /**
271
+ * Assign a pixel value to add to the min or max of the scale. This will increase the scales
272
+ * domain by the scale unit equivalent of the provided pixels.
273
+ */
274
+ yPadding?: PaddingArray;
275
+ /**
276
+ * Assign a pixel value to add to the min or max of the scale. This will increase the scales
277
+ * domain by the scale unit equivalent of the provided pixels.
278
+ */
279
+ zPadding?: PaddingArray;
280
+ /**
281
+ * Assign a pixel value to add to the min or max of the scale. This will increase the scales
282
+ * domain by the scale unit equivalent of the provided pixels.
283
+ */
284
+ rPadding?: PaddingArray;
285
+ /**
286
+ * The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
287
+ * you want to override the default or you want to extra options.
288
+ * @default scaleLinear
289
+ */
290
+ xScale?: XScale;
291
+ /**
292
+ * The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
293
+ * you want to override the default or you want to extra options.
294
+ * @default scaleLinear
295
+ */
296
+ yScale?: YScale;
297
+ /**
298
+ * The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
299
+ * you want to override the default or you want to extra options.
300
+ * @default scaleLinear
301
+ */
302
+ zScale?: AnyScale;
303
+ /**
304
+ * The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
305
+ * you want to override the default or you want to extra options.
306
+ * @default scaleSqrt
307
+ */
308
+ rScale?: AnyScale;
309
+ /**
310
+ * The D3 scale that should be used for the x1-dimension. Pass in an instantiated D3 scale if
311
+ * you want to override the default or you want to extra options.
312
+ * @default scaleLinear
313
+ */
314
+ x1Scale?: AnyScale;
315
+ /**
316
+ * The D3 scale that should be used for the y1-dimension. Pass in an instantiated D3 scale if
317
+ * you want to override the default or you want to extra options.
318
+ * @default scaleLinear
319
+ */
320
+ y1Scale?: AnyScale;
321
+ /**
322
+ * The D3 scale that should be used for the color dimension. Pass in an instantiated D3 scale
323
+ * if you want to override the default or you want to extra options.
324
+ * @default scaleOrdinal
325
+ */
326
+ cScale?: AnyScale;
327
+ /** Override the default x range of `[0, width]` by setting an array or function with argument
328
+ * `({ width, height})` that returns an array. Setting this prop overrides `xReverse`. This can
329
+ * also be a list of numbers or strings for scales with discrete ranges like
330
+ * [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
331
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
332
+ */
333
+ xRange?: BaseRange;
334
+ /**
335
+ * Override the default y range of `[0, height]` by setting an array or function with argument
336
+ * `({ width, height})` that returns an array. Setting this prop overrides `yReverse`. This can
337
+ * also be a list of numbers or strings for scales with discrete ranges like
338
+ * [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
339
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
340
+ */
341
+ yRange?: BaseRange;
342
+ /** Override the default z range of `[0, width]` by setting an array or function with argument
343
+ * `({ width, height})` that returns an array. Setting this prop overrides `zReverse`. This can
344
+ * also be a list of numbers or strings for scales with discrete ranges like
345
+ * [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
346
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
347
+ */
348
+ zRange?: BaseRange;
349
+ /** Override the default r range of `[1, 25]` by setting an array or function with argument
350
+ * `({ width, height})` that returns an array. Setting this prop overrides `rReverse`. This can
351
+ * also be a list of numbers or strings for scales with discrete ranges like
352
+ * [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
353
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
354
+ */
355
+ rRange?: BaseRange;
356
+ /**
357
+ * Set the x1 range by setting an array or function with argument `({ xScale, width, height})`
358
+ * that returns an array. This can also be a list of numbers or strings for scales with
359
+ * discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
360
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
361
+ */
362
+ x1Range?: XRangeWithScale<XScale>;
363
+ /**
364
+ * Set the y1 range by setting an array or function with argument `({ yScale, width, height})`
365
+ * that returns an array. This can also be a list of numbers or strings for scales with
366
+ * discrete ranges like [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
367
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
368
+ */
369
+ y1Range?: YRangeWithScale<YScale>;
370
+ /**
371
+ * Override the default y1 range of `[0, width]` by setting an array or function with argument
372
+ * `({ yScale, width, height})` that returns an array. Setting this prop overrides `x1Reverse`.
373
+ * This can also be a list of numbers or strings for scales with discrete ranges like
374
+ * [scaleThreshold](https://github.com/d3/d3-scale#threshold-scales) or
375
+ * [scaleQuantize](https://github.com/d3/d3-scale#quantize-scales).
376
+ */
377
+ cRange?: string[] | readonly string[];
378
+ /**
379
+ * Reverse the default x range. By default this is `false` and the range is `[0, width]`.
380
+ * Ignored if you set the xRange prop.
381
+ * @default false
382
+ */
383
+ xReverse?: boolean;
384
+ /**
385
+ * Reverse the default y range. By default this is `true` and the range is `[height, 0]` unless
386
+ * using an ordinal scale with a `.bandwidth` method for `yScale`.
387
+ * Ignored if you set the `yRange` prop.
388
+ * @default true
389
+ */
390
+ yReverse?: boolean;
391
+ /**
392
+ * Reverse the default z range. By default this is `false` and the range is `[0, width]`.
393
+ * Ignored if you set the zRange prop.
394
+ * @default false
395
+ */
396
+ zReverse?: boolean;
397
+ /**
398
+ * Reverse the default r range. By default this is `false` and the range is `[1, 25]`.
399
+ * Ignored if you set the rRange prop.
400
+ * @default false
401
+ */
402
+ rReverse?: boolean;
403
+ /**
404
+ * ***Only used when scale is ordinal.***
405
+ * Set whether the calculated unique items come back sorted.
406
+ *
407
+ * @default false
408
+ */
409
+ xDomainSort?: boolean;
410
+ /**
411
+ * ***Only used when scale is ordinal.***
412
+ * Set whether the calculated unique items come back sorted.
413
+ *
414
+ * @default false
415
+ */
416
+ yDomainSort?: boolean;
417
+ /**
418
+ * ***Only used when scale is ordinal.***
419
+ * Set whether the calculated unique items come back sorted.
420
+ *
421
+ * @default false
422
+ */
423
+ zDomainSort?: boolean;
424
+ /**
425
+ * ***Only used when scale is ordinal.***
426
+ * Set whether the calculated unique items come back sorted.
427
+ *
428
+ * @default false
429
+ */
430
+ rDomainSort?: boolean;
431
+ /**
432
+ * The amount of padding to put around your chart. It operates like CSS
433
+ * box-sizing: border-box; where values are subtracted from the parent container's width
434
+ * and height, the same as a [D3 margin convention](https://bl.ocks.org/mbostock/3019563).
435
+ *
436
+ * If a number is passed, it will be applied to all sides.
437
+ */
438
+ padding?: {
439
+ top?: number;
440
+ right?: number;
441
+ bottom?: number;
442
+ left?: number;
443
+ } | number;
444
+ /**
445
+ * Manually set the extents of the x, y or r scale as a two-dimensional array of the min and
446
+ * max you want. Setting values here will skip any dynamic extent calculation of the data for
447
+ * that dimension.
448
+ */
449
+ extents?: {
450
+ x?: [min: number, max: number];
451
+ y?: [min: number, max: number];
452
+ r?: [min: number, max: number];
453
+ z?: [min: number, max: number];
408
454
  };
455
+ /**
456
+ * Any extra configuration values you want available on the Chart context.
457
+ * This could be useful for color lookups or additional constants.
458
+ */
459
+ meta?: Record<string, any>;
460
+ /**
461
+ * Enable debug printing to the console.
462
+ * Useful to inspect your scales and dimensions.
463
+ *
464
+ * @default false
465
+ */
466
+ debug?: boolean;
467
+ /**
468
+ * Show warnings in the console.
469
+ *
470
+ * @default true
471
+ */
472
+ verbose?: boolean;
473
+ /**
474
+ * x value guaranteed to be visible in xDomain. Useful with optional negative values since
475
+ * `xDomain={[0, null]}` would ignore negative values
476
+ *
477
+ * @default null
478
+ */
479
+ xBaseline?: number | null;
480
+ /**
481
+ * y value guaranteed to be visible in yDomain. Useful with optional negative values since
482
+ * `yDomain={[0, null]}` would ignore negative values
483
+ *
484
+ * @default null
485
+ */
486
+ yBaseline?: number | null;
487
+ /**
488
+ * Use radial instead of cartesian coordinates, mapping `x` to `angle` and `y`` to radial.
489
+ * Radial lines are positioned relative to the origin, use transform (ex. `<Group center>`)
490
+ * to change the origin
491
+ *
492
+ * @default false
493
+ */
494
+ radial?: boolean;
495
+ children?: Snippet<[{
496
+ context: ChartContextValue<T, XScale, YScale>;
497
+ }]>;
498
+ /**
499
+ * A bindable reference to the chart context.
500
+ */
501
+ context?: ChartContextValue<T, XScale, YScale>;
502
+ /**
503
+ * Props passed to GeoContext
504
+ */
505
+ geo?: Partial<ComponentProps<typeof GeoContext>>;
506
+ /**
507
+ * Props passed to the `TooltipContext` component.
508
+ */
509
+ tooltip?: Partial<ComponentProps<typeof TooltipContext>> | boolean;
510
+ /**
511
+ * Props passed to TransformContext
512
+ */
513
+ transform?: Partial<ComponentProps<typeof TransformContext>>;
514
+ /** Props passed to BrushContext */
515
+ brush?: Partial<ComponentProps<typeof BrushContext>> | boolean;
516
+ /**
517
+ * A callback function that is called when the chart is resized.
518
+ */
519
+ onResize?: (e: ChartResizeDetail) => void;
520
+ ondragstart?: ComponentProps<typeof TransformContext>['ondragstart'];
521
+ ondragend?: ComponentProps<typeof TransformContext>['ondragend'];
522
+ onTransform?: ComponentProps<typeof TransformContext>['onTransform'];
523
+ };
524
+ declare class __sveltets_Render<TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale> {
525
+ props(): ChartPropsWithoutHTML<TData, XScale, YScale>;
526
+ events(): {};
527
+ slots(): {};
528
+ bindings(): "ref" | "context";
529
+ exports(): {};
409
530
  }
410
- export type ChartProps<TData> = ReturnType<__sveltets_Render<TData>['props']>;
411
- export type ChartEvents<TData> = ReturnType<__sveltets_Render<TData>['events']>;
412
- export type ChartSlots<TData> = ReturnType<__sveltets_Render<TData>['slots']>;
413
- export default class Chart<TData> extends SvelteComponentTyped<ChartProps<TData>, ChartEvents<TData>, ChartSlots<TData>> {
531
+ interface $$IsomorphicComponent {
532
+ new <TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<TData, XScale, YScale>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<TData, XScale, YScale>['props']>, ReturnType<__sveltets_Render<TData, XScale, YScale>['events']>, ReturnType<__sveltets_Render<TData, XScale, YScale>['slots']>> & {
533
+ $$bindings?: ReturnType<__sveltets_Render<TData, XScale, YScale>['bindings']>;
534
+ } & ReturnType<__sveltets_Render<TData, XScale, YScale>['exports']>;
535
+ <TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale>(internal: unknown, props: ReturnType<__sveltets_Render<TData, XScale, YScale>['props']> & {}): ReturnType<__sveltets_Render<TData, XScale, YScale>['exports']>;
536
+ z_$$bindings?: ReturnType<__sveltets_Render<any, any, any>['bindings']>;
414
537
  }
415
- export {};
538
+ declare const Chart: $$IsomorphicComponent;
539
+ type Chart<TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale> = InstanceType<typeof Chart<TData, XScale, YScale>>;
540
+ export default Chart;