svelteplot 0.0.1-alpha.8 → 0.1.3-next.3

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 (251) hide show
  1. package/LICENSE.md +5 -0
  2. package/README.md +3 -36
  3. package/dist/Mark.svelte +292 -0
  4. package/dist/Mark.svelte.d.ts +22 -0
  5. package/dist/Plot.svelte +148 -153
  6. package/dist/Plot.svelte.d.ts +15 -15
  7. package/dist/constants.d.ts +14 -0
  8. package/dist/constants.js +109 -0
  9. package/dist/core/Facet.svelte +59 -0
  10. package/dist/core/Facet.svelte.d.ts +18 -0
  11. package/dist/core/FacetAxes.svelte +66 -0
  12. package/dist/core/FacetAxes.svelte.d.ts +4 -0
  13. package/dist/core/FacetGrid.svelte +86 -0
  14. package/dist/core/FacetGrid.svelte.d.ts +13 -0
  15. package/dist/core/Plot.svelte +567 -0
  16. package/dist/core/Plot.svelte.d.ts +14 -0
  17. package/dist/helpers/arrowPath.d.ts +14 -0
  18. package/dist/helpers/arrowPath.js +129 -0
  19. package/dist/helpers/autoProjection.d.ts +19 -0
  20. package/dist/helpers/autoProjection.js +87 -0
  21. package/dist/helpers/autoScales.d.ts +23 -0
  22. package/dist/helpers/autoScales.js +203 -0
  23. package/dist/helpers/autoTicks.d.ts +3 -0
  24. package/dist/helpers/autoTicks.js +40 -0
  25. package/dist/helpers/autoTimeFormat.d.ts +2 -2
  26. package/dist/helpers/autoTimeFormat.js +34 -5
  27. package/dist/helpers/callWithProps.d.ts +8 -0
  28. package/dist/helpers/callWithProps.js +13 -0
  29. package/dist/helpers/colors.js +17 -2
  30. package/dist/helpers/curves.d.ts +3 -0
  31. package/dist/helpers/curves.js +42 -0
  32. package/dist/helpers/data.d.ts +9 -0
  33. package/dist/helpers/data.js +16 -0
  34. package/dist/helpers/facets.d.ts +12 -0
  35. package/dist/helpers/facets.js +49 -0
  36. package/dist/helpers/formats.d.ts +3 -0
  37. package/dist/helpers/formats.js +3 -0
  38. package/dist/helpers/getBaseStyles.d.ts +7 -2
  39. package/dist/helpers/getBaseStyles.js +34 -10
  40. package/dist/helpers/getLogTicks.js +5 -5
  41. package/dist/helpers/group.d.ts +6 -0
  42. package/dist/helpers/group.js +53 -0
  43. package/dist/helpers/index.d.ts +18 -0
  44. package/dist/helpers/index.js +53 -0
  45. package/dist/helpers/isRawValue.d.ts +2 -0
  46. package/dist/helpers/isRawValue.js +5 -0
  47. package/dist/helpers/isValid.d.ts +6 -0
  48. package/dist/helpers/isValid.js +6 -0
  49. package/dist/helpers/math.d.ts +19 -0
  50. package/dist/helpers/math.js +116 -0
  51. package/dist/helpers/mergeDeep.d.ts +1 -1
  52. package/dist/helpers/noise.d.ts +1 -0
  53. package/dist/helpers/noise.js +72 -0
  54. package/dist/helpers/projection.d.ts +33 -0
  55. package/dist/helpers/projection.js +100 -0
  56. package/dist/helpers/reduce.d.ts +10 -0
  57. package/dist/helpers/reduce.js +85 -0
  58. package/dist/helpers/regressionLoess.d.ts +12 -0
  59. package/dist/helpers/regressionLoess.js +47 -0
  60. package/dist/helpers/removeIdenticalLines.d.ts +8 -1
  61. package/dist/helpers/removeIdenticalLines.js +14 -7
  62. package/dist/helpers/resolve.d.ts +17 -0
  63. package/dist/helpers/resolve.js +152 -0
  64. package/dist/helpers/roundedRect.d.ts +9 -0
  65. package/dist/helpers/roundedRect.js +31 -0
  66. package/dist/helpers/scales.d.ts +42 -0
  67. package/dist/helpers/scales.js +309 -0
  68. package/dist/helpers/time.d.ts +6 -0
  69. package/dist/helpers/time.js +282 -0
  70. package/dist/helpers/typeChecks.d.ts +8 -5
  71. package/dist/helpers/typeChecks.js +27 -6
  72. package/dist/index.d.ts +49 -1
  73. package/dist/index.js +53 -2
  74. package/dist/marks/Area.svelte +146 -0
  75. package/dist/marks/Area.svelte.d.ts +30 -0
  76. package/dist/marks/AreaX.svelte +27 -0
  77. package/dist/marks/AreaX.svelte.d.ts +12 -0
  78. package/dist/marks/AreaY.svelte +38 -0
  79. package/dist/marks/AreaY.svelte.d.ts +19 -0
  80. package/dist/marks/Arrow.svelte +139 -0
  81. package/dist/marks/Arrow.svelte.d.ts +44 -0
  82. package/dist/marks/AxisX.svelte +198 -93
  83. package/dist/marks/AxisX.svelte.d.ts +17 -16
  84. package/dist/marks/AxisY.svelte +176 -62
  85. package/dist/marks/AxisY.svelte.d.ts +17 -14
  86. package/dist/marks/BarX.svelte +81 -0
  87. package/dist/marks/BarX.svelte.d.ts +4 -0
  88. package/dist/marks/BarY.svelte +95 -0
  89. package/dist/marks/BarY.svelte.d.ts +4 -0
  90. package/dist/marks/BollingerX.svelte +44 -0
  91. package/dist/marks/BollingerX.svelte.d.ts +18 -0
  92. package/dist/marks/BollingerY.svelte +39 -0
  93. package/dist/marks/BollingerY.svelte.d.ts +18 -0
  94. package/dist/marks/BoxX.svelte +89 -0
  95. package/dist/marks/BoxX.svelte.d.ts +4 -0
  96. package/dist/marks/BoxY.svelte +110 -0
  97. package/dist/marks/BoxY.svelte.d.ts +29 -0
  98. package/dist/marks/Cell.svelte +110 -0
  99. package/dist/marks/Cell.svelte.d.ts +16 -0
  100. package/dist/marks/CellX.svelte +24 -0
  101. package/dist/marks/CellX.svelte.d.ts +3 -0
  102. package/dist/marks/CellY.svelte +24 -0
  103. package/dist/marks/CellY.svelte.d.ts +3 -0
  104. package/dist/marks/ColorLegend.svelte +148 -27
  105. package/dist/marks/ColorLegend.svelte.d.ts +12 -13
  106. package/dist/marks/CustomMark.svelte +43 -0
  107. package/dist/marks/CustomMark.svelte.d.ts +16 -0
  108. package/dist/marks/CustomMarkHTML.svelte +103 -0
  109. package/dist/marks/CustomMarkHTML.svelte.d.ts +17 -0
  110. package/dist/marks/DifferenceY.svelte +144 -0
  111. package/dist/marks/DifferenceY.svelte.d.ts +30 -0
  112. package/dist/marks/Dot.svelte +128 -73
  113. package/dist/marks/Dot.svelte.d.ts +24 -14
  114. package/dist/marks/DotX.svelte +15 -3
  115. package/dist/marks/DotX.svelte.d.ts +8 -16
  116. package/dist/marks/DotY.svelte +8 -3
  117. package/dist/marks/DotY.svelte.d.ts +5 -17
  118. package/dist/marks/Frame.svelte +32 -31
  119. package/dist/marks/Frame.svelte.d.ts +7 -14
  120. package/dist/marks/Geo.svelte +102 -0
  121. package/dist/marks/Geo.svelte.d.ts +10 -0
  122. package/dist/marks/Graticule.svelte +28 -0
  123. package/dist/marks/Graticule.svelte.d.ts +9 -0
  124. package/dist/marks/GridX.svelte +67 -36
  125. package/dist/marks/GridX.svelte.d.ts +7 -18
  126. package/dist/marks/GridY.svelte +64 -25
  127. package/dist/marks/GridY.svelte.d.ts +7 -14
  128. package/dist/marks/HTMLTooltip.svelte +91 -0
  129. package/dist/marks/HTMLTooltip.svelte.d.ts +11 -0
  130. package/dist/marks/Line.svelte +219 -58
  131. package/dist/marks/Line.svelte.d.ts +30 -14
  132. package/dist/marks/LineX.svelte +8 -8
  133. package/dist/marks/LineX.svelte.d.ts +4 -17
  134. package/dist/marks/LineY.svelte +7 -8
  135. package/dist/marks/LineY.svelte.d.ts +4 -17
  136. package/dist/marks/Link.svelte +173 -0
  137. package/dist/marks/Link.svelte.d.ts +21 -0
  138. package/dist/marks/Pointer.svelte +126 -0
  139. package/dist/marks/Pointer.svelte.d.ts +23 -0
  140. package/dist/marks/Rect.svelte +103 -0
  141. package/dist/marks/Rect.svelte.d.ts +15 -0
  142. package/dist/marks/RectX.svelte +33 -0
  143. package/dist/marks/RectX.svelte.d.ts +15 -0
  144. package/dist/marks/RectY.svelte +33 -0
  145. package/dist/marks/RectY.svelte.d.ts +15 -0
  146. package/dist/marks/RegressionX.svelte +26 -0
  147. package/dist/marks/RegressionX.svelte.d.ts +4 -0
  148. package/dist/marks/RegressionY.svelte +26 -0
  149. package/dist/marks/RegressionY.svelte.d.ts +4 -0
  150. package/dist/marks/RuleX.svelte +52 -28
  151. package/dist/marks/RuleX.svelte.d.ts +14 -14
  152. package/dist/marks/RuleY.svelte +52 -28
  153. package/dist/marks/RuleY.svelte.d.ts +14 -14
  154. package/dist/marks/Sphere.svelte +8 -0
  155. package/dist/marks/Sphere.svelte.d.ts +51 -0
  156. package/dist/marks/Spike.svelte +15 -0
  157. package/dist/marks/Spike.svelte.d.ts +4 -0
  158. package/dist/marks/SymbolLegend.svelte +27 -12
  159. package/dist/marks/SymbolLegend.svelte.d.ts +8 -14
  160. package/dist/marks/Text.svelte +185 -0
  161. package/dist/marks/Text.svelte.d.ts +26 -0
  162. package/dist/marks/TickX.svelte +89 -0
  163. package/dist/marks/TickX.svelte.d.ts +22 -0
  164. package/dist/marks/TickY.svelte +90 -0
  165. package/dist/marks/TickY.svelte.d.ts +22 -0
  166. package/dist/marks/Vector.svelte +213 -0
  167. package/dist/marks/Vector.svelte.d.ts +31 -0
  168. package/dist/marks/helpers/BaseAxisX.svelte +210 -0
  169. package/dist/marks/helpers/BaseAxisX.svelte.d.ts +24 -0
  170. package/dist/marks/helpers/BaseAxisY.svelte +187 -0
  171. package/dist/marks/helpers/BaseAxisY.svelte.d.ts +23 -0
  172. package/dist/marks/helpers/CanvasLayer.svelte +38 -0
  173. package/dist/marks/helpers/CanvasLayer.svelte.d.ts +13 -0
  174. package/dist/marks/helpers/DotCanvas.svelte +184 -0
  175. package/dist/marks/helpers/DotCanvas.svelte.d.ts +11 -0
  176. package/dist/marks/helpers/GeoCanvas.svelte +165 -0
  177. package/dist/marks/helpers/GeoCanvas.svelte.d.ts +13 -0
  178. package/dist/marks/helpers/GroupMultiple.svelte +17 -0
  179. package/dist/marks/helpers/GroupMultiple.svelte.d.ts +9 -0
  180. package/dist/marks/helpers/Marker.svelte +93 -0
  181. package/dist/marks/helpers/Marker.svelte.d.ts +10 -0
  182. package/dist/marks/helpers/MarkerPath.svelte +164 -0
  183. package/dist/marks/helpers/MarkerPath.svelte.d.ts +44 -0
  184. package/dist/marks/helpers/Regression.svelte +174 -0
  185. package/dist/marks/helpers/Regression.svelte.d.ts +26 -0
  186. package/dist/marks/helpers/events.d.ts +8 -0
  187. package/dist/marks/helpers/events.js +64 -0
  188. package/dist/transforms/bin.d.ts +51 -0
  189. package/dist/transforms/bin.js +171 -0
  190. package/dist/transforms/bollinger.d.ts +21 -0
  191. package/dist/transforms/bollinger.js +53 -0
  192. package/dist/transforms/centroid.d.ts +9 -0
  193. package/dist/transforms/centroid.js +13 -0
  194. package/dist/transforms/facet.d.ts +1 -0
  195. package/dist/transforms/facet.js +1 -0
  196. package/dist/transforms/filter.d.ts +2 -0
  197. package/dist/transforms/filter.js +8 -0
  198. package/dist/transforms/group.d.ts +66 -0
  199. package/dist/transforms/group.js +109 -0
  200. package/dist/transforms/interval.d.ts +11 -0
  201. package/dist/transforms/interval.js +34 -0
  202. package/dist/transforms/jitter.d.ts +0 -0
  203. package/dist/transforms/jitter.js +1 -0
  204. package/dist/transforms/map.d.ts +10 -0
  205. package/dist/transforms/map.js +89 -0
  206. package/dist/transforms/normalize.d.ts +9 -0
  207. package/dist/transforms/normalize.js +86 -0
  208. package/dist/transforms/recordize.d.ts +13 -0
  209. package/dist/transforms/recordize.js +75 -0
  210. package/dist/transforms/rename.d.ts +14 -0
  211. package/dist/transforms/rename.js +42 -0
  212. package/dist/transforms/select.d.ts +35 -0
  213. package/dist/transforms/select.js +55 -0
  214. package/dist/transforms/shift.d.ts +13 -0
  215. package/dist/transforms/shift.js +45 -0
  216. package/dist/transforms/sort.d.ts +28 -0
  217. package/dist/transforms/sort.js +61 -0
  218. package/dist/transforms/stack.d.ts +10 -0
  219. package/dist/transforms/stack.js +110 -0
  220. package/dist/transforms/window.d.ts +22 -0
  221. package/dist/transforms/window.js +73 -0
  222. package/dist/types.d.ts +625 -188
  223. package/dist/ui/Checkbox.svelte +6 -0
  224. package/dist/ui/Checkbox.svelte.d.ts +13 -0
  225. package/dist/ui/RadioInput.svelte +27 -0
  226. package/dist/ui/RadioInput.svelte.d.ts +9 -0
  227. package/dist/ui/Select.svelte +27 -0
  228. package/dist/ui/Select.svelte.d.ts +9 -0
  229. package/dist/ui/Slider.svelte +47 -0
  230. package/dist/ui/Slider.svelte.d.ts +11 -0
  231. package/dist/ui/Spiral.svelte +46 -0
  232. package/dist/ui/Spiral.svelte.d.ts +15 -0
  233. package/dist/ui/index.d.ts +4 -0
  234. package/dist/ui/index.js +4 -0
  235. package/package.json +79 -40
  236. package/LICENSE +0 -11
  237. package/dist/classes/Channel.svelte.js +0 -74
  238. package/dist/classes/Mark.svelte.js +0 -17
  239. package/dist/classes/Plot.svelte.js +0 -98
  240. package/dist/contants.d.ts +0 -3
  241. package/dist/contants.js +0 -40
  242. package/dist/helpers/GroupMultiple.svelte +0 -8
  243. package/dist/helpers/GroupMultiple.svelte.d.ts +0 -19
  244. package/dist/helpers/createScale.d.ts +0 -5
  245. package/dist/helpers/createScale.js +0 -57
  246. package/dist/helpers/resolveChannel.d.ts +0 -2
  247. package/dist/helpers/resolveChannel.js +0 -28
  248. package/dist/helpers/wrapArray.d.ts +0 -2
  249. package/dist/helpers/wrapArray.js +0 -4
  250. package/dist/marks/BaseMark.svelte +0 -22
  251. package/dist/marks/BaseMark.svelte.d.ts +0 -19
package/dist/types.d.ts CHANGED
@@ -1,198 +1,635 @@
1
+ import type { ScaleBand, ScaleLinear, ScaleOrdinal } from 'd3-scale';
1
2
  import type { Snippet } from 'svelte';
2
- import type { CHANNEL_TYPES } from './contants.js';
3
- import type { Plot } from './classes/Plot.svelte';
4
3
  import type { MouseEventHandler } from 'svelte/elements';
5
- export type Datasets = {
6
- aapl: {
7
- Date: Date;
8
- High: number;
9
- Low: number;
10
- Open: number;
11
- Close: number;
12
- 'Adj Close': number;
13
- }[];
14
- cars: {
15
- name: string;
16
- 'economy (mpg)': number;
17
- cylinders: number;
18
- 'displacement (cc)': number;
19
- 'power (hp)': number;
20
- 'weight (lb)': number;
21
- '0-60 mph (s)': number;
22
- year: number;
23
- }[];
24
- penguins: {
25
- species: string;
26
- island: string;
27
- culmen_length_mm: number;
28
- culmen_depth_mm: number;
29
- flipper_length_mm: number;
30
- body_mass_g: number;
31
- sex: string;
32
- }[];
33
- bls: {
34
- division: string;
35
- date: Date;
36
- unemployment: number;
37
- }[];
4
+ import type { MarkerShape } from './marks/helpers/Marker.svelte';
5
+ import type { Writable } from 'svelte/store';
6
+ export type MarkType = 'area' | 'arrow' | 'axisX' | 'axisY' | 'barX' | 'barY' | 'cell' | 'dot' | 'vector' | 'frame' | 'geo' | 'gridX' | 'gridY' | 'line' | 'rect' | 'regression' | 'ruleX' | 'ruleY' | 'swoopyArrow' | 'text' | 'tickX' | 'tickY';
7
+ export type ScaleName = 'x' | 'y' | 'r' | 'color' | 'opacity' | 'length' | 'symbol' | 'fx' | 'fy' | 'projection';
8
+ export type ScaleType = 'linear' | 'pow' | 'sqrt' | 'log' | 'symlog' | 'time' | 'point' | 'ordinal' | 'sequential' | 'band' | 'categorical' | 'cyclical' | 'threshold' | 'quantile-cont' | 'quantile' | 'quantize' | 'diverging' | 'diverging-log' | 'diverging-pow' | 'diverging-sqrt' | 'diverging-symlog';
9
+ export type Mark<T> = {
10
+ id: symbol;
11
+ type: MarkType;
12
+ channels: ScaledChannelName[];
13
+ scales: Set<ScaleName>;
14
+ data: DataRecord[];
15
+ options: T;
16
+ };
17
+ export type ScaledChannelName = 'fill' | 'fillOpacity' | 'opacity' | 'r' | 'length' | 'stroke' | 'strokeOpacity' | 'symbol' | 'fx' | 'fy' | 'x' | 'x1' | 'x2' | 'y' | 'y1' | 'y2';
18
+ export type ChannelName = ScaledChannelName | 'z' | 'sort' | 'filter' | 'interval';
19
+ export type RawValue = number | Date | boolean | string;
20
+ export type ScaleOptions = {
21
+ /**
22
+ * Override the automatic scale type detection.
23
+ */
24
+ type: ScaleType | 'auto';
25
+ /**
26
+ * Set a custom domain for the scale instead of auto-computing the domain
27
+ * from the mark data channels.
28
+ */
29
+ domain?: RawValue[];
30
+ /**
31
+ * Set a custom range for the scale.
32
+ */
33
+ range?: RawValue[];
34
+ /**
35
+ * Reverse the scale.
36
+ */
37
+ reverse: boolean;
38
+ label?: string;
39
+ interval?: string | number;
40
+ clamp: boolean;
41
+ nice: boolean;
42
+ zero: boolean;
43
+ round: boolean;
44
+ percent: boolean;
45
+ transform?: (d: RawValue) => RawValue;
46
+ /**
47
+ * set the padding for band scales
48
+ */
49
+ padding: number;
50
+ /**
51
+ * set the align for band or point scales
52
+ */
53
+ align: number;
54
+ /**
55
+ * set the inner padding for band scales
56
+ */
57
+ paddingInner?: number;
58
+ /**
59
+ * set the outer padding for band scales
60
+ */
61
+ paddingOuter?: number;
62
+ insetLeft?: number;
63
+ insetRight?: number;
64
+ insetTop?: number;
65
+ insetBottom?: number;
66
+ ticks?: (number | Date)[];
67
+ tickSpacing: number;
68
+ base?: number;
69
+ sort?: ChannelAccessor | ((a: RawValue, b: RawValue) => number) | {
70
+ channel: string;
71
+ order: 'ascending' | 'descending';
72
+ };
73
+ constant?: number;
74
+ };
75
+ export type ColorScaleOptions = ScaleOptions & {
76
+ legend: boolean;
77
+ type: ScaleType | 'categorical' | 'sequential' | 'cyclical' | 'threshold' | 'quantile' | 'quantize' | 'diverging' | 'diverging-log' | 'diverging-pow' | 'diverging-sqrt' | 'diverging-symlog';
78
+ scheme: string;
79
+ /**
80
+ * fallback color used for null/undefined
81
+ */
82
+ unknown: string;
83
+ /**
84
+ * center value for diverging scales
85
+ */
86
+ pivot: number;
87
+ /**
88
+ * number of colors for quantize and quantile-threshold scales
89
+ */
90
+ n: number;
91
+ interpolate: (d: any) => typeof d;
38
92
  };
39
93
  export type AxisXAnchor = 'bottom' | 'top' | 'both';
40
94
  export type AxisYAnchor = 'left' | 'right' | 'both';
41
- export type PositionChannelOptions = Partial<{
42
- label?: string | null;
43
- domain?: [number, number] | null;
44
- grid?: boolean;
45
- ticks?: RawValue[];
46
- tickSpacing?: number;
47
- log?: boolean;
48
- reverse?: boolean;
49
- }>;
50
- export type PlotProps = {
51
- height?: number | 'auto';
52
- marginTop?: number;
53
- marginBottom?: number;
54
- marginLeft?: number;
55
- marginRight?: number;
95
+ export type XScaleOptions = ScaleOptions & {
96
+ /**
97
+ * Activate the implicit GridX mark. For more control over the grid styling
98
+ * and layering, add an explicit GridX mark to your plot instead of using the
99
+ * implicit grids.
100
+ */
101
+ grid: boolean;
102
+ /**
103
+ * Controls the position of the implicit AxisX mark, or set to false to disable
104
+ * the implicit AxisX mark. For more control over the axis styling and layering
105
+ * add an explicit AxisX mark to your plot instead of using the implicit axes.
106
+ */
107
+ axis: AxisXAnchor | false;
108
+ /**
109
+ * rotate the axis ticks
110
+ */
111
+ tickRotate: number;
112
+ labelAnchor: 'auto' | 'left' | 'center' | 'right';
113
+ tickFormat: 'auto' | string | ((d: RawValue) => string);
114
+ };
115
+ export type YScaleOptions = ScaleOptions & {
116
+ /**
117
+ * Activate the implicit GridY mark. For more control over the grid styling
118
+ * and layering, add an explicit GridY mark to your plot instead of using the
119
+ * implicit grids.
120
+ */
121
+ grid: boolean;
122
+ /**
123
+ * Controls the position of the implicit AxisY mark, or set to false to disable
124
+ * the implicit AxisY mark. For more control over the axis styling and layering
125
+ * add an explicit AxisY mark to your plot instead of using the implicit axes.
126
+ */
127
+ axis: AxisYAnchor | false;
128
+ tickFormat: string | ((d: RawValue) => string);
129
+ /**
130
+ * rotate the axis ticks
131
+ */
132
+ tickRotate: number;
133
+ labelAnchor: 'auto' | 'bottom' | 'middle' | 'top';
134
+ };
135
+ export type LegendScaleOptions = ScaleOptions & {
136
+ legend: boolean;
137
+ };
138
+ export type PlotOptions = {
139
+ /**
140
+ * The plot title, rendered as H2 tag above the SVG element. Instead of
141
+ * using the title, you can also pass a "header" snippet and render your
142
+ * own custom title markup.
143
+ */
144
+ title: string;
145
+ /**
146
+ * The plot subtitle, rendered as H3 tag above the SVG element. Instead of
147
+ * using the subtitle, you can also pass a "header" snippet and render your
148
+ * own custom title markup.
149
+ */
150
+ subtitle: string;
151
+ /**
152
+ * The plot caption, rendered as FIGCAPTION tag below the SVG element. Instead of
153
+ * using the caption, you can also pass a "footer" snippet and render your
154
+ * own custom title markup.
155
+ */
156
+ caption: string;
157
+ /**
158
+ * By default, the plot will extend to fit 100% of the parent container width. By
159
+ * setting the maxWidth style property you can limit the width of your plot.
160
+ */
56
161
  maxWidth?: string;
57
- inset?: number;
58
- grid?: boolean;
59
- frame?: boolean;
60
- title?: string;
61
- subtitle?: string;
62
- caption?: string;
63
- onmousemove?: MouseEventHandler<SVGElement>;
64
- header?: Snippet<Plot>;
65
- footer?: Snippet<Plot>;
66
- children?: Snippet<Plot>;
67
- overlay?: Snippet<Plot>;
68
- radius?: {
69
- range?: [number, number];
70
- };
71
- x?: PositionChannelOptions & {
72
- axis?: AxisXAnchor | {
73
- anchor: AxisXAnchor;
74
- tickSpacing: number;
75
- };
76
- };
77
- y?: PositionChannelOptions & {
78
- axis?: AxisYAnchor | {
79
- anchor: AxisYAnchor;
80
- tickSpacing: number;
81
- };
82
- };
83
- symbol?: {
84
- range?: string[];
85
- legend?: boolean;
86
- } | null;
87
- color?: {
88
- range?: string[];
89
- domain: RawValue[];
90
- scheme?: ColorScheme;
91
- legend?: boolean;
92
- } | null;
93
- };
94
- export type Margins = {
95
- top: number;
96
- left: number;
97
- bottom: number;
98
- right: number;
99
- };
100
- export type GridProps = {
101
- tickFormat?: (d: any) => string;
102
- };
103
- export type DataRecord = Record<string, RawValue>;
104
- export type DataRow = DataRecord | RawValue | [number, number];
105
- export type ChannelAccessor = RawValue | ((d: DataRow) => RawValue) | null;
106
- export type RawValue = number | Date | boolean | string | null;
107
- export type ChannelName = 'opacity' | 'color' | 'x' | 'y' | 'angle' | 'radius' | 'symbol' | 'width';
108
- export type MarkStyleProps = 'strokeDasharray' | 'opacity' | 'fill' | 'fillOpacity' | 'fontSize' | 'stroke' | 'strokeWidth' | 'strokeOpacity' | 'x' | 'y' | 'angle' | 'radius' | 'symbol' | 'width';
109
- export type MarkProps2 = 'x' | 'y' | 'r' | 'rotate' | 'symbol';
110
- export type ValueOf<T> = T[keyof T];
111
- export type ChannelType = ValueOf<typeof CHANNEL_TYPES>;
112
- export interface MarkProps {
113
- data: DataRow[];
114
- }
115
- export type BaseMarkProps = MarkProps & {
116
- type: string;
117
- channels: ChannelName[];
118
- automatic: boolean;
119
- };
120
- export type BaseMarkStyleProps = {
121
- fill?: ChannelAccessor;
122
- stroke?: ChannelAccessor;
123
- opacity?: ChannelAccessor;
124
- fillOpacity?: ChannelAccessor;
125
- strokeOpacity?: ChannelAccessor;
126
- strokeWidth?: ChannelAccessor;
127
- strokeDasharray?: ChannelAccessor;
128
- };
129
- export type FrameProps = BaseMarkStyleProps;
130
- export type DotMarkProps = MarkProps & BaseMarkStyleProps & {
131
- data: DataRow[];
132
- x?: ChannelAccessor;
133
- y?: ChannelAccessor;
134
- r?: ChannelAccessor;
135
- rotate?: ChannelAccessor;
136
- symbol?: ChannelAccessor;
162
+ /**
163
+ * force the plot into a fixed height
164
+ */
165
+ height: 'auto' | number | ((d: number) => number);
166
+ /**
167
+ * Convenience option for setting all four margins at once, in px.
168
+ */
169
+ margin: number;
170
+ /**
171
+ * Left margin of the plot, in px.
172
+ */
173
+ marginLeft: number;
174
+ /**
175
+ * Right margin of the plot, in px.
176
+ */
177
+ marginRight: number;
178
+ /**
179
+ * Top margin of the plot, in px.
180
+ */
181
+ marginTop: number;
182
+ /**
183
+ * Bottom margin of the plot, in px.
184
+ */
185
+ marginBottom: number;
186
+ /**
187
+ * Activates the implicit GridX and GridY marks.
188
+ */
189
+ grid: boolean;
190
+ /**
191
+ * Activates the implicit AxisX and AxisY marks.
192
+ */
193
+ axes: boolean;
194
+ /**
195
+ * Activates the implicit frame marks
196
+ */
197
+ frame: boolean;
198
+ /**
199
+ * Convenience shortcut for setting both the x and y scale insets.
200
+ */
201
+ inset: number;
202
+ /**
203
+ * Convenience shortcut for setting both the x and y scale paddings
204
+ */
205
+ padding: number;
206
+ /**
207
+ * Geo-projection
208
+ */
209
+ projection: string | null;
210
+ /**
211
+ * if not null, computes a default height such that a variation of one
212
+ * unit in the x dimension is represented by the corresponding number
213
+ * of pixels as a variation in the y dimension of one unit.
214
+ */
215
+ aspectRatio: number | null;
216
+ /**
217
+ * Top-level faceting options
218
+ */
219
+ facet: Partial<{
220
+ /**
221
+ * The data to facet by. Turns on automatic faceting for all marks that
222
+ * use the exact same data (===)
223
+ */
224
+ data: DataRecord[];
225
+ x: ChannelAccessor;
226
+ y: ChannelAccessor;
227
+ }>;
228
+ /**
229
+ * Options for the shared x scale.
230
+ */
231
+ x: Partial<XScaleOptions>;
232
+ /**
233
+ * Options for the shared y scale
234
+ */
235
+ y: Partial<YScaleOptions>;
236
+ /**
237
+ * Options for the shared radius scale
238
+ */
239
+ r: ScaleOptions;
240
+ color: ColorScaleOptions;
241
+ opacity: ScaleOptions;
242
+ symbol: LegendScaleOptions;
243
+ length: ScaleOptions;
244
+ fx: Partial<ScaleOptions>;
245
+ fy: Partial<ScaleOptions>;
246
+ children: Snippet<[
247
+ {
248
+ width: number;
249
+ height: number;
250
+ options: PlotOptions;
251
+ scales: PlotScales;
252
+ }
253
+ ]>;
254
+ /**
255
+ * You can use the header snippet to render a custom title and subtitle for
256
+ * your plot, or place a legend above the visualization.
257
+ */
258
+ header: Snippet;
259
+ footer: Snippet;
260
+ /**
261
+ * The underlay snippet is useful for adding a layer of custom HTML markup
262
+ * behind the SVG body of your plot, e.g. for a watermark or background image.
263
+ */
264
+ underlay: Snippet<[PlotOptions]>;
265
+ /**
266
+ * The overlay snippet is useful for adding a layer of custom HTML markup
267
+ * in front of the SVG body of your plot, e.g. for HTML tooltips.
268
+ */
269
+ overlay: Snippet;
270
+ facetAxes: Snippet;
271
+ /**
272
+ * if you set testid, the plot container will get a data-testid attribute which
273
+ * can be useful for automatic testing
274
+ */
275
+ testid: string;
276
+ /**
277
+ * in case you want to give your Plot element an extra CSS class
278
+ */
279
+ class: string | null;
280
+ /**
281
+ * if set to true, the plot will use the implicit scales
282
+ */
283
+ implicitScales: boolean;
284
+ /**
285
+ * locale used for automatic axis ticks
286
+ */
287
+ locale: string;
288
+ /**
289
+ *
290
+ */
291
+ css: (d: string) => string;
292
+ };
293
+ export type PlotDefaults = {
294
+ axisXAnchor: AxisXAnchor;
295
+ axisYAnchor: AxisYAnchor;
296
+ xTickSpacing: number;
297
+ yTickSpacing: number;
298
+ height: number;
299
+ inset: number;
300
+ colorScheme: ColorScheme | string[];
301
+ categoricalColorScheme: ColorScheme | string[];
302
+ dotRadius: number;
303
+ /**
304
+ * for computing the automatic height based on the number of
305
+ * domain items in a point scale
306
+ */
307
+ pointScaleHeight: number;
308
+ /**
309
+ * for computing the automatic height based on the number of
310
+ * domain items in a band scale
311
+ */
312
+ bandScaleHeight: number;
313
+ /**
314
+ * add frame to plots by default
315
+ */
316
+ frame: boolean;
317
+ grid: boolean;
318
+ axes: boolean;
319
+ /**
320
+ * initial width of the plot before measuring the actual width
321
+ */
322
+ initialWidth: number;
323
+ /**
324
+ * locale, used for automatic axis ticks
325
+ */
326
+ locale: string;
327
+ /**
328
+ * default number format for axis ticks
329
+ */
330
+ numberFormat: Intl.NumberFormatOptions;
331
+ markerDotRadius: number;
332
+ };
333
+ export type GenericMarkOptions = Record<string, any>;
334
+ export type DataRecord = Record<string, RawValue> & {
335
+ ___orig___?: RawValue | [RawValue, RawValue];
336
+ };
337
+ export type ResolvedDataRecord = Partial<Record<ScaledChannelName, any>> & {
338
+ datum: DataRecord;
339
+ };
340
+ export type ScaledDataRecord = Partial<Record<ScaledChannelName, number | string | boolean | undefined>> & {
341
+ datum: DataRecord;
342
+ valid: Boolean;
137
343
  };
138
- export type LineMarkProps = MarkProps & BaseMarkStyleProps & {
344
+ export type DataRow = DataRecord | RawValue | [number, number] | null;
345
+ export type PlotScale = {
346
+ type: ScaleType;
347
+ domain: RawValue[];
348
+ range: RawValue[];
349
+ autoTitle?: string;
350
+ /**
351
+ * The number of marks that are using this scale.
352
+ */
353
+ manualActiveMarks: number;
354
+ /**
355
+ * Set of accessors used in channels that are bound to this scale.
356
+ */
357
+ uniqueScaleProps: Set<ChannelAccessor>;
358
+ skip: Map<ScaledChannelName, Set<symbol>>;
359
+ fn: ScaleLinear<RawValue, number> & ScaleBand<RawValue> & ScaleOrdinal<string | Date, number> & ScaleOrdinal<string | Date, string>;
360
+ };
361
+ export type CurveName = 'basis' | 'basis-closed' | 'basis-open' | 'bundle' | 'bump-x' | 'bump-y' | 'cardinal' | 'cardinal-closed' | 'cardinal-open' | 'catmull-rom' | 'catmull-rom-closed' | 'catmull-rom-open' | 'linear' | 'linear-closed' | 'monotone-x' | 'monotone-y' | 'natural' | 'step' | 'step-after' | 'step-before';
362
+ export type MarkerOptions = {
363
+ /**
364
+ * the marker for the starting point of a line segment
365
+ */
366
+ markerStart?: boolean | MarkerShape | Snippet;
367
+ /**
368
+ * the marker for any intermediate point of a line segment
369
+ */
370
+ markerMid?: boolean | MarkerShape | Snippet;
371
+ /**
372
+ * the marker for the end point of a line segment
373
+ */
374
+ markerEnd?: boolean | MarkerShape | Snippet;
375
+ /**
376
+ * shorthand for setting the marker on all points
377
+ */
378
+ marker?: boolean | MarkerShape | Snippet;
379
+ };
380
+ export type PlotScales = Record<ScaleName, PlotScale>;
381
+ export type ChannelAccessor = RawValue | ((d: DataRow) => RawValue) | null | undefined;
382
+ export type ConstantAccessor<T> = T | ((d: DataRow) => T) | null | undefined;
383
+ export type PlotState = {
384
+ width: number;
385
+ height: number;
386
+ options: PlotOptions;
387
+ facetWidth: number;
388
+ facetHeight: number;
389
+ plotWidth: number;
390
+ plotHeight: number;
391
+ scales: PlotScales;
392
+ body: HTMLDivElement;
393
+ /**
394
+ * True if there's a color scale and a symbol scale and both are bound to the same
395
+ * single channel accessor.
396
+ */
397
+ colorSymbolRedundant: boolean;
398
+ /**
399
+ * True if the plot is using filled dot marks.
400
+ */
401
+ hasFilledDotMarks: boolean;
402
+ css: ((d: string) => string) | null;
403
+ };
404
+ export type PlotContext = {
405
+ /**
406
+ * Registers a mark with the Plot component along with its
407
+ * data and the channel mappings.
408
+ */
409
+ addMark: (mark: Mark<GenericMarkOptions>) => Mark<GenericMarkOptions>;
410
+ /**
411
+ * Updates a mark after either the data or the channel mappings
412
+ * have been updated.
413
+ */
414
+ updateMark: (mark: Mark<GenericMarkOptions>) => void;
415
+ /**
416
+ * Unregister a mark from the Plot component after the mark
417
+ * component has been destroyed.
418
+ */
419
+ removeMark: (mark: Mark<GenericMarkOptions>) => void;
420
+ getPlotState: () => PlotState;
421
+ getTopLevelFacet: () => PlotOptions['facet'];
422
+ /**
423
+ * Updates the plots internal facetWidth and facetHeight dimensions
424
+ * which are used as range for the positional scales x and y.
425
+ */
426
+ updateDimensions: (width: number, height: number) => void;
427
+ };
428
+ type FacetState = {
429
+ fx: RawValue;
430
+ fy: RawValue;
431
+ /**
432
+ * True, if the facet is the leftmost in its row
433
+ */
434
+ left: boolean;
435
+ /**
436
+ * True, if the facet is the topmost in its column
437
+ */
438
+ top: boolean;
439
+ /**
440
+ * True, if the facet is the rightmost in its row
441
+ */
442
+ right: boolean;
443
+ /**
444
+ * True, if the facet is the bottommost in its column
445
+ */
446
+ bottom: boolean;
447
+ /**
448
+ * True, if the adjacent facet to the top is empty
449
+ */
450
+ topEmpty: boolean;
451
+ /**
452
+ * True, if the adjacent facet to the bottom is empty
453
+ */
454
+ bottomEmpty: boolean;
455
+ /**
456
+ * True, if the adjacent facet to the left is empty
457
+ */
458
+ leftEmpty: boolean;
459
+ /**
460
+ * True, if the adjacent facet to the right is empty
461
+ */
462
+ rightEmpty: boolean;
463
+ };
464
+ /**
465
+ * Test if the given data record is visible in the current facet.
466
+ */
467
+ type TestFacetFunction = (datum: DataRecord, channels: Record<ChannelName, ChannelAccessor>) => boolean;
468
+ export type FacetContext = {
469
+ /**
470
+ * Returns a stateful function that tests whether a specific data
471
+ * record is visible in the current facet or not.
472
+ */
473
+ getTestFacet: () => TestFacetFunction;
474
+ getFacetState: () => FacetState;
475
+ };
476
+ export type BaseMarkProps = Partial<{
477
+ /**
478
+ * Filter the data without modifying the inferred scales
479
+ */
480
+ filter?: ConstantAccessor<boolean>;
481
+ facet?: 'auto' | 'include' | 'exclude';
482
+ fx: ChannelAccessor;
483
+ fy: ChannelAccessor;
484
+ dx: ConstantAccessor<number>;
485
+ dy: ConstantAccessor<number>;
486
+ fill: ConstantAccessor<string>;
487
+ fillOpacity: ConstantAccessor<number>;
488
+ stroke: ConstantAccessor<string>;
489
+ strokeWidth: ConstantAccessor<number>;
490
+ strokeOpacity: ConstantAccessor<number>;
491
+ strokeLinejoin: ConstantAccessor<'bevel' | 'miter' | 'miter-clip' | 'round'>;
492
+ strokeLinecap: ConstantAccessor<'butt' | 'square' | 'round'>;
493
+ strokeMiterlimit: ConstantAccessor<number>;
494
+ opacity: ConstantAccessor<number>;
495
+ strokeDasharray: ConstantAccessor<string>;
496
+ strokeDashoffset: ConstantAccessor<number>;
497
+ mixBlendMode: ConstantAccessor<'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'plus-darker' | 'plus-lighter'>;
498
+ clipPath: string;
499
+ imageFilter: ConstantAccessor<string>;
500
+ shapeRendering: ConstantAccessor<'crispEdges' | 'geometricPrecision' | 'optimizeSpeed' | 'auto'>;
501
+ paintOrder: ConstantAccessor<string>;
502
+ onclick?: MouseEventHandler<SVGPathElement>;
503
+ ondblclick?: MouseEventHandler<SVGPathElement>;
504
+ onmouseup?: MouseEventHandler<SVGPathElement>;
505
+ onmousedown?: MouseEventHandler<SVGPathElement>;
506
+ onmouseenter?: MouseEventHandler<SVGPathElement>;
507
+ onmousemove?: MouseEventHandler<SVGPathElement>;
508
+ onmouseleave?: MouseEventHandler<SVGPathElement>;
509
+ onmouseout?: MouseEventHandler<SVGPathElement>;
510
+ ondrag?: MouseEventHandler<SVGPathElement>;
511
+ ondrop?: MouseEventHandler<SVGPathElement>;
512
+ ondragstart?: MouseEventHandler<SVGPathElement>;
513
+ ondragenter?: MouseEventHandler<SVGPathElement>;
514
+ ondragleave?: MouseEventHandler<SVGPathElement>;
515
+ ondragover?: MouseEventHandler<SVGPathElement>;
516
+ ondragend?: MouseEventHandler<SVGPathElement>;
517
+ ontouchstart?: MouseEventHandler<SVGPathElement>;
518
+ ontouchmove?: MouseEventHandler<SVGPathElement>;
519
+ ontouchend?: MouseEventHandler<SVGPathElement>;
520
+ ontouchcancel?: MouseEventHandler<SVGPathElement>;
521
+ oncontextmenu?: MouseEventHandler<SVGPathElement>;
522
+ onwheel?: MouseEventHandler<SVGPathElement>;
523
+ /**
524
+ * simple browser tooltip to be displayed on mouseover
525
+ */
526
+ title: ConstantAccessor<string>;
527
+ /**
528
+ * if set, the mark element will be wrapped in a <a> link
529
+ * element
530
+ */
531
+ href: ConstantAccessor<string>;
532
+ target: ConstantAccessor<'_self' | '_blank' | string>;
533
+ /**
534
+ * if you want to give your mark element an extra CSS class
535
+ */
536
+ class: string;
537
+ }>;
538
+ export type BaseRectMarkProps = {
539
+ rx?: ConstantAccessor<number>;
540
+ ry?: ConstantAccessor<number>;
541
+ inset?: ConstantAccessor<number>;
542
+ insetLeft?: ConstantAccessor<number>;
543
+ insetTop?: ConstantAccessor<number>;
544
+ insetRight?: ConstantAccessor<number>;
545
+ insetBottom?: ConstantAccessor<number>;
546
+ };
547
+ export type Channels = Record<string, ChannelAccessor | ConstantAccessor<string | number | boolean>>;
548
+ export type TransformArg<K> = Channels & {
549
+ data: K[];
550
+ };
551
+ export type MapArg<K> = Channels & {
552
+ data: K[];
553
+ };
554
+ export type TransformArgsRow = Partial<Channels> & {
139
555
  data: DataRow[];
140
- x?: ChannelAccessor;
141
- y?: ChannelAccessor;
142
- z?: ChannelAccessor;
143
- sort?: ChannelAccessor | {
144
- channel: 'stroke' | 'fill';
145
- };
146
556
  };
147
- export type GridOptions = {
148
- ticks?: RawValue[];
149
- strokeDasharray?: ChannelAccessor;
150
- stroke?: ChannelAccessor;
151
- strokeWidth?: ChannelAccessor;
152
- };
153
- export type GridXMarkProps = Partial<MarkProps> & GridOptions & {
154
- y1?: ChannelAccessor;
155
- y2?: ChannelAccessor;
156
- automatic?: boolean;
157
- };
158
- export type GridYMarkProps = Partial<MarkProps> & GridOptions & {
159
- x1?: ChannelAccessor;
160
- x2?: ChannelAccessor;
161
- automatic?: boolean;
162
- };
163
- export type AxisMarkOptions = {
164
- ticks?: RawValue[];
165
- automatic?: boolean;
166
- tickSize?: number;
167
- tickPadding?: number;
168
- tickFormat?: ((d: RawValue) => string) | string;
169
- tickFontSize?: ChannelAccessor;
170
- title?: string;
171
- stroke?: ChannelAccessor;
172
- fill?: ChannelAccessor;
173
- };
174
- export type AxisXMarkProps = AxisMarkOptions & {
175
- anchor?: 'top' | 'bottom';
176
- };
177
- export type AxisYMarkProps = AxisMarkOptions & {
178
- anchor?: 'left' | 'right';
179
- };
180
- type RuleMarkProps = {
181
- stroke?: ChannelAccessor;
182
- opacity?: ChannelAccessor;
183
- strokeOpacity?: ChannelAccessor;
184
- strokeDasharray?: ChannelAccessor;
185
- strokeWidth?: ChannelAccessor;
186
- };
187
- export type RuleXMarkProps = MarkProps & RuleMarkProps & {
188
- x?: ChannelAccessor;
189
- y1?: ChannelAccessor;
190
- y2?: ChannelAccessor;
191
- };
192
- export type RuleYMarkProps = MarkProps & RuleMarkProps & {
193
- y?: ChannelAccessor;
194
- x1?: ChannelAccessor;
195
- x2?: ChannelAccessor;
196
- };
197
- export type ColorScheme = 'brbg' | 'prgn' | 'piyg' | 'puor' | 'rdbu' | 'rdgy' | 'rdylbu' | 'rdylgn' | 'spectral' | 'burd' | 'buylrd' | 'blues' | 'greens' | 'greys' | 'oranges' | 'purples' | 'reds' | 'turbo' | 'viridis' | 'magma' | 'inferno' | 'plasma' | 'cividis' | 'cubehelix' | 'warm' | 'cool' | 'bugn' | 'bupu' | 'gnbu' | 'orrd' | 'pubu' | 'pubugn' | 'purd' | 'rdpu' | 'ylgn' | 'ylgnbu' | 'ylorbr' | 'ylorrd' | 'rainbow' | 'sinebow' | 'accent' | 'category10' | 'dark2' | 'paired' | 'pastel1' | 'pastel2' | 'set1' | 'set2' | 'set3' | 'tableau10';
557
+ export type TransformArgsRecord = Partial<Channels> & {
558
+ data: DataRecord[];
559
+ };
560
+ export type ColorScheme = 'brbg' | 'prgn' | 'piyg' | 'puor' | 'rdbu' | 'rdgy' | 'rdylbu' | 'rdylgn' | 'spectral' | 'burd' | 'buylrd' | 'blues' | 'greens' | 'grays' | 'greys' | 'oranges' | 'purples' | 'reds' | 'turbo' | 'viridis' | 'magma' | 'inferno' | 'plasma' | 'cividis' | 'cubehelix' | 'warm' | 'cool' | 'bugn' | 'bupu' | 'gnbu' | 'orrd' | 'pubu' | 'pubugn' | 'purd' | 'rdpu' | 'ylgn' | 'ylgnbu' | 'ylorbr' | 'ylorrd' | 'rainbow' | 'sinebow' | 'accent' | 'category10' | 'dark2' | 'paired' | 'pastel1' | 'pastel2' | 'set1' | 'set2' | 'set3' | 'tableau10' | 'observable10';
561
+ export type MarkStyleProps = 'strokeDasharray' | 'strokeLinejoin' | 'strokeLinecap' | 'opacity' | 'cursor' | 'pointerEvents' | 'blend' | 'fill' | 'fillOpacity' | 'fontWeight' | 'fontSize' | 'fontStyle' | 'stroke' | 'strokeWidth' | 'strokeOpacity' | 'x' | 'y' | 'clipPath' | 'mask' | 'filter' | 'angle' | 'radius' | 'symbol' | 'textAnchor' | 'width';
562
+ export type AutoMarginStores = {
563
+ autoMarginTop: Writable<Map<string, number>>;
564
+ autoMarginLeft: Writable<Map<string, number>>;
565
+ autoMarginRight: Writable<Map<string, number>>;
566
+ autoMarginBottom: Writable<Map<string, number>>;
567
+ };
568
+ /**
569
+ * these are the default options for the plot marks that can be set using
570
+ * the 'svelteplot/defaults' context.
571
+ */
572
+ export type DefaultOptions = {
573
+ /**
574
+ * default plot height
575
+ */
576
+ height: number;
577
+ /**
578
+ * default plot inset
579
+ */
580
+ inset: number;
581
+ /**
582
+ * default tick line length
583
+ */
584
+ tickSize: number;
585
+ /**
586
+ * default padding between tick line and tick label
587
+ */
588
+ tickPadding: number;
589
+ /**
590
+ * default font size for tick labels
591
+ */
592
+ tickFontSize: number;
593
+ /**
594
+ * default anchor for x axis
595
+ */
596
+ axisXAnchor: 'bottom' | 'top';
597
+ /**
598
+ * default anchor for y axis
599
+ */
600
+ axisYAnchor: 'left' | 'right';
601
+ /**
602
+ * default spacing between ticks in AxisX and GridX
603
+ */
604
+ xTickSpacing: number;
605
+ /**
606
+ * default spacing between ticks in AxisY and GridY
607
+ */
608
+ yTickSpacing: number;
609
+ /**
610
+ * default color scheme
611
+ */
612
+ colorScheme: ColorScheme;
613
+ /**
614
+ * default step for graticule, in degrees
615
+ */
616
+ graticuleStep: number;
617
+ /**
618
+ * locale, used for automatic axis ticks
619
+ */
620
+ locale: string;
621
+ /**
622
+ * default number format for axis ticks
623
+ */
624
+ numberFormat: Intl.NumberFormatOptions;
625
+ /**
626
+ * default dot radius for line markers, used in dot, circle, and circle-stroke markers
627
+ */
628
+ markerDotRadius: number;
629
+ };
630
+ export type MapIndexObject = {
631
+ mapIndex: (I: number[], S: RawValue[], T: RawValue[]) => void;
632
+ };
633
+ export type MapMethod = 'cumsum' | 'rank' | 'quantile' | ((I: number[], S: number[]) => number[]) | MapIndexObject;
634
+ export type MapOptions = Partial<Record<ScaledChannelName, MapMethod>>;
198
635
  export {};