ggaction 0.0.12 → 0.0.15

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 (378) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +20 -11
  3. package/knowledge/action-card.schema.json +1 -1
  4. package/knowledge/action-cards.json +1 -1
  5. package/knowledge/action-cards.schema.json +1 -1
  6. package/knowledge/extension-authoring.md +2 -1
  7. package/knowledge/intent-taxonomy.json +1 -1
  8. package/knowledge/mcp-resources.json +1 -1
  9. package/knowledge/task-resolver.js +1 -1
  10. package/package.json +10 -3
  11. package/src/actions/basic.js +4 -2
  12. package/src/actions/boxPlots/components.js +14 -4
  13. package/src/actions/boxPlots/edit.js +31 -5
  14. package/src/actions/boxPlots/materialize.js +13 -4
  15. package/src/actions/boxPlots/options.js +48 -16
  16. package/src/actions/canvas/actions.js +3 -1
  17. package/src/actions/canvas/fitting.js +211 -0
  18. package/src/actions/canvas/index.js +2 -0
  19. package/src/actions/categoryOrder/index.js +18 -6
  20. package/src/actions/charts/area.js +51 -0
  21. package/src/actions/charts/bar.js +13 -6
  22. package/src/actions/charts/beeswarm.js +70 -0
  23. package/src/actions/charts/density.js +48 -0
  24. package/src/actions/charts/ecdf.js +186 -0
  25. package/src/actions/charts/endpoints.js +473 -0
  26. package/src/actions/charts/heatmap.js +4 -3
  27. package/src/actions/charts/histogram.js +5 -4
  28. package/src/actions/charts/horizon.js +73 -0
  29. package/src/actions/charts/index.js +37 -0
  30. package/src/actions/charts/interval-regression.js +172 -0
  31. package/src/actions/charts/line.js +8 -6
  32. package/src/actions/charts/parallel.js +8 -2
  33. package/src/actions/charts/pie.js +52 -0
  34. package/src/actions/charts/polar.js +134 -0
  35. package/src/actions/charts/radar.js +305 -0
  36. package/src/actions/charts/radial.js +50 -0
  37. package/src/actions/charts/raincloud.js +422 -0
  38. package/src/actions/charts/rug-strip.js +283 -0
  39. package/src/actions/charts/scatter.js +11 -3
  40. package/src/actions/charts/shared.js +69 -10
  41. package/src/actions/composition/actions.js +129 -3
  42. package/src/actions/coordinates/actions.js +1 -1
  43. package/src/actions/coordinates/edit.js +76 -0
  44. package/src/actions/data/bin.js +29 -0
  45. package/src/actions/data/bin2d.js +57 -185
  46. package/src/actions/data/complete.js +26 -0
  47. package/src/actions/data/computed.js +24 -0
  48. package/src/actions/data/create.js +2 -2
  49. package/src/actions/data/density.js +12 -20
  50. package/src/actions/data/derived.js +111 -15
  51. package/src/actions/data/ecdf.js +38 -0
  52. package/src/actions/data/edit.js +539 -0
  53. package/src/actions/data/filter.js +226 -30
  54. package/src/actions/data/fold.js +24 -0
  55. package/src/actions/data/impute.js +26 -0
  56. package/src/actions/data/index.js +38 -0
  57. package/src/actions/data/interval.js +2 -0
  58. package/src/actions/data/intervalEdit.js +86 -4
  59. package/src/actions/data/normalize.js +27 -0
  60. package/src/actions/data/regression.js +19 -21
  61. package/src/actions/data/revisionBindings.js +145 -0
  62. package/src/actions/data/shared.js +20 -4
  63. package/src/actions/data/stack.js +26 -0
  64. package/src/actions/data/summary.js +26 -0
  65. package/src/actions/data/timeUnit.js +4 -1
  66. package/src/actions/data/window.js +1 -1
  67. package/src/actions/encodings/appearance.js +32 -13
  68. package/src/actions/encodings/barWidth.js +8 -0
  69. package/src/actions/encodings/basic.js +2 -0
  70. package/src/actions/encodings/channels.js +415 -0
  71. package/src/actions/encodings/color/continuous.js +19 -59
  72. package/src/actions/encodings/color/index.js +30 -23
  73. package/src/actions/encodings/color/layout.js +3 -97
  74. package/src/actions/encodings/color/policy.js +5 -8
  75. package/src/actions/encodings/density/resolve.js +37 -5
  76. package/src/actions/encodings/density.js +124 -34
  77. package/src/actions/encodings/histogram.js +3 -2
  78. package/src/actions/encodings/horizon/resolve.js +8 -4
  79. package/src/actions/encodings/horizon.js +18 -8
  80. package/src/actions/encodings/index.js +6 -0
  81. package/src/actions/encodings/offset.js +30 -29
  82. package/src/actions/encodings/parallel.js +2 -8
  83. package/src/actions/encodings/position/apply.js +63 -11
  84. package/src/actions/encodings/position/index.js +52 -6
  85. package/src/actions/encodings/position/policies/arc.js +14 -0
  86. package/src/actions/encodings/position/policies/area.js +4 -42
  87. package/src/actions/encodings/position/policies/bar.js +57 -13
  88. package/src/actions/encodings/position/resolve.js +88 -26
  89. package/src/actions/encodings/ranged.js +123 -97
  90. package/src/actions/encodings/remove.js +44 -34
  91. package/src/actions/encodings/ruleAppearance.js +24 -32
  92. package/src/actions/encodings/seriesLayout.js +105 -0
  93. package/src/actions/encodings/shared.js +107 -37
  94. package/src/actions/encodings/stroke.js +226 -0
  95. package/src/actions/encodings/strokeDash.js +9 -6
  96. package/src/actions/encodings/temporal.js +7 -0
  97. package/src/actions/encodings/text.js +30 -15
  98. package/src/actions/errorBands/create.js +41 -8
  99. package/src/actions/errorBands/edit.js +360 -25
  100. package/src/actions/errorBars/create.js +56 -17
  101. package/src/actions/errorBars/edit.js +372 -21
  102. package/src/actions/facets/actions.js +619 -41
  103. package/src/actions/facets/derive.js +139 -25
  104. package/src/actions/gradientPlots/components.js +43 -13
  105. package/src/actions/gradientPlots/edit.js +14 -4
  106. package/src/actions/gradientPlots/materialize.js +8 -8
  107. package/src/actions/gradientPlots/options.js +10 -2
  108. package/src/actions/guides/applicability.js +28 -19
  109. package/src/actions/guides/axes/axes.js +4 -3
  110. package/src/actions/guides/axes/axis.js +18 -18
  111. package/src/actions/guides/axes/components.js +43 -0
  112. package/src/actions/guides/axes/edit.js +16 -51
  113. package/src/actions/guides/axes/labels.js +184 -28
  114. package/src/actions/guides/axes/lines.js +13 -7
  115. package/src/actions/guides/axes/parallel/lifecycle.js +117 -0
  116. package/src/actions/guides/axes/parallel/policy.js +137 -0
  117. package/src/actions/guides/axes/parallel/resolve.js +50 -25
  118. package/src/actions/guides/axes/parallel.js +93 -217
  119. package/src/actions/guides/axes/policy.js +21 -67
  120. package/src/actions/guides/axes/tickGroups.js +15 -8
  121. package/src/actions/guides/axes/ticks.js +11 -6
  122. package/src/actions/guides/axes/titles.js +32 -11
  123. package/src/actions/guides/basic.js +2 -0
  124. package/src/actions/guides/facade.js +106 -0
  125. package/src/actions/guides/facadeAxes.js +200 -0
  126. package/src/actions/guides/facadeLegend.js +63 -0
  127. package/src/actions/guides/grids/grid.js +37 -33
  128. package/src/actions/guides/grids/resolve.js +17 -4
  129. package/src/actions/guides/guides.js +54 -31
  130. package/src/actions/guides/legends/blocks.js +426 -0
  131. package/src/actions/guides/legends/categorical/actions.js +309 -279
  132. package/src/actions/guides/legends/categorical/components.js +21 -17
  133. package/src/actions/guides/legends/categorical/index.js +37 -33
  134. package/src/actions/guides/legends/categorical/layout.js +123 -354
  135. package/src/actions/guides/legends/categorical/options.js +32 -16
  136. package/src/actions/guides/legends/categorical/recipes.js +114 -9
  137. package/src/actions/guides/legends/categorical/resolve.js +30 -15
  138. package/src/actions/guides/legends/categorical/symbols.js +87 -33
  139. package/src/actions/guides/legends/continuous/common.js +99 -26
  140. package/src/actions/guides/legends/continuous/gradient.js +120 -89
  141. package/src/actions/guides/legends/continuous/index.js +8 -2
  142. package/src/actions/guides/legends/continuous/interval.js +79 -95
  143. package/src/actions/guides/legends/continuous/opacity.js +113 -89
  144. package/src/actions/guides/legends/continuous/stroke.js +525 -0
  145. package/src/actions/guides/legends/creation.js +40 -0
  146. package/src/actions/guides/legends/edit.js +321 -90
  147. package/src/actions/guides/legends/focused.js +2 -2
  148. package/src/actions/guides/legends/index.js +2 -0
  149. package/src/actions/guides/legends/lane.js +149 -102
  150. package/src/actions/guides/legends/lifecycle.js +143 -0
  151. package/src/actions/guides/legends/remove.js +43 -78
  152. package/src/actions/guides/legends/sampling.js +140 -0
  153. package/src/actions/guides/legends/size.js +213 -116
  154. package/src/actions/guides/legends/strokeWidth.js +121 -73
  155. package/src/actions/guides/legends/target.js +123 -0
  156. package/src/actions/guides/legends/transition.js +192 -0
  157. package/src/actions/guides/polar/axes/facade.js +81 -66
  158. package/src/actions/guides/polar/axes/labels.js +28 -8
  159. package/src/actions/guides/polar/axes/lines.js +12 -5
  160. package/src/actions/guides/polar/axes/shared.js +22 -0
  161. package/src/actions/guides/polar/axes/ticks.js +6 -5
  162. package/src/actions/guides/polar/axes/titles.js +6 -5
  163. package/src/actions/guides/polar/grids.js +8 -8
  164. package/src/actions/guides/polar/resolve.js +12 -8
  165. package/src/actions/guides/reuse.js +44 -0
  166. package/src/actions/guides/tickValues.js +19 -21
  167. package/src/actions/index.js +15 -2
  168. package/src/actions/intervals/resolve.js +35 -15
  169. package/src/actions/marks/arc/actions.js +78 -20
  170. package/src/actions/marks/area/actions.js +51 -12
  171. package/src/actions/marks/area/materialize.js +22 -3
  172. package/src/actions/marks/bar/create.js +11 -2
  173. package/src/actions/marks/bar/edit.js +20 -3
  174. package/src/actions/marks/bar/materialize.js +33 -9
  175. package/src/actions/marks/index.js +14 -0
  176. package/src/actions/marks/line/actions.js +71 -113
  177. package/src/actions/marks/line/materialize.js +57 -56
  178. package/src/actions/marks/point/create.js +8 -2
  179. package/src/actions/marks/point/edit.js +29 -21
  180. package/src/actions/marks/point/index.js +1 -0
  181. package/src/actions/marks/point/jitter.js +3 -0
  182. package/src/actions/marks/point/materialize.js +154 -16
  183. package/src/actions/marks/point/packing.js +68 -0
  184. package/src/actions/marks/rect/actions.js +33 -12
  185. package/src/actions/marks/references.js +658 -0
  186. package/src/actions/marks/remove.js +87 -4
  187. package/src/actions/marks/rule/actions.js +77 -9
  188. package/src/actions/marks/rule/appearance.js +26 -0
  189. package/src/actions/marks/shared.js +13 -13
  190. package/src/actions/marks/text/actions.js +296 -13
  191. package/src/actions/marks/text/index.js +4 -0
  192. package/src/actions/marks/text/layout.js +156 -8
  193. package/src/actions/marks/text/removal.js +173 -0
  194. package/src/actions/marks/text/selection.js +73 -0
  195. package/src/actions/marks/tick/actions.js +22 -5
  196. package/src/actions/primitives/createGraphics.js +3 -1
  197. package/src/actions/primitives/editGraphics.js +26 -0
  198. package/src/actions/primitives/semantic.js +3 -2
  199. package/src/actions/primitives/semanticAction.js +120 -10
  200. package/src/actions/primitives/semanticValidation/guide.js +10 -0
  201. package/src/actions/primitives/semanticValidation/index.js +9 -1
  202. package/src/actions/primitives/semanticValidation/layer.js +23 -1
  203. package/src/actions/primitives/semanticValidation/scale.js +38 -8
  204. package/src/actions/regression/components.js +26 -11
  205. package/src/actions/regression/create.js +11 -3
  206. package/src/actions/regression/edit.js +40 -13
  207. package/src/actions/regression/resolve.js +1 -1
  208. package/src/actions/resources/index.js +7 -0
  209. package/src/actions/resources/remove.js +172 -0
  210. package/src/actions/scales/channels.js +212 -0
  211. package/src/actions/scales/consumers/common.js +21 -54
  212. package/src/actions/scales/consumers/families.js +28 -14
  213. package/src/actions/scales/consumers/index.js +42 -4
  214. package/src/actions/scales/consumers/seriesLayout.js +57 -12
  215. package/src/actions/scales/create.js +58 -26
  216. package/src/actions/scales/definitions.js +109 -39
  217. package/src/actions/scales/edit.js +101 -34
  218. package/src/actions/scales/editPolicy.js +95 -35
  219. package/src/actions/scales/index.js +6 -0
  220. package/src/actions/scales/materialize.js +14 -49
  221. package/src/actions/scales/offset.js +48 -0
  222. package/src/actions/scales/parallel.js +71 -0
  223. package/src/actions/scales/patch.js +1 -1
  224. package/src/actions/scales/preview.js +140 -0
  225. package/src/actions/scales/quantitativeColor.js +9 -5
  226. package/src/actions/selection/actions.js +154 -30
  227. package/src/actions/selection/index.js +3 -0
  228. package/src/actions/theme/actions.js +98 -0
  229. package/src/actions/theme/composition.js +238 -0
  230. package/src/actions/theme/index.js +16 -0
  231. package/src/actions/theme/reconcile.js +1130 -0
  232. package/src/actions/theme/state.js +160 -0
  233. package/src/actions/titles/actions.js +11 -10
  234. package/src/actions/titles/resolve.js +1 -40
  235. package/src/actions/violinPlots/create.js +90 -43
  236. package/src/actions/violinPlots/edit.js +192 -0
  237. package/src/actions/violinPlots/index.js +2 -0
  238. package/src/core/ChartProgram.js +7 -0
  239. package/src/core/action.js +32 -2
  240. package/src/core/compositionState.js +141 -8
  241. package/src/core/programState.js +20 -0
  242. package/src/core/resourceReferences.js +332 -0
  243. package/src/core/vocabulary.js +16 -3
  244. package/src/grammar/aggregate.js +66 -23
  245. package/src/grammar/arcs.js +58 -1
  246. package/src/grammar/areaEndpoints.js +46 -0
  247. package/src/grammar/areaSeries.js +87 -41
  248. package/src/grammar/bars/aggregate.js +37 -13
  249. package/src/grammar/bars/geometry.js +44 -0
  250. package/src/grammar/bars/policy.js +9 -7
  251. package/src/grammar/bin.js +226 -0
  252. package/src/grammar/categoryOrder.js +34 -0
  253. package/src/grammar/complete.js +279 -0
  254. package/src/grammar/computed.js +351 -0
  255. package/src/grammar/coordinates.js +37 -0
  256. package/src/grammar/density.js +239 -37
  257. package/src/grammar/displayLabels.js +57 -0
  258. package/src/grammar/ecdf.js +198 -0
  259. package/src/grammar/facets/dependencies.js +133 -1
  260. package/src/grammar/facets/guides.js +3 -0
  261. package/src/grammar/facets/index.js +123 -52
  262. package/src/grammar/facets/scales.js +15 -18
  263. package/src/grammar/fold.js +123 -0
  264. package/src/grammar/horizon.js +6 -4
  265. package/src/grammar/impute.js +340 -0
  266. package/src/grammar/interval.js +37 -20
  267. package/src/grammar/lineSeries.js +20 -63
  268. package/src/grammar/markFilter.js +22 -4
  269. package/src/grammar/markLabelSelection.js +57 -0
  270. package/src/grammar/markLabels.js +110 -0
  271. package/src/grammar/normalize.js +366 -0
  272. package/src/grammar/parallelAxisTitles.js +16 -0
  273. package/src/grammar/pathSeries.js +109 -0
  274. package/src/grammar/pointPacking.js +183 -0
  275. package/src/grammar/pointShapes.js +13 -4
  276. package/src/grammar/polar.js +90 -8
  277. package/src/grammar/positionDatum.js +12 -0
  278. package/src/grammar/rects.js +9 -1
  279. package/src/grammar/regression/derive.js +4 -0
  280. package/src/grammar/regression/index.js +8 -2
  281. package/src/grammar/regression/models.js +22 -7
  282. package/src/grammar/regression/parameters.js +63 -13
  283. package/src/grammar/rotation.js +29 -0
  284. package/src/grammar/roundedRect.js +180 -0
  285. package/src/grammar/rules.js +8 -21
  286. package/src/grammar/scales/color.js +23 -1
  287. package/src/grammar/scales/colorConsumers.js +57 -0
  288. package/src/grammar/scales/continuous.js +2 -2
  289. package/src/grammar/scales/definition.js +42 -5
  290. package/src/grammar/scales/discretized.js +11 -5
  291. package/src/grammar/scales/fields.js +38 -8
  292. package/src/grammar/scales/index.js +1 -0
  293. package/src/grammar/scales/mapping.js +2 -0
  294. package/src/grammar/scales/ordinal.js +12 -3
  295. package/src/grammar/scales/policies.js +2 -2
  296. package/src/grammar/scales/radial.js +55 -0
  297. package/src/grammar/scales/size.js +456 -0
  298. package/src/grammar/scales/types.js +1 -0
  299. package/src/grammar/schemas/concreteGraphic.js +14 -2
  300. package/src/grammar/schemas/graphic.js +15 -0
  301. package/src/grammar/schemas/graphicBounds.js +179 -30
  302. package/src/grammar/schemas/semanticPath.js +23 -4
  303. package/src/grammar/stack.js +170 -0
  304. package/src/grammar/statisticalReference.js +103 -0
  305. package/src/grammar/statistics/confidenceInterval.js +101 -0
  306. package/src/grammar/strokeStyle.js +77 -0
  307. package/src/grammar/summary.js +245 -0
  308. package/src/grammar/text.js +22 -16
  309. package/src/grammar/timeUnit.js +234 -13
  310. package/src/grammar/transformTopology.js +10 -0
  311. package/src/grammar/transforms.js +418 -16
  312. package/src/grammar/valueFormat.js +112 -0
  313. package/src/grammar/weightedStatistics.js +374 -0
  314. package/src/grammar/window.js +232 -21
  315. package/src/layout/aspect.js +80 -0
  316. package/src/layout/facets.js +100 -12
  317. package/src/layout/guideCollisions.js +12 -0
  318. package/src/layout/labels.js +343 -0
  319. package/src/layout/legend.js +2 -10
  320. package/src/layout/legendItems.js +102 -0
  321. package/src/layout/legendLane.js +100 -11
  322. package/src/materialization/bars/aggregate.js +56 -147
  323. package/src/materialization/bars/histogram.js +104 -20
  324. package/src/materialization/bars/ranged.js +19 -3
  325. package/src/materialization/bars/resolve.js +7 -4
  326. package/src/materialization/categorySlotOffset.js +40 -0
  327. package/src/materialization/composition.js +3 -1
  328. package/src/materialization/compositionSnapshot.js +1 -1
  329. package/src/materialization/coordinateBounds.js +204 -0
  330. package/src/materialization/dependencies.js +93 -16
  331. package/src/materialization/encodings.js +1 -1
  332. package/src/materialization/facetGuides/legacyCategorical.js +3 -0
  333. package/src/materialization/facetGuides/placement.js +8 -2
  334. package/src/materialization/facetGuides/preparation.js +12 -7
  335. package/src/materialization/facetHeaders.js +346 -0
  336. package/src/materialization/facets.js +23 -66
  337. package/src/materialization/guides/layout.js +57 -0
  338. package/src/materialization/guides/resources.js +28 -2
  339. package/src/materialization/legends.js +11 -2
  340. package/src/materialization/marks/capabilities.js +20 -5
  341. package/src/materialization/marks/grouping.js +52 -0
  342. package/src/materialization/marks/index.js +68 -27
  343. package/src/materialization/marks/policies.js +4 -1
  344. package/src/materialization/rect.js +55 -42
  345. package/src/materialization/rectConfig.js +5 -1
  346. package/src/materialization/rowEncoding.js +13 -13
  347. package/src/materialization/scaleGuideDependencies.js +8 -5
  348. package/src/materialization/scales/map.js +6 -3
  349. package/src/materialization/scales/policies/arc.js +42 -0
  350. package/src/materialization/scales/policies/binnedPosition.js +7 -4
  351. package/src/materialization/scales/policies/offset.js +50 -8
  352. package/src/materialization/scales/policies/series.js +5 -1
  353. package/src/materialization/scales/resolve.js +65 -17
  354. package/src/materialization/selection/compatibility.js +11 -0
  355. package/src/materialization/selection/items/arc.js +28 -4
  356. package/src/materialization/selection/items/bar.js +42 -71
  357. package/src/materialization/selection/items/common.js +27 -6
  358. package/src/materialization/selection/items/path.js +3 -13
  359. package/src/materialization/selection/items/rect.js +35 -8
  360. package/src/materialization/selection/path.js +1 -1
  361. package/src/materialization/selection/point.js +3 -1
  362. package/src/materialization/text.js +324 -14
  363. package/src/mcp/adapter.js +2 -2
  364. package/src/renderers/canvas/circle.js +2 -3
  365. package/src/renderers/canvas/line.js +2 -3
  366. package/src/renderers/canvas/native.js +4 -4
  367. package/src/renderers/canvas/path.js +2 -3
  368. package/src/renderers/canvas/rect.js +2 -3
  369. package/src/renderers/canvas/stroke.js +11 -0
  370. package/src/renderers/svg.js +19 -0
  371. package/src/selectors/datasets.js +44 -0
  372. package/src/selectors/layers.js +7 -2
  373. package/src/selectors/scales.js +6 -0
  374. package/src/theme/defaults.js +140 -0
  375. package/types/basic.d.ts +17 -2
  376. package/types/index.d.ts +211 -0
  377. package/types/program.d.ts +2182 -204
  378. package/src/materialization/bars/grouped.js +0 -144
@@ -1,5 +1,34 @@
1
1
  import type { RegisteredExtensionActions } from "./extension.js";
2
2
 
3
+ export type TemporalInputUnit = "auto" | "year" | "timestamp";
4
+ export type ThemeName = "light" | "dark";
5
+ export interface ThemeTokens {
6
+ background: string;
7
+ mark: string;
8
+ text: string;
9
+ strongText: string;
10
+ mutedText: string;
11
+ axis: string;
12
+ axisTitle: string;
13
+ grid: string;
14
+ border: string;
15
+ sizeSymbol: string;
16
+ regressionBand: string;
17
+ boxLine: string;
18
+ boxMedian: string;
19
+ referenceLine: string;
20
+ referenceBand: string;
21
+ gradientCenter: string;
22
+ highlight: string;
23
+ fontFamily: string;
24
+ }
25
+ export type ThemeDefinition =
26
+ | ThemeName
27
+ | { base: ThemeName; tokens: Partial<ThemeTokens> };
28
+ export interface ApplyThemeOptions {
29
+ theme: ThemeDefinition;
30
+ scope?: "self" | "descendants";
31
+ }
3
32
  export type FieldType = "quantitative" | "temporal" | "ordinal" | "nominal";
4
33
  export type GraphicType =
5
34
  | "canvas"
@@ -41,6 +70,7 @@ export interface LinearGradientPaint {
41
70
  ];
42
71
  }
43
72
  export type FillPaint = string | LinearGradientPaint;
73
+ type FilledMarkStroke = string | false;
44
74
  export type CurveInterpolation =
45
75
  | "linear"
46
76
  | "step"
@@ -65,6 +95,20 @@ export interface JitterPointsOptions {
65
95
  export interface RemoveJitterOptions {
66
96
  target?: string;
67
97
  }
98
+ export type PointPackingMaxOffset =
99
+ | { pixels: number; band?: never }
100
+ | { pixels?: never; band: number };
101
+ export interface PackPointsOptions {
102
+ target?: string;
103
+ channel: "x" | "y";
104
+ maxOffset?: PointPackingMaxOffset;
105
+ padding?: number;
106
+ key?: string;
107
+ overflow?: "error" | "overlap";
108
+ }
109
+ export interface RemovePointPackingOptions {
110
+ target?: string;
111
+ }
68
112
  export type ScaleType =
69
113
  | "linear"
70
114
  | "log"
@@ -108,17 +152,31 @@ export interface ReplaceCompositionChildOptions {
108
152
  target: string;
109
153
  program: ChartProgram;
110
154
  }
155
+ export interface InsertCompositionChildOptions {
156
+ id: string;
157
+ program: ChartProgram;
158
+ before?: string;
159
+ after?: string;
160
+ }
161
+ export interface RemoveCompositionChildOptions { target: string; }
162
+ export interface ReorderCompositionChildrenOptions {
163
+ order: readonly [string, ...string[]];
164
+ }
111
165
  export type FacetScaleResolution = "shared" | "independent";
112
166
  export interface FacetScaleResolutions {
113
167
  x?: FacetScaleResolution;
114
168
  y?: FacetScaleResolution;
115
169
  xOffset?: FacetScaleResolution;
116
170
  yOffset?: FacetScaleResolution;
171
+ theta?: FacetScaleResolution;
172
+ r?: FacetScaleResolution;
117
173
  color?: FacetScaleResolution;
174
+ stroke?: FacetScaleResolution;
118
175
  size?: FacetScaleResolution;
119
176
  shape?: FacetScaleResolution;
120
177
  opacity?: FacetScaleResolution;
121
178
  strokeDash?: FacetScaleResolution;
179
+ parallelDimensions?: FacetScaleResolution;
122
180
  }
123
181
  export interface FacetGuideOptions {
124
182
  axes?: "each" | "outer";
@@ -128,6 +186,35 @@ export interface FacetOptions {
128
186
  id?: string;
129
187
  field: string;
130
188
  data?: string;
189
+ values?: readonly DatasetScalar[];
190
+ columns?: number;
191
+ gap?: number;
192
+ align?: CompositionAlign;
193
+ padding?: number | CompositionPadding;
194
+ scales?: FacetScaleResolutions;
195
+ guides?: FacetGuideOptions;
196
+ }
197
+ export interface FacetGridRole {
198
+ field: string;
199
+ values?: readonly DatasetScalar[];
200
+ }
201
+ export interface FacetGridOptions {
202
+ id?: string;
203
+ data?: string;
204
+ rows: FacetGridRole;
205
+ columns: FacetGridRole;
206
+ combinations?: "observed" | "full";
207
+ gap?: number;
208
+ align?: CompositionAlign;
209
+ padding?: number | CompositionPadding;
210
+ scales?: FacetScaleResolutions;
211
+ guides?: FacetGuideOptions;
212
+ }
213
+ export interface RepeatChartsOptions {
214
+ id?: string;
215
+ target?: string;
216
+ channel: "x" | "y" | "theta" | "r" | { parallelDimension: string };
217
+ fields: readonly [string, ...string[]];
131
218
  columns?: number;
132
219
  gap?: number;
133
220
  align?: CompositionAlign;
@@ -135,13 +222,21 @@ export interface FacetOptions {
135
222
  scales?: FacetScaleResolutions;
136
223
  guides?: FacetGuideOptions;
137
224
  }
225
+ export interface EditFacetSourceOptions { program: ChartProgram; }
138
226
  export interface EditFacetHeadersOptions {
139
227
  fontSize?: number;
140
228
  fontFamily?: string;
141
229
  fontWeight?: string | number;
142
230
  color?: string;
143
231
  offset?: number;
144
- }
232
+ role?: FacetHeaderRole;
233
+ labelMap?: DisplayLabelMap | "auto";
234
+ side?: FacetHeaderSide;
235
+ align?: FacetHeaderAlign;
236
+ }
237
+ export type FacetHeaderRole = "all" | "row" | "column";
238
+ export type FacetHeaderSide = "top" | "bottom" | "left" | "right";
239
+ export type FacetHeaderAlign = "start" | "center" | "end";
145
240
  export interface ConcatCompositionSpec {
146
241
  readonly id: string;
147
242
  readonly direction: "horizontal" | "vertical";
@@ -160,8 +255,26 @@ export interface FacetCompositionSpec {
160
255
  readonly padding: Readonly<Required<CompositionPadding>>;
161
256
  readonly facet: {
162
257
  readonly data: string;
163
- readonly field: string;
258
+ readonly field?: string;
164
259
  readonly values: readonly DatasetScalar[];
260
+ readonly grid?: {
261
+ readonly rows: { readonly field: string; readonly values: readonly DatasetScalar[] };
262
+ readonly columns: { readonly field: string; readonly values: readonly DatasetScalar[] };
263
+ readonly combinations: "observed" | "full";
264
+ readonly cells: readonly {
265
+ readonly id: string;
266
+ readonly row: number;
267
+ readonly column: number;
268
+ readonly rowValue: DatasetScalar;
269
+ readonly columnValue: DatasetScalar;
270
+ readonly empty: boolean;
271
+ }[];
272
+ };
273
+ readonly repeat?: {
274
+ readonly target: string;
275
+ readonly channel: "x" | "y" | "theta" | "r" | { readonly parallelDimension: string };
276
+ readonly fields: readonly string[];
277
+ };
165
278
  readonly scales: Readonly<Required<FacetScaleResolutions>>;
166
279
  readonly guides: {
167
280
  readonly axes: "each" | "outer";
@@ -176,6 +289,10 @@ export type DensityKernel =
176
289
  | "uniform"
177
290
  | "triangular";
178
291
  export type DensityNormalization = "unit" | "count";
292
+ export interface StatisticalWeight {
293
+ readonly field: string;
294
+ readonly kind: "frequency" | "reliability";
295
+ }
179
296
  export type DensityPlacementSide =
180
297
  | "both"
181
298
  | "left"
@@ -222,6 +339,13 @@ export type FilterDataOptions = {
222
339
  field: string;
223
340
  } & FilterModeOptions;
224
341
  export type DatasetScalar = string | number | boolean | null;
342
+ export type DisplayLabelMap = ReadonlyArray<Readonly<{
343
+ value: DatasetScalar;
344
+ label: string;
345
+ }>>;
346
+ export interface DisplayLabelOptions {
347
+ labelMap?: DisplayLabelMap | "auto";
348
+ }
225
349
  export type DatasetFilterTransform = {
226
350
  type: "filter";
227
351
  field: string;
@@ -238,22 +362,28 @@ export type DatasetRegressionTransform = {
238
362
  } & (
239
363
  | {
240
364
  method: "linear";
241
- confidence: number;
242
365
  interval: "mean" | "prediction";
243
366
  degree?: never;
244
367
  span?: never;
245
- }
368
+ } & (
369
+ | { confidenceMethod: ConfidenceIntervalMethod; level: number; confidence?: never }
370
+ | { confidence: number; confidenceMethod?: never; level?: never }
371
+ )
246
372
  | {
247
373
  method: "polynomial";
248
374
  degree: number;
249
- confidence: number;
250
375
  interval: "mean" | "prediction";
251
376
  span?: never;
252
- }
377
+ } & (
378
+ | { confidenceMethod: ConfidenceIntervalMethod; level: number; confidence?: never }
379
+ | { confidence: number; confidenceMethod?: never; level?: never }
380
+ )
253
381
  | {
254
382
  method: "loess";
255
383
  span: number;
256
384
  degree?: never;
385
+ confidenceMethod?: never;
386
+ level?: never;
257
387
  confidence?: never;
258
388
  interval?: never;
259
389
  }
@@ -267,6 +397,7 @@ export interface DatasetDensityTransform {
267
397
  steps: number;
268
398
  kernel?: DensityKernel;
269
399
  normalization?: DensityNormalization;
400
+ weight?: StatisticalWeight;
270
401
  as: readonly [string, string];
271
402
  resolve: "shared";
272
403
  placement?: {
@@ -284,10 +415,22 @@ export interface DatasetDensityTransform {
284
415
  };
285
416
  };
286
417
  resolved?: {
287
- readonly bandwidth: number;
288
418
  readonly extent: readonly [number, number];
289
419
  readonly splitDomain?: readonly [unknown, unknown];
290
- };
420
+ } & (
421
+ | {
422
+ readonly bandwidth: number;
423
+ readonly bandwidths?: never;
424
+ }
425
+ | {
426
+ readonly bandwidth?: never;
427
+ readonly bandwidths: readonly {
428
+ readonly group?: unknown;
429
+ readonly split?: unknown;
430
+ readonly bandwidth: number;
431
+ }[];
432
+ }
433
+ );
291
434
  }
292
435
  export type HorizonResolution = "shared" | "independent";
293
436
  export type HorizonMissingPolicy = "break" | "error";
@@ -304,10 +447,10 @@ export interface HorizonOutputFields {
304
447
  }
305
448
  export interface DatasetHorizonTransform {
306
449
  readonly type: "horizon";
307
- readonly x: {
308
- readonly field: string;
309
- readonly fieldType: "quantitative" | "temporal";
310
- };
450
+ readonly x: { readonly field: string } & (
451
+ | { readonly fieldType: "quantitative"; readonly temporalUnit?: never }
452
+ | { readonly fieldType: "temporal"; readonly temporalUnit?: TemporalInputUnit }
453
+ );
311
454
  readonly y: {
312
455
  readonly field: string;
313
456
  readonly fieldType: "quantitative";
@@ -346,16 +489,19 @@ export type DatasetIntervalTransform = {
346
489
  | {
347
490
  center: "mean";
348
491
  extent: "stderr" | "stdev";
492
+ method?: never;
349
493
  level?: never;
350
494
  }
351
495
  | {
352
496
  center: "mean";
353
497
  extent: "ci";
498
+ method?: ConfidenceIntervalMethod;
354
499
  level: number;
355
500
  }
356
501
  | {
357
502
  center: "median";
358
503
  extent: "iqr";
504
+ method?: never;
359
505
  level?: never;
360
506
  }
361
507
  );
@@ -364,6 +510,22 @@ export interface WindowSort {
364
510
  field: string;
365
511
  order?: WindowSortOrder;
366
512
  }
513
+ export type RowWindowFrame = {
514
+ preceding: number;
515
+ following?: number;
516
+ duration?: never;
517
+ };
518
+ export type DurationWindowUnit = "millisecond" | "second" | "minute" | "hour" | "day";
519
+ export type DurationWindowFrame = {
520
+ preceding?: never;
521
+ following?: never;
522
+ duration: {
523
+ preceding: number;
524
+ following?: number;
525
+ unit: DurationWindowUnit;
526
+ };
527
+ };
528
+ export type WindowFrame = RowWindowFrame | DurationWindowFrame;
367
529
  export type WindowOperation =
368
530
  | { op: "rowNumber" | "rank" | "denseRank"; as: string }
369
531
  | { op: "cumulativeSum"; field: string; as: string }
@@ -378,10 +540,9 @@ export type WindowOperation =
378
540
  op: "movingMean" | "movingSum";
379
541
  field: string;
380
542
  as: string;
381
- frame: {
382
- preceding: number;
383
- following?: number;
384
- };
543
+ frame: WindowFrame;
544
+ minPeriods?: number;
545
+ missing?: "error" | "skip";
385
546
  };
386
547
  export interface DatasetWindowSort {
387
548
  readonly field: string;
@@ -405,16 +566,48 @@ export type DatasetWindowOperation =
405
566
  readonly op: "movingMean" | "movingSum";
406
567
  readonly field: string;
407
568
  readonly as: string;
408
- readonly frame: {
409
- readonly preceding: number;
410
- readonly following: number;
411
- };
569
+ readonly frame:
570
+ | {
571
+ readonly preceding: number;
572
+ readonly following: number;
573
+ }
574
+ | {
575
+ readonly duration: {
576
+ readonly preceding: number;
577
+ readonly following: number;
578
+ readonly unit: DurationWindowUnit;
579
+ };
580
+ };
581
+ readonly minPeriods: number;
582
+ readonly missing: "error" | "skip";
412
583
  };
413
584
  export interface DatasetWindowTransform {
414
585
  readonly type: "window";
415
586
  readonly partitionBy: readonly string[];
416
587
  readonly sortBy: readonly DatasetWindowSort[];
417
588
  readonly operations: readonly DatasetWindowOperation[];
589
+ readonly temporalUnit?: TemporalInputUnit;
590
+ }
591
+ export interface ECDFOutputFields {
592
+ value: string;
593
+ cumulative: string;
594
+ probability: string;
595
+ }
596
+ export interface DatasetECDFResolvedGroup {
597
+ readonly keys: Readonly<Record<string, string | number | boolean>>;
598
+ readonly denominator: number;
599
+ readonly validCount: number;
600
+ }
601
+ export interface DatasetECDFTransform {
602
+ readonly type: "ecdf";
603
+ readonly field: string;
604
+ readonly groupBy: readonly string[];
605
+ readonly weight?: string;
606
+ readonly missing: "drop" | "error";
607
+ readonly as: Readonly<ECDFOutputFields>;
608
+ readonly resolved?: {
609
+ readonly groups: readonly DatasetECDFResolvedGroup[];
610
+ };
418
611
  }
419
612
  export type TimeUnit =
420
613
  | "year"
@@ -423,13 +616,28 @@ export type TimeUnit =
423
616
  | "day"
424
617
  | "hour"
425
618
  | "minute"
426
- | "second";
427
- export interface DatasetTimeUnitTransform {
619
+ | "second"
620
+ | "week"
621
+ | "weekday";
622
+ type DatasetTimeUnitTransformBase = {
428
623
  readonly type: "timeUnit";
429
624
  readonly field: string;
430
- readonly unit: TimeUnit;
625
+ readonly temporalUnit?: TemporalInputUnit;
431
626
  readonly as: string;
432
- }
627
+ readonly timeZone?: string;
628
+ };
629
+ export type DatasetTimeUnitTransform = DatasetTimeUnitTransformBase & (
630
+ | {
631
+ readonly unit: Exclude<TimeUnit, "week">;
632
+ readonly weekStartsOn?: never;
633
+ readonly weekRule?: never;
634
+ }
635
+ | {
636
+ readonly unit: "week";
637
+ readonly weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
638
+ readonly weekRule: "calendar" | "iso";
639
+ }
640
+ );
433
641
  export interface Bin2DCounts {
434
642
  x: number;
435
643
  y: number;
@@ -479,20 +687,228 @@ export interface DatasetBin2DTransform {
479
687
  readonly occupiedCount: number;
480
688
  };
481
689
  }
690
+ export interface DatasetBinTransform {
691
+ readonly type: "bin";
692
+ readonly field: string;
693
+ readonly bin:
694
+ | { readonly maxBins: number }
695
+ | { readonly step: number }
696
+ | { readonly boundaries: readonly [number, number, ...number[]] };
697
+ readonly extent: "auto" | readonly [number, number];
698
+ readonly nice: boolean;
699
+ readonly zero: boolean;
700
+ readonly includeEmpty: boolean;
701
+ readonly members: boolean;
702
+ readonly weight?: StatisticalWeight;
703
+ readonly as: {
704
+ readonly lower: string;
705
+ readonly upper: string;
706
+ readonly count: string;
707
+ readonly members?: string;
708
+ };
709
+ readonly resolved?: {
710
+ readonly domain: readonly [number, number];
711
+ readonly step?: number;
712
+ readonly boundaries: readonly [number, number, ...number[]];
713
+ };
714
+ }
715
+ export interface DatasetFoldTransform {
716
+ readonly type: "fold";
717
+ readonly fields: readonly string[];
718
+ readonly as: {
719
+ readonly key: string;
720
+ readonly value: string;
721
+ };
722
+ }
723
+ export type ComputedExpression =
724
+ | { readonly field: string }
725
+ | { readonly constant: number | string | boolean | null }
726
+ | {
727
+ readonly op: "negate" | "absolute" | "log" | "sqrt" | "not" | "isNull";
728
+ readonly operand: ComputedExpression;
729
+ }
730
+ | {
731
+ readonly op: "add" | "subtract" | "multiply" | "divide" |
732
+ "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
733
+ readonly left: ComputedExpression;
734
+ readonly right: ComputedExpression;
735
+ }
736
+ | {
737
+ readonly op: "and" | "or" | "coalesce";
738
+ readonly operands: readonly [ComputedExpression, ComputedExpression, ...ComputedExpression[]];
739
+ }
740
+ | {
741
+ readonly op: "concat";
742
+ readonly operands: readonly [ComputedExpression, ...ComputedExpression[]];
743
+ }
744
+ | {
745
+ readonly op: "if";
746
+ readonly condition: ComputedExpression;
747
+ readonly then: ComputedExpression;
748
+ readonly else: ComputedExpression;
749
+ };
750
+ export interface DatasetComputedTransform {
751
+ readonly type: "computed";
752
+ readonly as: string;
753
+ readonly expression: ComputedExpression;
754
+ }
755
+ export type NormalizeMethod =
756
+ | "share"
757
+ | "zscore"
758
+ | "minmax"
759
+ | "index"
760
+ | "change"
761
+ | "percentChange";
762
+ export type NormalizeZeroDenominator = "error" | "null" | "zero";
763
+ export type NormalizeBaseline =
764
+ | { readonly position: "first" | "last" }
765
+ | { readonly value: number };
766
+ type DatasetNormalizedBaseTransform = {
767
+ readonly type: "normalize";
768
+ readonly field: string;
769
+ readonly as: string;
770
+ readonly groupBy: readonly string[];
771
+ };
772
+ type DatasetNormalizeBaselineTransform = {
773
+ readonly baseline: NormalizeBaseline;
774
+ readonly sortBy: readonly WindowSort[];
775
+ };
776
+ export type DatasetNormalizedTransform = DatasetNormalizedBaseTransform & (
777
+ | {
778
+ readonly method: "share" | "minmax";
779
+ readonly zeroDenominator: NormalizeZeroDenominator;
780
+ }
781
+ | {
782
+ readonly method: "zscore";
783
+ readonly variance: "population" | "sample";
784
+ readonly zeroDenominator: NormalizeZeroDenominator;
785
+ }
786
+ | ({
787
+ readonly method: "index" | "percentChange";
788
+ readonly zeroDenominator: NormalizeZeroDenominator;
789
+ } & DatasetNormalizeBaselineTransform)
790
+ | ({ readonly method: "change" } & DatasetNormalizeBaselineTransform)
791
+ );
792
+ export type DatasetCompleteTransform = {
793
+ readonly type: "complete";
794
+ readonly key: string;
795
+ readonly groupBy: readonly string[];
796
+ readonly fill: Readonly<Record<string, DatasetScalar>>;
797
+ readonly members?: string;
798
+ } & (
799
+ | { readonly values: readonly DatasetScalar[]; readonly sequence?: never }
800
+ | {
801
+ readonly sequence: { readonly start: number; readonly end: number; readonly step: number };
802
+ readonly values?: never;
803
+ }
804
+ | { readonly values?: never; readonly sequence?: never }
805
+ );
806
+ type DatasetImputedBaseTransform = {
807
+ readonly type: "impute";
808
+ readonly fields: readonly string[];
809
+ readonly groupBy: readonly string[];
810
+ readonly edges: "keep" | "error";
811
+ readonly maxGap?: number;
812
+ };
813
+ export type DatasetImputedTransform = DatasetImputedBaseTransform & (
814
+ | {
815
+ readonly method: "constant";
816
+ readonly value: DatasetScalar;
817
+ readonly sortBy: readonly DatasetWindowSort[];
818
+ }
819
+ | {
820
+ readonly method: "forward" | "backward";
821
+ readonly value?: never;
822
+ readonly sortBy: readonly [DatasetWindowSort, ...DatasetWindowSort[]];
823
+ }
824
+ | {
825
+ readonly method: "linear";
826
+ readonly value?: never;
827
+ readonly sortBy: readonly [{ readonly field: string; readonly order: "ascending" }];
828
+ }
829
+ );
830
+ export type StackDataMode = "stack" | "fill" | "center" | "diverging";
831
+ export interface StackDataOutputFields {
832
+ start?: string;
833
+ end?: string;
834
+ value?: string;
835
+ share?: string;
836
+ }
837
+ export interface DatasetStackTransform {
838
+ readonly type: "stack";
839
+ readonly category: string;
840
+ readonly group: string;
841
+ readonly value: string;
842
+ readonly mode: StackDataMode;
843
+ readonly as: Required<StackDataOutputFields>;
844
+ }
845
+ interface DatasetStatisticalReferenceTransform {
846
+ readonly type: "statisticalReference";
847
+ readonly target: string;
848
+ }
482
849
  export type DatasetTransform =
850
+ | DatasetBinTransform
483
851
  | DatasetBin2DTransform
852
+ | DatasetCompleteTransform
853
+ | DatasetComputedTransform
854
+ | DatasetImputedTransform
855
+ | DatasetNormalizedTransform
484
856
  | DatasetFilterTransform
857
+ | DatasetFoldTransform
485
858
  | DatasetRegressionTransform
486
859
  | DatasetDensityTransform
860
+ | DatasetECDFTransform
487
861
  | DatasetHorizonTransform
488
862
  | DatasetIntervalTransform
863
+ | DatasetSummaryTransform
864
+ | DatasetStackTransform
865
+ | DatasetStatisticalReferenceTransform
489
866
  | DatasetTimeUnitTransform
490
867
  | DatasetWindowTransform;
868
+ type RequestedTransform<T> = T extends unknown ? Omit<T, "resolved"> : never;
869
+ export type RequestedDatasetTransform = RequestedTransform<Exclude<
870
+ DatasetTransform,
871
+ DatasetHorizonTransform | DatasetStatisticalReferenceTransform
872
+ >>;
873
+ export type DerivedDataDependents = "reject" | "recompute";
874
+ export interface EditDerivedDataOptions {
875
+ target: string;
876
+ definition: RequestedDatasetTransform;
877
+ dependents?: DerivedDataDependents;
878
+ }
491
879
  export interface CreateDerivedDataOptions {
492
880
  id: string;
493
881
  source: string;
494
882
  transform: readonly [DatasetTransform];
495
883
  }
884
+ export interface DatasetSummaryTransform {
885
+ type: "summary";
886
+ groupBy: readonly string[];
887
+ aggregates: readonly SummaryAggregateOptions[];
888
+ members?: string;
889
+ weight?: StatisticalWeight;
890
+ }
891
+ export interface SummaryAggregateOptions {
892
+ op: AggregateOperation;
893
+ field?: string;
894
+ as: string;
895
+ }
896
+ export interface SummaryDataOptions {
897
+ id: string;
898
+ source?: string;
899
+ groupBy?: string | readonly string[];
900
+ aggregates: readonly SummaryAggregateOptions[];
901
+ members?: string;
902
+ weight?: StatisticalWeight;
903
+ }
904
+ export interface BindMarkDataOptions {
905
+ target: string;
906
+ data: string;
907
+ }
908
+
909
+ export interface RemoveResourceOptions {
910
+ readonly id: string;
911
+ }
496
912
  export type MarkGraphicProperty =
497
913
  | "x" | "y" | "width" | "height" | "radius"
498
914
  | "x1" | "y1" | "x2" | "y2"
@@ -501,7 +917,7 @@ export type MarkSelector = {
501
917
  grain?: "item" | "stack";
502
918
  } & (
503
919
  | { field: string; channel?: never; property?: never }
504
- | { channel: "x" | "y" | "x2" | "y2" | "xOffset" | "yOffset" | "theta" | "radius" | "color" | "strokeDash" | "size" | "shape" | "group" | "opacity"; field?: never; property?: never }
920
+ | { channel: "x" | "y" | "x2" | "y2" | "xOffset" | "yOffset" | "theta" | "radius" | "color" | "stroke" | "strokeDash" | "strokeWidth" | "size" | "shape" | "group" | "opacity"; field?: never; property?: never }
505
921
  | { property: MarkGraphicProperty; field?: never; channel?: never }
506
922
  ) & (
507
923
  | { op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte"; value: unknown }
@@ -531,7 +947,11 @@ export interface RemoveMarkSelectionOptions {
531
947
  }
532
948
  export type FilterMarksOptions = {
533
949
  target?: string;
950
+ mode?: "replace" | "compose";
534
951
  } & MarkSelector;
952
+ export interface RemoveMarkFilterOptions {
953
+ target?: string;
954
+ }
535
955
  export interface HighlightMarksOptions {
536
956
  id?: string;
537
957
  target?: string;
@@ -561,12 +981,18 @@ export type ScalarAggregateOperation =
561
981
  | "distinct" | "valid" | "missing"
562
982
  | "variance" | "varianceP" | "stdev" | "stdevP" | "stderr"
563
983
  | "q1" | "q3" | "ciLower" | "ciUpper";
984
+ export type ConfidenceIntervalMethod = "normal" | "student-t";
564
985
  export type ParameterizedAggregateOperation =
565
986
  | { op: "quantile"; probability: number }
566
987
  | {
567
988
  op: "first" | "last";
568
989
  orderBy: string;
569
990
  order?: "ascending" | "descending";
991
+ }
992
+ | {
993
+ op: "ciLower" | "ciUpper";
994
+ method?: ConfidenceIntervalMethod;
995
+ level?: number;
570
996
  };
571
997
  export type AggregateOperation =
572
998
  | ScalarAggregateOperation
@@ -593,6 +1019,14 @@ export type PointShape =
593
1019
  | "star"
594
1020
  | "hexagon"
595
1021
  | "wye";
1022
+ export type StrokeStyleDetails = {
1023
+ lineCap?: "butt" | "round" | "square";
1024
+ lineJoin?: "miter" | "round" | "bevel";
1025
+ miterLimit?: number;
1026
+ };
1027
+ export type RectStyleDetails = StrokeStyleDetails & {
1028
+ cornerRadius?: number;
1029
+ };
596
1030
  export type PaletteName =
597
1031
  | "accent"
598
1032
  | "category10" | "category20" | "category20b" | "category20c"
@@ -623,6 +1057,11 @@ export type ScaleRange = "auto" | readonly unknown[] | {
623
1057
  readonly palette: Palette;
624
1058
  };
625
1059
  export type ActionOptions = Record<string, unknown>;
1060
+ /**
1061
+ * One semantic assignment or removal. Complete unreferenced source datasets and
1062
+ * coordinates can be removed; source values remain immutable. Domain removal
1063
+ * actions own full resource/configuration lifecycle checks and cleanup.
1064
+ */
626
1065
  export type EditSemanticOptions =
627
1066
  | { property: string; value: unknown; remove?: false }
628
1067
  | { property: string; remove: true; value?: never };
@@ -651,7 +1090,8 @@ export interface SemanticLayer {
651
1090
  readonly data?: string;
652
1091
  readonly source?: string;
653
1092
  readonly coordinate?: string;
654
- readonly mark?: Readonly<{ type?: string; [key: string]: unknown }>;
1093
+ readonly mark?: Readonly<{ type?: string; missing?: "error" | "break"; [key: string]: unknown }>;
1094
+ readonly layout?: Readonly<{ mode?: ColorLayout }>;
655
1095
  readonly encoding?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
656
1096
  readonly [key: string]: unknown;
657
1097
  }
@@ -666,7 +1106,9 @@ export interface SemanticScale {
666
1106
 
667
1107
  export interface SemanticCoordinate {
668
1108
  readonly id: string;
669
- readonly type?: "cartesian" | "polar";
1109
+ readonly type?: "cartesian" | "polar" | "parallel";
1110
+ readonly aspect?: CoordinateAspect;
1111
+ readonly polarFrame?: Exclude<PolarFrameOptions, "auto">;
670
1112
  readonly layers?: readonly string[];
671
1113
  readonly [key: string]: unknown;
672
1114
  }
@@ -705,16 +1147,32 @@ export interface CanvasOptions {
705
1147
  margin?: number | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
706
1148
  }
707
1149
 
1150
+ export interface FitCanvasOptions {
1151
+ /** Minimum fitted margin on every Canvas edge. Defaults to 0. */
1152
+ padding?: number;
1153
+ /** Required final plot width. Defaults to 160. */
1154
+ minPlotWidth?: number;
1155
+ /** Required final plot height. Defaults to 120. */
1156
+ minPlotHeight?: number;
1157
+ /** Maximum binary-search probes per edge. Defaults to 32; maximum 64. */
1158
+ iterationLimit?: number;
1159
+ /** Reject an unsatisfied fit or preserve it with a structured overflow result. */
1160
+ overflow?: "error" | "report";
1161
+ }
1162
+
708
1163
  export type XAxisPosition = "bottom" | "top";
709
1164
  export type YAxisPosition = "left" | "right";
1165
+ export type RotationUnit = "radians" | "degrees";
1166
+ export type RotationInput = number | { value: number; unit: RotationUnit };
1167
+ type ValueFormatDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
1168
+ type ValueFormatPrecision = ValueFormatDigit | 10 | 11 | 12 | `0${ValueFormatDigit}`;
710
1169
  type TimeAxisDirective = "Y" | "m" | "d" | "b";
711
- export type AxisFormatString =
712
- | ".0f" | ".1f" | ".2f"
713
- | ".0%" | ".1%" | ".2e"
714
- | `${string}%${TimeAxisDirective}${string}`;
1170
+ export type NumericFormatString = `.${ValueFormatPrecision}${"f" | "%" | "e"}`;
1171
+ export type UtcFormatString = `${string}%${TimeAxisDirective}${string}`;
1172
+ export type ValueFormat = "auto" | NumericFormatString | UtcFormatString;
1173
+ export type AxisFormatString = NumericFormatString | UtcFormatString;
715
1174
  export type AxisFormat =
716
- | "auto"
717
- | AxisFormatString
1175
+ | ValueFormat
718
1176
  | { decimals: number };
719
1177
  export type AxisValue = string | boolean | number;
720
1178
  export interface AxisLineStyleOptions {
@@ -732,13 +1190,23 @@ export interface AxisLabelStyleOptions {
732
1190
  fontFamily?: string;
733
1191
  fontWeight?: string | number;
734
1192
  }
1193
+ export interface AxisLabelLayoutOptions {
1194
+ /** Legacy numbers are radians; structured values make radians or degrees explicit. */
1195
+ rotation?: RotationInput;
1196
+ /** Wrap each label to this measured width; false removes an existing wrap policy. */
1197
+ maxWidth?: number | false;
1198
+ wrap?: "word" | "character";
1199
+ lineHeight?: number;
1200
+ /** Defaults to error; allow stores an intentional label-label overlap policy. */
1201
+ overlap?: "error" | "allow";
1202
+ }
735
1203
  export interface AxisTicksAndLabelsOptions<P extends string> {
736
1204
  scale?: string;
737
1205
  position?: P;
738
1206
  count?: number;
739
1207
  values?: readonly AxisValue[];
740
1208
  ticks?: AxisTickStyleOptions;
741
- labels?: AxisLabelStyleOptions;
1209
+ labels?: AxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
742
1210
  }
743
1211
  export interface AxisTitleOptions<P extends string> {
744
1212
  text?: string;
@@ -746,7 +1214,7 @@ export interface AxisTitleOptions<P extends string> {
746
1214
  position?: P;
747
1215
  at?: "start" | "center" | "end" | number;
748
1216
  offset?: number;
749
- rotation?: number;
1217
+ rotation?: RotationInput;
750
1218
  color?: string;
751
1219
  fontSize?: number;
752
1220
  fontFamily?: string;
@@ -756,9 +1224,9 @@ export interface CompleteAxisOptions<P extends string> {
756
1224
  scale?: string;
757
1225
  coordinate?: string;
758
1226
  position?: P;
759
- line?: AxisLineStyleOptions;
760
- ticksAndLabels?: Omit<AxisTicksAndLabelsOptions<P>, "scale" | "position">;
761
- title?: Omit<AxisTitleOptions<P>, "scale" | "position">;
1227
+ line?: false | AxisLineStyleOptions;
1228
+ ticksAndLabels?: false | Omit<AxisTicksAndLabelsOptions<P>, "scale" | "position">;
1229
+ title?: false | Omit<AxisTitleOptions<P>, "scale" | "position">;
762
1230
  }
763
1231
  export interface CreateAxesOptions {
764
1232
  coordinate?: {
@@ -778,13 +1246,43 @@ export interface AxisTickOptions<P extends string>
778
1246
  values?: readonly AxisValue[];
779
1247
  }
780
1248
  export interface AxisLabelOptions<P extends string>
781
- extends AxisLabelStyleOptions {
1249
+ extends AxisLabelStyleOptions, AxisLabelLayoutOptions, DisplayLabelOptions {
782
1250
  scale?: string;
783
1251
  position?: P;
784
1252
  count?: number;
785
1253
  values?: readonly AxisValue[];
786
1254
  }
787
1255
 
1256
+ export type ParallelAxisTickSelection =
1257
+ | { count?: number; values?: never }
1258
+ | { values: readonly AxisValue[]; count?: never };
1259
+ export type ParallelAxisTicksOptions = AxisTickStyleOptions & ParallelAxisTickSelection;
1260
+ export type ParallelAxisLabelsOptions = AxisLabelStyleOptions & ParallelAxisTickSelection;
1261
+ export interface ParallelAxisTitleOptions {
1262
+ text?: string;
1263
+ offset?: number;
1264
+ color?: string;
1265
+ fontSize?: number;
1266
+ fontFamily?: string;
1267
+ fontWeight?: string | number;
1268
+ }
1269
+ export type ParallelAxisComponentsOptions = {
1270
+ field: string;
1271
+ target?: string;
1272
+ line?: false | AxisLineStyleOptions;
1273
+ title?: false | ParallelAxisTitleOptions;
1274
+ } & (
1275
+ | { ticksAndLabels?: false | (ParallelAxisTickSelection & {
1276
+ ticks?: AxisTickStyleOptions; labels?: AxisLabelStyleOptions;
1277
+ }); ticks?: never; labels?: never }
1278
+ | { ticks?: false | ParallelAxisTicksOptions; labels?: false | ParallelAxisLabelsOptions;
1279
+ ticksAndLabels?: never }
1280
+ );
1281
+ export type CreateParallelAxisOptions = ParallelAxisComponentsOptions;
1282
+ export type EditParallelAxisOptions = ParallelAxisComponentsOptions;
1283
+ export interface ParallelAxesOptions { target?: string; coordinate?: string; }
1284
+ export interface RemoveParallelAxisOptions { field: string; target?: string; }
1285
+
788
1286
  export interface PolarGuideResourceOptions {
789
1287
  scale?: string;
790
1288
  coordinate?: string;
@@ -804,6 +1302,11 @@ export interface PolarTicksAndLabelsOptions {
804
1302
  ticks?: AxisTickStyleOptions;
805
1303
  labels?: AxisLabelStyleOptions;
806
1304
  }
1305
+ export type ThetaAxisLabelOptions = PolarLabelOptions & DisplayLabelOptions;
1306
+ export interface ThetaTicksAndLabelsOptions
1307
+ extends Omit<PolarTicksAndLabelsOptions, "labels"> {
1308
+ labels?: AxisLabelStyleOptions & DisplayLabelOptions;
1309
+ }
807
1310
  export interface PolarTitleOptions {
808
1311
  text?: string;
809
1312
  offset?: number;
@@ -815,26 +1318,54 @@ export interface PolarTitleOptions {
815
1318
  export interface RadialTitleOptions extends PolarTitleOptions {
816
1319
  position?: "inside" | "outside";
817
1320
  }
818
- export interface CompletePolarAxisOptions extends PolarGuideResourceOptions {
819
- line?: AxisLineStyleOptions;
820
- ticksAndLabels?: PolarTicksAndLabelsOptions;
1321
+ export type PolarAxisTickSelection =
1322
+ | { count?: number; values?: never }
1323
+ | { values: readonly AxisValue[]; count?: never };
1324
+ export type CreateThetaAxisLineOptions = AxisLineStyleOptions &
1325
+ Omit<PolarGuideResourceOptions, "angle">;
1326
+ export type CreateRadialAxisLineOptions = AxisLineStyleOptions & PolarGuideResourceOptions;
1327
+ export type CreateThetaAxisTicksOptions = Omit<PolarTickOptions, "count" | "values"> &
1328
+ PolarAxisTickSelection & Omit<PolarGuideResourceOptions, "angle">;
1329
+ export type CreateRadialAxisTicksOptions = Omit<PolarTickOptions, "count" | "values"> &
1330
+ PolarAxisTickSelection & PolarGuideResourceOptions;
1331
+ export type CreateThetaAxisLabelsOptions = Omit<PolarLabelOptions, "count" | "values"> &
1332
+ PolarAxisTickSelection & Omit<PolarGuideResourceOptions, "angle"> &
1333
+ DisplayLabelOptions;
1334
+ export type CreateRadialAxisLabelsOptions = Omit<PolarLabelOptions, "count" | "values"> &
1335
+ PolarAxisTickSelection & PolarGuideResourceOptions;
1336
+ export type CreateThetaAxisTitleOptions = PolarTitleOptions &
1337
+ Omit<PolarGuideResourceOptions, "angle">;
1338
+ export type CreateRadialAxisTitleOptions = RadialTitleOptions & PolarGuideResourceOptions;
1339
+ export interface CompletePolarAxisOptions extends Omit<PolarGuideResourceOptions, "angle"> {
1340
+ line?: false | AxisLineStyleOptions;
1341
+ ticksAndLabels?: false | PolarTicksAndLabelsOptions;
821
1342
  title?: false | PolarTitleOptions;
822
1343
  }
1344
+ export interface CompleteThetaAxisOptions
1345
+ extends Omit<CompletePolarAxisOptions, "ticksAndLabels"> {
1346
+ ticksAndLabels?: false | ThetaTicksAndLabelsOptions;
1347
+ }
823
1348
  export interface CompleteRadialAxisOptions
824
1349
  extends Omit<CompletePolarAxisOptions, "title"> {
1350
+ angle?: number;
825
1351
  title?: false | RadialTitleOptions;
826
1352
  }
827
1353
  export interface EditPolarAxisOptions {
828
1354
  angle?: number;
829
- line?: AxisLineStyleOptions;
830
- ticks?: PolarTickOptions;
831
- labels?: PolarLabelOptions;
832
- ticksAndLabels?: PolarTicksAndLabelsOptions;
833
- title?: PolarTitleOptions;
1355
+ line?: false | AxisLineStyleOptions;
1356
+ ticks?: false | PolarTickOptions;
1357
+ labels?: false | PolarLabelOptions;
1358
+ ticksAndLabels?: false | PolarTicksAndLabelsOptions;
1359
+ title?: false | PolarTitleOptions;
1360
+ }
1361
+ export interface EditThetaAxisOptions
1362
+ extends Omit<EditPolarAxisOptions, "angle" | "labels" | "ticksAndLabels"> {
1363
+ labels?: false | ThetaAxisLabelOptions;
1364
+ ticksAndLabels?: false | ThetaTicksAndLabelsOptions;
834
1365
  }
835
1366
  export interface EditRadialAxisOptions
836
1367
  extends Omit<EditPolarAxisOptions, "title"> {
837
- title?: RadialTitleOptions;
1368
+ title?: false | RadialTitleOptions;
838
1369
  }
839
1370
 
840
1371
  export interface GridDirectionOptions {
@@ -894,12 +1425,67 @@ type CartesianAxesOptions = Omit<
894
1425
  > & {
895
1426
  coordinate?: { id?: string; type?: "auto" | "cartesian" };
896
1427
  };
1428
+ type CAxisTicks<P extends string> = Omit<AxisTicksAndLabelsOptions<P>, "labels"> & {
1429
+ labels?: AxisLabelStyleOptions & AxisLabelLayoutOptions;
1430
+ };
1431
+ type CAxis<P extends string> = Omit<CompleteAxisOptions<P>, "ticksAndLabels"> & {
1432
+ ticksAndLabels?: false | Omit<CAxisTicks<P>, "scale" | "position">;
1433
+ };
1434
+ type CAxes = Omit<CartesianAxesOptions, "x" | "y"> & {
1435
+ x?: false | CAxis<XAxisPosition>;
1436
+ y?: false | CAxis<YAxisPosition>;
1437
+ };
897
1438
  type CartesianGridOptions = Pick<CreateGridOptions, "horizontal" | "vertical">;
1439
+ type FilledMarkLegendOptions = Omit<LegendOptions, "symbol"> & {
1440
+ symbol?: "auto"
1441
+ | { width?: number; height?: number; stroke?: string; strokeWidth?: number }
1442
+ | { layers: readonly LegendSymbolLayer[] };
1443
+ };
1444
+ type CategoricalLegendTextOptions = {
1445
+ offset?: number;
1446
+ color?: string;
1447
+ fontSize?: number;
1448
+ fontFamily?: string;
1449
+ fontWeight?: string | number;
1450
+ format?: "auto";
1451
+ };
1452
+ type PathLegendOptions = Omit<
1453
+ LegendOptions,
1454
+ "symbol" | "gradient" | "count" | "values" | "labels"
1455
+ > & {
1456
+ symbol?: "auto" | { length?: number; lineWidth?: number }
1457
+ | { layers: readonly LegendSymbolLayer[] };
1458
+ labels?: CategoricalLegendTextOptions;
1459
+ };
898
1460
  type CartesianGuideOptions = {
899
1461
  axes?: false | CartesianAxesOptions;
900
1462
  grid?: false | CartesianGridOptions;
901
- legend?: false | LegendOptions;
1463
+ legend?: false | (Omit<FilledMarkLegendOptions, "order"> & { order?: CartesianLegendOrder });
902
1464
  };
1465
+ type CartesianPathGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1466
+ legend?: false | (Omit<PathLegendOptions, "order"> & { order?: LegendValueOrder });
1467
+ };
1468
+ type CartesianCategoricalGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1469
+ legend?: false | (Omit<
1470
+ FilledMarkLegendOptions,
1471
+ "count" | "values" | "gradient" | "labels" | "order"
1472
+ > & {
1473
+ labels?: CategoricalLegendTextOptions;
1474
+ order?: CartesianLegendOrder;
1475
+ });
1476
+ };
1477
+ type CPathGuides = Omit<CartesianPathGuideOptions, "axes"> & {
1478
+ axes?: false | CAxes;
1479
+ };
1480
+ type CCategoricalGuides = Omit<CartesianCategoricalGuideOptions, "axes"> & {
1481
+ axes?: false | CAxes;
1482
+ };
1483
+ type ColorGuides = Omit<CartesianGuideOptions, "legend"> & {
1484
+ legend?: false | (Omit<FilledMarkLegendOptions, "values" | "order"> & {
1485
+ order?: CartesianLegendOrder;
1486
+ });
1487
+ };
1488
+ type BoxPlotGuideOptions = Omit<CartesianGuideOptions, "legend"> & { legend?: false };
903
1489
  type GradientPlotDensityLegendOptions = {
904
1490
  title?: string;
905
1491
  position?: "right";
@@ -912,7 +1498,7 @@ type ParallelGuideOptions = {
912
1498
  coordinate?: { id?: string; type?: "auto" | "parallel" };
913
1499
  };
914
1500
  grid?: false;
915
- legend?: false | LegendOptions;
1501
+ legend?: false | (Omit<PathLegendOptions, "order"> & { order?: LegendValueOrder });
916
1502
  };
917
1503
 
918
1504
  export interface CreateCoordinateOptions {
@@ -921,7 +1507,38 @@ export interface CreateCoordinateOptions {
921
1507
  layers?: readonly string[];
922
1508
  }
923
1509
 
1510
+ export type CoordinateAspectAlign = "start" | "center" | "end";
1511
+ export type CoordinateAspect = "auto" | {
1512
+ mode: "frame" | "data";
1513
+ ratio: number;
1514
+ alignX?: CoordinateAspectAlign;
1515
+ alignY?: CoordinateAspectAlign;
1516
+ };
1517
+
1518
+ export type PolarFrameCenter = {
1519
+ x: number;
1520
+ y: number;
1521
+ };
1522
+ export type PolarFrameRadius =
1523
+ | { unit: "fraction"; value: number }
1524
+ | { unit: "px"; value: number };
1525
+ export type PolarFrameOptions = "auto" | {
1526
+ center?: PolarFrameCenter;
1527
+ radius?: PolarFrameRadius;
1528
+ };
1529
+
1530
+ type EditCoordinateTarget = {
1531
+ target: string;
1532
+ };
1533
+ export type EditCoordinateOptions = EditCoordinateTarget & (
1534
+ | { aspect: CoordinateAspect; polarFrame?: PolarFrameOptions }
1535
+ | { aspect?: CoordinateAspect; polarFrame: PolarFrameOptions }
1536
+ );
1537
+
1538
+ export type RadialMapping = "area" | "radius-length";
1539
+
924
1540
  export interface ScaleOptions {
1541
+ radialMapping?: RadialMapping;
925
1542
  id?: string;
926
1543
  type?: ScaleType;
927
1544
  domain?: "auto" | readonly unknown[];
@@ -939,6 +1556,7 @@ export interface ScaleOptions {
939
1556
  align?: number;
940
1557
  palette?: Palette;
941
1558
  interpolate?: ContinuousColorInterpolation;
1559
+ midpoint?: number | "auto";
942
1560
  unknown?: unknown;
943
1561
  }
944
1562
 
@@ -1002,12 +1620,59 @@ export type NonPointCategoricalColorScaleOptions = ScaleFields<"id" | "palette">
1002
1620
  };
1003
1621
  export type CategoricalColorScaleOptions =
1004
1622
  NonPointCategoricalColorScaleOptions & { unknown?: string };
1005
- export type SizeScaleOptions = ScaleFields<"id"> & {
1006
- type?: "linear";
1007
- domain?: "auto" | readonly [number, number];
1008
- range?: "auto" | readonly [number, number];
1623
+ type SizeScaleCommonOptions = ScaleFields<"id" | "reverse"> & {
1009
1624
  unknown?: number;
1010
1625
  };
1626
+ type ContinuousSizeScaleOptions = SizeScaleCommonOptions &
1627
+ ScaleFields<"clamp"> & {
1628
+ domain?: "auto" | readonly [number, number];
1629
+ range?: "auto" | readonly [number, number];
1630
+ };
1631
+ export type SizeScaleOptions =
1632
+ | (ContinuousSizeScaleOptions & {
1633
+ type?: "linear";
1634
+ base?: never;
1635
+ exponent?: never;
1636
+ })
1637
+ | (ContinuousSizeScaleOptions & {
1638
+ type: "log";
1639
+ base?: number;
1640
+ exponent?: never;
1641
+ })
1642
+ | (ContinuousSizeScaleOptions & {
1643
+ type: "sqrt";
1644
+ base?: never;
1645
+ exponent?: never;
1646
+ })
1647
+ | (ContinuousSizeScaleOptions & {
1648
+ type: "pow";
1649
+ exponent: number;
1650
+ base?: never;
1651
+ })
1652
+ | (SizeScaleCommonOptions & {
1653
+ type: "quantize";
1654
+ domain?: "auto" | readonly [number, number];
1655
+ range: readonly [number, number, ...number[]];
1656
+ clamp?: never;
1657
+ base?: never;
1658
+ exponent?: never;
1659
+ })
1660
+ | (SizeScaleCommonOptions & {
1661
+ type: "quantile";
1662
+ domain?: "auto" | readonly [number, ...number[]];
1663
+ range: readonly [number, number, ...number[]];
1664
+ clamp?: never;
1665
+ base?: never;
1666
+ exponent?: never;
1667
+ })
1668
+ | (SizeScaleCommonOptions & {
1669
+ type: "threshold";
1670
+ domain: readonly [number, ...number[]];
1671
+ range: readonly [number, number, ...number[]];
1672
+ clamp?: never;
1673
+ base?: never;
1674
+ exponent?: never;
1675
+ });
1011
1676
  export type ShapeScaleOptions = ScaleFields<"id"> & {
1012
1677
  type?: "ordinal";
1013
1678
  domain?: "auto" | readonly unknown[];
@@ -1018,6 +1683,7 @@ export type ShapeScaleOptions = ScaleFields<"id"> & {
1018
1683
  export type CreateScaleOptions = ScaleOptions & { id: string };
1019
1684
 
1020
1685
  export interface EditScaleOptions {
1686
+ radialMapping?: RadialMapping;
1021
1687
  id?: string;
1022
1688
  type?: ScaleType;
1023
1689
  domain?: "auto" | readonly unknown[];
@@ -1035,9 +1701,80 @@ export interface EditScaleOptions {
1035
1701
  align?: number;
1036
1702
  palette?: Palette;
1037
1703
  interpolate?: ContinuousColorInterpolation;
1704
+ midpoint?: number | "auto";
1038
1705
  unknown?: unknown;
1039
1706
  }
1040
1707
 
1708
+ type FocusedScaleSelection = { id?: string; target?: string };
1709
+ export type EditXScaleOptions = FocusedScaleSelection & WithoutScaleId<
1710
+ QuantitativePositionScaleOptions | TemporalPositionScaleOptions | CategoricalPositionScaleOptions
1711
+ >;
1712
+ export type EditYScaleOptions = EditXScaleOptions;
1713
+ export type OffsetScaleEditPatch = Pick<
1714
+ ScaleOptions,
1715
+ "domain" | "reverse" | "padding" | "paddingInner" | "paddingOuter" | "align"
1716
+ >;
1717
+ export type EditXOffsetScaleOptions = { target: string } & OffsetScaleEditPatch;
1718
+ export type EditYOffsetScaleOptions = EditXOffsetScaleOptions;
1719
+ export type EditParallelScaleOptions = {
1720
+ target: string;
1721
+ dimension: string;
1722
+ } & WithoutScaleId<
1723
+ QuantitativePositionScaleOptions | CategoricalPositionScaleOptions
1724
+ >;
1725
+ export type EditThetaScaleOptions = FocusedScaleSelection & WithoutScaleId<ThetaScaleOptions>;
1726
+ export type EditRScaleOptions = FocusedScaleSelection & WithoutScaleId<RadiusScaleOptions> & {
1727
+ radialMapping?: RadialMapping;
1728
+ };
1729
+ export type EditColorScaleOptions = FocusedScaleSelection & WithoutScaleId<
1730
+ CategoricalColorScaleOptions | ContinuousColorScaleOptions | DiscretizedColorScaleOptions
1731
+ >;
1732
+ export type EditStrokeScaleOptions = { target: string } & Omit<
1733
+ EditColorScaleOptions,
1734
+ "id" | "target"
1735
+ >;
1736
+ type ExistingSizeScaleEditPatch = {
1737
+ type?: never;
1738
+ domain?: "auto" | readonly [number, ...number[]];
1739
+ range?: "auto" | readonly [number, number, ...number[]];
1740
+ unknown?: number;
1741
+ clamp?: boolean;
1742
+ reverse?: boolean;
1743
+ base?: number;
1744
+ exponent?: number;
1745
+ };
1746
+ type SizeScaleTypeEditPatch =
1747
+ | (Omit<WithoutScaleId<SizeScaleOptions>, "type"> & { type?: "linear" })
1748
+ | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "log" }>, "type"> & {
1749
+ type: "log";
1750
+ })
1751
+ | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "sqrt" }>, "type"> & {
1752
+ type: "sqrt";
1753
+ })
1754
+ | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "pow" }>, "type" | "exponent"> & {
1755
+ type: "pow";
1756
+ exponent?: number;
1757
+ })
1758
+ | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "quantize" }>, "type" | "range"> & {
1759
+ type: "quantize";
1760
+ range?: readonly [number, number, ...number[]];
1761
+ })
1762
+ | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "quantile" }>, "type" | "range"> & {
1763
+ type: "quantile";
1764
+ range?: readonly [number, number, ...number[]];
1765
+ })
1766
+ | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "threshold" }>, "type" | "domain" | "range"> & {
1767
+ type: "threshold";
1768
+ domain?: readonly [number, ...number[]];
1769
+ range?: readonly [number, number, ...number[]];
1770
+ });
1771
+ export type EditSizeScaleOptions = FocusedScaleSelection &
1772
+ (ExistingSizeScaleEditPatch | SizeScaleTypeEditPatch);
1773
+ export type EditOpacityScaleOptions = FocusedScaleSelection & WithoutScaleId<OpacityScaleOptions>;
1774
+ export type EditShapeScaleOptions = FocusedScaleSelection & WithoutScaleId<ShapeScaleOptions>;
1775
+ export type EditStrokeWidthScaleOptions = FocusedScaleSelection & WithoutScaleId<StrokeWidthScaleOptions>;
1776
+ export type EditStrokeDashScaleOptions = FocusedScaleSelection & WithoutScaleId<DashScaleOptions>;
1777
+
1041
1778
  interface PositionEncodingBase {
1042
1779
  field: string;
1043
1780
  target?: string;
@@ -1061,6 +1798,7 @@ type PositionScaleBranches<Quantitative, Temporal, Categorical> =
1061
1798
  }
1062
1799
  | {
1063
1800
  fieldType: "temporal";
1801
+ temporalUnit?: TemporalInputUnit;
1064
1802
  aggregate?: never;
1065
1803
  scale?: Temporal;
1066
1804
  }
@@ -1115,27 +1853,38 @@ export interface RadiusScaleOptions {
1115
1853
  constant?: number;
1116
1854
  }
1117
1855
 
1118
- export interface ThetaEncodingOptions {
1856
+ export type ThetaEncodingOptions = {
1119
1857
  /**
1120
1858
  * Arc marks interpret an aggregate-free quantitative field as per-row sector
1121
1859
  * weights. Categorical arc theta retains the count and weighted-sum modes.
1122
1860
  */
1123
1861
  field: string;
1124
1862
  target?: string;
1125
- fieldType?: FieldType;
1126
1863
  scale?: ThetaScaleOptions;
1127
1864
  coordinate?: string;
1128
1865
  aggregate?: "count" | "sum";
1129
1866
  weight?: string;
1130
- }
1867
+ } & (
1868
+ | { fieldType?: Exclude<FieldType, "temporal">; temporalUnit?: never }
1869
+ | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit }
1870
+ );
1131
1871
 
1132
- export interface RadialEncodingOptions {
1133
- field: string;
1872
+ export type MeasuredRadiusScaleOptions = Pick<RadiusScaleOptions, "id" | "domain" | "range" | "clamp"> & {
1873
+ type?: "linear";
1874
+ zero?: true;
1875
+ nice?: false;
1876
+ reverse?: false;
1877
+ };
1878
+
1879
+ export type RadialEncodingOptions = {
1134
1880
  target?: string;
1135
1881
  fieldType?: "quantitative";
1136
- scale?: RadiusScaleOptions;
1137
1882
  coordinate?: string;
1138
- }
1883
+ } & (
1884
+ | { field: string; mapping?: false; aggregate?: never; scale?: RadiusScaleOptions }
1885
+ | { field: string; mapping?: RadialMapping; aggregate: "sum"; scale?: MeasuredRadiusScaleOptions }
1886
+ | { field?: never; mapping?: RadialMapping; aggregate: "count"; scale?: MeasuredRadiusScaleOptions }
1887
+ );
1139
1888
 
1140
1889
  type RulePositionValue =
1141
1890
  | { field: string; datum?: never }
@@ -1157,7 +1906,7 @@ type InferredRuleDatumPositionEncodingOptions = {
1157
1906
  | NonPointCategoricalPositionScaleOptions;
1158
1907
  };
1159
1908
 
1160
- export type RulePositionEncodingOptions =
1909
+ export type DatumPositionEncodingOptions =
1161
1910
  | InferredRuleDatumPositionEncodingOptions
1162
1911
  | RulePositionEncodingBase & (
1163
1912
  | {
@@ -1166,6 +1915,7 @@ export type RulePositionEncodingOptions =
1166
1915
  }
1167
1916
  | {
1168
1917
  fieldType: "temporal";
1918
+ temporalUnit?: TemporalInputUnit;
1169
1919
  scale?: NonPointTemporalPositionScaleOptions;
1170
1920
  }
1171
1921
  | {
@@ -1174,29 +1924,54 @@ export type RulePositionEncodingOptions =
1174
1924
  }
1175
1925
  );
1176
1926
 
1927
+ /** Constant primary position accepted by Rule, Rect, Area, Point, Tick, and independent Text policies. */
1928
+ export type RulePositionEncodingOptions = DatumPositionEncodingOptions;
1929
+
1930
+ type TemporalBindingBranch =
1931
+ | { fieldType?: "quantitative"; temporalUnit?: never }
1932
+ | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit };
1933
+
1177
1934
  type SecondaryRulePositionEncodingOptions = RulePositionEncodingBase & {
1178
- fieldType: FieldType;
1179
1935
  scale?: { id?: string };
1180
- };
1936
+ } & (
1937
+ | { fieldType: Exclude<FieldType, "temporal">; temporalUnit?: never }
1938
+ | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit }
1939
+ );
1181
1940
 
1182
1941
  export type SecondaryPositionEncodingOptions =
1183
1942
  | SecondaryRulePositionEncodingOptions
1184
- | {
1185
- field: string;
1186
- datum?: never;
1187
- target?: string;
1188
- fieldType?: "quantitative" | "temporal";
1189
- scale?: { id?: string };
1190
- coordinate?: string;
1191
- };
1943
+ | { datum: unknown; field?: never; fieldType?: "quantitative"; target?: string; scale?: { id?: string }; coordinate?: string }
1944
+ | ({ field: string; datum?: never; target?: string; scale?: { id?: string }; coordinate?: string } & TemporalBindingBranch);
1192
1945
 
1193
- export type HistogramEncodingOptions = {
1194
- field: string;
1946
+ type AreaRangePositionEncodingOptions = {
1195
1947
  target?: string;
1196
1948
  coordinate?: string;
1197
- stack?: StackMode;
1198
- xScale?: NonPointQuantitativePositionScaleOptions;
1949
+ fieldType?: "quantitative";
1950
+ temporalUnit?: never;
1951
+ scale?: NonPointQuantitativePositionScaleOptions;
1952
+ } & (
1953
+ | { lower: string; upper: { datum: number } }
1954
+ | { lower: { datum: number }; upper: string }
1955
+ );
1956
+
1957
+ type RangePositionEncodingOptions = AreaRangePositionEncodingOptions | {
1958
+ lower: string;
1959
+ upper: string;
1960
+ target?: string;
1961
+ coordinate?: string;
1962
+ } & (
1963
+ | { fieldType?: "quantitative"; temporalUnit?: never; scale?: NonPointQuantitativePositionScaleOptions }
1964
+ | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit; scale?: NonPointTemporalPositionScaleOptions }
1965
+ );
1966
+
1967
+ export type HistogramEncodingOptions = {
1968
+ field: string;
1969
+ target?: string;
1970
+ coordinate?: string;
1971
+ stack?: StackMode;
1972
+ xScale?: NonPointQuantitativePositionScaleOptions;
1199
1973
  yScale?: NonPointZeroSupportingPositionScaleOptions;
1974
+ weight?: StatisticalWeight;
1200
1975
  } & (
1201
1976
  | { maxBins?: number; binStep?: never; binBoundaries?: never }
1202
1977
  | { maxBins?: never; binStep: number; binBoundaries?: never }
@@ -1226,10 +2001,12 @@ export interface DensityDataOptions {
1226
2001
  steps?: number;
1227
2002
  kernel?: DensityKernel;
1228
2003
  normalization?: DensityNormalization;
2004
+ weight?: StatisticalWeight;
1229
2005
  as?: readonly [string, string];
1230
2006
  }
1231
2007
 
1232
- type DensityEncodingBase = Omit<DensityDataOptions, "id"> & {
2008
+ type DensityEncodingBase = Omit<DensityDataOptions, "id" | "groupBy"> & {
2009
+ groupBy?: string | false;
1233
2010
  target?: string;
1234
2011
  densityChannel?: "x" | "y";
1235
2012
  coordinate?: string;
@@ -1254,6 +2031,7 @@ export type HorizonXEncoding = { field: string } & (
1254
2031
  }
1255
2032
  | {
1256
2033
  fieldType: "temporal";
2034
+ temporalUnit?: TemporalInputUnit;
1257
2035
  scale?: NonPointTemporalPositionScaleOptions;
1258
2036
  }
1259
2037
  | {
@@ -1286,7 +2064,7 @@ export interface HorizonEncodingOptions {
1286
2064
  source?: string;
1287
2065
  x?: string | HorizonXEncoding;
1288
2066
  y?: string | HorizonYEncoding;
1289
- groupBy?: string;
2067
+ groupBy?: string | false;
1290
2068
  bands?: number;
1291
2069
  baseline?: number;
1292
2070
  extent?: "auto" | number;
@@ -1317,6 +2095,7 @@ export interface IntervalDataOptions {
1317
2095
  groupBy?: string | readonly string[];
1318
2096
  center?: IntervalCenter;
1319
2097
  extent?: IntervalExtent;
2098
+ method?: ConfidenceIntervalMethod;
1320
2099
  level?: number;
1321
2100
  as?: IntervalOutputFields;
1322
2101
  }
@@ -1327,14 +2106,169 @@ export interface WindowDataOptions {
1327
2106
  partitionBy?: string | readonly string[];
1328
2107
  sortBy?: readonly WindowSort[];
1329
2108
  operations: readonly WindowOperation[];
2109
+ temporalUnit?: TemporalInputUnit;
2110
+ }
2111
+
2112
+ export interface ECDFDataOptions {
2113
+ id: string;
2114
+ source?: string;
2115
+ field: string;
2116
+ groupBy?: string | readonly [string, ...string[]];
2117
+ weight?: string;
2118
+ missing?: "drop" | "error";
2119
+ as?: ECDFOutputFields;
1330
2120
  }
1331
2121
 
1332
- export interface TimeUnitDataOptions {
2122
+ type TimeUnitDataBaseOptions = {
1333
2123
  id: string;
1334
2124
  source?: string;
1335
2125
  field: string;
1336
- unit: TimeUnit;
2126
+ temporalUnit?: TemporalInputUnit;
1337
2127
  as: string;
2128
+ timeZone?: string;
2129
+ };
2130
+ export type TimeUnitDataOptions = TimeUnitDataBaseOptions & (
2131
+ | {
2132
+ unit: Exclude<TimeUnit, "week">;
2133
+ weekStartsOn?: never;
2134
+ weekRule?: never;
2135
+ }
2136
+ | {
2137
+ unit: "week";
2138
+ weekRule?: "calendar";
2139
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
2140
+ }
2141
+ | {
2142
+ unit: "week";
2143
+ weekRule: "iso";
2144
+ weekStartsOn?: 1;
2145
+ }
2146
+ );
2147
+
2148
+ export interface BinDataOutputFields {
2149
+ lower?: string;
2150
+ upper?: string;
2151
+ count?: string;
2152
+ members?: string;
2153
+ }
2154
+ type BinDataMode =
2155
+ | { maxBins?: number; step?: never; boundaries?: never }
2156
+ | { maxBins?: never; step: number; boundaries?: never }
2157
+ | {
2158
+ maxBins?: never;
2159
+ step?: never;
2160
+ boundaries: readonly [number, number, ...number[]];
2161
+ };
2162
+ export type BinDataOptions = {
2163
+ id: string;
2164
+ source?: string;
2165
+ field: string;
2166
+ extent?: "auto" | readonly [number, number];
2167
+ nice?: boolean;
2168
+ zero?: boolean;
2169
+ includeEmpty?: boolean;
2170
+ members?: boolean;
2171
+ weight?: StatisticalWeight;
2172
+ as?: BinDataOutputFields;
2173
+ } & BinDataMode;
2174
+
2175
+ export interface FoldDataOutputFields {
2176
+ key?: string;
2177
+ value?: string;
2178
+ }
2179
+ export interface FoldDataOptions {
2180
+ id: string;
2181
+ source?: string;
2182
+ fields: readonly string[];
2183
+ as?: FoldDataOutputFields;
2184
+ }
2185
+ export interface ComputedDataOptions {
2186
+ id: string;
2187
+ source?: string;
2188
+ as: string;
2189
+ expression: ComputedExpression;
2190
+ }
2191
+ type NormalizedDataBaseOptions = {
2192
+ id: string;
2193
+ source?: string;
2194
+ field: string;
2195
+ as: string;
2196
+ groupBy?: string | readonly string[];
2197
+ };
2198
+ type NormalizeBaselineOptions =
2199
+ | {
2200
+ baseline?: { position: "first" | "last" };
2201
+ sortBy: readonly [WindowSort, ...WindowSort[]];
2202
+ }
2203
+ | {
2204
+ baseline: { value: number };
2205
+ sortBy?: readonly WindowSort[];
2206
+ };
2207
+ export type NormalizedDataOptions = NormalizedDataBaseOptions & (
2208
+ | {
2209
+ method: "share" | "minmax";
2210
+ zeroDenominator?: NormalizeZeroDenominator;
2211
+ }
2212
+ | {
2213
+ method: "zscore";
2214
+ variance?: "population" | "sample";
2215
+ zeroDenominator?: NormalizeZeroDenominator;
2216
+ }
2217
+ | ({
2218
+ method: "index" | "percentChange";
2219
+ zeroDenominator?: NormalizeZeroDenominator;
2220
+ } & NormalizeBaselineOptions)
2221
+ | ({ method: "change" } & NormalizeBaselineOptions)
2222
+ );
2223
+ type CompleteDataBaseOptions = {
2224
+ id: string;
2225
+ source?: string;
2226
+ key: string;
2227
+ groupBy?: string | readonly string[];
2228
+ fill?: Readonly<Record<string, DatasetScalar>>;
2229
+ members?: string;
2230
+ };
2231
+ export type CompleteDataOptions = CompleteDataBaseOptions & (
2232
+ | { values: readonly [DatasetScalar, ...DatasetScalar[]]; sequence?: never }
2233
+ | {
2234
+ values?: never;
2235
+ sequence: { start: number; end: number; step: number };
2236
+ }
2237
+ | { values?: never; sequence?: never }
2238
+ );
2239
+ type ImputedDataBaseOptions = {
2240
+ id: string;
2241
+ source?: string;
2242
+ fields: string | readonly [string, ...string[]];
2243
+ groupBy?: string | readonly string[];
2244
+ edges?: "keep" | "error";
2245
+ maxGap?: number;
2246
+ };
2247
+ export type ImputedDataOptions = ImputedDataBaseOptions & (
2248
+ | {
2249
+ method: "constant";
2250
+ value: DatasetScalar;
2251
+ sortBy?: readonly WindowSort[];
2252
+ }
2253
+ | {
2254
+ method: "forward" | "backward";
2255
+ value?: never;
2256
+ sortBy: readonly [WindowSort, ...WindowSort[]];
2257
+ }
2258
+ | {
2259
+ method: "linear";
2260
+ value?: never;
2261
+ sortBy: readonly [{ field: string; order?: "ascending" }];
2262
+ }
2263
+ );
2264
+ export interface StackDataOptions {
2265
+ id: string;
2266
+ source?: string;
2267
+ category: string;
2268
+ group: string;
2269
+ value: string;
2270
+ mode?: StackDataMode;
2271
+ as?: StackDataOutputFields;
1338
2272
  }
1339
2273
 
1340
2274
  export interface Bin2DDataOptions {
@@ -1359,8 +2293,51 @@ export interface EditBin2DDataOptions {
1359
2293
  includeEmpty?: boolean;
1360
2294
  members?: boolean;
1361
2295
  as?: DatasetBin2DOutputFields;
2296
+ dependents?: DerivedDataDependents;
1362
2297
  }
1363
2298
 
2299
+ type FocusedDerivedDataPatch<T> = T extends unknown
2300
+ ? Partial<Omit<T, "id" | "source">>
2301
+ : never;
2302
+ type FocusedDerivedDataEdit<T> = {
2303
+ target: string;
2304
+ dependents?: DerivedDataDependents;
2305
+ } & FocusedDerivedDataPatch<T>;
2306
+ type FocusedWeightedDerivedDataEdit<T, Weight> = {
2307
+ target: string;
2308
+ dependents?: DerivedDataDependents;
2309
+ } & (T extends unknown
2310
+ ? Omit<FocusedDerivedDataPatch<T>, "weight"> & { weight?: Weight | false }
2311
+ : never);
2312
+
2313
+ export type EditComputedDataOptions = FocusedDerivedDataEdit<ComputedDataOptions>;
2314
+ export type EditFilteredDataOptions = FocusedDerivedDataEdit<FilterDataOptions>;
2315
+ export type EditFoldDataOptions = FocusedDerivedDataEdit<FoldDataOptions>;
2316
+ export type EditSummaryDataOptions = FocusedWeightedDerivedDataEdit<
2317
+ SummaryDataOptions,
2318
+ StatisticalWeight
2319
+ >;
2320
+ export type EditBinDataOptions = FocusedWeightedDerivedDataEdit<
2321
+ BinDataOptions,
2322
+ StatisticalWeight
2323
+ >;
2324
+ export type EditTimeUnitDataOptions = FocusedDerivedDataEdit<TimeUnitDataOptions>;
2325
+ export type EditWindowDataOptions = FocusedDerivedDataEdit<WindowDataOptions>;
2326
+ export type EditDensityDataOptions = FocusedWeightedDerivedDataEdit<
2327
+ DensityDataOptions,
2328
+ StatisticalWeight
2329
+ >;
2330
+ export type EditStackDataOptions = FocusedDerivedDataEdit<StackDataOptions>;
2331
+ export type EditRegressionDataOptions = FocusedDerivedDataEdit<RegressionDataOptions>;
2332
+ export type EditIntervalDataOptions = FocusedDerivedDataEdit<IntervalDataOptions>;
2333
+ export type EditECDFDataOptions = FocusedWeightedDerivedDataEdit<
2334
+ ECDFDataOptions,
2335
+ string
2336
+ >;
2337
+ export type EditNormalizedDataOptions = FocusedDerivedDataEdit<NormalizedDataOptions>;
2338
+ export type EditCompleteDataOptions = FocusedDerivedDataEdit<CompleteDataOptions>;
2339
+ export type EditImputedDataOptions = FocusedDerivedDataEdit<ImputedDataOptions>;
2340
+
1364
2341
  export type ErrorBarPositionChannel = { field?: string } & (
1365
2342
  | {
1366
2343
  fieldType?: "nominal" | "ordinal";
@@ -1368,6 +2345,7 @@ export type ErrorBarPositionChannel = { field?: string } & (
1368
2345
  }
1369
2346
  | {
1370
2347
  fieldType: "temporal";
2348
+ temporalUnit?: TemporalInputUnit;
1371
2349
  scale?: NonPointTemporalPositionScaleOptions;
1372
2350
  }
1373
2351
  | {
@@ -1380,6 +2358,7 @@ export interface ErrorBarStatisticalIntervalChannel {
1380
2358
  field?: string;
1381
2359
  center?: IntervalCenter;
1382
2360
  extent?: IntervalExtent;
2361
+ method?: ConfidenceIntervalMethod;
1383
2362
  level?: number;
1384
2363
  scale?: NonPointQuantitativePositionScaleOptions;
1385
2364
  }
@@ -1403,7 +2382,7 @@ export interface ErrorBarOffsetChannel {
1403
2382
  paddingOuter?: number;
1404
2383
  }
1405
2384
 
1406
- export interface ErrorBarOptions {
2385
+ export interface ErrorBarOptions extends StrokeStyleDetails {
1407
2386
  id?: string;
1408
2387
  target?: string;
1409
2388
  data?: string;
@@ -1411,7 +2390,7 @@ export interface ErrorBarOptions {
1411
2390
  y?: ErrorBarPositionChannel | ErrorBarIntervalChannel;
1412
2391
  xOffset?: ErrorBarOffsetChannel;
1413
2392
  yOffset?: ErrorBarOffsetChannel;
1414
- groupBy?: string;
2393
+ groupBy?: string | false;
1415
2394
  coordinate?: string;
1416
2395
  caps?: boolean;
1417
2396
  capSize?: number;
@@ -1421,8 +2400,14 @@ export interface ErrorBarOptions {
1421
2400
  opacity?: number;
1422
2401
  }
1423
2402
 
1424
- export interface EditErrorBarOptions {
2403
+ export interface EditErrorBarOptions extends StrokeStyleDetails {
1425
2404
  target?: string;
2405
+ data?: string;
2406
+ x?: ErrorBarPositionChannel | ErrorBarIntervalChannel;
2407
+ y?: ErrorBarPositionChannel | ErrorBarIntervalChannel;
2408
+ xOffset?: ErrorBarOffsetChannel | false;
2409
+ yOffset?: ErrorBarOffsetChannel | false;
2410
+ groupBy?: string | false;
1426
2411
  caps?: boolean;
1427
2412
  capSize?: number;
1428
2413
  stroke?: string;
@@ -1432,6 +2417,7 @@ export interface EditErrorBarOptions {
1432
2417
  statistics?: {
1433
2418
  center?: IntervalCenter;
1434
2419
  extent?: IntervalExtent;
2420
+ method?: ConfidenceIntervalMethod;
1435
2421
  level?: number;
1436
2422
  };
1437
2423
  }
@@ -1466,22 +2452,22 @@ export interface BoxPlotOptions {
1466
2452
  whisker?: BoxPlotWhisker;
1467
2453
  width?: { band?: number };
1468
2454
  outliers?: boolean;
1469
- box?: {
2455
+ box?: RectStyleDetails & {
1470
2456
  fill?: string;
1471
2457
  opacity?: number;
1472
2458
  stroke?: string;
1473
2459
  strokeWidth?: number;
1474
2460
  };
1475
- median?: {
2461
+ median?: StrokeStyleDetails & {
1476
2462
  stroke?: string;
1477
2463
  strokeWidth?: number;
1478
2464
  };
1479
- outlier?: {
2465
+ outlier?: StrokeStyleDetails & {
1480
2466
  shape?: PointShape;
1481
2467
  radius?: number;
1482
2468
  opacity?: number;
1483
2469
  };
1484
- guides?: false | CartesianGuideOptions;
2470
+ guides?: false | BoxPlotGuideOptions;
1485
2471
  }
1486
2472
 
1487
2473
  export interface EditBoxPlotOptions {
@@ -1492,17 +2478,17 @@ export interface EditBoxPlotOptions {
1492
2478
  whisker?: BoxPlotWhisker;
1493
2479
  width?: { band?: number };
1494
2480
  outliers?: boolean;
1495
- box?: {
2481
+ box?: RectStyleDetails & {
1496
2482
  fill?: string;
1497
2483
  opacity?: number;
1498
2484
  stroke?: string;
1499
2485
  strokeWidth?: number;
1500
2486
  };
1501
- median?: {
2487
+ median?: StrokeStyleDetails & {
1502
2488
  stroke?: string;
1503
2489
  strokeWidth?: number;
1504
2490
  };
1505
- outlier?: {
2491
+ outlier?: StrokeStyleDetails & {
1506
2492
  shape?: PointShape;
1507
2493
  radius?: number;
1508
2494
  opacity?: number;
@@ -1524,7 +2510,7 @@ export interface GradientPlotAppearanceOptions {
1524
2510
  opacity?: readonly [number, number];
1525
2511
  }
1526
2512
 
1527
- export interface GradientPlotCenterOptions {
2513
+ export interface GradientPlotCenterOptions extends StrokeStyleDetails {
1528
2514
  type?: "mean" | "median";
1529
2515
  stroke?: string;
1530
2516
  strokeWidth?: number;
@@ -1566,7 +2552,9 @@ export type ViolinPlotPositionChannel =
1566
2552
 
1567
2553
  export interface ViolinPlotDensityOptions
1568
2554
  extends GradientPlotDensityOptions {
2555
+ weight?: StatisticalWeight;
1569
2556
  width?: DensityPlacementWidth;
2557
+ side?: "both" | "left" | "right" | "top" | "bottom";
1570
2558
  }
1571
2559
 
1572
2560
  export interface ViolinPlotSplitOptions {
@@ -1584,7 +2572,7 @@ export type ViolinPlotColorOptions =
1584
2572
  layout?: "overlay";
1585
2573
  };
1586
2574
 
1587
- export interface ViolinPlotAreaOptions {
2575
+ export interface ViolinPlotAreaOptions extends StrokeStyleDetails {
1588
2576
  fill?: string;
1589
2577
  opacity?: number;
1590
2578
  stroke?: string;
@@ -1602,7 +2590,18 @@ export interface ViolinPlotOptions {
1602
2590
  color?: ViolinPlotColorOptions;
1603
2591
  density?: ViolinPlotDensityOptions;
1604
2592
  area?: ViolinPlotAreaOptions;
1605
- guides?: false | CartesianGuideOptions;
2593
+ guides?: false | CartesianCategoricalGuideOptions;
2594
+ }
2595
+
2596
+ export interface EditViolinPlotOptions {
2597
+ target?: string;
2598
+ data?: string;
2599
+ x?: ViolinPlotPositionChannel;
2600
+ y?: ViolinPlotPositionChannel;
2601
+ split?: false | ViolinPlotSplitOptions;
2602
+ density?: Omit<ViolinPlotDensityOptions, "weight"> & {
2603
+ weight?: StatisticalWeight | false;
2604
+ };
1606
2605
  }
1607
2606
 
1608
2607
  export interface EditGradientPlotOptions {
@@ -1629,6 +2628,7 @@ type PointFacadePositionChannel =
1629
2628
  }
1630
2629
  | {
1631
2630
  fieldType: "temporal";
2631
+ temporalUnit?: TemporalInputUnit;
1632
2632
  scale?: TemporalPositionScaleOptions;
1633
2633
  }
1634
2634
  | {
@@ -1645,6 +2645,7 @@ type LineXPositionChannel =
1645
2645
  }
1646
2646
  | {
1647
2647
  fieldType: "temporal";
2648
+ temporalUnit?: TemporalInputUnit;
1648
2649
  scale?: NonPointTemporalPositionScaleOptions;
1649
2650
  }
1650
2651
  ));
@@ -1658,6 +2659,7 @@ type LineYPositionChannel =
1658
2659
  }
1659
2660
  | {
1660
2661
  fieldType: "temporal";
2662
+ temporalUnit?: TemporalInputUnit;
1661
2663
  aggregate?: never;
1662
2664
  scale?: NonPointTemporalPositionScaleOptions;
1663
2665
  }
@@ -1669,6 +2671,14 @@ type BandPositionChannel = FacadePositionChannel<
1669
2671
  >;
1670
2672
  type BarYPositionChannel =
1671
2673
  | string
2674
+ | {
2675
+ field: string;
2676
+ fieldType: "temporal";
2677
+ temporalUnit?: TemporalInputUnit;
2678
+ aggregate?: never;
2679
+ stack?: never;
2680
+ scale?: NonPointTemporalPositionScaleOptions;
2681
+ }
1672
2682
  | ({ field: string; stack?: StackMode } & (
1673
2683
  | {
1674
2684
  fieldType?: "quantitative";
@@ -1703,7 +2713,8 @@ type BasicColorChannel =
1703
2713
  | {
1704
2714
  field: string;
1705
2715
  fieldType: "temporal";
1706
- scale?: ContinuousColorScaleOptions;
2716
+ temporalUnit?: TemporalInputUnit;
2717
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
1707
2718
  palette?: Palette;
1708
2719
  };
1709
2720
  type NonPointCategoricalColorChannel =
@@ -1767,7 +2778,8 @@ type RectColorChannel =
1767
2778
  | {
1768
2779
  field: string;
1769
2780
  fieldType: "temporal";
1770
- scale?: NonPointContinuousColorScaleOptions;
2781
+ temporalUnit?: TemporalInputUnit;
2782
+ scale?: Omit<NonPointContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
1771
2783
  palette?: Palette;
1772
2784
  };
1773
2785
  export type BasicSizeChannel = string | {
@@ -1810,45 +2822,513 @@ export interface ParallelCoordinatesEncodingOptions {
1810
2822
  coordinate?: string;
1811
2823
  dimensions: readonly [ParallelDimension, ParallelDimension, ...ParallelDimension[]];
1812
2824
  key?: string;
1813
- missing?: ParallelMissingPolicy;
2825
+ missing?: ParallelMissingPolicy;
2826
+ }
2827
+ export interface CreateParallelCoordinatesOptions {
2828
+ id?: string;
2829
+ data?: string;
2830
+ coordinate?: string;
2831
+ dimensions: readonly [ParallelDimension, ParallelDimension, ...ParallelDimension[]];
2832
+ key?: string;
2833
+ missing?: ParallelMissingPolicy;
2834
+ color?: LineCategoricalColorChannel;
2835
+ strokeDash?: BasicStrokeDashChannel;
2836
+ line?: StrokeStyleDetails & {
2837
+ strokeWidth?: number;
2838
+ stroke?: string;
2839
+ opacity?: number;
2840
+ curve?: "linear";
2841
+ closed?: false;
2842
+ };
2843
+ guides?: false | ParallelGuideOptions;
2844
+ }
2845
+
2846
+ export interface CreateScatterPlotOptions {
2847
+ id?: string;
2848
+ data?: string;
2849
+ coordinate?: string;
2850
+ x: PointFacadePositionChannel;
2851
+ y: PointFacadePositionChannel;
2852
+ color?: BasicColorChannel;
2853
+ size?: BasicSizeChannel;
2854
+ shape?: BasicShapeChannel;
2855
+ point?: StrokeStyleDetails & {
2856
+ radius?: number;
2857
+ shape?: PointShape;
2858
+ fill?: string;
2859
+ opacity?: number;
2860
+ stroke?: FilledMarkStroke;
2861
+ strokeWidth?: number;
2862
+ };
2863
+ guides?: false | CartesianGuideOptions;
2864
+ }
2865
+
2866
+ export interface IntervalPlotErrorBarOptions extends StrokeStyleDetails {
2867
+ caps?: boolean;
2868
+ capSize?: number;
2869
+ stroke?: string;
2870
+ strokeWidth?: number;
2871
+ strokeDash?: DashStyle | DashPattern;
2872
+ opacity?: number;
2873
+ }
2874
+ type IntervalPlotBaseOptions = {
2875
+ id?: string;
2876
+ data?: string;
2877
+ coordinate?: string;
2878
+ xOffset?: ErrorBarOffsetChannel;
2879
+ yOffset?: ErrorBarOffsetChannel;
2880
+ groupBy?: string | false;
2881
+ color?: BasicColorChannel;
2882
+ point?: CreateScatterPlotOptions["point"];
2883
+ errorBar?: IntervalPlotErrorBarOptions;
2884
+ guides?: false | CartesianGuideOptions;
2885
+ };
2886
+ export type CreateIntervalPlotOptions = IntervalPlotBaseOptions & (
2887
+ | {
2888
+ x: string | ErrorBarPositionChannel;
2889
+ y: string | ErrorBarIntervalChannel;
2890
+ }
2891
+ | {
2892
+ x: string | ErrorBarIntervalChannel;
2893
+ y: string | ErrorBarPositionChannel;
2894
+ }
2895
+ );
2896
+
2897
+ export type RegressionPlotPositionChannel = string | {
2898
+ field: string;
2899
+ fieldType?: "quantitative";
2900
+ scale?: NonPointQuantitativePositionScaleOptions;
2901
+ };
2902
+ type RegressionPlotBaseOptions = {
2903
+ id?: string;
2904
+ data?: string;
2905
+ coordinate?: string;
2906
+ x: RegressionPlotPositionChannel;
2907
+ y: RegressionPlotPositionChannel;
2908
+ color?: BasicColorChannel;
2909
+ size?: BasicSizeChannel;
2910
+ shape?: BasicShapeChannel;
2911
+ point?: CreateScatterPlotOptions["point"];
2912
+ guides?: false | CartesianGuideOptions;
2913
+ };
2914
+ type RegressionPlotStatisticalOptions<T> = T extends unknown
2915
+ ? Omit<T, "target" | "x" | "y">
2916
+ : never;
2917
+ export type CreateRegressionPlotOptions = RegressionPlotBaseOptions &
2918
+ RegressionPlotStatisticalOptions<RegressionOptions>;
2919
+
2920
+ export type EndpointPlotSummary = false | "mean" | "median" | "sum" | "min" | "max";
2921
+ export type EndpointCategoryChannel = string | {
2922
+ field: string;
2923
+ fieldType?: "nominal" | "ordinal";
2924
+ scale?: NonPointCategoricalPositionScaleOptions;
2925
+ };
2926
+ export type EndpointValueChannel = string | {
2927
+ field: string;
2928
+ fieldType?: "quantitative";
2929
+ scale?: NonPointQuantitativePositionScaleOptions;
2930
+ };
2931
+ export type EndpointLabelOptions = Omit<
2932
+ TextMarkOptions,
2933
+ "id" | "data" | "source" | "text"
2934
+ > & {
2935
+ format?: TextFormat;
2936
+ layout?: false | Omit<LabelLayoutOptions, "target">;
2937
+ } & (
2938
+ | { field?: string; value?: never }
2939
+ | { field?: never; value: unknown }
2940
+ );
2941
+ type EndpointPlotBaseOptions = {
2942
+ id?: string;
2943
+ data?: string;
2944
+ coordinate?: string;
2945
+ category: EndpointCategoryChannel;
2946
+ orientation?: "horizontal" | "vertical";
2947
+ summary?: EndpointPlotSummary;
2948
+ guides?: false | CartesianGuideOptions;
2949
+ };
2950
+ export interface CreateDotPlotOptions extends EndpointPlotBaseOptions {
2951
+ value: EndpointValueChannel;
2952
+ point?: CreateScatterPlotOptions["point"];
2953
+ labels?: false | EndpointLabelOptions;
2954
+ }
2955
+ export interface CreateLollipopPlotOptions extends EndpointPlotBaseOptions {
2956
+ value: EndpointValueChannel;
2957
+ baseline?: number;
2958
+ point?: CreateScatterPlotOptions["point"];
2959
+ stem?: RuleStyleOptions;
2960
+ labels?: false | EndpointLabelOptions;
2961
+ }
2962
+ export interface CreateDumbbellPlotOptions extends EndpointPlotBaseOptions {
2963
+ start: EndpointValueChannel;
2964
+ end: EndpointValueChannel;
2965
+ startPoint?: CreateScatterPlotOptions["point"];
2966
+ endPoint?: CreateScatterPlotOptions["point"];
2967
+ connector?: RuleStyleOptions;
2968
+ labels?: false | (EndpointLabelOptions & { endpoint?: "start" | "end" | "both" });
2969
+ }
2970
+ export type EditEndpointPlotOptions = { target?: string } & Partial<Pick<
2971
+ CreateDumbbellPlotOptions,
2972
+ "data" | "coordinate" | "category" | "start" | "end" | "orientation" | "summary"
2973
+ >> & {
2974
+ value?: EndpointValueChannel;
2975
+ baseline?: number;
2976
+ };
2977
+
2978
+ export interface CreateECDFPlotOptions {
2979
+ id?: string;
2980
+ data?: string;
2981
+ coordinate?: string;
2982
+ field: string;
2983
+ groupBy?: string | readonly [string, ...string[]];
2984
+ weight?: string;
2985
+ missing?: "drop" | "error";
2986
+ as?: ECDFOutputFields;
2987
+ color?: string | LineCategoricalColorChannel;
2988
+ line?: StrokeStyleDetails & { strokeWidth?: number; stroke?: string; opacity?: number };
2989
+ labels?: false | EndpointLabelOptions;
2990
+ guides?: false | CartesianPathGuideOptions;
2991
+ }
2992
+ export type EditECDFPlotOptions = { target?: string } & Partial<Pick<
2993
+ CreateECDFPlotOptions,
2994
+ "data" | "coordinate" | "field" | "missing" | "as"
2995
+ >> & {
2996
+ groupBy?: CreateECDFPlotOptions["groupBy"] | false;
2997
+ weight?: string | false;
2998
+ color?: CreateECDFPlotOptions["color"] | false;
2999
+ };
3000
+
3001
+ export type PolarThetaChannel = string | ({ field: string; scale?: ThetaScaleOptions } & (
3002
+ | { fieldType?: "quantitative" | "nominal" | "ordinal"; temporalUnit?: never }
3003
+ | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit }
3004
+ ));
3005
+ export type PolarRadiusChannel = string | {
3006
+ field: string;
3007
+ fieldType?: "quantitative";
3008
+ scale?: RadiusScaleOptions;
3009
+ };
3010
+ export type PolarChartGuideOptions = {
3011
+ axes?: false | Pick<CreateAxesOptions, "theta" | "radius"> & {
3012
+ coordinate?: { id?: string; type?: "auto" | "polar" };
3013
+ };
3014
+ grid?: false | Pick<CreateGridOptions, "theta" | "radial">;
3015
+ legend?: false | LegendOptions;
3016
+ };
3017
+ type PolarLegendOrder = LegendValueOrder | { channel: "theta"; values?: never };
3018
+ type PolarPathLegendOptions = Omit<PathLegendOptions, "order"> & {
3019
+ order?: PolarLegendOrder;
3020
+ };
3021
+ type PolarPointLegendOptions = Omit<FilledMarkLegendOptions, "order"> & {
3022
+ order?: PolarLegendOrder;
3023
+ };
3024
+ export type PolarPathGuideOptions = Omit<PolarChartGuideOptions, "legend"> & {
3025
+ legend?: false | PolarPathLegendOptions;
3026
+ };
3027
+ export type PolarPointGuideOptions = Omit<PolarChartGuideOptions, "legend"> & {
3028
+ legend?: false | PolarPointLegendOptions;
3029
+ };
3030
+ export interface CreatePolarScatterPlotOptions {
3031
+ id?: string;
3032
+ data?: string;
3033
+ coordinate?: string;
3034
+ theta: PolarThetaChannel;
3035
+ radius: PolarRadiusChannel;
3036
+ color?: BasicColorChannel;
3037
+ size?: BasicSizeChannel;
3038
+ shape?: BasicShapeChannel;
3039
+ point?: CreateScatterPlotOptions["point"];
3040
+ guides?: false | PolarPointGuideOptions;
3041
+ }
3042
+ export interface CreatePolarLinePlotOptions {
3043
+ id?: string;
3044
+ data?: string;
3045
+ coordinate?: string;
3046
+ theta: PolarThetaChannel;
3047
+ radius: PolarRadiusChannel;
3048
+ color?: LineCategoricalColorChannel;
3049
+ groupBy?: string | readonly [string, ...string[]];
3050
+ strokeDash?: BasicStrokeDashChannel;
3051
+ line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve"> & {
3052
+ curve?: "linear";
3053
+ closed?: boolean;
3054
+ };
3055
+ guides?: false | PolarPathGuideOptions;
3056
+ }
3057
+ export type RadarCategoryValue = string | number | boolean;
3058
+ export type RadarCategoryScaleOptions = Pick<
3059
+ ThetaScaleOptions,
3060
+ "id" | "domain" | "range" | "reverse" | "paddingInner" | "paddingOuter" |
3061
+ "padding" | "align"
3062
+ > & { type?: "band" | "point" };
3063
+ export type RadarCategoryChannel = string | {
3064
+ field: string;
3065
+ fieldType?: "nominal" | "ordinal";
3066
+ scale?: RadarCategoryScaleOptions;
3067
+ };
3068
+ type CategoricalThetaTicksAndLabelsOptions = Omit<
3069
+ PolarTicksAndLabelsOptions,
3070
+ "count" | "labels"
3071
+ > & {
3072
+ count?: never;
3073
+ labels?: Omit<AxisLabelStyleOptions, "format"> & DisplayLabelOptions &
3074
+ { format?: "auto" };
3075
+ };
3076
+ type CategoricalThetaAxisOptions = Omit<CompletePolarAxisOptions, "ticksAndLabels"> & {
3077
+ ticksAndLabels?: false | CategoricalThetaTicksAndLabelsOptions;
3078
+ };
3079
+ type CategoricalThetaGridOptions = Omit<PolarGridOptions, "count"> & {
3080
+ count?: never;
3081
+ };
3082
+ type CategoricalPolarAxesOptions = Omit<
3083
+ Pick<CreateAxesOptions, "theta" | "radius">,
3084
+ "theta"
3085
+ > & {
3086
+ coordinate?: { id?: string; type?: "auto" | "polar" };
3087
+ theta?: false | CategoricalThetaAxisOptions;
3088
+ };
3089
+ type CategoricalPolarGridOptions = Omit<
3090
+ Pick<CreateGridOptions, "theta" | "radial">,
3091
+ "theta"
3092
+ > & {
3093
+ theta?: boolean | CategoricalThetaGridOptions;
3094
+ };
3095
+ export type RadarGuideOptions = Omit<PolarPathGuideOptions, "axes" | "grid" | "legend"> & {
3096
+ axes?: false | CategoricalPolarAxesOptions;
3097
+ grid?: false | CategoricalPolarGridOptions;
3098
+ legend?: false | (Omit<PathLegendOptions, "order"> & { order?: LegendValueOrder });
3099
+ };
3100
+ export interface RadarWideOptions {
3101
+ fields: readonly [string, string, string, ...string[]];
3102
+ as?: { key?: string; value?: string };
3103
+ }
3104
+ export type CreateRadarPlotOptions = {
3105
+ id?: string;
3106
+ data?: string;
3107
+ coordinate?: string;
3108
+ groupBy?: string | readonly [string, ...string[]];
3109
+ order?: readonly [
3110
+ RadarCategoryValue,
3111
+ RadarCategoryValue,
3112
+ RadarCategoryValue,
3113
+ ...RadarCategoryValue[]
3114
+ ];
3115
+ color?: LineCategoricalColorChannel;
3116
+ strokeDash?: BasicStrokeDashChannel;
3117
+ line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve"> & {
3118
+ curve?: "linear";
3119
+ closed?: true;
3120
+ };
3121
+ guides?: false | RadarGuideOptions;
3122
+ } & (
3123
+ | { category: RadarCategoryChannel; value: PolarRadiusChannel; wide?: never }
3124
+ | { wide: RadarWideOptions; category?: never; value?: never }
3125
+ );
3126
+ export type RugMeasureChannel = string | (
3127
+ | {
3128
+ field: string;
3129
+ fieldType?: "quantitative";
3130
+ temporalUnit?: never;
3131
+ scale?: NonPointQuantitativePositionScaleOptions;
3132
+ }
3133
+ | {
3134
+ field: string;
3135
+ fieldType: "temporal";
3136
+ temporalUnit?: TemporalInputUnit;
3137
+ scale?: NonPointTemporalPositionScaleOptions;
3138
+ }
3139
+ );
3140
+ export interface RugTickOptions extends StrokeStyleDetails {
3141
+ length?: number;
3142
+ stroke?: string;
3143
+ strokeWidth?: number;
3144
+ opacity?: number;
3145
+ }
3146
+ export type RugGuideOptions = Omit<CartesianGuideOptions, "axes" | "legend"> & {
3147
+ axes?: false | CAxes;
3148
+ legend?: false;
3149
+ };
3150
+ export type CreateRugPlotOptions = {
3151
+ id?: string;
3152
+ data?: string;
3153
+ coordinate?: string;
3154
+ tick?: RugTickOptions;
3155
+ guides?: false | RugGuideOptions;
3156
+ } & (
3157
+ | { x: RugMeasureChannel; y?: never; edge: "top" | "bottom" }
3158
+ | { y: RugMeasureChannel; x?: never; edge: "left" | "right" }
3159
+ );
3160
+ export type StripCategoryChannel = string | {
3161
+ field: string;
3162
+ fieldType?: "nominal" | "ordinal";
3163
+ scale?: CategoricalPositionScaleOptions;
3164
+ };
3165
+ export interface StripPixelJitterOptions {
3166
+ maxOffset: { pixels: number; band?: never };
3167
+ seed?: string | number;
3168
+ key?: string;
1814
3169
  }
1815
- export interface CreateParallelCoordinatesOptions {
3170
+ export interface StripBandJitterOptions {
3171
+ maxOffset: { pixels?: never; band: number };
3172
+ seed?: string | number;
3173
+ key?: string;
3174
+ }
3175
+ export type StripJitterOptions = StripPixelJitterOptions | StripBandJitterOptions;
3176
+ export type CreateStripPlotOptions = {
1816
3177
  id?: string;
1817
3178
  data?: string;
1818
3179
  coordinate?: string;
1819
- dimensions: readonly [ParallelDimension, ParallelDimension, ...ParallelDimension[]];
1820
- key?: string;
1821
- missing?: ParallelMissingPolicy;
1822
- color?: LineCategoricalColorChannel;
1823
- strokeDash?: BasicStrokeDashChannel;
1824
- line?: {
1825
- strokeWidth?: number;
1826
- stroke?: string;
3180
+ color?: BasicColorChannel;
3181
+ size?: BasicSizeChannel;
3182
+ shape?: BasicShapeChannel;
3183
+ point?: StrokeStyleDetails & {
3184
+ radius?: number;
3185
+ shape?: PointShape;
3186
+ fill?: string;
1827
3187
  opacity?: number;
1828
- curve?: "linear";
1829
- closed?: false;
3188
+ stroke?: FilledMarkStroke;
3189
+ strokeWidth?: number;
1830
3190
  };
1831
- guides?: false | ParallelGuideOptions;
3191
+ guides?: false | CartesianGuideOptions;
3192
+ } & (
3193
+ | { x: RugMeasureChannel; y?: never; jitter?: false | StripPixelJitterOptions }
3194
+ | { x: RugMeasureChannel; y: StripCategoryChannel; jitter?: false | StripBandJitterOptions }
3195
+ | { x: StripCategoryChannel; y: RugMeasureChannel; jitter?: false | StripBandJitterOptions }
3196
+ );
3197
+ export interface BeeswarmPackingOptions {
3198
+ maxOffset?: PointPackingMaxOffset;
3199
+ padding?: number;
3200
+ key?: string;
3201
+ overflow?: "error" | "overlap";
1832
3202
  }
1833
-
1834
- export interface CreateScatterPlotOptions {
3203
+ export type CreateBeeswarmPlotOptions = {
1835
3204
  id?: string;
1836
3205
  data?: string;
1837
3206
  coordinate?: string;
1838
- x: PointFacadePositionChannel;
1839
- y: PointFacadePositionChannel;
1840
3207
  color?: BasicColorChannel;
1841
3208
  size?: BasicSizeChannel;
1842
3209
  shape?: BasicShapeChannel;
1843
- point?: {
3210
+ point?: StrokeStyleDetails & {
3211
+ radius?: number;
1844
3212
  shape?: PointShape;
1845
3213
  fill?: string;
1846
3214
  opacity?: number;
1847
- stroke?: string;
3215
+ stroke?: FilledMarkStroke;
1848
3216
  strokeWidth?: number;
1849
3217
  };
1850
- guides?: false | CreateGuidesOptions;
3218
+ packing?: false | BeeswarmPackingOptions;
3219
+ guides?: false | CartesianGuideOptions;
3220
+ } & (
3221
+ | { x: RugMeasureChannel; y: StripCategoryChannel }
3222
+ | { x: StripCategoryChannel; y: RugMeasureChannel }
3223
+ );
3224
+
3225
+ export interface RaincloudDensityOptions extends GradientPlotDensityOptions {
3226
+ width?: DensityPlacementWidth;
3227
+ area?: ViolinPlotAreaOptions;
3228
+ }
3229
+ export interface RaincloudBoxSummaryOptions {
3230
+ type?: "box";
3231
+ whisker?: BoxPlotWhisker;
3232
+ width?: { band?: number };
3233
+ outliers?: boolean;
3234
+ box?: BoxPlotOptions["box"];
3235
+ median?: BoxPlotOptions["median"];
3236
+ outlier?: BoxPlotOptions["outlier"];
3237
+ }
3238
+ export interface RaincloudIntervalSummaryOptions {
3239
+ type: "interval";
3240
+ center?: IntervalCenter;
3241
+ extent?: IntervalExtent;
3242
+ method?: ConfidenceIntervalMethod;
3243
+ level?: number;
3244
+ point?: CreateScatterPlotOptions["point"];
3245
+ errorBar?: IntervalPlotErrorBarOptions;
3246
+ }
3247
+ export type RaincloudSummaryOptions =
3248
+ | RaincloudBoxSummaryOptions
3249
+ | RaincloudIntervalSummaryOptions;
3250
+ export interface RaincloudPointAppearanceOptions {
3251
+ size?: BasicSizeChannel;
3252
+ shape?: BasicShapeChannel;
3253
+ point?: CreateScatterPlotOptions["point"];
3254
+ }
3255
+ export type RaincloudPointsOptions =
3256
+ | (RaincloudPointAppearanceOptions & {
3257
+ type: "strip";
3258
+ jitter?: false | StripBandJitterOptions;
3259
+ packing?: never;
3260
+ })
3261
+ | (RaincloudPointAppearanceOptions & {
3262
+ type?: "beeswarm";
3263
+ packing?: false | BeeswarmPackingOptions;
3264
+ jitter?: never;
3265
+ });
3266
+ export type RaincloudCategoryChannel = string | {
3267
+ field: string;
3268
+ fieldType?: "nominal" | "ordinal";
3269
+ scale?: NonPointBandPositionScaleOptions;
3270
+ };
3271
+ export type RaincloudValueChannel = string | {
3272
+ field: string;
3273
+ fieldType?: "quantitative";
3274
+ scale?: NonPointQuantitativePositionScaleOptions;
3275
+ };
3276
+ export interface CreateRaincloudPlotOptions {
3277
+ id?: string;
3278
+ data?: string;
3279
+ coordinate?: string;
3280
+ category: RaincloudCategoryChannel;
3281
+ value: RaincloudValueChannel;
3282
+ orientation?: "vertical" | "horizontal";
3283
+ side?: "before" | "after";
3284
+ density?: false | RaincloudDensityOptions;
3285
+ summary?: false | RaincloudSummaryOptions;
3286
+ points?: false | RaincloudPointsOptions;
3287
+ color?: LineCategoricalColorChannel;
3288
+ guides?: false | CartesianCategoricalGuideOptions;
1851
3289
  }
3290
+ export interface EditRaincloudPlotOptions {
3291
+ target?: string;
3292
+ data?: string;
3293
+ category?: RaincloudCategoryChannel;
3294
+ value?: RaincloudValueChannel;
3295
+ orientation?: "vertical" | "horizontal";
3296
+ side?: "before" | "after";
3297
+ density?: false | RaincloudDensityOptions;
3298
+ summary?: false | RaincloudSummaryOptions;
3299
+ points?: false | RaincloudPointsOptions;
3300
+ color?: false | LineCategoricalColorChannel;
3301
+ }
3302
+
3303
+ export type GroupEncodingOptions = { target?: string; fieldType?: "nominal" } & (
3304
+ | { field: string; fields?: never }
3305
+ | { fields: readonly [string, ...string[]]; field?: never }
3306
+ );
3307
+
3308
+ export interface SeriesLayoutOptions { target?: string; mode: ColorLayout; }
3309
+ export interface BasicSeriesLayoutOptions { target?: string; mode: Exclude<ColorLayout, "center">; }
3310
+ export type AreaPlotIndependentChannel = string | ({ field: string } & (
3311
+ | { fieldType?: "quantitative"; scale?: NonPointQuantitativePositionScaleOptions }
3312
+ | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit; scale?: NonPointTemporalPositionScaleOptions }
3313
+ ));
3314
+ export type AreaPlotMeasureChannel = string | { field: string; scale?: NonPointQuantitativePositionScaleOptions }
3315
+ | ({ scale?: NonPointQuantitativePositionScaleOptions } & (
3316
+ | { lower: string; upper: string | { datum: number } }
3317
+ | { lower: { datum: number }; upper: string }
3318
+ ));
3319
+ export type CreateAreaPlotOptions = {
3320
+ id?: string; data?: string; coordinate?: string;
3321
+ groupBy?: string | readonly [string, ...string[]];
3322
+ layout?: Exclude<ColorLayout, "group">; missing?: "error" | "break";
3323
+ color?: string | { field: string; fieldType?: "nominal" | "ordinal"; scale?: NonPointCategoricalColorScaleOptions; palette?: Palette };
3324
+ area?: StrokeStyleDetails & { fill?: string; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3325
+ guides?: false | DensityPlotGuideOptions;
3326
+ } & (
3327
+ | { valueChannel?: "y"; x: AreaPlotIndependentChannel; y: Exclude<AreaPlotMeasureChannel, { lower: unknown }>; baseline?: number }
3328
+ | { valueChannel?: "y"; x: AreaPlotIndependentChannel; y: Extract<AreaPlotMeasureChannel, { lower: unknown }>; baseline?: never }
3329
+ | { valueChannel: "x"; x: Exclude<AreaPlotMeasureChannel, { lower: unknown }>; y: AreaPlotIndependentChannel; baseline?: number }
3330
+ | { valueChannel: "x"; x: Extract<AreaPlotMeasureChannel, { lower: unknown }>; y: AreaPlotIndependentChannel; baseline?: never }
3331
+ );
1852
3332
 
1853
3333
  export interface CreateLinePlotOptions {
1854
3334
  id?: string;
@@ -1857,16 +3337,16 @@ export interface CreateLinePlotOptions {
1857
3337
  x: LineXPositionChannel;
1858
3338
  y: LineYPositionChannel;
1859
3339
  color?: LineCategoricalColorChannel;
1860
- groupBy?: string;
3340
+ groupBy?: string | readonly [string, ...string[]];
1861
3341
  strokeDash?: BasicStrokeDashChannel;
1862
- line?: {
3342
+ line?: StrokeStyleDetails & {
1863
3343
  strokeWidth?: number;
1864
3344
  curve?: CurveInterpolation;
1865
3345
  stroke?: string;
1866
3346
  opacity?: number;
1867
3347
  closed?: false;
1868
3348
  };
1869
- guides?: false | CreateGuidesOptions;
3349
+ guides?: false | CPathGuides;
1870
3350
  }
1871
3351
 
1872
3352
  type BasicHistogramEncoding =
@@ -1886,13 +3366,13 @@ export interface CreateBarPlotOptions {
1886
3366
  y: BarYPositionChannel;
1887
3367
  color?: BarColorChannel;
1888
3368
  width?: Omit<BarWidthOptions, "target">;
1889
- bar?: {
3369
+ bar?: RectStyleDetails & {
1890
3370
  fill?: string;
1891
3371
  opacity?: number;
1892
- stroke?: string;
3372
+ stroke?: FilledMarkStroke;
1893
3373
  strokeWidth?: number;
1894
3374
  };
1895
- guides?: false | CreateGuidesOptions;
3375
+ guides?: false | ColorGuides;
1896
3376
  }
1897
3377
 
1898
3378
  export type CreateHistogramOptions = BasicHistogramEncoding & {
@@ -1901,20 +3381,115 @@ export type CreateHistogramOptions = BasicHistogramEncoding & {
1901
3381
  coordinate?: string;
1902
3382
  field: string;
1903
3383
  color?: HistogramCategoricalColorChannel;
1904
- bar?: {
3384
+ bar?: RectStyleDetails & {
1905
3385
  fill?: string;
1906
3386
  opacity?: number;
1907
- stroke?: string;
3387
+ stroke?: FilledMarkStroke;
1908
3388
  strokeWidth?: number;
1909
3389
  };
1910
- guides?: false | CreateGuidesOptions;
3390
+ guides?: false | CartesianCategoricalGuideOptions;
3391
+ };
3392
+
3393
+ export type HorizonPlotGuideOptions = {
3394
+ axes?: false | (Omit<CAxes, "y"> & { y?: false });
3395
+ grid?: false | (Pick<CartesianGridOptions, "vertical"> & { horizontal?: false });
3396
+ legend?: false;
3397
+ };
3398
+ export interface CreateHorizonPlotOptions {
3399
+ id?: string;
3400
+ data?: string;
3401
+ coordinate?: string;
3402
+ x: string | HorizonXEncoding;
3403
+ y: string | HorizonYEncoding;
3404
+ groupBy?: string | false;
3405
+ bands?: number;
3406
+ baseline?: number;
3407
+ extent?: "auto" | number;
3408
+ resolve?: HorizonResolution;
3409
+ missing?: HorizonMissingPolicy;
3410
+ overflow?: HorizonOverflowPolicy;
3411
+ palette?: HorizonPaletteOptions;
3412
+ area?: StrokeStyleDetails & { opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3413
+ guides?: false | HorizonPlotGuideOptions;
3414
+ }
3415
+
3416
+ export type DensityPlotLegendOptions = Omit<PieLegendOptions, "order"> & { order?: LegendValueOrder };
3417
+ export type DensityPlotGuideOptions = Omit<CCategoricalGuides, "legend"> & {
3418
+ legend?: false | DensityPlotLegendOptions;
3419
+ };
3420
+ export interface CreateDensityPlotOptions {
3421
+ id?: string;
3422
+ data?: string;
3423
+ coordinate?: string;
3424
+ field: string;
3425
+ groupBy?: string | false;
3426
+ bandwidth?: "auto" | number;
3427
+ extent?: "auto" | readonly [number, number];
3428
+ steps?: number;
3429
+ kernel?: DensityKernel;
3430
+ normalization?: DensityNormalization;
3431
+ weight?: StatisticalWeight;
3432
+ as?: readonly [string, string];
3433
+ densityChannel?: "x" | "y";
3434
+ valueScale?: NonPointQuantitativePositionScaleOptions;
3435
+ densityScale?: NonPointZeroSupportingPositionScaleOptions;
3436
+ color?: string | {
3437
+ field: string;
3438
+ fieldType?: "nominal" | "ordinal";
3439
+ scale?: NonPointCategoricalColorScaleOptions;
3440
+ palette?: Palette;
3441
+ layout?: "overlay";
3442
+ };
3443
+ area?: StrokeStyleDetails & { fill?: string; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3444
+ guides?: false | DensityPlotGuideOptions;
3445
+ }
3446
+
3447
+ export type PieCategory = string | {
3448
+ field: string;
3449
+ fieldType?: "nominal" | "ordinal";
3450
+ scale?: Pick<ThetaScaleOptions, "id" | "domain" | "range" | "reverse"> & { type?: "band" };
1911
3451
  };
3452
+ export type PieColor = string | {
3453
+ field: string;
3454
+ fieldType?: "nominal" | "ordinal";
3455
+ scale?: NonPointCategoricalColorScaleOptions;
3456
+ palette?: Palette;
3457
+ };
3458
+ export type PieLegendOptions = Omit<
3459
+ FilledMarkLegendOptions,
3460
+ "count" | "values" | "gradient" | "channels" | "order" | "labels"
3461
+ > & {
3462
+ channels?: readonly ["color"];
3463
+ order?: LegendValueOrder | { channel: "theta"; values?: never };
3464
+ labels?: CategoricalLegendTextOptions;
3465
+ };
3466
+ export type CreatePiePlotOptions = {
3467
+ id?: string;
3468
+ data?: string;
3469
+ coordinate?: string;
3470
+ category: PieCategory;
3471
+ color?: false | PieColor;
3472
+ arc?: StrokeStyleDetails & { innerRadius?: number; padAngle?: number; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3473
+ guides?: false | { axes?: false; grid?: false; legend?: false | PieLegendOptions };
3474
+ } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate: "sum" });
3475
+
3476
+ export type MeasuredRadialGuideOptions = {
3477
+ axes?: false | CategoricalPolarAxesOptions;
3478
+ grid?: false | CategoricalPolarGridOptions;
3479
+ legend?: false | PieLegendOptions;
3480
+ };
3481
+ export type CreateRosePlotOptions = Omit<CreatePiePlotOptions, "guides" | "arc" | "aggregate" | "value"> & {
3482
+ radiusScale?: MeasuredRadiusScaleOptions;
3483
+ arc?: StrokeStyleDetails & { innerRadius?: number; padAngle?: 0; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3484
+ guides?: false | MeasuredRadialGuideOptions;
3485
+ } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate: "sum" });
3486
+ export type CreateRadialBarPlotOptions = CreateRosePlotOptions;
1912
3487
 
1913
3488
  export interface HeatmapBaseOptions {
1914
3489
  id?: string;
1915
3490
  data?: string;
1916
3491
  coordinate?: string;
1917
- rect?: {
3492
+ rect?: RectStyleDetails & {
1918
3493
  opacity?: number;
1919
3494
  stroke?: string | false;
1920
3495
  strokeWidth?: number;
@@ -1974,6 +3549,7 @@ export type ErrorBandPositionChannel = { field?: string } & (
1974
3549
  }
1975
3550
  | {
1976
3551
  fieldType: "temporal";
3552
+ temporalUnit?: TemporalInputUnit;
1977
3553
  scale?: NonPointTemporalPositionScaleOptions;
1978
3554
  }
1979
3555
  );
@@ -1982,6 +3558,7 @@ export interface ErrorBandStatisticalIntervalChannel {
1982
3558
  field?: string;
1983
3559
  center?: IntervalCenter;
1984
3560
  extent?: IntervalExtent;
3561
+ method?: ConfidenceIntervalMethod;
1985
3562
  level?: number;
1986
3563
  scale?: NonPointQuantitativePositionScaleOptions;
1987
3564
  }
@@ -1997,7 +3574,7 @@ export type ErrorBandIntervalChannel =
1997
3574
  | ErrorBandStatisticalIntervalChannel
1998
3575
  | ErrorBandExplicitIntervalChannel;
1999
3576
 
2000
- export interface ErrorBandOptions {
3577
+ export interface ErrorBandOptions extends StrokeStyleDetails {
2001
3578
  id?: string;
2002
3579
  target?: string;
2003
3580
  data?: string;
@@ -2008,35 +3585,40 @@ export interface ErrorBandOptions {
2008
3585
  fill?: string;
2009
3586
  opacity?: number;
2010
3587
  curve?: CurveInterpolation;
2011
- boundaries?: false | {
3588
+ boundaries?: false | (StrokeStyleDetails & {
2012
3589
  stroke?: string;
2013
3590
  strokeWidth?: number;
2014
3591
  strokeDash?: DashStyle | DashPattern;
2015
3592
  opacity?: number;
2016
3593
  curve?: CurveInterpolation;
2017
- };
3594
+ });
2018
3595
  }
2019
3596
 
2020
- export interface EditErrorBandOptions {
3597
+ export interface EditErrorBandOptions extends StrokeStyleDetails {
2021
3598
  target?: string;
2022
- fill?: string;
3599
+ data?: string;
3600
+ x?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3601
+ y?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3602
+ groupBy?: string | false;
3603
+ fill?: string | false;
2023
3604
  opacity?: number;
2024
3605
  curve?: CurveInterpolation;
2025
3606
  statistics?: {
2026
3607
  center?: IntervalCenter;
2027
3608
  extent?: IntervalExtent;
3609
+ method?: ConfidenceIntervalMethod;
2028
3610
  level?: number;
2029
3611
  };
2030
- boundaries?: false | {
3612
+ boundaries?: false | (StrokeStyleDetails & {
2031
3613
  stroke?: string;
2032
3614
  strokeWidth?: number;
2033
3615
  strokeDash?: DashStyle | DashPattern;
2034
3616
  opacity?: number;
2035
3617
  curve?: CurveInterpolation;
2036
- };
3618
+ });
2037
3619
  }
2038
3620
 
2039
- export interface EditErrorBandBoundaryOptions {
3621
+ export interface EditErrorBandBoundaryOptions extends StrokeStyleDetails {
2040
3622
  target?: string;
2041
3623
  boundary?: "both" | "lower" | "upper";
2042
3624
  stroke?: string;
@@ -2056,6 +3638,9 @@ export interface EditDensityOptions {
2056
3638
  steps?: number;
2057
3639
  kernel?: DensityKernel;
2058
3640
  normalization?: DensityNormalization;
3641
+ weight?: StatisticalWeight | false;
3642
+ densityChannel?: "x" | "y";
3643
+ valueScale?: NonPointQuantitativePositionScaleOptions;
2059
3644
  placement?: DensityPlacement;
2060
3645
  }
2061
3646
 
@@ -2063,7 +3648,11 @@ export interface OffsetScaleOptions {
2063
3648
  id?: string;
2064
3649
  type?: "ordinal";
2065
3650
  domain?: "auto" | readonly unknown[];
2066
- range?: "auto" | readonly [number, number];
3651
+ reverse?: boolean;
3652
+ padding?: number;
3653
+ paddingInner?: number;
3654
+ paddingOuter?: number;
3655
+ align?: number;
2067
3656
  }
2068
3657
 
2069
3658
  export interface OffsetEncodingOptions {
@@ -2078,11 +3667,13 @@ export interface OffsetEncodingOptions {
2078
3667
  export interface XOffsetEncodingOptions extends OffsetEncodingOptions {}
2079
3668
  export interface YOffsetEncodingOptions extends OffsetEncodingOptions {}
2080
3669
 
2081
- export type TextFormat = "auto" | `.${number}f`;
3670
+ export type TextFormat = ValueFormat;
2082
3671
 
2083
3672
  export interface TextMarkOptions {
2084
3673
  id?: string;
2085
3674
  data?: string;
3675
+ /** Explicit source mark. Mutually exclusive with data; may be incomplete. */
3676
+ source?: string;
2086
3677
  text?: unknown;
2087
3678
  fill?: string;
2088
3679
  opacity?: number;
@@ -2091,12 +3682,12 @@ export interface TextMarkOptions {
2091
3682
  fontWeight?: string | number;
2092
3683
  align?: "left" | "right" | "center" | "start" | "end";
2093
3684
  baseline?: "top" | "hanging" | "middle" | "alphabetic" | "ideographic" | "bottom";
2094
- rotation?: number;
3685
+ rotation?: RotationInput;
2095
3686
  dx?: number;
2096
3687
  dy?: number;
2097
3688
  }
2098
3689
 
2099
- export interface EditTextMarkOptions extends Omit<TextMarkOptions, "id" | "data" | "text"> {
3690
+ export interface EditTextMarkOptions extends Omit<TextMarkOptions, "id" | "data" | "source" | "text"> {
2100
3691
  target?: string;
2101
3692
  }
2102
3693
 
@@ -2110,6 +3701,27 @@ export interface LabelLeaderOptions {
2110
3701
  opacity?: number;
2111
3702
  }
2112
3703
 
3704
+ export type MarkLabelAnchor =
3705
+ | "center"
3706
+ | "insideStart"
3707
+ | "insideEnd"
3708
+ | "outsideStart"
3709
+ | "outsideEnd";
3710
+
3711
+ export interface MarkLabelPlacementLeaderOptions {
3712
+ stroke?: string;
3713
+ strokeWidth?: number;
3714
+ }
3715
+
3716
+ export interface MarkLabelPlacement {
3717
+ anchor: MarkLabelAnchor;
3718
+ /** Pixel gap between the source boundary and the nearest text edge. Defaults to 4. */
3719
+ gap?: number;
3720
+ /** Inside-fit behavior. Defaults to hide. */
3721
+ overflow?: "hide" | "outside" | "allow";
3722
+ leader?: false | MarkLabelPlacementLeaderOptions;
3723
+ }
3724
+
2113
3725
  export interface LabelLayoutOptions {
2114
3726
  target?: string;
2115
3727
  axis?: LabelLayoutAxis;
@@ -2123,7 +3735,7 @@ export interface RemoveLabelLayoutOptions {
2123
3735
  target?: string;
2124
3736
  }
2125
3737
 
2126
- export interface RectMarkOptions {
3738
+ export interface RectMarkOptions extends RectStyleDetails {
2127
3739
  id?: string;
2128
3740
  data?: string;
2129
3741
  fill?: string;
@@ -2140,10 +3752,81 @@ export type TextEncodingOptions = {
2140
3752
  target?: string;
2141
3753
  format?: TextFormat;
2142
3754
  } & (
2143
- | { field: string; value?: never }
2144
- | { field?: never; value: unknown }
3755
+ | { field: string; value?: never; content?: never; normalizeBy?: never }
3756
+ | { field?: never; value: unknown; content?: never; normalizeBy?: never }
3757
+ | { field?: never; value?: never; content: "category" | "value"; normalizeBy?: never }
3758
+ | { field?: never; value?: never; content: "share"; normalizeBy?: "source" | "category" }
3759
+ );
3760
+
3761
+ /** Attached final-item labels; lower text actions own subsequent edits. */
3762
+ export type MarkLabelSelectionOptions =
3763
+ | { select?: never; selection?: never }
3764
+ | { select: MarkSelector; selection?: never }
3765
+ | { selection: string; select?: never };
3766
+
3767
+ export type CreateMarkLabelsOptions = Omit<TextMarkOptions, "data" | "text"> & {
3768
+ layout?: false | Omit<LabelLayoutOptions, "target">;
3769
+ placement?: MarkLabelPlacement;
3770
+ } & (
3771
+ | (TextEncodingOptions extends infer Options
3772
+ ? Options extends TextEncodingOptions ? Omit<Options, "target"> : never
3773
+ : never)
3774
+ | { field?: never; value?: never; content?: never; normalizeBy?: never; format?: TextFormat }
3775
+ ) & MarkLabelSelectionOptions;
3776
+
3777
+ /** Replace the requested final-item membership of one attached label layer. */
3778
+ export type EditMarkLabelSelectionOptions = { target: string } & (
3779
+ | { select: MarkSelector; selection?: never; all?: never }
3780
+ | { selection: string; select?: never; all?: never }
3781
+ | { all: true; select?: never; selection?: never }
2145
3782
  );
2146
3783
 
3784
+ /** Replace semantic placement or reset one attached label layer to its legacy anchor. */
3785
+ export interface EditMarkLabelPlacementOptions {
3786
+ target: string;
3787
+ placement: MarkLabelPlacement | "auto";
3788
+ }
3789
+
3790
+ /** Remove one attached label layer or every attached label owned by a source mark. */
3791
+ export type RemoveMarkLabelsOptions =
3792
+ | { target: string; source?: never }
3793
+ | { source: string; target?: never };
3794
+
3795
+ type AnnotationBaseOptions = Omit<TextMarkOptions, "id" | "data" | "source" | "text"> & {
3796
+ id?: string;
3797
+ text: unknown;
3798
+ format?: TextFormat;
3799
+ layout?: false | Omit<LabelLayoutOptions, "target">;
3800
+ };
3801
+
3802
+ type AnnotationAnchor =
3803
+ | {
3804
+ x?: never;
3805
+ y?: never;
3806
+ space?: never;
3807
+ source?: string;
3808
+ data?: never;
3809
+ coordinate?: never;
3810
+ }
3811
+ | {
3812
+ x: unknown;
3813
+ y: unknown;
3814
+ space?: "data";
3815
+ source?: string;
3816
+ data?: never;
3817
+ coordinate?: never;
3818
+ }
3819
+ | {
3820
+ x: number;
3821
+ y: number;
3822
+ space: "plot";
3823
+ source?: never;
3824
+ data?: string;
3825
+ coordinate?: string;
3826
+ };
3827
+
3828
+ export type CreateAnnotationOptions = AnnotationBaseOptions & AnnotationAnchor;
3829
+
2147
3830
  export type BarWidthOptions = { target?: string } & (
2148
3831
  | { band?: number; pixels?: never }
2149
3832
  | { band?: never; pixels: number }
@@ -2173,7 +3856,7 @@ export type StrokeDashEncodingOptions =
2173
3856
  };
2174
3857
 
2175
3858
  export type NonPointContinuousColorScaleOptions = ScaleFields<
2176
- "id" | "interpolate" | "clamp" | "reverse"
3859
+ "id" | "interpolate" | "midpoint" | "clamp" | "reverse"
2177
3860
  > & {
2178
3861
  type?: "sequential";
2179
3862
  domain?: "auto" | readonly [unknown, unknown];
@@ -2237,12 +3920,49 @@ export type ColorEncodingOptions =
2237
3920
  field: string;
2238
3921
  target?: string;
2239
3922
  fieldType: "temporal";
3923
+ temporalUnit?: TemporalInputUnit;
2240
3924
  aggregate?: never;
2241
- scale?: ContinuousColorScaleOptions;
3925
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
2242
3926
  palette?: Palette;
2243
3927
  layout?: never;
2244
3928
  };
2245
3929
 
3930
+ export type StrokeEncodingOptions =
3931
+ | {
3932
+ target?: string;
3933
+ value: string;
3934
+ field?: never;
3935
+ fieldType?: never;
3936
+ temporalUnit?: never;
3937
+ scale?: never;
3938
+ }
3939
+ | {
3940
+ target?: string;
3941
+ field: string;
3942
+ value?: never;
3943
+ fieldType?: "nominal" | "ordinal";
3944
+ temporalUnit?: never;
3945
+ scale?: CategoricalColorScaleOptions;
3946
+ }
3947
+ | {
3948
+ target?: string;
3949
+ field: string;
3950
+ value?: never;
3951
+ fieldType: "quantitative";
3952
+ temporalUnit?: never;
3953
+ scale?: ContinuousColorScaleOptions | DiscretizedColorScaleOptions;
3954
+ }
3955
+ | {
3956
+ target?: string;
3957
+ field: string;
3958
+ value?: never;
3959
+ fieldType: "temporal";
3960
+ temporalUnit?: TemporalInputUnit;
3961
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & {
3962
+ midpoint?: "auto";
3963
+ };
3964
+ };
3965
+
2246
3966
  export type OpacityScaleOptions = ScaleFields<
2247
3967
  "id" | "nice" | "zero" | "clamp" | "reverse"
2248
3968
  > & {
@@ -2253,7 +3973,7 @@ export type OpacityScaleOptions = ScaleFields<
2253
3973
  };
2254
3974
 
2255
3975
  export type OpacityEncodingOptions =
2256
- | { value: number; field?: never; target?: string }
3976
+ | { value: number; field?: never; target?: string; fieldType?: never; scale?: never }
2257
3977
  | {
2258
3978
  field: string;
2259
3979
  value?: never;
@@ -2264,6 +3984,48 @@ export type OpacityEncodingOptions =
2264
3984
 
2265
3985
  export type StrokeWidthScaleOptions = NonPointQuantitativePositionScaleOptions;
2266
3986
 
3987
+ export interface RuleStyleOptions extends StrokeStyleDetails {
3988
+ stroke?: string;
3989
+ strokeWidth?: number;
3990
+ strokeDash?: DashStyle | DashPattern;
3991
+ opacity?: number;
3992
+ }
3993
+
3994
+ type ReferenceAxis<Value> = { x: Value; y?: never } | { y: Value; x?: never };
3995
+ type ReferenceBinding<DataValue, PlotValue> =
3996
+ | ({ space?: "data"; source?: string; temporalUnit?: TemporalInputUnit;
3997
+ data?: never; coordinate?: never } & ReferenceAxis<DataValue>)
3998
+ | ({ space: "plot"; data?: string; coordinate?: string;
3999
+ source?: never; temporalUnit?: never } & ReferenceAxis<PlotValue>);
4000
+
4001
+ export type ReferenceStatistic =
4002
+ | { readonly op: "mean" | "median" | "min" | "max"; readonly p?: never }
4003
+ | { readonly op: "quantile"; readonly p: number };
4004
+ type DynamicReferenceBinding = {
4005
+ readonly id?: string;
4006
+ readonly source: string;
4007
+ readonly axis: "x" | "y";
4008
+ readonly population?: "boundData" | "visibleItems";
4009
+ readonly field?: string;
4010
+ readonly x?: never;
4011
+ readonly y?: never;
4012
+ readonly space?: never;
4013
+ readonly data?: never;
4014
+ readonly coordinate?: never;
4015
+ readonly temporalUnit?: never;
4016
+ };
4017
+ export type CreateReferenceLineOptions =
4018
+ | ({ id?: string } & RuleStyleOptions & ReferenceBinding<unknown, number>)
4019
+ | (DynamicReferenceBinding & RuleStyleOptions & {
4020
+ readonly statistic: ReferenceStatistic;
4021
+ });
4022
+ export type CreateReferenceBandOptions =
4023
+ | (Omit<RectMarkOptions, "data"> &
4024
+ ReferenceBinding<readonly [unknown, unknown], readonly [number, number]>)
4025
+ | (DynamicReferenceBinding & Omit<RectMarkOptions, "id" | "data" | "source"> & {
4026
+ readonly statistics: readonly [ReferenceStatistic, ReferenceStatistic];
4027
+ });
4028
+
2267
4029
  export type StrokeWidthEncodingOptions =
2268
4030
  | {
2269
4031
  value: number;
@@ -2280,10 +4042,63 @@ export type StrokeWidthEncodingOptions =
2280
4042
  scale?: StrokeWidthScaleOptions;
2281
4043
  };
2282
4044
 
4045
+ export type SizeEncodingOptions = {
4046
+ field: string;
4047
+ target?: string;
4048
+ fieldType?: "quantitative";
4049
+ scale?: SizeScaleOptions;
4050
+ };
4051
+
4052
+ export type ShapeEncodingOptions = {
4053
+ field: string;
4054
+ target?: string;
4055
+ fieldType?: "nominal";
4056
+ scale?: ShapeScaleOptions;
4057
+ };
4058
+
4059
+ export type AngleEncodingOptions =
4060
+ | { target?: string; value: number; field?: never; fieldType?: never }
4061
+ | { target?: string; field: string; fieldType?: "quantitative"; value?: never };
4062
+
4063
+ type WithoutEncodingTarget<T> = T extends unknown
4064
+ ? Omit<T, "target" | "coordinate">
4065
+ : never;
4066
+
4067
+ export interface EncodingChannelAssignments {
4068
+ x?: WithoutEncodingTarget<PositionEncodingOptions | DatumPositionEncodingOptions>;
4069
+ y?: WithoutEncodingTarget<YPositionEncodingOptions | DatumPositionEncodingOptions>;
4070
+ x2?: WithoutEncodingTarget<SecondaryPositionEncodingOptions>;
4071
+ y2?: WithoutEncodingTarget<SecondaryPositionEncodingOptions>;
4072
+ theta?: WithoutEncodingTarget<ThetaEncodingOptions>;
4073
+ r?: WithoutEncodingTarget<RadialEncodingOptions>;
4074
+ xOffset?: WithoutEncodingTarget<XOffsetEncodingOptions>;
4075
+ yOffset?: WithoutEncodingTarget<YOffsetEncodingOptions>;
4076
+ group?: WithoutEncodingTarget<GroupEncodingOptions>;
4077
+ pathOrder?: WithoutEncodingTarget<PathOrderEncodingOptions>;
4078
+ color?: WithoutEncodingTarget<ColorEncodingOptions>;
4079
+ stroke?: WithoutEncodingTarget<StrokeEncodingOptions>;
4080
+ size?: WithoutEncodingTarget<SizeEncodingOptions>;
4081
+ shape?: WithoutEncodingTarget<ShapeEncodingOptions>;
4082
+ opacity?: WithoutEncodingTarget<OpacityEncodingOptions>;
4083
+ strokeWidth?: WithoutEncodingTarget<StrokeWidthEncodingOptions>;
4084
+ strokeDash?: WithoutEncodingTarget<StrokeDashEncodingOptions>;
4085
+ angle?: WithoutEncodingTarget<AngleEncodingOptions>;
4086
+ text?: WithoutEncodingTarget<TextEncodingOptions>;
4087
+ }
4088
+
4089
+ type AtLeastOne<T> = {
4090
+ [K in keyof T]-?: Required<Pick<T, K>> & Partial<Omit<T, K>>
4091
+ }[keyof T];
4092
+
4093
+ export interface EncodeChannelsOptions {
4094
+ target: string;
4095
+ channels: AtLeastOne<EncodingChannelAssignments>;
4096
+ }
4097
+
2283
4098
  export type RegressionMethod = "linear" | "polynomial" | "loess";
2284
4099
  export type RegressionInterval = "mean" | "prediction";
2285
4100
 
2286
- export interface RegressionBandOptions {
4101
+ export interface RegressionBandOptions extends StrokeStyleDetails {
2287
4102
  color?: string;
2288
4103
  opacity?: number;
2289
4104
  stroke?: string;
@@ -2291,7 +4106,7 @@ export interface RegressionBandOptions {
2291
4106
  curve?: CurveInterpolation;
2292
4107
  }
2293
4108
 
2294
- export interface CreateRegressionBandOptions {
4109
+ export interface CreateRegressionBandOptions extends StrokeStyleDetails {
2295
4110
  id: string;
2296
4111
  data: string;
2297
4112
  x: string;
@@ -2308,7 +4123,7 @@ export interface CreateRegressionBandOptions {
2308
4123
  curve?: CurveInterpolation;
2309
4124
  }
2310
4125
 
2311
- export interface CreateRegressionLineOptions {
4126
+ export interface CreateRegressionLineOptions extends StrokeStyleDetails {
2312
4127
  id: string;
2313
4128
  data: string;
2314
4129
  x: string;
@@ -2327,6 +4142,8 @@ type RegressionParameterOptions =
2327
4142
  method?: "linear";
2328
4143
  degree?: never;
2329
4144
  span?: never;
4145
+ confidenceMethod?: ConfidenceIntervalMethod;
4146
+ level?: number;
2330
4147
  confidence?: number;
2331
4148
  interval?: RegressionInterval;
2332
4149
  }
@@ -2334,6 +4151,8 @@ type RegressionParameterOptions =
2334
4151
  method: "polynomial";
2335
4152
  degree?: number;
2336
4153
  span?: never;
4154
+ confidenceMethod?: ConfidenceIntervalMethod;
4155
+ level?: number;
2337
4156
  confidence?: number;
2338
4157
  interval?: RegressionInterval;
2339
4158
  }
@@ -2341,6 +4160,8 @@ type RegressionParameterOptions =
2341
4160
  method: "loess";
2342
4161
  degree?: never;
2343
4162
  span?: number;
4163
+ confidenceMethod?: never;
4164
+ level?: never;
2344
4165
  confidence?: never;
2345
4166
  interval?: never;
2346
4167
  };
@@ -2357,8 +4178,8 @@ type RegressionCommonOptions = {
2357
4178
  target?: string;
2358
4179
  x?: string;
2359
4180
  y?: string;
2360
- groupBy?: string;
2361
- line?: { strokeWidth?: number; curve?: CurveInterpolation };
4181
+ groupBy?: string | false;
4182
+ line?: StrokeStyleDetails & { strokeWidth?: number; curve?: CurveInterpolation };
2362
4183
  };
2363
4184
 
2364
4185
  export type RegressionOptions = RegressionCommonOptions & (
@@ -2382,10 +4203,12 @@ export interface EditRegressionOptions {
2382
4203
  method?: RegressionMethod;
2383
4204
  degree?: number;
2384
4205
  span?: number;
4206
+ confidenceMethod?: ConfidenceIntervalMethod;
4207
+ level?: number;
2385
4208
  confidence?: number;
2386
4209
  interval?: RegressionInterval;
2387
4210
  band?: false | RegressionBandOptions;
2388
- line?: { strokeWidth?: number; curve?: CurveInterpolation };
4211
+ line?: StrokeStyleDetails & { strokeWidth?: number; curve?: CurveInterpolation };
2389
4212
  }
2390
4213
 
2391
4214
  export interface RemoveAxisOptions {
@@ -2402,7 +4225,8 @@ export interface RemoveGridOptions {
2402
4225
 
2403
4226
  export interface RemoveLegendOptions {
2404
4227
  target?: string;
2405
- channels?: readonly ("color" | "strokeDash" | "strokeWidth" | "shape" | "size" | "opacity")[];
4228
+ /** Remove selected content, including part of a combined categorical legend; omission removes every owned block. */
4229
+ channels?: readonly ("color" | "stroke" | "strokeDash" | "strokeWidth" | "shape" | "size" | "opacity")[];
2406
4230
  }
2407
4231
 
2408
4232
  export interface RemoveMarkOptions {
@@ -2410,11 +4234,17 @@ export interface RemoveMarkOptions {
2410
4234
  }
2411
4235
 
2412
4236
  export interface LegendTextOptions {
4237
+ /** Gap after the occupied sample slot: categorical color/interval default 8; series 10; size/width 12.
4238
+ * Categorical slots include all recipe strokes and mapped shape extents.
4239
+ * Size retains a minimum 32px slot. Width includes the widest line stroke.
4240
+ * Opacity: visible circle-stroke gap, default 12 (inline 8). */
2413
4241
  offset?: number;
2414
4242
  color?: string;
2415
4243
  fontSize?: number;
2416
4244
  fontFamily?: string;
2417
4245
  fontWeight?: string | number;
4246
+ /** Continuous numeric/temporal label format. Categorical legends accept auto only. */
4247
+ format?: ValueFormat;
2418
4248
  }
2419
4249
 
2420
4250
  export interface LegendTitleStyleOptions {
@@ -2444,6 +4274,8 @@ export type LegendSymbolLayer =
2444
4274
 
2445
4275
  export type LegendSymbolRecipe =
2446
4276
  | "auto"
4277
+ /** Sampled opacity uses a single point recipe; radius defaults to 7 and must be positive. */
4278
+ | { type?: "point"; radius?: number; fill?: string; stroke?: string; strokeWidth?: number }
2447
4279
  | { length?: number; lineWidth?: number }
2448
4280
  | { width?: number; height?: number; stroke?: string; strokeWidth?: number }
2449
4281
  | { layers: readonly LegendSymbolLayer[] };
@@ -2455,42 +4287,99 @@ export interface LegendBorderOptions {
2455
4287
  background?: string;
2456
4288
  }
2457
4289
 
4290
+ type LegendValueOrder = "scale" | { values: readonly CategoryValue[]; channel?: never };
4291
+ type CartesianLegendOrder = LegendValueOrder | { channel: "x" | "y"; values?: never };
4292
+ export type LegendOrder = LegendValueOrder |
4293
+ { channel: "x" | "y" | "theta"; values?: never };
4294
+
2458
4295
  export interface LegendOptions {
4296
+ /** Categorical, interval, size, or stroke-width layout. Defaults to edge; legacy-bottom is categorical and requires bottom position. */
4297
+ layout?: "edge" | "legacy-bottom";
4298
+ /** Categorical item order; preserves the appearance scale's assignments. */
4299
+ order?: LegendOrder;
2459
4300
  target?: string;
2460
- channels?: readonly ("color" | "strokeDash" | "strokeWidth" | "shape" | "size" | "opacity")[];
4301
+ /** Exact requested content; omission infers encoded point color/shape/size. Explicit subsets include size only when listed. */
4302
+ channels?: readonly ("color" | "stroke" | "strokeDash" | "strokeWidth" | "shape" | "size" | "opacity")[];
2461
4303
  position?: "right" | "left" | "bottom" | "top";
4304
+ /** Single top/bottom edge: align complete occupied bounds, including border strokes, to the plot. Side positions require center. */
2462
4305
  align?: "left" | "center" | "right";
4306
+ /** Categorical sides require vertical (the default); horizontal edges default to horizontal. */
2463
4307
  direction?: "horizontal" | "vertical";
4308
+ /** Categorical sides allow omission or 1; multiple columns require a horizontal edge. */
2464
4309
  columns?: number;
4310
+ /** Single top/bottom edge: gap from the plot to the nearest occupied legend edge. */
2465
4311
  offset?: number;
2466
4312
  titlePosition?: "top" | "left";
2467
4313
  title?: string;
4314
+ /** Exact ascending samples for continuous size, opacity, or stroke-width legends. Cannot be combined with count. */
4315
+ values?: readonly number[];
2468
4316
  count?: number;
2469
4317
  gradient?: { length?: number; thickness?: number };
2470
4318
  symbol?: LegendSymbolRecipe;
2471
4319
  labels?: LegendTextOptions;
4320
+ /** New categorical+size blocks share typography on every edge; retained standalone size styles remain independent. */
2472
4321
  titleStyle?: LegendTitleStyleOptions;
2473
4322
  itemGap?: number;
2474
4323
  border?: boolean | LegendBorderOptions;
2475
4324
  }
2476
4325
 
4326
+ export type LegendChannel = NonNullable<LegendOptions["channels"]>[number];
4327
+
4328
+ export interface LegendBlockTextPatch {
4329
+ fontSize?: number;
4330
+ fontFamily?: string;
4331
+ fontWeight?: string | number;
4332
+ color?: string;
4333
+ }
4334
+
4335
+ export interface LegendBlockSymbolPatch {
4336
+ /** Point glyph area in square pixels. */
4337
+ size?: number;
4338
+ fill?: string;
4339
+ stroke?: string;
4340
+ strokeWidth?: number;
4341
+ opacity?: number;
4342
+ }
4343
+
4344
+ export interface EditLegendBlockOptions {
4345
+ target: string;
4346
+ channel: LegendChannel;
4347
+ title?: string;
4348
+ values?: readonly [number, ...number[]] | "auto";
4349
+ count?: number;
4350
+ order?: readonly CategoryValue[];
4351
+ gap?: number;
4352
+ text?: LegendBlockTextPatch;
4353
+ symbol?: LegendBlockSymbolPatch;
4354
+ labelMap?: DisplayLabelMap | "auto";
4355
+ }
4356
+
2477
4357
  export interface EditLegendOptions
2478
- extends Omit<LegendOptions, "channels" | "title"> {
4358
+ extends Omit<LegendOptions, "title" | "values"> {
4359
+ /** Exact final content set for the whole target; omission preserves content. */
4360
+ channels?: LegendOptions["channels"];
2479
4361
  title?: string | "auto" | false;
4362
+ /** Replace exact samples, or reset them to the remembered automatic count. */
4363
+ values?: readonly number[] | "auto";
2480
4364
  }
2481
4365
 
2482
4366
  export interface EditLegendLayoutOptions {
2483
4367
  target?: string;
4368
+ layout?: "edge" | "legacy-bottom";
2484
4369
  position?: "right" | "left" | "bottom" | "top";
4370
+ /** Single top/bottom edge: align complete occupied bounds, including border strokes, to the plot. Side positions require center. */
2485
4371
  align?: "left" | "center" | "right";
4372
+ /** Categorical sides require vertical (the default); horizontal edges default to horizontal. */
2486
4373
  direction?: "horizontal" | "vertical";
4374
+ /** Categorical sides allow omission or 1; multiple columns require a horizontal edge. */
2487
4375
  columns?: number;
4376
+ /** Single top/bottom edge: gap from the plot to the nearest occupied legend edge. */
2488
4377
  offset?: number;
2489
4378
  titlePosition?: "top" | "left";
2490
4379
  itemGap?: number;
2491
4380
  }
2492
4381
 
2493
- export interface EditLegendLabelsOptions extends LegendTitleStyleOptions {
4382
+ export interface EditLegendLabelsOptions extends LegendTextOptions {
2494
4383
  target?: string;
2495
4384
  }
2496
4385
 
@@ -2556,11 +4445,11 @@ export type CategoryOrder =
2556
4445
  };
2557
4446
  export type OrderCategoriesOptions = {
2558
4447
  target?: string;
2559
- channel: "x" | "y";
4448
+ channel: "x" | "y" | "theta";
2560
4449
  } & CategoryOrder;
2561
4450
  export interface RemoveCategoryOrderOptions {
2562
4451
  target?: string;
2563
- channel: "x" | "y";
4452
+ channel: "x" | "y" | "theta";
2564
4453
  }
2565
4454
 
2566
4455
  export interface TitleOptions {
@@ -2599,40 +4488,73 @@ export class ChartProgram {
2599
4488
 
2600
4489
  createCanvas(options?: CanvasOptions): ChartProgram;
2601
4490
  editCanvas(options: CanvasOptions): ChartProgram;
4491
+ fitCanvas(options?: FitCanvasOptions): ChartProgram;
4492
+ applyTheme(options: ApplyThemeOptions): ChartProgram;
4493
+ removeTheme(): ChartProgram;
2602
4494
  createData(options: { id?: string; values: readonly unknown[] }): ChartProgram;
4495
+ removeData(options: RemoveResourceOptions): ChartProgram;
4496
+ removeScale(options: RemoveResourceOptions): ChartProgram;
4497
+ removeCoordinate(options: RemoveResourceOptions): ChartProgram;
4498
+ bindMarkData(options: BindMarkDataOptions): ChartProgram;
2603
4499
  filterData(options: FilterDataOptions): ChartProgram;
2604
4500
  filterMarks(options: FilterMarksOptions): ChartProgram;
4501
+ removeMarkFilter(options?: RemoveMarkFilterOptions): ChartProgram;
2605
4502
  selectMarks(options: SelectMarksOptions): ChartProgram;
2606
4503
  editMarkSelection(options: EditMarkSelectionOptions): ChartProgram;
2607
4504
  removeMarkHighlight(options?: RemoveMarkSelectionOptions): ChartProgram;
2608
4505
  removeMarkSelection(options?: RemoveMarkSelectionOptions): ChartProgram;
2609
4506
  highlightMarks(options: HighlightMarksOptions): ChartProgram;
2610
4507
  createDensityData(options: DensityDataOptions): ChartProgram;
4508
+ createSummaryData(options: SummaryDataOptions): ChartProgram;
4509
+ createBinData(options: BinDataOptions): ChartProgram;
4510
+ createFoldData(options: FoldDataOptions): ChartProgram;
4511
+ createComputedData(options: ComputedDataOptions): ChartProgram;
4512
+ createNormalizedData(options: NormalizedDataOptions): ChartProgram;
4513
+ createCompleteData(options: CompleteDataOptions): ChartProgram;
4514
+ createImputedData(options: ImputedDataOptions): ChartProgram;
4515
+ createStackData(options: StackDataOptions): ChartProgram;
2611
4516
  createRegressionData(options: RegressionDataOptions): ChartProgram;
2612
4517
  createIntervalData(options: IntervalDataOptions): ChartProgram;
4518
+ createECDFData(options: ECDFDataOptions): ChartProgram;
2613
4519
  createTimeUnitData(options: TimeUnitDataOptions): ChartProgram;
2614
4520
  createWindowData(options: WindowDataOptions): ChartProgram;
2615
4521
  createBin2DData(options: Bin2DDataOptions): ChartProgram;
4522
+ editDerivedData(options: EditDerivedDataOptions): ChartProgram;
4523
+ editComputedData(options: EditComputedDataOptions): ChartProgram;
4524
+ editFilteredData(options: EditFilteredDataOptions): ChartProgram;
4525
+ editFoldData(options: EditFoldDataOptions): ChartProgram;
4526
+ editSummaryData(options: EditSummaryDataOptions): ChartProgram;
4527
+ editBinData(options: EditBinDataOptions): ChartProgram;
4528
+ editTimeUnitData(options: EditTimeUnitDataOptions): ChartProgram;
4529
+ editWindowData(options: EditWindowDataOptions): ChartProgram;
4530
+ editDensityData(options: EditDensityDataOptions): ChartProgram;
4531
+ editStackData(options: EditStackDataOptions): ChartProgram;
4532
+ editRegressionData(options: EditRegressionDataOptions): ChartProgram;
4533
+ editIntervalData(options: EditIntervalDataOptions): ChartProgram;
4534
+ editECDFData(options: EditECDFDataOptions): ChartProgram;
4535
+ editNormalizedData(options: EditNormalizedDataOptions): ChartProgram;
4536
+ editCompleteData(options: EditCompleteDataOptions): ChartProgram;
4537
+ editImputedData(options: EditImputedDataOptions): ChartProgram;
2616
4538
  editBin2DData(options: EditBin2DDataOptions): ChartProgram;
2617
4539
 
2618
- createPointMark(options?: {
4540
+ createPointMark(options?: StrokeStyleDetails & {
2619
4541
  id?: string;
2620
4542
  data?: string;
2621
4543
  shape?: PointShape;
2622
4544
  fill?: string;
2623
4545
  opacity?: number;
2624
- stroke?: string;
4546
+ stroke?: FilledMarkStroke;
2625
4547
  strokeWidth?: number;
2626
4548
  }): ChartProgram;
2627
- editPointMark(options: {
4549
+ editPointMark(options: StrokeStyleDetails & {
2628
4550
  target?: string;
2629
4551
  shape?: PointShape;
2630
4552
  fill?: string;
2631
4553
  opacity?: number;
2632
- stroke?: string | false;
4554
+ stroke?: FilledMarkStroke;
2633
4555
  strokeWidth?: number;
2634
4556
  }): ChartProgram;
2635
- createTickMark(options?: {
4557
+ createTickMark(options?: StrokeStyleDetails & {
2636
4558
  id?: string;
2637
4559
  data?: string;
2638
4560
  length?: number;
@@ -2640,7 +4562,7 @@ export class ChartProgram {
2640
4562
  strokeWidth?: number;
2641
4563
  opacity?: number;
2642
4564
  }): ChartProgram;
2643
- editTickMark(options: {
4565
+ editTickMark(options: StrokeStyleDetails & {
2644
4566
  target?: string;
2645
4567
  length?: number;
2646
4568
  stroke?: string;
@@ -2649,7 +4571,9 @@ export class ChartProgram {
2649
4571
  }): ChartProgram;
2650
4572
  jitterPoints(options: JitterPointsOptions): ChartProgram;
2651
4573
  removeJitter(options?: RemoveJitterOptions): ChartProgram;
2652
- createLineMark(options?: {
4574
+ packPoints(options: PackPointsOptions): ChartProgram;
4575
+ removePointPacking(options?: RemovePointPackingOptions): ChartProgram;
4576
+ createLineMark(options?: StrokeStyleDetails & {
2653
4577
  id?: string;
2654
4578
  data?: string;
2655
4579
  strokeWidth?: number;
@@ -2658,7 +4582,7 @@ export class ChartProgram {
2658
4582
  opacity?: number;
2659
4583
  closed?: boolean;
2660
4584
  }): ChartProgram;
2661
- editLineMark(options: {
4585
+ editLineMark(options: StrokeStyleDetails & {
2662
4586
  target?: string;
2663
4587
  strokeWidth?: number;
2664
4588
  curve?: CurveInterpolation;
@@ -2666,22 +4590,22 @@ export class ChartProgram {
2666
4590
  opacity?: number;
2667
4591
  closed?: boolean;
2668
4592
  }): ChartProgram;
2669
- createBarMark(options?: {
4593
+ createBarMark(options?: RectStyleDetails & {
2670
4594
  id?: string;
2671
4595
  data?: string;
2672
4596
  fill?: string;
2673
4597
  opacity?: number;
2674
- stroke?: string;
4598
+ stroke?: FilledMarkStroke;
2675
4599
  strokeWidth?: number;
2676
4600
  }): ChartProgram;
2677
- editBarMark(options: {
4601
+ editBarMark(options: RectStyleDetails & {
2678
4602
  target?: string;
2679
4603
  fill?: string;
2680
4604
  opacity?: number;
2681
- stroke?: string | false;
4605
+ stroke?: FilledMarkStroke;
2682
4606
  strokeWidth?: number;
2683
4607
  }): ChartProgram;
2684
- createAreaMark(options?: {
4608
+ createAreaMark(options?: StrokeStyleDetails & {
2685
4609
  id?: string;
2686
4610
  data?: string;
2687
4611
  fill?: string;
@@ -2689,8 +4613,9 @@ export class ChartProgram {
2689
4613
  stroke?: string;
2690
4614
  strokeWidth?: number;
2691
4615
  curve?: CurveInterpolation;
4616
+ missing?: "error" | "break";
2692
4617
  }): ChartProgram;
2693
- createArcMark(options?: {
4618
+ createArcMark(options?: StrokeStyleDetails & {
2694
4619
  id?: string;
2695
4620
  data?: string;
2696
4621
  innerRadius?: number;
@@ -2700,7 +4625,7 @@ export class ChartProgram {
2700
4625
  stroke?: string;
2701
4626
  strokeWidth?: number;
2702
4627
  }): ChartProgram;
2703
- editArcMark(options: {
4628
+ editArcMark(options: StrokeStyleDetails & {
2704
4629
  target?: string;
2705
4630
  innerRadius?: number;
2706
4631
  padAngle?: number;
@@ -2711,33 +4636,39 @@ export class ChartProgram {
2711
4636
  }): ChartProgram;
2712
4637
  createRectMark(options?: RectMarkOptions): ChartProgram;
2713
4638
  editRectMark(options: EditRectMarkOptions): ChartProgram;
2714
- createRuleMark(options?: { id?: string; data?: string }): ChartProgram;
4639
+ createRuleMark(options?: { id?: string; data?: string } & RuleStyleOptions): ChartProgram;
4640
+ editRuleMark(options: { target?: string } & RuleStyleOptions): ChartProgram;
2715
4641
  createTextMark(options?: TextMarkOptions): ChartProgram;
4642
+ createMarkLabels(options?: CreateMarkLabelsOptions): ChartProgram;
4643
+ editMarkLabelSelection(options: EditMarkLabelSelectionOptions): ChartProgram;
4644
+ editMarkLabelPlacement(options: EditMarkLabelPlacementOptions): ChartProgram;
4645
+ removeMarkLabels(options: RemoveMarkLabelsOptions): ChartProgram;
4646
+ createAnnotation(options: CreateAnnotationOptions): ChartProgram;
4647
+ createReferenceLine(options: CreateReferenceLineOptions): ChartProgram;
4648
+ createReferenceBand(options: CreateReferenceBandOptions): ChartProgram;
2716
4649
  editTextMark(options: EditTextMarkOptions): ChartProgram;
2717
4650
  layoutLabels(options?: LabelLayoutOptions): ChartProgram;
2718
4651
  removeLabelLayout(options?: RemoveLabelLayoutOptions): ChartProgram;
2719
- editAreaMark(options: {
4652
+ editAreaMark(options: StrokeStyleDetails & {
2720
4653
  target?: string;
2721
4654
  fill?: string;
2722
4655
  opacity?: number;
2723
4656
  stroke?: string | false;
2724
4657
  strokeWidth?: number;
2725
4658
  curve?: CurveInterpolation;
4659
+ missing?: "error" | "break";
2726
4660
  }): ChartProgram;
2727
4661
 
2728
- encodeX(options: PositionEncodingOptions | RulePositionEncodingOptions): ChartProgram;
2729
- encodeY(options: YPositionEncodingOptions | RulePositionEncodingOptions): ChartProgram;
4662
+ encodeX(options: PositionEncodingOptions | DatumPositionEncodingOptions): ChartProgram;
4663
+ encodeY(options: YPositionEncodingOptions | DatumPositionEncodingOptions): ChartProgram;
2730
4664
  encodeTheta(options: ThetaEncodingOptions): ChartProgram;
2731
4665
  encodeR(options: RadialEncodingOptions): ChartProgram;
2732
4666
  encodeX2(options: SecondaryPositionEncodingOptions): ChartProgram;
2733
4667
  encodeColor(options: ColorEncodingOptions): ChartProgram;
2734
4668
  encodeStrokeDash(options: StrokeDashEncodingOptions): ChartProgram;
2735
- encodeSize(options: { field: string; target?: string; fieldType?: "quantitative"; scale?: SizeScaleOptions }): ChartProgram;
2736
- encodeShape(options: { field: string; target?: string; fieldType?: "nominal"; scale?: ShapeScaleOptions }): ChartProgram;
2737
- encodeAngle(options:
2738
- | { target?: string; value: number; field?: never; fieldType?: never }
2739
- | { target?: string; field: string; fieldType?: "quantitative"; value?: never }
2740
- ): ChartProgram;
4669
+ encodeSize(options: SizeEncodingOptions): ChartProgram;
4670
+ encodeShape(options: ShapeEncodingOptions): ChartProgram;
4671
+ encodeAngle(options: AngleEncodingOptions): ChartProgram;
2741
4672
  encodeOpacity(options: OpacityEncodingOptions): ChartProgram;
2742
4673
  encodeRadius(options: { value: number; target?: string }): ChartProgram;
2743
4674
  encodePointRadius(options: { value: number; target?: string }): ChartProgram;
@@ -2745,23 +4676,10 @@ export class ChartProgram {
2745
4676
  encodeXOffset(options: XOffsetEncodingOptions): ChartProgram;
2746
4677
  encodeYOffset(options: YOffsetEncodingOptions): ChartProgram;
2747
4678
  encodeY2(options: SecondaryPositionEncodingOptions): ChartProgram;
2748
- encodeYRange(options: {
2749
- lower: string;
2750
- upper: string;
2751
- target?: string;
2752
- fieldType?: "quantitative";
2753
- coordinate?: string;
2754
- scale?: NonPointQuantitativePositionScaleOptions;
2755
- }): ChartProgram;
2756
- encodeXRange(options: {
2757
- lower: string;
2758
- upper: string;
2759
- target?: string;
2760
- fieldType?: "quantitative";
2761
- coordinate?: string;
2762
- scale?: NonPointQuantitativePositionScaleOptions;
2763
- }): ChartProgram;
2764
- encodeGroup(options: { field: string; target?: string; fieldType?: "nominal" }): ChartProgram;
4679
+ encodeYRange(options: RangePositionEncodingOptions): ChartProgram;
4680
+ encodeXRange(options: RangePositionEncodingOptions): ChartProgram;
4681
+ encodeGroup(options: GroupEncodingOptions): ChartProgram;
4682
+ layoutSeries(options: SeriesLayoutOptions): ChartProgram;
2765
4683
  encodePathOrder(options: PathOrderEncodingOptions): ChartProgram;
2766
4684
  orderCategories(options: OrderCategoriesOptions): ChartProgram;
2767
4685
  encodeParallelCoordinates(options: ParallelCoordinatesEncodingOptions): ChartProgram;
@@ -2771,7 +4689,7 @@ export class ChartProgram {
2771
4689
  target?: string;
2772
4690
  channel:
2773
4691
  | "x" | "y" | "x2" | "y2" | "xOffset" | "yOffset"
2774
- | "theta" | "radius" | "color" | "strokeDash" | "strokeWidth"
4692
+ | "theta" | "radius" | "color" | "stroke" | "strokeDash" | "strokeWidth"
2775
4693
  | "size" | "shape" | "angle" | "group" | "opacity" | "text";
2776
4694
  }): ChartProgram;
2777
4695
  encodeText(options: TextEncodingOptions): ChartProgram;
@@ -2781,8 +4699,9 @@ export class ChartProgram {
2781
4699
  encodeHorizon(options?: HorizonEncodingOptions): ChartProgram;
2782
4700
  editHorizon(options: EditHorizonOptions): ChartProgram;
2783
4701
  encodeBarWidth(options?: BarWidthOptions): ChartProgram;
2784
- encodeStroke(options: { target?: string; value: string }): ChartProgram;
4702
+ encodeStroke(options: StrokeEncodingOptions): ChartProgram;
2785
4703
  encodeStrokeWidth(options: StrokeWidthEncodingOptions): ChartProgram;
4704
+ encodeChannels(options: EncodeChannelsOptions): ChartProgram;
2786
4705
 
2787
4706
  createRegression(options?: RegressionOptions): ChartProgram;
2788
4707
  editRegression(options: EditRegressionOptions): ChartProgram;
@@ -2796,23 +4715,59 @@ export class ChartProgram {
2796
4715
  createGradientPlot(options?: GradientPlotOptions): ChartProgram;
2797
4716
  editGradientPlot(options: EditGradientPlotOptions): ChartProgram;
2798
4717
  createViolinPlot(options: ViolinPlotOptions): ChartProgram;
4718
+ editViolinPlot(options: EditViolinPlotOptions): ChartProgram;
2799
4719
  createScatterPlot(options: CreateScatterPlotOptions): ChartProgram;
4720
+ createIntervalPlot(options: CreateIntervalPlotOptions): ChartProgram;
4721
+ createRegressionPlot(options: CreateRegressionPlotOptions): ChartProgram;
4722
+ createDotPlot(options: CreateDotPlotOptions): ChartProgram;
4723
+ createLollipopPlot(options: CreateLollipopPlotOptions): ChartProgram;
4724
+ createDumbbellPlot(options: CreateDumbbellPlotOptions): ChartProgram;
4725
+ editEndpointPlot(options: EditEndpointPlotOptions): ChartProgram;
4726
+ createECDFPlot(options: CreateECDFPlotOptions): ChartProgram;
4727
+ editECDFPlot(options: EditECDFPlotOptions): ChartProgram;
2800
4728
  createLinePlot(options: CreateLinePlotOptions): ChartProgram;
4729
+ createPolarScatterPlot(options: CreatePolarScatterPlotOptions): ChartProgram;
4730
+ createPolarLinePlot(options: CreatePolarLinePlotOptions): ChartProgram;
4731
+ createRadarPlot(options: CreateRadarPlotOptions): ChartProgram;
4732
+ createRugPlot(options: CreateRugPlotOptions): ChartProgram;
4733
+ createStripPlot(options: CreateStripPlotOptions): ChartProgram;
4734
+ createBeeswarmPlot(options: CreateBeeswarmPlotOptions): ChartProgram;
4735
+ createRaincloudPlot(options: CreateRaincloudPlotOptions): ChartProgram;
4736
+ editRaincloudPlot(options: EditRaincloudPlotOptions): ChartProgram;
4737
+ createAreaPlot(options: CreateAreaPlotOptions): ChartProgram;
2801
4738
  createBarPlot(options: CreateBarPlotOptions): ChartProgram;
2802
4739
  createHistogram(options: CreateHistogramOptions): ChartProgram;
4740
+ createPiePlot(options: CreatePiePlotOptions): ChartProgram;
4741
+ createRosePlot(options: CreateRosePlotOptions): ChartProgram;
4742
+ createRadialBarPlot(options: CreateRadialBarPlotOptions): ChartProgram;
4743
+ createDensityPlot(options: CreateDensityPlotOptions): ChartProgram;
4744
+ createHorizonPlot(options: CreateHorizonPlotOptions): ChartProgram;
2803
4745
  createHeatmap(options: CreateHeatmapOptions): ChartProgram;
2804
4746
  createParallelCoordinates(options: CreateParallelCoordinatesOptions): ChartProgram;
2805
4747
  removeMark(options?: RemoveMarkOptions): ChartProgram;
4748
+ createParallelAxes(options?: ParallelAxesOptions): ChartProgram;
4749
+ createParallelAxis(options: CreateParallelAxisOptions): ChartProgram;
4750
+ editParallelAxis(options: EditParallelAxisOptions): ChartProgram;
4751
+ removeParallelAxis(options: RemoveParallelAxisOptions): ChartProgram;
4752
+ removeParallelAxes(options?: ParallelAxesOptions): ChartProgram;
2806
4753
  createAxes(options?: CreateAxesOptions): ChartProgram;
2807
4754
  createXAxis(options?: CompleteAxisOptions<XAxisPosition>): ChartProgram;
2808
4755
  createYAxis(options?: CompleteAxisOptions<YAxisPosition>): ChartProgram;
2809
- createThetaAxis(options?: CompletePolarAxisOptions): ChartProgram;
4756
+ createThetaAxis(options?: CompleteThetaAxisOptions): ChartProgram;
2810
4757
  createRadialAxis(options?: CompleteRadialAxisOptions): ChartProgram;
4758
+ createThetaAxisLine(options?: CreateThetaAxisLineOptions): ChartProgram;
4759
+ createRadialAxisLine(options?: CreateRadialAxisLineOptions): ChartProgram;
4760
+ createThetaAxisTicks(options?: CreateThetaAxisTicksOptions): ChartProgram;
4761
+ createRadialAxisTicks(options?: CreateRadialAxisTicksOptions): ChartProgram;
4762
+ createThetaAxisLabels(options?: CreateThetaAxisLabelsOptions): ChartProgram;
4763
+ createRadialAxisLabels(options?: CreateRadialAxisLabelsOptions): ChartProgram;
4764
+ createThetaAxisTitle(options?: CreateThetaAxisTitleOptions): ChartProgram;
4765
+ createRadialAxisTitle(options?: CreateRadialAxisTitleOptions): ChartProgram;
2811
4766
  editThetaAxisLine(options?: AxisLineStyleOptions): ChartProgram;
2812
4767
  editRadialAxisLine(options?: AxisLineStyleOptions): ChartProgram;
2813
4768
  editThetaAxisTicks(options?: PolarTickOptions): ChartProgram;
2814
4769
  editRadialAxisTicks(options?: PolarTickOptions): ChartProgram;
2815
- editThetaAxisLabels(options?: PolarLabelOptions): ChartProgram;
4770
+ editThetaAxisLabels(options?: ThetaAxisLabelOptions): ChartProgram;
2816
4771
  editRadialAxisLabels(options?: PolarLabelOptions): ChartProgram;
2817
4772
  editThetaAxisTitle(options?: PolarTitleOptions): ChartProgram;
2818
4773
  editRadialAxisTitle(options?: RadialTitleOptions): ChartProgram;
@@ -2838,7 +4793,7 @@ export class ChartProgram {
2838
4793
  editYAxisTitle(options?: Omit<AxisTitleOptions<YAxisPosition>, "scale">): ChartProgram;
2839
4794
  editXAxis(options: EditAxisOptions<XAxisPosition>): ChartProgram;
2840
4795
  editYAxis(options: EditAxisOptions<YAxisPosition>): ChartProgram;
2841
- editThetaAxis(options: Omit<EditPolarAxisOptions, "angle">): ChartProgram;
4796
+ editThetaAxis(options: EditThetaAxisOptions): ChartProgram;
2842
4797
  editRadialAxis(options: EditRadialAxisOptions): ChartProgram;
2843
4798
  removeXAxis(options?: RemoveAxisOptions): ChartProgram;
2844
4799
  removeYAxis(options?: RemoveAxisOptions): ChartProgram;
@@ -2855,8 +4810,10 @@ export class ChartProgram {
2855
4810
  editRadialGrid(options: EditPolarGridOptions): ChartProgram;
2856
4811
  editGrid(options: EditGridDirectionsOptions): ChartProgram;
2857
4812
  removeGrid(options?: RemoveGridOptions): ChartProgram;
4813
+ /** Combined categorical and size legends support all four edges with layout "edge". */
2858
4814
  createLegend(options?: LegendOptions): ChartProgram;
2859
4815
  editLegend(options: EditLegendOptions): ChartProgram;
4816
+ editLegendBlock(options: EditLegendBlockOptions): ChartProgram;
2860
4817
  editLegendLayout(options: EditLegendLayoutOptions): ChartProgram;
2861
4818
  editLegendLabels(options: EditLegendLabelsOptions): ChartProgram;
2862
4819
  editLegendTitle(options: EditLegendTitleOptions): ChartProgram;
@@ -2869,11 +4826,26 @@ export class ChartProgram {
2869
4826
  removeTitle(): ChartProgram;
2870
4827
 
2871
4828
  createCoordinate(options?: CreateCoordinateOptions): ChartProgram;
4829
+ editCoordinate(options: EditCoordinateOptions): ChartProgram;
2872
4830
  createScale(options: CreateScaleOptions): ChartProgram;
2873
4831
  editScale(options: EditScaleOptions): ChartProgram;
4832
+ editXScale(options: EditXScaleOptions): ChartProgram;
4833
+ editYScale(options: EditYScaleOptions): ChartProgram;
4834
+ editXOffsetScale(options: EditXOffsetScaleOptions): ChartProgram;
4835
+ editYOffsetScale(options: EditYOffsetScaleOptions): ChartProgram;
4836
+ editParallelScale(options: EditParallelScaleOptions): ChartProgram;
4837
+ editThetaScale(options: EditThetaScaleOptions): ChartProgram;
4838
+ editRScale(options: EditRScaleOptions): ChartProgram;
4839
+ editColorScale(options: EditColorScaleOptions): ChartProgram;
4840
+ editStrokeScale(options: EditStrokeScaleOptions): ChartProgram;
4841
+ editSizeScale(options: EditSizeScaleOptions): ChartProgram;
4842
+ editOpacityScale(options: EditOpacityScaleOptions): ChartProgram;
4843
+ editShapeScale(options: EditShapeScaleOptions): ChartProgram;
4844
+ editStrokeWidthScale(options: EditStrokeWidthScaleOptions): ChartProgram;
4845
+ editStrokeDashScale(options: EditStrokeDashScaleOptions): ChartProgram;
2874
4846
  createDerivedData(options: CreateDerivedDataOptions): ChartProgram;
2875
4847
  createRegressionBand(options: CreateRegressionBandOptions): ChartProgram;
2876
- editRegressionBand(options: {
4848
+ editRegressionBand(options: StrokeStyleDetails & {
2877
4849
  target?: string;
2878
4850
  color?: string;
2879
4851
  opacity?: number;
@@ -2882,7 +4854,7 @@ export class ChartProgram {
2882
4854
  curve?: CurveInterpolation;
2883
4855
  }): ChartProgram;
2884
4856
  createRegressionLine(options: CreateRegressionLineOptions): ChartProgram;
2885
- editRegressionLine(options: {
4857
+ editRegressionLine(options: StrokeStyleDetails & {
2886
4858
  target?: string;
2887
4859
  strokeWidth?: number;
2888
4860
  curve?: CurveInterpolation;
@@ -2890,7 +4862,13 @@ export class ChartProgram {
2890
4862
 
2891
4863
  editCompositionLayout(options: EditCompositionLayoutOptions): ChartProgram;
2892
4864
  replaceCompositionChild(options: ReplaceCompositionChildOptions): ChartProgram;
4865
+ insertCompositionChild(options: InsertCompositionChildOptions): ChartProgram;
4866
+ removeCompositionChild(options: RemoveCompositionChildOptions): ChartProgram;
4867
+ reorderCompositionChildren(options: ReorderCompositionChildrenOptions): ChartProgram;
2893
4868
  facet(options: FacetOptions): ChartProgram;
4869
+ facetGrid(options: FacetGridOptions): ChartProgram;
4870
+ repeatCharts(options: RepeatChartsOptions): ChartProgram;
4871
+ editFacetSource(options: EditFacetSourceOptions): ChartProgram;
2894
4872
  editFacetScales(options: FacetScaleResolutions): ChartProgram;
2895
4873
  editFacetGuides(options: FacetGuideOptions): ChartProgram;
2896
4874
  editFacetHeaders(options: EditFacetHeadersOptions): ChartProgram;