ggaction 0.0.17 → 0.0.19

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 (315) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +6 -2
  3. package/knowledge/action-card.schema.json +1 -1
  4. package/knowledge/action-cards.json +1 -1
  5. package/knowledge/intent-taxonomy.json +1 -1
  6. package/knowledge/mcp-resources.json +1 -1
  7. package/knowledge/task-resolver.js +1 -1
  8. package/package.json +3 -3
  9. package/src/BasicChartProgram.js +1 -1
  10. package/src/accessibility.js +3 -2
  11. package/src/actions/boxPlots/create.js +14 -4
  12. package/src/actions/boxPlots/edit.js +39 -33
  13. package/src/actions/boxPlots/materialize.js +7 -3
  14. package/src/actions/boxPlots/options.js +37 -11
  15. package/src/actions/canvas/actions.js +70 -95
  16. package/src/actions/canvas/fitting.js +20 -1
  17. package/src/actions/canvas/index.js +3 -0
  18. package/src/actions/canvas/plotBorder.js +28 -0
  19. package/src/actions/charts/area.js +2 -2
  20. package/src/actions/charts/bar.js +34 -7
  21. package/src/actions/charts/ecdf.js +4 -18
  22. package/src/actions/charts/endpoints.js +4 -18
  23. package/src/actions/charts/heatmap.js +8 -7
  24. package/src/actions/charts/index.js +2 -0
  25. package/src/actions/charts/interval-regression.js +2 -2
  26. package/src/actions/charts/line.js +1 -1
  27. package/src/actions/charts/pie.js +3 -47
  28. package/src/actions/charts/radial.js +34 -12
  29. package/src/actions/charts/scatter.js +16 -2
  30. package/src/actions/charts/shared.js +2 -2
  31. package/src/actions/charts/text.js +35 -0
  32. package/src/actions/composition/actions.js +6 -2
  33. package/src/actions/data/box.js +2 -1
  34. package/src/actions/data/derived.js +11 -1
  35. package/src/actions/data/edit.js +3 -1
  36. package/src/actions/data/index.js +4 -0
  37. package/src/actions/data/regression.js +25 -16
  38. package/src/actions/data/regressionStatistics.js +73 -0
  39. package/src/actions/data/shared.js +8 -4
  40. package/src/actions/data/stack.js +3 -1
  41. package/src/actions/distributions/revision.js +24 -18
  42. package/src/actions/encodings/appearance.js +37 -29
  43. package/src/actions/encodings/barWidth.js +36 -11
  44. package/src/actions/encodings/channels.js +0 -1
  45. package/src/actions/encodings/color/continuous.js +1 -1
  46. package/src/actions/encodings/color/index.js +1 -1
  47. package/src/actions/encodings/color/policy.js +10 -3
  48. package/src/actions/encodings/density/resolve.js +1 -6
  49. package/src/actions/encodings/position/policies/arc.js +12 -10
  50. package/src/actions/encodings/position/policies/area.js +3 -3
  51. package/src/actions/encodings/position/policies/bar.js +15 -6
  52. package/src/actions/encodings/position/policies/line.js +17 -6
  53. package/src/actions/encodings/position/resolve.js +3 -2
  54. package/src/actions/encodings/ranged.js +17 -0
  55. package/src/actions/encodings/remove.js +14 -8
  56. package/src/actions/encodings/seriesLayout.js +1 -0
  57. package/src/actions/encodings/shared.js +26 -24
  58. package/src/actions/encodings/text.js +6 -3
  59. package/src/actions/errorBands/create.js +2 -2
  60. package/src/actions/errorBands/edit.js +2 -1
  61. package/src/actions/facets/actions.js +176 -247
  62. package/src/actions/facets/guides.js +2 -1
  63. package/src/actions/gradientPlots/resolve.js +2 -17
  64. package/src/actions/guides/applicability.js +1 -1
  65. package/src/actions/guides/axes/axes.js +30 -11
  66. package/src/actions/guides/axes/axis.js +72 -10
  67. package/src/actions/guides/axes/components.js +13 -13
  68. package/src/actions/guides/axes/edit.js +36 -24
  69. package/src/actions/guides/axes/labels.js +155 -71
  70. package/src/actions/guides/axes/lines.js +27 -24
  71. package/src/actions/guides/axes/parallel/lifecycle.js +1 -1
  72. package/src/actions/guides/axes/parallel/policy.js +8 -7
  73. package/src/actions/guides/axes/remove.js +13 -8
  74. package/src/actions/guides/axes/tickGroups.js +11 -7
  75. package/src/actions/guides/axes/ticks.js +36 -24
  76. package/src/actions/guides/axes/titles.js +107 -69
  77. package/src/actions/guides/basic.js +2 -0
  78. package/src/actions/guides/facadeAxes.js +33 -24
  79. package/src/actions/guides/facadeLegend.js +12 -4
  80. package/src/actions/guides/grids/grid.js +8 -2
  81. package/src/actions/guides/grids/resolve.js +102 -58
  82. package/src/actions/guides/legends/blocks.js +46 -20
  83. package/src/actions/guides/legends/categorical/actions.js +95 -19
  84. package/src/actions/guides/legends/categorical/components.js +15 -18
  85. package/src/actions/guides/legends/categorical/index.js +8 -0
  86. package/src/actions/guides/legends/categorical/layout.js +45 -20
  87. package/src/actions/guides/legends/categorical/options.js +39 -22
  88. package/src/actions/guides/legends/categorical/recipes.js +7 -3
  89. package/src/actions/guides/legends/categorical/resolve.js +11 -4
  90. package/src/actions/guides/legends/categorical/symbols.js +38 -18
  91. package/src/actions/guides/legends/categorical/validation.js +1 -6
  92. package/src/actions/guides/legends/colorSize.js +110 -0
  93. package/src/actions/guides/legends/combine.js +37 -0
  94. package/src/actions/guides/legends/continuous/colorSymbols.js +1 -0
  95. package/src/actions/guides/legends/continuous/common.js +1 -447
  96. package/src/actions/guides/legends/continuous/gradient.js +73 -46
  97. package/src/actions/guides/legends/continuous/interval.js +4 -4
  98. package/src/actions/guides/legends/continuous/opacity.js +33 -21
  99. package/src/actions/guides/legends/creation.js +2 -0
  100. package/src/actions/guides/legends/edit.js +1 -604
  101. package/src/actions/guides/legends/focused.js +8 -7
  102. package/src/actions/guides/legends/group.js +1 -0
  103. package/src/actions/guides/legends/lane.js +1 -516
  104. package/src/actions/guides/legends/lifecycle.js +2 -1
  105. package/src/actions/guides/legends/remove.js +9 -3
  106. package/src/actions/guides/legends/sampling.js +1 -1
  107. package/src/actions/guides/legends/size.js +65 -47
  108. package/src/actions/guides/legends/strokeWidth.js +13 -29
  109. package/src/actions/guides/legends/target.js +2 -79
  110. package/src/actions/guides/legends/transition.js +44 -11
  111. package/src/actions/guides/polar/axes/labels.js +4 -2
  112. package/src/actions/guides/polar/axes/titles.js +7 -5
  113. package/src/actions/guides/polar/resolve.js +6 -14
  114. package/src/actions/guides/tickValues.js +8 -5
  115. package/src/actions/index.js +16 -16
  116. package/src/actions/marks/arc/actions.js +3 -10
  117. package/src/actions/marks/area/actions.js +8 -5
  118. package/src/actions/marks/area/materialize.js +8 -9
  119. package/src/actions/marks/bar/create.js +10 -4
  120. package/src/actions/marks/bar/edit.js +29 -14
  121. package/src/actions/marks/bar/materialize.js +15 -7
  122. package/src/actions/marks/line/actions.js +11 -4
  123. package/src/actions/marks/line/materialize.js +9 -5
  124. package/src/actions/marks/point/edit.js +1 -1
  125. package/src/actions/marks/point/materialize.js +5 -1
  126. package/src/actions/marks/rect/actions.js +3 -3
  127. package/src/actions/marks/remove.js +12 -10
  128. package/src/actions/marks/rule/actions.js +7 -4
  129. package/src/actions/marks/text/actions.js +17 -5
  130. package/src/actions/marks/text/layout.js +3 -0
  131. package/src/actions/primitives/createGraphics.js +3 -2
  132. package/src/actions/primitives/editGraphics.js +15 -11
  133. package/src/actions/primitives/graphicProperties.js +1 -6
  134. package/src/actions/primitives/semanticAction.js +27 -1
  135. package/src/actions/primitives/semanticValidation/guide.js +11 -1
  136. package/src/actions/primitives/semanticValidation/layer.js +8 -0
  137. package/src/actions/regression/create.js +1 -1
  138. package/src/actions/regression/edit.js +18 -6
  139. package/src/actions/regression/resolve.js +2 -6
  140. package/src/actions/scales/channels.js +9 -4
  141. package/src/actions/scales/consumers/families.js +16 -5
  142. package/src/actions/scales/create.js +10 -5
  143. package/src/actions/scales/definitions.js +1 -425
  144. package/src/actions/scales/edit.js +3 -3
  145. package/src/actions/scales/editPolicy.js +12 -3
  146. package/src/actions/scales/materialize.js +1 -1
  147. package/src/actions/scales/patch.js +1 -1
  148. package/src/actions/scales/preview.js +21 -1
  149. package/src/actions/scales/quantitativeColor.js +8 -3
  150. package/src/actions/selection/actions.js +1 -13
  151. package/src/actions/theme/reconcile.js +126 -45
  152. package/src/actions/theme/state.js +12 -0
  153. package/src/actions/titles/actions.js +5 -18
  154. package/src/actions/titles/resolve.js +41 -19
  155. package/src/actions/violinPlots/edit.js +3 -20
  156. package/src/core/compositionState.js +6 -3
  157. package/src/core/font.js +9 -2
  158. package/src/core/graphicProperties.js +1 -0
  159. package/src/core/optionRequirements.js +1 -0
  160. package/src/core/programState.js +4 -0
  161. package/src/core/resourceReferences.js +5 -2
  162. package/src/core/textMetricProfile.js +3 -2
  163. package/src/core/textMetrics.js +41 -4
  164. package/src/core/validation.js +35 -0
  165. package/src/core/vocabulary.js +7 -0
  166. package/src/grammar/aggregate.js +4 -18
  167. package/src/grammar/arcs.js +1 -386
  168. package/src/grammar/areaPaint.js +10 -0
  169. package/src/grammar/areaSeries.js +18 -10
  170. package/src/grammar/axisTextPlacement.js +1 -0
  171. package/src/grammar/bars/geometry.js +30 -3
  172. package/src/grammar/bars/policy.js +12 -1
  173. package/src/grammar/bin.js +2 -12
  174. package/src/grammar/bin2d.js +1 -6
  175. package/src/grammar/boxPlot.js +56 -9
  176. package/src/grammar/categoryOrder.js +1 -6
  177. package/src/grammar/colorSizeLegend.js +39 -0
  178. package/src/grammar/complete.js +15 -19
  179. package/src/grammar/computed.js +115 -26
  180. package/src/grammar/curveCommands.js +29 -16
  181. package/src/grammar/datasetSchema.js +13 -9
  182. package/src/grammar/displayLabels.js +36 -0
  183. package/src/grammar/ecdf.js +2 -9
  184. package/src/grammar/facets/dependencies.js +6 -2
  185. package/src/grammar/facets/guides.js +58 -30
  186. package/src/grammar/facets/index.js +2 -5
  187. package/src/grammar/facets/legendIntent.js +65 -0
  188. package/src/grammar/fold.js +2 -12
  189. package/src/grammar/gradientProfile.js +1 -6
  190. package/src/grammar/guideDash.js +1 -0
  191. package/src/grammar/impute.js +21 -48
  192. package/src/grammar/interval.js +2 -9
  193. package/src/grammar/legendBlocks.js +1 -0
  194. package/src/grammar/legendBorder.js +9 -0
  195. package/src/grammar/legendClip.js +19 -0
  196. package/src/grammar/legendCombinations.js +45 -0
  197. package/src/grammar/legendGradient.js +27 -0
  198. package/src/grammar/legendGroups.js +1 -0
  199. package/src/grammar/legendOpacity.js +6 -0
  200. package/src/grammar/legendTitleStyle.js +22 -0
  201. package/src/grammar/lineSeries.js +32 -17
  202. package/src/grammar/markLabels.js +5 -2
  203. package/src/grammar/normalize.js +4 -54
  204. package/src/grammar/numeric.js +1 -290
  205. package/src/grammar/parallelCoordinates.js +1 -6
  206. package/src/grammar/parseTime.js +41 -0
  207. package/src/grammar/pathCommands.js +11 -4
  208. package/src/grammar/pointShapes.js +16 -2
  209. package/src/grammar/polar.js +1 -184
  210. package/src/grammar/positionCompatibility.js +3 -3
  211. package/src/grammar/regression/derive.js +16 -2
  212. package/src/grammar/regression/models.js +142 -54
  213. package/src/grammar/regression/parameters.js +23 -4
  214. package/src/grammar/regression/statistics.js +64 -0
  215. package/src/grammar/roundedRect.js +42 -54
  216. package/src/grammar/scales/appearance.js +1 -206
  217. package/src/grammar/scales/color.js +1 -382
  218. package/src/grammar/scales/colorConsumers.js +5 -2
  219. package/src/grammar/scales/definition.js +1 -197
  220. package/src/grammar/scales/discretized.js +1 -195
  221. package/src/grammar/scales/size.js +1 -456
  222. package/src/grammar/scales/temporal.js +2 -13
  223. package/src/grammar/scales/transformed.js +1 -383
  224. package/src/grammar/scales/types.js +1 -1
  225. package/src/grammar/scales/validation.js +1 -66
  226. package/src/grammar/schemas/concreteGraphic.js +14 -0
  227. package/src/grammar/schemas/graphic.js +6 -0
  228. package/src/grammar/schemas/graphicBounds.js +31 -7
  229. package/src/grammar/schemas/semanticPath.js +19 -3
  230. package/src/grammar/stack.js +2 -10
  231. package/src/grammar/statisticalReference.js +1 -6
  232. package/src/grammar/summary.js +4 -27
  233. package/src/grammar/text.js +19 -0
  234. package/src/grammar/timeUnit.js +22 -11
  235. package/src/grammar/transformKeys.js +47 -0
  236. package/src/grammar/transformTopology.js +1 -0
  237. package/src/grammar/transforms.js +15 -2
  238. package/src/grammar/valueFormat.js +17 -5
  239. package/src/grammar/weightedStatistics.js +1 -6
  240. package/src/grammar/window.js +4 -58
  241. package/src/inspectionDescriptors.js +1 -1
  242. package/src/layout/canvas.js +1 -110
  243. package/src/layout/facets.js +1 -244
  244. package/src/layout/guideCollisions.js +9 -1
  245. package/src/layout/labels.js +1 -0
  246. package/src/layout/legend.js +13 -0
  247. package/src/layout/legendGroup.js +1 -0
  248. package/src/layout/legendItems.js +59 -15
  249. package/src/layout/legendLane.js +1 -441
  250. package/src/layout/legendText.js +1 -0
  251. package/src/layout/title.js +35 -13
  252. package/src/materialization/bars/aggregate.js +11 -5
  253. package/src/materialization/bars/histogram.js +4 -1
  254. package/src/materialization/bars/ranged.js +19 -6
  255. package/src/materialization/bars/resolve.js +22 -1
  256. package/src/materialization/compositionSnapshot.js +2 -7
  257. package/src/materialization/coordinateBounds.js +21 -0
  258. package/src/materialization/dependencies.js +4 -44
  259. package/src/materialization/facetGuides/edit.js +30 -0
  260. package/src/materialization/facetGuides/layout.js +1 -0
  261. package/src/materialization/facetGuides/owner.js +125 -0
  262. package/src/materialization/facetGuides/ownerLayout.js +71 -0
  263. package/src/materialization/facetGuides/placement.js +71 -14
  264. package/src/materialization/facetGuides/preparation.js +22 -7
  265. package/src/materialization/facetHeaders.js +1 -347
  266. package/src/materialization/facets.js +1 -185
  267. package/src/materialization/graphicHierarchy.js +5 -1
  268. package/src/materialization/graphicTranslation.js +73 -0
  269. package/src/materialization/guides/layout.js +1 -57
  270. package/src/materialization/guides/resources.js +1 -123
  271. package/src/materialization/layout.js +53 -0
  272. package/src/materialization/legendBorder.js +28 -0
  273. package/src/materialization/legendClip.js +76 -0
  274. package/src/materialization/legendGroups.js +1 -0
  275. package/src/materialization/legendText.js +1 -0
  276. package/src/materialization/legends.js +2 -2
  277. package/src/materialization/marks/capabilities.js +5 -6
  278. package/src/materialization/rect.js +1 -1
  279. package/src/materialization/scaleGuideDependencies.js +14 -15
  280. package/src/materialization/scales/map.js +6 -0
  281. package/src/materialization/scales/policies/arc.js +8 -7
  282. package/src/materialization/scales/policies/bar.js +19 -7
  283. package/src/materialization/scales/policies/series.js +2 -1
  284. package/src/materialization/scales/resolve.js +7 -3
  285. package/src/materialization/selection/items/arc.js +1 -1
  286. package/src/materialization/selection/items/bar.js +7 -6
  287. package/src/materialization/selection/items/path.js +7 -6
  288. package/src/materialization/selection/items/rect.js +2 -2
  289. package/src/materialization/text.js +13 -4
  290. package/src/materialization/textLines.js +15 -0
  291. package/src/materialization/typography.js +10 -2
  292. package/src/persistence/codec.js +37 -6
  293. package/src/persistence/validation.js +220 -0
  294. package/src/persistence.js +19 -6
  295. package/src/renderers/canvas/circle.js +6 -3
  296. package/src/renderers/canvas/fill.js +7 -1
  297. package/src/renderers/canvas/index.js +22 -11
  298. package/src/renderers/canvas/isolated.js +166 -0
  299. package/src/renderers/canvas/limits.js +3 -0
  300. package/src/renderers/canvas/line.js +1 -0
  301. package/src/renderers/canvas/path.js +1 -1
  302. package/src/renderers/canvas/rect.js +11 -8
  303. package/src/renderers/canvas/stroke.js +2 -1
  304. package/src/renderers/canvas/text.js +5 -3
  305. package/src/renderers/pdf.js +2 -2
  306. package/src/renderers/png.js +2 -2
  307. package/src/renderers/svg.js +14 -4
  308. package/src/selectors/axes.js +1 -0
  309. package/src/selectors/graphicCapacity.js +38 -0
  310. package/src/selectors/layers.js +19 -0
  311. package/src/theme/defaults.js +8 -2
  312. package/src/version.js +1 -1
  313. package/types/basic.d.ts +3 -0
  314. package/types/index.d.ts +12 -0
  315. package/types/program.d.ts +536 -129
@@ -7,6 +7,7 @@ export interface TextMeasurement {
7
7
  readonly fontFamily: string;
8
8
  readonly fontSize: number;
9
9
  readonly fontWeight: TextMetricFontWeight;
10
+ readonly fontStyle?: "normal" | "italic";
10
11
  readonly width: number;
11
12
  }
12
13
  export interface TextMetricsProfile {
@@ -18,6 +19,11 @@ export interface ApplyTextMetricsOptions { profile: TextMetricsProfile; }
18
19
 
19
20
  export type ThemeName = "light" | "dark";
20
21
  export interface ThemeTokens {
22
+ axisLabel?: string;
23
+ axisLabelFontFamily?: string;
24
+ axisTitleFontFamily?: string;
25
+ axisLabelFontSize?: number;
26
+ axisTitleFontSize?: number;
21
27
  background: string;
22
28
  mark: string;
23
29
  text: string;
@@ -162,6 +168,8 @@ export interface EditCompositionLayoutOptions {
162
168
  gap?: number;
163
169
  align?: CompositionAlign;
164
170
  padding?: number | CompositionPadding;
171
+ /** Interpret gap between child canvases (default) or inner plot regions. */
172
+ spacing?: "canvas" | "plot";
165
173
  }
166
174
  export interface ReplaceCompositionChildOptions {
167
175
  target: string;
@@ -193,9 +201,17 @@ export interface FacetScaleResolutions {
193
201
  strokeDash?: FacetScaleResolution;
194
202
  parallelDimensions?: FacetScaleResolution;
195
203
  }
204
+ interface StoredFacetLegendIntent {
205
+ readonly type: "authored-legend";
206
+ readonly blocks: Readonly<Record<string, {
207
+ readonly config: Readonly<Record<string, unknown>>;
208
+ readonly guide?: Readonly<Record<string, unknown>>;
209
+ }>>;
210
+ readonly groups: Readonly<Record<string, unknown>>;
211
+ }
196
212
  export interface FacetGuideOptions {
197
213
  axes?: "each" | "outer";
198
- legend?: false | "shared";
214
+ legend?: false | "shared" | LegendOptions;
199
215
  }
200
216
  export interface FacetOptions {
201
217
  id?: string;
@@ -208,6 +224,9 @@ export interface FacetOptions {
208
224
  padding?: number | CompositionPadding;
209
225
  scales?: FacetScaleResolutions;
210
226
  guides?: FacetGuideOptions;
227
+ headers?: FacetHeadersOptions;
228
+ /** Interpret gap between child canvases (default) or inner plot regions. */
229
+ spacing?: "canvas" | "plot";
211
230
  }
212
231
  export interface FacetGridRole {
213
232
  field: string;
@@ -224,6 +243,9 @@ export interface FacetGridOptions {
224
243
  padding?: number | CompositionPadding;
225
244
  scales?: FacetScaleResolutions;
226
245
  guides?: FacetGuideOptions;
246
+ headers?: FacetHeadersOptions;
247
+ /** Interpret gap between child canvases (default) or inner plot regions. */
248
+ spacing?: "canvas" | "plot";
227
249
  }
228
250
  export interface RepeatChartsOptions {
229
251
  id?: string;
@@ -236,6 +258,9 @@ export interface RepeatChartsOptions {
236
258
  padding?: number | CompositionPadding;
237
259
  scales?: FacetScaleResolutions;
238
260
  guides?: FacetGuideOptions;
261
+ headers?: FacetHeadersOptions;
262
+ /** Interpret gap between child canvases (default) or inner plot regions. */
263
+ spacing?: "canvas" | "plot";
239
264
  }
240
265
  export interface EditFacetSourceOptions { program: ChartProgram; }
241
266
  export interface EditFacetHeadersOptions {
@@ -249,6 +274,10 @@ export interface EditFacetHeadersOptions {
249
274
  side?: FacetHeaderSide;
250
275
  align?: FacetHeaderAlign;
251
276
  }
277
+ export type FacetHeadersOptions = Omit<EditFacetHeadersOptions, "role" | "side"> & {
278
+ row?: Omit<EditFacetHeadersOptions, "role">;
279
+ column?: Omit<EditFacetHeadersOptions, "role">;
280
+ };
252
281
  export type FacetHeaderRole = "all" | "row" | "column";
253
282
  export type FacetHeaderSide = "top" | "bottom" | "left" | "right";
254
283
  export type FacetHeaderAlign = "start" | "center" | "end";
@@ -265,6 +294,7 @@ export interface FacetCompositionSpec {
265
294
  readonly type: "facet";
266
295
  readonly children: readonly string[];
267
296
  readonly columns: number;
297
+ readonly spacing?: "canvas" | "plot";
268
298
  readonly gap: number;
269
299
  readonly align: CompositionAlign;
270
300
  readonly padding: Readonly<Required<CompositionPadding>>;
@@ -293,7 +323,7 @@ export interface FacetCompositionSpec {
293
323
  readonly scales: Readonly<Required<FacetScaleResolutions>>;
294
324
  readonly guides: {
295
325
  readonly axes: "each" | "outer";
296
- readonly legend: false | "shared";
326
+ readonly legend: false | "shared" | Readonly<LegendOptions> | StoredFacetLegendIntent;
297
327
  };
298
328
  };
299
329
  }
@@ -389,6 +419,7 @@ export type DatasetRegressionTransform = {
389
419
  method: "linear";
390
420
  degree?: never;
391
421
  span?: never;
422
+ robustIterations?: never;
392
423
  } & ({ interval: false; confidenceMethod?: never; level?: never; confidence?: never } | ({ interval: "mean" | "prediction" } & (
393
424
  | { confidenceMethod: ConfidenceIntervalMethod; level: number; confidence?: never }
394
425
  | { confidence: number; confidenceMethod?: never; level?: never }
@@ -397,13 +428,25 @@ export type DatasetRegressionTransform = {
397
428
  method: "polynomial";
398
429
  degree: number;
399
430
  span?: never;
431
+ robustIterations?: never;
400
432
  } & ({ interval: false; confidenceMethod?: never; level?: never; confidence?: never } | ({ interval: "mean" | "prediction" } & (
401
433
  | { confidenceMethod: ConfidenceIntervalMethod; level: number; confidence?: never }
402
434
  | { confidence: number; confidenceMethod?: never; level?: never }
403
435
  ))))
436
+ | {
437
+ method: "exp";
438
+ interval: false;
439
+ degree?: never;
440
+ span?: never;
441
+ robustIterations?: never;
442
+ confidenceMethod?: never;
443
+ level?: never;
444
+ confidence?: never;
445
+ }
404
446
  | {
405
447
  method: "loess";
406
448
  span: number;
449
+ robustIterations?: number;
407
450
  degree?: never;
408
451
  confidenceMethod?: never;
409
452
  level?: never;
@@ -761,11 +804,34 @@ export interface DatasetFoldTransform {
761
804
  readonly value: string;
762
805
  };
763
806
  }
807
+ export type ParseTimeFormat = "auto" | "%Y-%m-%d" | "%d/%m/%Y" | "%m/%d/%Y";
764
808
  export type ComputedExpression =
765
809
  | { readonly field: string }
766
810
  | { readonly constant: number | string | boolean | null }
767
811
  | {
768
- readonly op: "negate" | "absolute" | "log" | "sqrt" | "not" | "isNull";
812
+ readonly op: "getPath";
813
+ readonly operand: { readonly field: string };
814
+ readonly path: readonly [string, ...string[]];
815
+ }
816
+ | {
817
+ readonly op: "replaceLiteral";
818
+ readonly operand: ComputedExpression;
819
+ readonly search: string;
820
+ readonly replacement: string;
821
+ }
822
+ | {
823
+ readonly op: "datePart";
824
+ readonly part: "year";
825
+ readonly operand: ComputedExpression;
826
+ readonly timeZone?: string;
827
+ }
828
+ | {
829
+ readonly op: "parseTime";
830
+ readonly operand: ComputedExpression;
831
+ readonly format?: ParseTimeFormat;
832
+ }
833
+ | {
834
+ readonly op: "negate" | "absolute" | "log" | "sqrt" | "floor" | "not" | "isNull" | "toNumber";
769
835
  readonly operand: ComputedExpression;
770
836
  }
771
837
  | {
@@ -852,6 +918,7 @@ type DatasetImputedBaseTransform = {
852
918
  readonly maxGap?: number;
853
919
  };
854
920
  export type DatasetImputedTransform = DatasetImputedBaseTransform & (
921
+ | { readonly method: "mean"; readonly value?: never; readonly sortBy: readonly DatasetWindowSort[]; }
855
922
  | {
856
923
  readonly method: "constant";
857
924
  readonly value: DatasetScalar;
@@ -897,6 +964,7 @@ export type DatasetTransform =
897
964
  | DatasetFilterTransform
898
965
  | DatasetFoldTransform
899
966
  | DatasetRegressionTransform
967
+ | DatasetRegressionStatisticsTransform
900
968
  | DatasetSortTransform
901
969
  | DatasetDensityTransform
902
970
  | DatasetECDFTransform
@@ -1074,7 +1142,9 @@ export type PointShape =
1074
1142
  | "cross"
1075
1143
  | "star"
1076
1144
  | "hexagon"
1077
- | "wye";
1145
+ | "wye"
1146
+ | "wedge"
1147
+ | "arrow";
1078
1148
  export type StrokeStyleDetails = {
1079
1149
  lineCap?: "butt" | "round" | "square";
1080
1150
  lineJoin?: "miter" | "round" | "bevel";
@@ -1082,6 +1152,10 @@ export type StrokeStyleDetails = {
1082
1152
  };
1083
1153
  export type RectStyleDetails = StrokeStyleDetails & {
1084
1154
  cornerRadius?: number;
1155
+ cornerRadiusTopLeft?: number;
1156
+ cornerRadiusTopRight?: number;
1157
+ cornerRadiusBottomRight?: number;
1158
+ cornerRadiusBottomLeft?: number;
1085
1159
  };
1086
1160
  export type PaletteName =
1087
1161
  | "accent"
@@ -1156,6 +1230,7 @@ export interface DatasetFieldLineage {
1156
1230
  readonly role: string;
1157
1231
  }
1158
1232
  export interface DatasetSchemaField {
1233
+ /** Lossless stored row key; empty names cannot be used as action field references. */
1159
1234
  readonly name: string;
1160
1235
  readonly storageType: DatasetStorageType;
1161
1236
  readonly nullable: boolean;
@@ -1169,6 +1244,7 @@ export interface DatasetSchema {
1169
1244
  readonly fields: readonly DatasetSchemaField[];
1170
1245
  }
1171
1246
  export interface SourceSchemaField {
1247
+ /** Exact source row key, including an empty string or whitespace. */
1172
1248
  name: string;
1173
1249
  storageType: Exclude<DatasetStorageType, "unknown" | "mixed">;
1174
1250
  nullable?: boolean;
@@ -1183,7 +1259,7 @@ export interface SemanticLayer {
1183
1259
  readonly data?: string;
1184
1260
  readonly source?: string;
1185
1261
  readonly coordinate?: string;
1186
- readonly mark?: Readonly<{ type?: string; missing?: "error" | "break" | "skip"; [key: string]: unknown }>;
1262
+ readonly mark?: Readonly<{ type?: string; missing?: "error" | "break" | "skip"; blend?: "difference"; [key: string]: unknown }>;
1187
1263
  readonly layout?: Readonly<{ mode?: ColorLayout }>;
1188
1264
  readonly derivedBindings?: Readonly<{ regression?: Readonly<{ mode: "follow"; roles: readonly ["data", "x", "y"] }> }>;
1189
1265
  readonly encoding?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
@@ -1240,6 +1316,15 @@ export interface CanvasOptions {
1240
1316
  height?: number;
1241
1317
  background?: string;
1242
1318
  margin?: number | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
1319
+ /** Exact inner dimensions with automatic outer guide margins; false disables this mode. */
1320
+ plot?: { width: number; height: number } | false;
1321
+ /** Optional inner plot outline. Defaults off; an object replaces the complete style on edit. */
1322
+ plotBorder?: false | {
1323
+ /** Non-empty color string. Defaults to #ddd. */
1324
+ color?: string;
1325
+ /** Positive finite width smaller than both plot dimensions. Defaults to 1. */
1326
+ lineWidth?: number;
1327
+ };
1243
1328
  }
1244
1329
 
1245
1330
  export interface FitCanvasOptions {
@@ -1261,7 +1346,7 @@ export type RotationUnit = "radians" | "degrees";
1261
1346
  export type RotationInput = number | { value: number; unit: RotationUnit };
1262
1347
  type ValueFormatDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
1263
1348
  type ValueFormatPrecision = ValueFormatDigit | 10 | 11 | 12 | `0${ValueFormatDigit}`;
1264
- type TimeAxisDirective = "Y" | "m" | "d" | "b";
1349
+ type TimeAxisDirective = "Y" | "m" | "d" | "b" | "H" | "M" | "S" | "L";
1265
1350
  export type NumericFormatString = `.${ValueFormatPrecision}${"f" | "%" | "e"}`;
1266
1351
  export type UtcFormatString = `${string}%${TimeAxisDirective}${string}`;
1267
1352
  export type ValueFormat = "auto" | NumericFormatString | UtcFormatString;
@@ -1277,6 +1362,17 @@ export interface AxisLineStyleOptions {
1277
1362
  export interface AxisTickStyleOptions extends AxisLineStyleOptions {
1278
1363
  length?: number;
1279
1364
  }
1365
+ export interface CartesianAxisTickStyleOptions extends AxisTickStyleOptions {
1366
+ strokeDash?: readonly number[];
1367
+ /** Typed raw-value overrides. Empty arrays and auto clear only the map. */
1368
+ strokeDashMap?: CartesianGuideDashMap | "auto";
1369
+ /** Signed logical pixels along the axis: positive right for x, down for y. */
1370
+ alongOffset?: number;
1371
+ }
1372
+ export type CartesianGuideDashMap = ReadonlyArray<Readonly<{
1373
+ value: AxisValue;
1374
+ strokeDash: readonly number[];
1375
+ }>>;
1280
1376
  export interface AxisLabelStyleOptions {
1281
1377
  offset?: number;
1282
1378
  format?: AxisFormat;
@@ -1285,6 +1381,20 @@ export interface AxisLabelStyleOptions {
1285
1381
  fontFamily?: string;
1286
1382
  fontWeight?: string | number;
1287
1383
  }
1384
+ export type CartesianAxisLabelColorMap = ReadonlyArray<Readonly<{
1385
+ value: DatasetScalar;
1386
+ color: string;
1387
+ }>>;
1388
+ export interface CartesianAxisLabelStyleOptions extends AxisLabelStyleOptions {
1389
+ /** Local text alignment before rotation; omitted edits retain existing intent. */
1390
+ align?: "left" | "center" | "right";
1391
+ /** Typed raw-tick color overrides; missing entries use color. Auto removes the map. */
1392
+ colorMap?: CartesianAxisLabelColorMap | "auto";
1393
+ /** Keep unrotated label bounds inside the mapped axis span; defaults to false. */
1394
+ flush?: boolean;
1395
+ /** Signed displacement from the mapped tick position, independent of outward offset. */
1396
+ alongOffset?: number;
1397
+ }
1288
1398
  export interface AxisLabelLayoutOptions {
1289
1399
  /** Legacy numbers are radians; structured values make radians or degrees explicit. */
1290
1400
  rotation?: RotationInput;
@@ -1296,18 +1406,28 @@ export interface AxisLabelLayoutOptions {
1296
1406
  overlap?: "error" | "allow";
1297
1407
  }
1298
1408
  export interface AxisTicksAndLabelsOptions<P extends string> {
1409
+ /** Axis resource identity; omission prefers canonical, then a unique named owner. */
1410
+ target?: string;
1299
1411
  scale?: string;
1300
1412
  position?: P;
1301
1413
  count?: number;
1302
1414
  values?: readonly AxisValue[];
1303
- ticks?: AxisTickStyleOptions;
1304
- labels?: AxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
1415
+ ticks?: CartesianAxisTickStyleOptions;
1416
+ labels?: CartesianAxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
1305
1417
  }
1306
1418
  export interface AxisTitleOptions<P extends string> {
1419
+ /** Axis resource identity; omission prefers canonical, then a unique named owner. */
1420
+ target?: string;
1421
+ /** Signed logical pixels: positive right for x, down for y, independent of scale reversal. */
1422
+ alongOffset?: number;
1423
+ align?: "left" | "center" | "right";
1424
+ baseline?: "top" | "hanging" | "middle" | "alphabetic" | "ideographic" | "bottom";
1425
+ /** Hard breaks retain ordered lines with the chosen block baseline, spaced at 1.2 times fontSize. */
1307
1426
  text?: string;
1308
1427
  scale?: string;
1309
1428
  position?: P;
1310
1429
  at?: "start" | "center" | "end" | number;
1430
+ /** Signed distance from the axis frame: positive outward, negative inward. */
1311
1431
  offset?: number;
1312
1432
  rotation?: RotationInput;
1313
1433
  color?: string;
@@ -1316,32 +1436,42 @@ export interface AxisTitleOptions<P extends string> {
1316
1436
  fontWeight?: string | number;
1317
1437
  }
1318
1438
  export interface CompleteAxisOptions<P extends string> {
1439
+ /** Omission retains the canonical x/y identity. */
1440
+ id?: string;
1441
+ /** Non-negative outward displacement of the complete axis frame in logical pixels. */
1442
+ offset?: number;
1319
1443
  scale?: string;
1320
1444
  coordinate?: string;
1321
1445
  position?: P;
1322
1446
  line?: false | AxisLineStyleOptions;
1323
- ticksAndLabels?: false | Omit<AxisTicksAndLabelsOptions<P>, "scale" | "position">;
1324
- title?: false | Omit<AxisTitleOptions<P>, "scale" | "position">;
1447
+ ticksAndLabels?: false | Omit<AxisTicksAndLabelsOptions<P>, "scale" | "position" | "target">;
1448
+ title?: false | Omit<AxisTitleOptions<P>, "scale" | "position" | "target">;
1325
1449
  }
1450
+ export type NamedCompleteAxis<P extends string> = CompleteAxisOptions<P> & { id: string };
1326
1451
  export interface CreateAxesOptions {
1327
1452
  coordinate?: {
1328
1453
  id?: string;
1329
1454
  type?: "auto" | "cartesian" | "polar" | "parallel";
1330
1455
  };
1331
- x?: false | CompleteAxisOptions<XAxisPosition>;
1332
- y?: false | CompleteAxisOptions<YAxisPosition>;
1456
+ x?: false | CompleteAxisOptions<XAxisPosition> | readonly [NamedCompleteAxis<XAxisPosition>, ...NamedCompleteAxis<XAxisPosition>[]];
1457
+ y?: false | CompleteAxisOptions<YAxisPosition> | readonly [NamedCompleteAxis<YAxisPosition>, ...NamedCompleteAxis<YAxisPosition>[]];
1333
1458
  theta?: false | CompletePolarAxisOptions;
1334
1459
  radius?: false | CompleteRadialAxisOptions;
1335
1460
  }
1336
1461
  export interface AxisTickOptions<P extends string>
1337
- extends AxisTickStyleOptions {
1462
+ extends CartesianAxisTickStyleOptions {
1463
+ /** Axis resource identity; omission prefers canonical, then a unique named owner. */
1464
+ target?: string;
1338
1465
  scale?: string;
1339
1466
  position?: P;
1340
1467
  count?: number;
1341
1468
  values?: readonly AxisValue[];
1342
1469
  }
1470
+ /** Cartesian label maps use typed category values or finite numeric/timestamp keys on continuous scales. Empty mapped labels are omitted without removing ticks. */
1343
1471
  export interface AxisLabelOptions<P extends string>
1344
- extends AxisLabelStyleOptions, AxisLabelLayoutOptions, DisplayLabelOptions {
1472
+ extends CartesianAxisLabelStyleOptions, AxisLabelLayoutOptions, DisplayLabelOptions {
1473
+ /** Axis resource identity; omission prefers canonical, then a unique named owner. */
1474
+ target?: string;
1345
1475
  scale?: string;
1346
1476
  position?: P;
1347
1477
  count?: number;
@@ -1464,17 +1594,31 @@ export interface EditRadialAxisOptions
1464
1594
  }
1465
1595
 
1466
1596
  export interface GridDirectionOptions {
1597
+ strokeDashMap?: CartesianGuideDashMap | "auto";
1598
+ /** Signed logical pixels along the scale: vertical lines right, horizontal lines down. */
1599
+ alongOffset?: number;
1600
+ /** Grid draw order relative to marks at zero: positive above, nonpositive behind. */
1601
+ zIndex?: number;
1602
+ /** Band centers by default; boundary draws both edges of each selected band. */
1603
+ bandPosition?: "center" | "boundary";
1467
1604
  scale?: string;
1468
1605
  coordinate?: string;
1469
1606
  count?: number;
1470
- values?: readonly number[];
1607
+ values?: readonly CategoryValue[];
1471
1608
  color?: string;
1472
1609
  lineWidth?: number;
1473
1610
  strokeDash?: readonly number[];
1474
1611
  }
1475
1612
  export interface EditGridOptions {
1613
+ strokeDashMap?: CartesianGuideDashMap | "auto";
1614
+ /** Absolute signed logical-pixel displacement; omission preserves the current value. */
1615
+ alongOffset?: number;
1616
+ /** Preserve omitted order; finite values sort Cartesian grids relative to marks at zero. */
1617
+ zIndex?: number;
1618
+ /** Band centers by default; boundary draws both edges of each selected band. */
1619
+ bandPosition?: "center" | "boundary";
1476
1620
  count?: number;
1477
- values?: readonly number[] | "auto";
1621
+ values?: readonly CategoryValue[] | "auto";
1478
1622
  color?: string;
1479
1623
  lineWidth?: number;
1480
1624
  strokeDash?: readonly number[];
@@ -1521,21 +1665,27 @@ type CartesianAxesOptions = Omit<
1521
1665
  coordinate?: { id?: string; type?: "auto" | "cartesian" };
1522
1666
  };
1523
1667
  type CAxisTicks<P extends string> = Omit<AxisTicksAndLabelsOptions<P>, "labels"> & {
1524
- labels?: AxisLabelStyleOptions & AxisLabelLayoutOptions;
1668
+ labels?: CartesianAxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
1525
1669
  };
1526
1670
  type CAxis<P extends string> = Omit<CompleteAxisOptions<P>, "ticksAndLabels"> & {
1527
- ticksAndLabels?: false | Omit<CAxisTicks<P>, "scale" | "position">;
1671
+ ticksAndLabels?: false | Omit<CAxisTicks<P>, "scale" | "position" | "target">;
1528
1672
  };
1529
1673
  type CAxes = Omit<CartesianAxesOptions, "x" | "y"> & {
1530
- x?: false | CAxis<XAxisPosition>;
1531
- y?: false | CAxis<YAxisPosition>;
1674
+ x?: false | CAxis<XAxisPosition> | readonly [CAxis<XAxisPosition> & { id: string }, ...(CAxis<XAxisPosition> & { id: string })[]];
1675
+ y?: false | CAxis<YAxisPosition> | readonly [CAxis<YAxisPosition> & { id: string }, ...(CAxis<YAxisPosition> & { id: string })[]];
1532
1676
  };
1533
1677
  type CartesianGridOptions = Pick<CreateGridOptions, "horizontal" | "vertical">;
1534
- type FilledMarkLegendOptions = Omit<LegendOptions, "symbol"> & {
1535
- symbol?: "auto"
1536
- | { width?: number; height?: number; stroke?: string; strokeWidth?: number }
1537
- | { layers: readonly LegendSymbolLayer[] };
1538
- };
1678
+ type FilledLegendSymbolRecipe = "auto"
1679
+ | { width?: number; height?: number; stroke?: string; strokeWidth?: number }
1680
+ | { layers: readonly LegendSymbolLayer[] };
1681
+ type FilledMarkLegendOptions = Omit<LegendOptions, "symbol" | "representation" | "combine"> & (
1682
+ | { combine?: "separate" | "size-shape"; representation?: "gradient"; symbol?: FilledLegendSymbolRecipe }
1683
+ | { combine?: "separate" | "size-shape"; representation: "symbols"; symbol?: "auto" | { type?: "point"; radius?: number; stroke?: string; strokeWidth?: number } }
1684
+ | { combine: "color-size"; representation?: never; symbol?: "auto" | { type?: "point"; stroke?: string; strokeWidth?: number; opacity?: number } }
1685
+ );
1686
+ type DistributiveLegendOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
1687
+ type SeparateFilledLegendOptions = DistributiveLegendOmit<Exclude<FilledMarkLegendOptions, { combine: "color-size" }>, "combine"> & { combine?: "separate" };
1688
+ type CategoricalPointLegendOptions = DistributiveLegendOmit<Exclude<FilledMarkLegendOptions, { combine: "color-size" }>, "representation">;
1539
1689
  type CategoricalLegendTextOptions = {
1540
1690
  offset?: number;
1541
1691
  color?: string;
@@ -1546,8 +1696,10 @@ type CategoricalLegendTextOptions = {
1546
1696
  };
1547
1697
  type PathLegendOptions = Omit<
1548
1698
  LegendOptions,
1549
- "symbol" | "gradient" | "count" | "values" | "labels"
1699
+ "symbol" | "gradient" | "count" | "values" | "labels" | "representation" | "combine" | "titlePosition"
1550
1700
  > & {
1701
+ titlePosition?: "top" | "left";
1702
+ combine?: "separate";
1551
1703
  symbol?: "auto" | { length?: number; lineWidth?: number }
1552
1704
  | { layers: readonly LegendSymbolLayer[] };
1553
1705
  labels?: CategoricalLegendTextOptions;
@@ -1555,16 +1707,27 @@ type PathLegendOptions = Omit<
1555
1707
  type CartesianGuideOptions = {
1556
1708
  axes?: false | CartesianAxesOptions;
1557
1709
  grid?: false | CartesianGridOptions;
1558
- legend?: false | (Omit<FilledMarkLegendOptions, "order"> & { order?: CartesianLegendOrder });
1710
+ legend?: false | (DistributiveLegendOmit<FilledMarkLegendOptions, "order"> & { order?: CartesianLegendOrder });
1559
1711
  };
1560
1712
  type CartesianPathGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1561
1713
  legend?: false | (Omit<PathLegendOptions, "order"> & { order?: LegendValueOrder });
1562
1714
  };
1715
+ type CartesianSeparateGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1716
+ legend?: false | (DistributiveLegendOmit<SeparateFilledLegendOptions, "order"> & { order?: CartesianLegendOrder });
1717
+ };
1718
+ type CartesianCategoricalPointGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1719
+ legend?: false | (Omit<CategoricalPointLegendOptions, "count" | "values" | "gradient" | "labels" | "order" | "symbol" | "titlePosition"> & {
1720
+ titlePosition?: "top" | "left";
1721
+ symbol?: FilledLegendSymbolRecipe; labels?: CategoricalLegendTextOptions; order?: CartesianLegendOrder;
1722
+ });
1723
+ };
1563
1724
  type CartesianCategoricalGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1564
1725
  legend?: false | (Omit<
1565
- FilledMarkLegendOptions,
1566
- "count" | "values" | "gradient" | "labels" | "order"
1726
+ SeparateFilledLegendOptions,
1727
+ "count" | "values" | "gradient" | "labels" | "order" | "representation" | "symbol" | "titlePosition"
1567
1728
  > & {
1729
+ titlePosition?: "top" | "left";
1730
+ symbol?: FilledLegendSymbolRecipe;
1568
1731
  labels?: CategoricalLegendTextOptions;
1569
1732
  order?: CartesianLegendOrder;
1570
1733
  });
@@ -1576,7 +1739,7 @@ type CCategoricalGuides = Omit<CartesianCategoricalGuideOptions, "axes"> & {
1576
1739
  axes?: false | CAxes;
1577
1740
  };
1578
1741
  type ColorGuides = Omit<CartesianGuideOptions, "legend"> & {
1579
- legend?: false | (Omit<FilledMarkLegendOptions, "values" | "order"> & {
1742
+ legend?: false | (DistributiveLegendOmit<SeparateFilledLegendOptions, "order"> & {
1580
1743
  order?: CartesianLegendOrder;
1581
1744
  });
1582
1745
  };
@@ -1617,9 +1780,11 @@ export type PolarFrameCenter = {
1617
1780
  export type PolarFrameRadius =
1618
1781
  | { unit: "fraction"; value: number }
1619
1782
  | { unit: "px"; value: number };
1783
+ export type ArcInnerRadius = number | { unit: "px"; value: number };
1620
1784
  export type PolarFrameOptions = "auto" | {
1621
1785
  center?: PolarFrameCenter;
1622
1786
  radius?: PolarFrameRadius;
1787
+ overflow?: "error" | "allow";
1623
1788
  };
1624
1789
 
1625
1790
  type EditCoordinateTarget = {
@@ -1652,6 +1817,8 @@ export interface ScaleOptions {
1652
1817
  align?: number;
1653
1818
  palette?: Palette;
1654
1819
  interpolate?: ContinuousColorInterpolation;
1820
+ whitePoint?: "d65" | "d50";
1821
+ gamma?: number;
1655
1822
  midpoint?: number | "auto";
1656
1823
  unknown?: unknown;
1657
1824
  }
@@ -1724,6 +1891,14 @@ type ContinuousSizeScaleOptions = SizeScaleCommonOptions &
1724
1891
  domain?: "auto" | readonly [number, number];
1725
1892
  range?: "auto" | readonly [number, number];
1726
1893
  };
1894
+ export type CategoricalSizeScaleOptions = SizeScaleCommonOptions & {
1895
+ type?: "ordinal";
1896
+ domain?: "auto" | readonly (string | number | boolean)[];
1897
+ range?: "auto" | readonly [number, ...number[]];
1898
+ clamp?: never;
1899
+ base?: never;
1900
+ exponent?: never;
1901
+ };
1727
1902
  export type SizeScaleOptions =
1728
1903
  | (ContinuousSizeScaleOptions & {
1729
1904
  type?: "linear";
@@ -1772,6 +1947,7 @@ export type SizeScaleOptions =
1772
1947
  export type ShapeScaleOptions = ScaleFields<"id"> & {
1773
1948
  type?: "ordinal";
1774
1949
  domain?: "auto" | readonly unknown[];
1950
+ /** One entry per domain value; explicit repeated shapes are allowed. Auto uses distinct shapes. */
1775
1951
  range?: "auto" | readonly PointShape[];
1776
1952
  unknown?: PointShape;
1777
1953
  };
@@ -1798,6 +1974,8 @@ export interface EditScaleOptions {
1798
1974
  align?: number;
1799
1975
  palette?: Palette;
1800
1976
  interpolate?: ContinuousColorInterpolation;
1977
+ whitePoint?: "d65" | "d50" | "auto";
1978
+ gamma?: number | "auto";
1801
1979
  midpoint?: number | "auto";
1802
1980
  unknown?: unknown;
1803
1981
  }
@@ -1824,16 +2002,14 @@ export type EditRScaleOptions = FocusedScaleSelection & WithoutScaleId<RadiusSca
1824
2002
  radialMapping?: RadialMapping;
1825
2003
  };
1826
2004
  export type EditColorScaleOptions = FocusedScaleSelection & WithoutScaleId<
1827
- CategoricalColorScaleOptions | ContinuousColorScaleOptions | DiscretizedColorScaleOptions
1828
- >;
1829
- export type EditStrokeScaleOptions = { target: string } & Omit<
1830
- EditColorScaleOptions,
1831
- "id" | "target"
1832
- >;
2005
+ CategoricalColorScaleOptions | Omit<ContinuousColorScaleOptions, "whitePoint" | "gamma"> | DiscretizedColorScaleOptions
2006
+ > & { whitePoint?: "d65" | "d50" | "auto"; gamma?: number | "auto" };
2007
+ type WithoutScaleSelection<T> = T extends unknown ? Omit<T, "id" | "target"> : never;
2008
+ export type EditStrokeScaleOptions = { target: string } & WithoutScaleSelection<EditColorScaleOptions>;
1833
2009
  type ExistingSizeScaleEditPatch = {
1834
2010
  type?: never;
1835
- domain?: "auto" | readonly [number, ...number[]];
1836
- range?: "auto" | readonly [number, number, ...number[]];
2011
+ domain?: "auto" | readonly [string | number | boolean, ...(string | number | boolean)[]];
2012
+ range?: "auto" | readonly [number, ...number[]];
1837
2013
  unknown?: number;
1838
2014
  clamp?: boolean;
1839
2015
  reverse?: boolean;
@@ -1841,6 +2017,7 @@ type ExistingSizeScaleEditPatch = {
1841
2017
  exponent?: number;
1842
2018
  };
1843
2019
  type SizeScaleTypeEditPatch =
2020
+ | (WithoutScaleId<CategoricalSizeScaleOptions> & { type: "ordinal" })
1844
2021
  | (Omit<WithoutScaleId<SizeScaleOptions>, "type"> & { type?: "linear" })
1845
2022
  | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "log" }>, "type"> & {
1846
2023
  type: "log";
@@ -1979,6 +2156,8 @@ export type RadialEncodingOptions = {
1979
2156
  coordinate?: string;
1980
2157
  } & (
1981
2158
  | { field: string; mapping?: false; aggregate?: never; scale?: RadiusScaleOptions }
2159
+ | { field: string; mapping?: never; aggregate: "sum"; scale?: RadiusScaleOptions }
2160
+ | { field?: never; mapping?: never; aggregate: "count"; scale?: RadiusScaleOptions }
1982
2161
  | { field: string; mapping?: RadialMapping; aggregate: "sum"; scale?: MeasuredRadiusScaleOptions }
1983
2162
  | { field?: never; mapping?: RadialMapping; aggregate: "count"; scale?: MeasuredRadiusScaleOptions }
1984
2163
  );
@@ -2223,7 +2402,8 @@ type TimeUnitDataBaseOptions = {
2223
2402
  source?: string;
2224
2403
  field: string;
2225
2404
  temporalUnit?: TemporalInputUnit;
2226
- as: string;
2405
+ /** Defaults to `${field}_${unit}`; collisions are rejected. */
2406
+ as?: string;
2227
2407
  timeZone?: string;
2228
2408
  };
2229
2409
  export type TimeUnitDataOptions = TimeUnitDataBaseOptions & (
@@ -2345,6 +2525,7 @@ type ImputedDataBaseOptions = {
2345
2525
  maxGap?: number;
2346
2526
  };
2347
2527
  export type ImputedDataOptions = ImputedDataBaseOptions & (
2528
+ | { method?: "mean"; value?: never; sortBy?: readonly WindowSort[]; }
2348
2529
  | {
2349
2530
  method: "constant";
2350
2531
  value: DatasetScalar;
@@ -2362,7 +2543,7 @@ export type ImputedDataOptions = ImputedDataBaseOptions & (
2362
2543
  }
2363
2544
  );
2364
2545
  export interface StackDataOptions {
2365
- id: string;
2546
+ id?: string;
2366
2547
  source?: string;
2367
2548
  category: string;
2368
2549
  group: string;
@@ -2553,11 +2734,24 @@ export type BoxPlotPositionChannel =
2553
2734
  | BoxPlotCategoryChannel
2554
2735
  | BoxPlotMeasureChannel;
2555
2736
 
2556
- export type BoxPlotWhisker =
2737
+ export type BoxPlotWhisker = (
2557
2738
  | { type?: "tukey"; factor?: number }
2558
- | { type: "minmax"; factor?: never };
2739
+ | { type: "minmax"; factor?: never }
2740
+ ) & Pick<ErrorBarOptions, "caps" | "capSize" | "stroke" | "strokeWidth" | "strokeDash" | "opacity" |
2741
+ "lineCap" | "lineJoin" | "miterLimit">;
2742
+
2743
+ export interface BoxPlotSummaryFields {
2744
+ min: string;
2745
+ q1: string;
2746
+ median: string;
2747
+ q3: string;
2748
+ max: string;
2749
+ }
2750
+
2751
+ type BoxPlotWidth = { band?: number; pixels?: never } | { band?: never; pixels: number };
2559
2752
 
2560
2753
  export interface BoxPlotOptions {
2754
+ summary?: BoxPlotSummaryFields;
2561
2755
  id?: string;
2562
2756
  target?: string;
2563
2757
  data?: string;
@@ -2565,7 +2759,7 @@ export interface BoxPlotOptions {
2565
2759
  y?: BoxPlotPositionChannel;
2566
2760
  coordinate?: string;
2567
2761
  whisker?: BoxPlotWhisker;
2568
- width?: { band?: number };
2762
+ width?: BoxPlotWidth;
2569
2763
  outliers?: boolean;
2570
2764
  box?: RectStyleDetails & {
2571
2765
  fill?: string;
@@ -2574,6 +2768,7 @@ export interface BoxPlotOptions {
2574
2768
  strokeWidth?: number;
2575
2769
  };
2576
2770
  median?: StrokeStyleDetails & {
2771
+ width?: { pixels: number } | "auto";
2577
2772
  stroke?: string;
2578
2773
  strokeWidth?: number;
2579
2774
  };
@@ -2586,12 +2781,13 @@ export interface BoxPlotOptions {
2586
2781
  }
2587
2782
 
2588
2783
  export interface EditBoxPlotOptions {
2784
+ summary?: BoxPlotSummaryFields | false;
2589
2785
  target?: string;
2590
2786
  data?: string;
2591
2787
  x?: BoxPlotPositionChannel;
2592
2788
  y?: BoxPlotPositionChannel;
2593
2789
  whisker?: BoxPlotWhisker;
2594
- width?: { band?: number };
2790
+ width?: BoxPlotWidth;
2595
2791
  outliers?: boolean;
2596
2792
  box?: RectStyleDetails & {
2597
2793
  fill?: string;
@@ -2600,6 +2796,7 @@ export interface EditBoxPlotOptions {
2600
2796
  strokeWidth?: number;
2601
2797
  };
2602
2798
  median?: StrokeStyleDetails & {
2799
+ width?: { pixels: number } | "auto";
2603
2800
  stroke?: string;
2604
2801
  strokeWidth?: number;
2605
2802
  };
@@ -2688,7 +2885,7 @@ export type ViolinPlotColorOptions =
2688
2885
  };
2689
2886
 
2690
2887
  export interface ViolinPlotAreaOptions extends StrokeStyleDetails {
2691
- fill?: string;
2888
+ fill?: FillPaint;
2692
2889
  opacity?: number;
2693
2890
  stroke?: string;
2694
2891
  strokeWidth?: number;
@@ -2763,6 +2960,11 @@ type LineXPositionChannel =
2763
2960
  temporalUnit?: TemporalInputUnit;
2764
2961
  scale?: NonPointTemporalPositionScaleOptions;
2765
2962
  }
2963
+ | {
2964
+ fieldType: "nominal" | "ordinal";
2965
+ bin?: never;
2966
+ scale?: NonPointCategoricalPositionScaleOptions;
2967
+ }
2766
2968
  ));
2767
2969
  type LineYPositionChannel =
2768
2970
  | string
@@ -2788,13 +2990,14 @@ type BarYPositionChannel =
2788
2990
  | string
2789
2991
  | {
2790
2992
  field: string;
2993
+ bin?: never;
2791
2994
  fieldType: "temporal";
2792
2995
  temporalUnit?: TemporalInputUnit;
2793
2996
  aggregate?: never;
2794
2997
  stack?: never;
2795
2998
  scale?: NonPointTemporalPositionScaleOptions;
2796
2999
  }
2797
- | ({ field: string; stack?: StackMode } & (
3000
+ | ({ field: string; bin?: never; stack?: StackMode } & (
2798
3001
  | {
2799
3002
  fieldType?: "quantitative";
2800
3003
  aggregate?: never;
@@ -2829,7 +3032,7 @@ type BasicColorChannel =
2829
3032
  field: string;
2830
3033
  fieldType: "temporal";
2831
3034
  temporalUnit?: TemporalInputUnit;
2832
- scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
3035
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint" | "type" | "base" | "exponent" | "constant"> & { midpoint?: "auto"; type?: "sequential" };
2833
3036
  palette?: Palette;
2834
3037
  };
2835
3038
  type NonPointCategoricalColorChannel =
@@ -2894,14 +3097,10 @@ type RectColorChannel =
2894
3097
  field: string;
2895
3098
  fieldType: "temporal";
2896
3099
  temporalUnit?: TemporalInputUnit;
2897
- scale?: Omit<NonPointContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
3100
+ scale?: Omit<NonPointContinuousColorScaleOptions, "midpoint" | "type" | "base" | "exponent" | "constant"> & { midpoint?: "auto"; type?: "sequential" };
2898
3101
  palette?: Palette;
2899
3102
  };
2900
- export type BasicSizeChannel = string | {
2901
- field: string;
2902
- fieldType?: "quantitative";
2903
- scale?: SizeScaleOptions;
2904
- };
3103
+ export type BasicSizeChannel = string | WithoutEncodingTarget<SizeEncodingOptions>;
2905
3104
  export type BasicShapeChannel = string | {
2906
3105
  field: string;
2907
3106
  fieldType?: "nominal";
@@ -2965,6 +3164,7 @@ export interface CreateScatterPlotOptions {
2965
3164
  x: PointFacadePositionChannel;
2966
3165
  y: PointFacadePositionChannel;
2967
3166
  color?: BasicColorChannel;
3167
+ stroke?: string | WithoutEncodingTarget<Extract<StrokeEncodingOptions, { field: string }>>;
2968
3168
  size?: BasicSizeChannel;
2969
3169
  shape?: BasicShapeChannel;
2970
3170
  point?: StrokeStyleDetails & {
@@ -2996,7 +3196,7 @@ type IntervalPlotBaseOptions = {
2996
3196
  color?: BasicColorChannel;
2997
3197
  point?: CreateScatterPlotOptions["point"];
2998
3198
  errorBar?: IntervalPlotErrorBarOptions;
2999
- guides?: false | CartesianGuideOptions;
3199
+ guides?: false | CartesianSeparateGuideOptions;
3000
3200
  };
3001
3201
  export type CreateIntervalPlotOptions = IntervalPlotBaseOptions & (
3002
3202
  | {
@@ -3060,7 +3260,7 @@ type EndpointPlotBaseOptions = {
3060
3260
  category: EndpointCategoryChannel;
3061
3261
  orientation?: "horizontal" | "vertical";
3062
3262
  summary?: EndpointPlotSummary;
3063
- guides?: false | CartesianGuideOptions;
3263
+ guides?: false | CartesianSeparateGuideOptions;
3064
3264
  };
3065
3265
  export interface CreateDotPlotOptions extends EndpointPlotBaseOptions {
3066
3266
  value: EndpointValueChannel;
@@ -3133,7 +3333,7 @@ type PolarLegendOrder = LegendValueOrder | { channel: "theta"; values?: never };
3133
3333
  type PolarPathLegendOptions = Omit<PathLegendOptions, "order"> & {
3134
3334
  order?: PolarLegendOrder;
3135
3335
  };
3136
- type PolarPointLegendOptions = Omit<FilledMarkLegendOptions, "order"> & {
3336
+ type PolarPointLegendOptions = DistributiveLegendOmit<Exclude<FilledMarkLegendOptions, { combine: "color-size" }>, "order"> & {
3137
3337
  order?: PolarLegendOrder;
3138
3338
  };
3139
3339
  export type PolarPathGuideOptions = Omit<PolarChartGuideOptions, "legend"> & {
@@ -3163,7 +3363,7 @@ export interface CreatePolarLinePlotOptions {
3163
3363
  color?: LineCategoricalColorChannel;
3164
3364
  groupBy?: string | readonly [string, ...string[]];
3165
3365
  strokeDash?: BasicStrokeDashChannel;
3166
- line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve"> & {
3366
+ line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve" | "tension"> & {
3167
3367
  curve?: "linear";
3168
3368
  closed?: boolean;
3169
3369
  };
@@ -3229,7 +3429,7 @@ export type CreateRadarPlotOptions = {
3229
3429
  ];
3230
3430
  color?: LineCategoricalColorChannel;
3231
3431
  strokeDash?: BasicStrokeDashChannel;
3232
- line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve"> & {
3432
+ line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve" | "tension"> & {
3233
3433
  curve?: "linear";
3234
3434
  closed?: true;
3235
3435
  };
@@ -3258,8 +3458,17 @@ export interface RugTickOptions extends StrokeStyleDetails {
3258
3458
  strokeWidth?: number;
3259
3459
  opacity?: number;
3260
3460
  }
3261
- export type RugGuideOptions = Omit<CartesianGuideOptions, "axes" | "legend"> & {
3461
+ type ContinuousGridDirectionOptions = Omit<GridDirectionOptions, "bandPosition"> & {
3462
+ /** Continuous position scales do not have categorical band edges. */
3463
+ bandPosition?: never;
3464
+ };
3465
+ type ContinuousCartesianGridOptions = {
3466
+ vertical?: boolean | ContinuousGridDirectionOptions;
3467
+ horizontal?: boolean | ContinuousGridDirectionOptions;
3468
+ };
3469
+ export type RugGuideOptions = Omit<CartesianGuideOptions, "axes" | "legend" | "grid"> & {
3262
3470
  axes?: false | CAxes;
3471
+ grid?: false | ContinuousCartesianGridOptions;
3263
3472
  legend?: false;
3264
3473
  };
3265
3474
  export type CreateRugPlotOptions = {
@@ -3400,7 +3609,7 @@ export interface CreateRaincloudPlotOptions {
3400
3609
  summary?: false | RaincloudSummaryOptions;
3401
3610
  points?: false | RaincloudPointsOptions;
3402
3611
  color?: LineCategoricalColorChannel;
3403
- guides?: false | CartesianCategoricalGuideOptions;
3612
+ guides?: false | CartesianCategoricalPointGuideOptions;
3404
3613
  }
3405
3614
  export interface EditRaincloudPlotOptions {
3406
3615
  target?: string;
@@ -3423,6 +3632,7 @@ export type GroupEncodingOptions = { target?: string; fieldType?: "nominal" } &
3423
3632
  export interface SeriesLayoutOptions { target?: string; mode: ColorLayout; }
3424
3633
  export interface BasicSeriesLayoutOptions { target?: string; mode: Exclude<ColorLayout, "center">; }
3425
3634
  export type AreaPlotIndependentChannel = string | ({ field: string } & (
3635
+ | { fieldType: "nominal" | "ordinal"; scale?: NonPointCategoricalPositionScaleOptions }
3426
3636
  | { fieldType?: "quantitative"; scale?: NonPointQuantitativePositionScaleOptions }
3427
3637
  | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit; scale?: NonPointTemporalPositionScaleOptions }
3428
3638
  ));
@@ -3436,8 +3646,8 @@ export type CreateAreaPlotOptions = {
3436
3646
  groupBy?: string | readonly [string, ...string[]];
3437
3647
  layout?: Exclude<ColorLayout, "group">; missing?: "error" | "break";
3438
3648
  color?: string | { field: string; fieldType?: "nominal" | "ordinal"; scale?: NonPointCategoricalColorScaleOptions; palette?: Palette };
3439
- area?: StrokeStyleDetails & { fill?: string; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3440
- guides?: false | DensityPlotGuideOptions;
3649
+ area?: StrokeStyleDetails & { fill?: FillPaint; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3650
+ guides?: false | (Omit<DensityPlotGuideOptions, "grid"> & { grid?: false | CartesianGridOptions });
3441
3651
  } & (
3442
3652
  | { valueChannel?: "y"; x: AreaPlotIndependentChannel; y: Exclude<AreaPlotMeasureChannel, { lower: unknown }>; baseline?: number }
3443
3653
  | { valueChannel?: "y"; x: AreaPlotIndependentChannel; y: Extract<AreaPlotMeasureChannel, { lower: unknown }>; baseline?: never }
@@ -3457,11 +3667,22 @@ export interface CreateLinePlotOptions {
3457
3667
  line?: StrokeStyleDetails & {
3458
3668
  strokeWidth?: number;
3459
3669
  curve?: CurveInterpolation;
3670
+ tension?: number;
3460
3671
  stroke?: string;
3461
3672
  opacity?: number;
3462
3673
  closed?: false;
3463
3674
  };
3464
- guides?: false | CPathGuides;
3675
+ guides?: false | (Omit<CPathGuides, "legend" | "grid"> & {
3676
+ grid?: false | (Omit<CartesianGridOptions, "horizontal"> & {
3677
+ horizontal?: boolean | (Omit<GridDirectionOptions, "bandPosition"> & {
3678
+ /** Line y is continuous; band positioning is available only for categorical x grids. */
3679
+ bandPosition?: never;
3680
+ });
3681
+ });
3682
+ legend?: false | (Omit<PathLegendOptions, "order"> & {
3683
+ order?: LegendValueOrder | { channel: "x"; values?: never };
3684
+ });
3685
+ });
3465
3686
  }
3466
3687
 
3467
3688
  type BasicHistogramEncoding =
@@ -3473,22 +3694,44 @@ type BasicHistogramEncoding =
3473
3694
  : never
3474
3695
  : never;
3475
3696
 
3476
- export interface CreateBarPlotOptions {
3697
+ export type BarRangePositionChannel = {
3698
+ lower: string;
3699
+ upper: string;
3700
+ fieldType?: "quantitative";
3701
+ scale?: NonPointZeroSupportingPositionScaleOptions;
3702
+ field?: never;
3703
+ aggregate?: never;
3704
+ stack?: never;
3705
+ };
3706
+ type BarFieldPosition<T> = T extends string ? T : T & { lower?: never; upper?: never };
3707
+ type BarRangeOppositePositionChannel = string | {
3708
+ field: string;
3709
+ fieldType?: "nominal" | "ordinal" | "temporal";
3710
+ temporalUnit?: TemporalInputUnit;
3711
+ scale?: NonPointBandPositionScaleOptions | NonPointTemporalPositionScaleOptions;
3712
+ bin?: never;
3713
+ aggregate?: never;
3714
+ stack?: never;
3715
+ };
3716
+ export type CreateBarPlotOptions = {
3477
3717
  id?: string;
3478
3718
  data?: string;
3479
3719
  coordinate?: string;
3480
- x: BandPositionChannel;
3481
- y: BarYPositionChannel;
3720
+ orientation?: "vertical" | "horizontal";
3482
3721
  color?: BarColorChannel;
3483
- width?: Omit<BarWidthOptions, "target">;
3722
+ width?: Omit<BarWidthOptions, "target" | "interval">;
3484
3723
  bar?: RectStyleDetails & {
3485
- fill?: string;
3724
+ fill?: FillPaint;
3486
3725
  opacity?: number;
3487
3726
  stroke?: FilledMarkStroke;
3488
3727
  strokeWidth?: number;
3489
3728
  };
3490
3729
  guides?: false | ColorGuides;
3491
- }
3730
+ } & (
3731
+ | { x: BarFieldPosition<BandPositionChannel>; y: BarFieldPosition<BarYPositionChannel> }
3732
+ | { x: BarRangePositionChannel; y: BarRangeOppositePositionChannel }
3733
+ | { x: BarRangeOppositePositionChannel; y: BarRangePositionChannel }
3734
+ );
3492
3735
 
3493
3736
  export type CreateHistogramOptions = BasicHistogramEncoding & {
3494
3737
  id?: string;
@@ -3497,17 +3740,20 @@ export type CreateHistogramOptions = BasicHistogramEncoding & {
3497
3740
  field: string;
3498
3741
  color?: HistogramCategoricalColorChannel;
3499
3742
  bar?: RectStyleDetails & {
3500
- fill?: string;
3743
+ fill?: FillPaint;
3501
3744
  opacity?: number;
3502
3745
  stroke?: FilledMarkStroke;
3503
3746
  strokeWidth?: number;
3504
3747
  };
3505
- guides?: false | CartesianCategoricalGuideOptions;
3748
+ guides?: false | (Omit<CartesianCategoricalGuideOptions, "grid"> & {
3749
+ /** Bin position and count axes are continuous; neither grid has categorical band edges. */
3750
+ grid?: false | ContinuousCartesianGridOptions;
3751
+ });
3506
3752
  };
3507
3753
 
3508
3754
  export type HorizonPlotGuideOptions = {
3509
3755
  axes?: false | (Omit<CAxes, "y"> & { y?: false });
3510
- grid?: false | (Pick<CartesianGridOptions, "vertical"> & { horizontal?: false });
3756
+ grid?: false | { vertical?: boolean | ContinuousGridDirectionOptions; horizontal?: false };
3511
3757
  legend?: false;
3512
3758
  };
3513
3759
  export interface CreateHorizonPlotOptions {
@@ -3529,7 +3775,8 @@ export interface CreateHorizonPlotOptions {
3529
3775
  }
3530
3776
 
3531
3777
  export type DensityPlotLegendOptions = Omit<PieLegendOptions, "order"> & { order?: LegendValueOrder };
3532
- export type DensityPlotGuideOptions = Omit<CCategoricalGuides, "legend"> & {
3778
+ export type DensityPlotGuideOptions = Omit<CCategoricalGuides, "legend" | "grid"> & {
3779
+ grid?: false | ContinuousCartesianGridOptions;
3533
3780
  legend?: false | DensityPlotLegendOptions;
3534
3781
  };
3535
3782
  export interface CreateDensityPlotOptions {
@@ -3555,7 +3802,7 @@ export interface CreateDensityPlotOptions {
3555
3802
  palette?: Palette;
3556
3803
  layout?: "overlay";
3557
3804
  };
3558
- area?: StrokeStyleDetails & { fill?: string; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3805
+ area?: StrokeStyleDetails & { fill?: FillPaint; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3559
3806
  guides?: false | DensityPlotGuideOptions;
3560
3807
  }
3561
3808
 
@@ -3571,33 +3818,40 @@ export type PieColor = string | {
3571
3818
  palette?: Palette;
3572
3819
  };
3573
3820
  export type PieLegendOptions = Omit<
3574
- FilledMarkLegendOptions,
3575
- "count" | "values" | "gradient" | "channels" | "order" | "labels"
3821
+ SeparateFilledLegendOptions,
3822
+ "count" | "values" | "gradient" | "channels" | "order" | "labels" | "representation" | "symbol" | "titlePosition"
3576
3823
  > & {
3824
+ titlePosition?: "top" | "left";
3825
+ symbol?: FilledLegendSymbolRecipe;
3577
3826
  channels?: readonly ["color"];
3578
3827
  order?: LegendValueOrder | { channel: "theta"; values?: never };
3579
3828
  labels?: CategoricalLegendTextOptions;
3580
3829
  };
3830
+ export type PieRadiusChannel = string | {
3831
+ scale?: RadiusScaleOptions;
3832
+ } & ({ field: string; aggregate?: "sum" } | { field?: never; aggregate: "count" });
3833
+
3581
3834
  export type CreatePiePlotOptions = {
3582
3835
  id?: string;
3583
3836
  data?: string;
3584
3837
  coordinate?: string;
3585
3838
  category: PieCategory;
3586
3839
  color?: false | PieColor;
3587
- arc?: StrokeStyleDetails & { innerRadius?: number; padAngle?: number; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3840
+ radius?: PieRadiusChannel;
3841
+ arc?: StrokeStyleDetails & { innerRadius?: ArcInnerRadius; padAngle?: number; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3588
3842
  guides?: false | { axes?: false; grid?: false; legend?: false | PieLegendOptions };
3589
- } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate: "sum" });
3843
+ } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate?: "sum" });
3590
3844
 
3591
3845
  export type MeasuredRadialGuideOptions = {
3592
3846
  axes?: false | CategoricalPolarAxesOptions;
3593
3847
  grid?: false | CategoricalPolarGridOptions;
3594
3848
  legend?: false | PieLegendOptions;
3595
3849
  };
3596
- export type CreateRosePlotOptions = Omit<CreatePiePlotOptions, "guides" | "arc" | "aggregate" | "value"> & {
3850
+ export type CreateRosePlotOptions = Omit<CreatePiePlotOptions, "guides" | "arc" | "aggregate" | "value" | "radius"> & {
3597
3851
  radiusScale?: MeasuredRadiusScaleOptions;
3598
- arc?: StrokeStyleDetails & { innerRadius?: number; padAngle?: 0; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3852
+ arc?: StrokeStyleDetails & { innerRadius?: ArcInnerRadius; padAngle?: 0; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3599
3853
  guides?: false | MeasuredRadialGuideOptions;
3600
- } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate: "sum" });
3854
+ } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate?: "sum" });
3601
3855
  export type CreateRadialBarPlotOptions = CreateRosePlotOptions;
3602
3856
 
3603
3857
  export interface HeatmapBaseOptions {
@@ -3609,7 +3863,7 @@ export interface HeatmapBaseOptions {
3609
3863
  stroke?: string | false;
3610
3864
  strokeWidth?: number;
3611
3865
  };
3612
- guides?: false | CartesianGuideOptions;
3866
+ guides?: false | CartesianSeparateGuideOptions;
3613
3867
  }
3614
3868
 
3615
3869
  export type HeatmapCategoryPositionChannel =
@@ -3624,7 +3878,7 @@ export interface PreGriddedHeatmapOptions extends HeatmapBaseOptions {
3624
3878
  x: HeatmapCategoryPositionChannel;
3625
3879
  y: HeatmapCategoryPositionChannel;
3626
3880
  bin?: never;
3627
- color: RectColorChannel;
3881
+ color?: RectColorChannel;
3628
3882
  }
3629
3883
 
3630
3884
  export interface BinnedHeatmapPositionChannel {
@@ -3697,7 +3951,7 @@ export interface ErrorBandOptions extends StrokeStyleDetails {
3697
3951
  y?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3698
3952
  groupBy?: string;
3699
3953
  coordinate?: string;
3700
- fill?: string;
3954
+ fill?: FillPaint;
3701
3955
  opacity?: number;
3702
3956
  curve?: CurveInterpolation;
3703
3957
  boundaries?: false | (StrokeStyleDetails & {
@@ -3715,7 +3969,7 @@ export interface EditErrorBandOptions extends StrokeStyleDetails {
3715
3969
  x?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3716
3970
  y?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3717
3971
  groupBy?: string | false;
3718
- fill?: string | false;
3972
+ fill?: FillPaint | false;
3719
3973
  opacity?: number;
3720
3974
  curve?: CurveInterpolation;
3721
3975
  statistics?: {
@@ -3785,6 +4039,12 @@ export interface YOffsetEncodingOptions extends OffsetEncodingOptions {}
3785
4039
  export type TextFormat = ValueFormat;
3786
4040
 
3787
4041
  export interface TextMarkOptions {
4042
+ /** Logical-pixel baseline spacing; defaults to 1.2 times fontSize. */
4043
+ lineHeight?: number;
4044
+ /** Anchor the first line or center the complete multiline block. */
4045
+ blockAlign?: "first" | "middle";
4046
+ /** Follow resolved source appearance; an explicit fill takes precedence. Source-owned labels only. */
4047
+ inheritColor?: "fill" | "stroke" | false;
3788
4048
  id?: string;
3789
4049
  data?: string;
3790
4050
  /** Explicit source mark. Mutually exclusive with data; may be incomplete. */
@@ -3918,6 +4178,18 @@ type AnnotationBaseOptions = Omit<TextMarkOptions, "id" | "data" | "source" | "t
3918
4178
 
3919
4179
  type AnnotationAnchor =
3920
4180
  | {
4181
+ anchor: "plot-center";
4182
+ x?: never;
4183
+ y?: never;
4184
+ space?: never;
4185
+ source?: never;
4186
+ align?: never;
4187
+ baseline?: never;
4188
+ data?: string;
4189
+ coordinate?: string;
4190
+ }
4191
+ | {
4192
+ anchor?: never;
3921
4193
  x?: never;
3922
4194
  y?: never;
3923
4195
  space?: never;
@@ -3926,6 +4198,7 @@ type AnnotationAnchor =
3926
4198
  coordinate?: never;
3927
4199
  }
3928
4200
  | {
4201
+ anchor?: never;
3929
4202
  x: unknown;
3930
4203
  y: unknown;
3931
4204
  space?: "data";
@@ -3934,6 +4207,7 @@ type AnnotationAnchor =
3934
4207
  coordinate?: never;
3935
4208
  }
3936
4209
  | {
4210
+ anchor?: never;
3937
4211
  x: number;
3938
4212
  y: number;
3939
4213
  space: "plot";
@@ -3944,9 +4218,30 @@ type AnnotationAnchor =
3944
4218
 
3945
4219
  export type CreateAnnotationOptions = AnnotationBaseOptions & AnnotationAnchor;
3946
4220
 
4221
+ type TextPlotPositionChannel =
4222
+ | string
4223
+ | ({ field: string } & PositionScaleBranches<
4224
+ NonPointQuantitativePositionScaleOptions,
4225
+ NonPointTemporalPositionScaleOptions,
4226
+ NonPointCategoricalPositionScaleOptions>)
4227
+ | WithoutEncodingTarget<Extract<DatumPositionEncodingOptions, { datum: unknown }>> & { coordinate?: never };
4228
+
4229
+ export interface CreateTextPlotOptions {
4230
+ id?: string;
4231
+ data?: string;
4232
+ coordinate?: string;
4233
+ x: TextPlotPositionChannel;
4234
+ y: TextPlotPositionChannel;
4235
+ text: string | WithoutEncodingTarget<Extract<TextEncodingOptions, { field: string } | { value: unknown }>>;
4236
+ color?: RectColorChannel;
4237
+ style?: Omit<TextMarkOptions, "id" | "data" | "source" | "text" | "inheritColor">;
4238
+ guides?: false | ColorGuides;
4239
+ }
4240
+
3947
4241
  export type BarWidthOptions = { target?: string } & (
3948
- | { band?: number; pixels?: never }
3949
- | { band?: never; pixels: number }
4242
+ | { band?: number; pixels?: never; interval?: never }
4243
+ | { band?: never; pixels: number; interval?: never }
4244
+ | { band?: never; pixels?: never; interval: { unit: Exclude<TimeUnit, "week" | "weekday">; insetStart?: number; insetEnd?: number } }
3950
4245
  );
3951
4246
 
3952
4247
  export interface DashScaleOptions {
@@ -3973,16 +4268,20 @@ export type StrokeDashEncodingOptions =
3973
4268
  };
3974
4269
 
3975
4270
  export type NonPointContinuousColorScaleOptions = ScaleFields<
3976
- "id" | "interpolate" | "midpoint" | "clamp" | "reverse"
4271
+ "id" | "interpolate" | "whitePoint" | "gamma" | "midpoint" | "clamp" | "reverse"
3977
4272
  > & {
3978
- type?: "sequential";
4273
+ base?: number;
4274
+ constant?: number;
3979
4275
  domain?: "auto" | readonly [unknown, unknown];
3980
4276
  range?: "auto" | readonly [string, string, ...string[]];
3981
4277
  palette?: PaletteName | {
3982
4278
  name: PaletteName;
3983
4279
  extent?: readonly [number, number];
3984
4280
  };
3985
- };
4281
+ } & (
4282
+ | { type: "pow"; exponent?: number }
4283
+ | { type?: "sequential" | "log" | "sqrt" | "symlog"; exponent?: never }
4284
+ );
3986
4285
 
3987
4286
  export type ContinuousColorScaleOptions =
3988
4287
  NonPointContinuousColorScaleOptions & { unknown?: string };
@@ -4039,7 +4338,7 @@ export type ColorEncodingOptions =
4039
4338
  fieldType: "temporal";
4040
4339
  temporalUnit?: TemporalInputUnit;
4041
4340
  aggregate?: never;
4042
- scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
4341
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint" | "type" | "base" | "exponent" | "constant"> & { midpoint?: "auto"; type?: "sequential" };
4043
4342
  palette?: Palette;
4044
4343
  layout?: never;
4045
4344
  };
@@ -4162,9 +4461,10 @@ export type StrokeWidthEncodingOptions =
4162
4461
  export type SizeEncodingOptions = {
4163
4462
  field: string;
4164
4463
  target?: string;
4165
- fieldType?: "quantitative";
4166
- scale?: SizeScaleOptions;
4167
- };
4464
+ } & (
4465
+ | { fieldType?: "quantitative"; scale?: SizeScaleOptions }
4466
+ | { fieldType: "nominal" | "ordinal"; scale?: CategoricalSizeScaleOptions }
4467
+ );
4168
4468
 
4169
4469
  export type ShapeEncodingOptions = {
4170
4470
  field: string;
@@ -4212,7 +4512,7 @@ export interface EncodeChannelsOptions {
4212
4512
  channels: AtLeastOne<EncodingChannelAssignments>;
4213
4513
  }
4214
4514
 
4215
- export type RegressionMethod = "linear" | "polynomial" | "loess";
4515
+ export type RegressionMethod = "linear" | "polynomial" | "loess" | "exp";
4216
4516
  export type RegressionInterval = "mean" | "prediction";
4217
4517
 
4218
4518
  export interface RegressionBandOptions extends StrokeStyleDetails {
@@ -4255,10 +4555,22 @@ export interface CreateRegressionLineOptions extends StrokeStyleDetails {
4255
4555
  }
4256
4556
 
4257
4557
  type RegressionParameterOptions =
4558
+ | {
4559
+ method: "exp";
4560
+ interval?: false;
4561
+ degree?: never;
4562
+ span?: never;
4563
+ robustIterations?: never;
4564
+ confidenceMethod?: never;
4565
+ level?: never;
4566
+ confidence?: never;
4567
+ predict?: RegressionPredictOptions;
4568
+ }
4258
4569
  | {
4259
4570
  method?: "linear";
4260
4571
  degree?: never;
4261
4572
  span?: never;
4573
+ robustIterations?: never;
4262
4574
  confidenceMethod?: ConfidenceIntervalMethod;
4263
4575
  level?: number;
4264
4576
  confidence?: number;
@@ -4269,6 +4581,7 @@ type RegressionParameterOptions =
4269
4581
  method: "polynomial";
4270
4582
  degree?: number;
4271
4583
  span?: never;
4584
+ robustIterations?: never;
4272
4585
  confidenceMethod?: ConfidenceIntervalMethod;
4273
4586
  level?: number;
4274
4587
  confidence?: number;
@@ -4279,6 +4592,8 @@ type RegressionParameterOptions =
4279
4592
  method: "loess";
4280
4593
  degree?: never;
4281
4594
  span?: number;
4595
+ /** Residual reweighting passes, integer 0..32; default 0. */
4596
+ robustIterations?: number;
4282
4597
  confidenceMethod?: never;
4283
4598
  level?: never;
4284
4599
  confidence?: never;
@@ -4295,6 +4610,18 @@ export type RegressionDataOptions = {
4295
4610
  missing?: "error" | "drop";
4296
4611
  } & RegressionParameterOptions;
4297
4612
 
4613
+ export interface DatasetRegressionStatisticsTransform {
4614
+ readonly type: "regressionStatistics";
4615
+ }
4616
+ export interface RegressionStatisticsDataOptions {
4617
+ id: string;
4618
+ source: string;
4619
+ }
4620
+ export interface EditRegressionStatisticsDataOptions {
4621
+ target?: string;
4622
+ source?: string;
4623
+ }
4624
+
4298
4625
  type RegressionCommonOptions = {
4299
4626
  target?: string;
4300
4627
  x?: string;
@@ -4306,6 +4633,9 @@ type RegressionCommonOptions = {
4306
4633
  };
4307
4634
 
4308
4635
  export type RegressionOptions = RegressionCommonOptions & (
4636
+ | (Extract<RegressionParameterOptions, { method: "exp" }> & {
4637
+ band?: false;
4638
+ })
4309
4639
  | (Extract<RegressionParameterOptions, { method?: "linear" }> & {
4310
4640
  band?: false | RegressionBandOptions;
4311
4641
  })
@@ -4326,6 +4656,7 @@ export interface EditRegressionOptions {
4326
4656
  method?: RegressionMethod;
4327
4657
  degree?: number;
4328
4658
  span?: number;
4659
+ robustIterations?: number;
4329
4660
  confidenceMethod?: ConfidenceIntervalMethod;
4330
4661
  level?: number;
4331
4662
  confidence?: number;
@@ -4338,6 +4669,7 @@ export interface EditRegressionOptions {
4338
4669
  }
4339
4670
 
4340
4671
  export interface RemoveAxisOptions {
4672
+ target?: string;
4341
4673
  coordinate?: string;
4342
4674
  scale?: string;
4343
4675
  }
@@ -4374,6 +4706,8 @@ export interface LegendTextOptions {
4374
4706
  }
4375
4707
 
4376
4708
  export interface LegendTitleStyleOptions {
4709
+ /** Align a top title inside its measured content block; omission keeps native layout defaults. */
4710
+ align?: "left" | "center" | "right";
4377
4711
  color?: string;
4378
4712
  fontSize?: number;
4379
4713
  fontFamily?: string;
@@ -4381,7 +4715,7 @@ export interface LegendTitleStyleOptions {
4381
4715
  }
4382
4716
 
4383
4717
  export type LegendSymbolLayer =
4384
- | { type: "line"; length?: number; lineWidth?: number }
4718
+ | { type: "line"; length?: number; lineWidth?: number; opacity?: number }
4385
4719
  | {
4386
4720
  type: "point";
4387
4721
  shape?: "circle";
@@ -4389,6 +4723,7 @@ export type LegendSymbolLayer =
4389
4723
  fill?: string;
4390
4724
  stroke?: string;
4391
4725
  strokeWidth?: number;
4726
+ opacity?: number;
4392
4727
  }
4393
4728
  | {
4394
4729
  type: "swatch";
@@ -4396,17 +4731,20 @@ export type LegendSymbolLayer =
4396
4731
  height?: number;
4397
4732
  stroke?: string;
4398
4733
  strokeWidth?: number;
4734
+ opacity?: number;
4399
4735
  };
4400
4736
 
4401
4737
  export type LegendSymbolRecipe =
4402
4738
  | "auto"
4403
4739
  /** Sampled opacity uses a single point recipe; radius defaults to 7 and must be positive. */
4404
- | { type?: "point"; radius?: number; fill?: string; stroke?: string; strokeWidth?: number }
4740
+ | { type?: "point"; radius?: number; fill?: string; stroke?: string; strokeWidth?: number; opacity?: number }
4405
4741
  | { length?: number; lineWidth?: number }
4406
4742
  | { width?: number; height?: number; stroke?: string; strokeWidth?: number }
4407
4743
  | { layers: readonly LegendSymbolLayer[] };
4408
4744
 
4409
4745
  export interface LegendBorderOptions {
4746
+ /** Even-length non-negative finite dash sequence; [] restores a solid frame. */
4747
+ strokeDash?: readonly number[];
4410
4748
  color?: string;
4411
4749
  lineWidth?: number;
4412
4750
  padding?: number;
@@ -4419,32 +4757,50 @@ export type LegendOrder = LegendValueOrder |
4419
4757
  { channel: "x" | "y" | "theta"; values?: never };
4420
4758
 
4421
4759
  export interface LegendOptions {
4760
+ /** Positive sample window height. Clips point-bearing glyphs without changing mapped area. */
4761
+ clipHeight?: number;
4762
+ /** Explicitly combine ordinal size/shape or same-field quantitative color/size circle samples. Omission retains separate blocks. */
4763
+ combine?: "separate" | "size-shape" | "color-size";
4764
+ /** Continuous color only. Omission creates the existing gradient; symbols samples the same scale without changing marks. */
4765
+ representation?: "gradient" | "symbols";
4422
4766
  /** Categorical, interval, size, or stroke-width layout. Defaults to edge; legacy-bottom is categorical and requires bottom position. */
4423
4767
  layout?: "edge" | "legacy-bottom";
4768
+ /** Categorical and ordinal-size display limit; omitted or false shows every item. */
4769
+ overflow?: false | { maxItems: number; summary?: "ellipsis-count" };
4424
4770
  /** Categorical item order; preserves the appearance scale's assignments. */
4425
4771
  order?: LegendOrder;
4426
4772
  target?: string;
4427
4773
  /** Exact requested content; omission infers encoded point color/shape/size. Explicit subsets include size only when listed. */
4428
4774
  channels?: readonly ("color" | "stroke" | "strokeDash" | "strokeWidth" | "shape" | "size" | "opacity")[];
4429
- position?: "right" | "left" | "bottom" | "top";
4775
+ /** Outside right/left: complete legend stack top aligns with the plot top, including borders and excluding chart titles. */
4776
+ position?: "right" | "left" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
4777
+ /** Arrange every legend block owned by the selected target. Item direction and columns remain independent. */
4778
+ blockLayout?: "row" | "column" | "wrap";
4779
+ /** Occupied group top-left relative to the plot. Cannot be supplied with position, align, or offset in the same call. */
4780
+ at?: { x: number; y: number };
4430
4781
  /** Single top/bottom edge: align complete occupied bounds, including border strokes, to the plot. Side positions require center. */
4431
4782
  align?: "left" | "center" | "right";
4432
- /** Categorical sides require vertical (the default); horizontal edges default to horizontal. */
4783
+ /** Gradient orientation is independent of position; auto is gradient-only. Categorical sides require vertical. */
4433
4784
  direction?: "horizontal" | "vertical";
4434
- /** Categorical sides allow omission or 1; multiple columns require a horizontal edge. */
4785
+ /** Categorical legends accept a positive column count on every supported position. */
4435
4786
  columns?: number;
4436
4787
  /** Single top/bottom edge: gap from the plot to the nearest occupied legend edge. */
4437
4788
  offset?: number;
4438
- titlePosition?: "top" | "left";
4439
- title?: string;
4440
- /** Exact ascending samples for continuous size, opacity, or stroke-width legends. Cannot be combined with count. */
4789
+ /** bottom is gradient-only; left retains the existing categorical/opacity rules. */
4790
+ titlePosition?: "top" | "left" | "bottom";
4791
+ /** false hides the title while retaining its inferred field text. */
4792
+ /** LF, CRLF and CR preserve explicit title lines, including blank lines. */
4793
+ title?: string | false;
4794
+ /** Exact ascending samples for continuous size, opacity, stroke-width, or color with representation symbols. Cannot be combined with count. */
4441
4795
  values?: readonly number[];
4442
4796
  count?: number;
4443
- gradient?: { length?: number; thickness?: number };
4797
+ /** Body-only opacity defaults to 1; edits preserve omitted fields. */
4798
+ gradient?: { length?: number; thickness?: number; opacity?: number };
4444
4799
  symbol?: LegendSymbolRecipe;
4445
4800
  labels?: LegendTextOptions;
4446
4801
  /** New categorical+size blocks share typography on every edge; retained standalone size styles remain independent. */
4447
4802
  titleStyle?: LegendTitleStyleOptions;
4803
+ /** Vertical items default to 18 logical pixels; the pitch grows to fit samples and labels. */
4448
4804
  itemGap?: number;
4449
4805
  border?: boolean | LegendBorderOptions;
4450
4806
  }
@@ -4468,8 +4824,12 @@ export interface LegendBlockSymbolPatch {
4468
4824
  }
4469
4825
 
4470
4826
  export interface EditLegendBlockOptions {
4827
+ /** Reset only the sample window with auto. */
4828
+ clipHeight?: number | "auto";
4471
4829
  target: string;
4472
4830
  channel: LegendChannel;
4831
+ /** Block-local anchor; inherit removes only this override. */
4832
+ position?: "right" | "left" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "inherit";
4473
4833
  title?: string;
4474
4834
  values?: readonly [number, ...number[]] | "auto";
4475
4835
  count?: number;
@@ -4477,11 +4837,24 @@ export interface EditLegendBlockOptions {
4477
4837
  gap?: number;
4478
4838
  text?: LegendBlockTextPatch;
4479
4839
  symbol?: LegendBlockSymbolPatch;
4840
+ /** Display-only: categorical keys, or finite numeric keys for continuous size samples. Empty labels omit text only. */
4480
4841
  labelMap?: DisplayLabelMap | "auto";
4481
4842
  }
4482
4843
 
4844
+ export interface LegendTitleStyleEditOptions extends Omit<LegendTitleStyleOptions, "align"> {
4845
+ align?: "left" | "center" | "right" | "auto";
4846
+ }
4847
+
4483
4848
  export interface EditLegendOptions
4484
- extends Omit<LegendOptions, "title" | "values"> {
4849
+ extends Omit<LegendOptions, "title" | "values" | "titleStyle" | "direction" | "position" | "clipHeight"> {
4850
+ clipHeight?: number | "auto";
4851
+ /** Select one existing block; cannot accompany channels. */
4852
+ channel?: LegendChannel;
4853
+ /** inherit is allowed only with a singular channel selector. */
4854
+ position?: "right" | "left" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "inherit";
4855
+ /** Gradient-only auto resets orientation. */
4856
+ direction?: "horizontal" | "vertical" | "auto";
4857
+ titleStyle?: LegendTitleStyleEditOptions;
4485
4858
  /** Exact final content set for the whole target; omission preserves content. */
4486
4859
  channels?: LegendOptions["channels"];
4487
4860
  title?: string | "auto" | false;
@@ -4491,51 +4864,73 @@ export interface EditLegendOptions
4491
4864
 
4492
4865
  export interface EditLegendLayoutOptions {
4493
4866
  target?: string;
4867
+ /** Select one existing block without changing its content. */
4868
+ channel?: LegendChannel;
4494
4869
  layout?: "edge" | "legacy-bottom";
4495
- position?: "right" | "left" | "bottom" | "top";
4870
+ /** Outside right/left: complete legend stack top aligns with the plot top, including borders and excluding chart titles. */
4871
+ position?: "right" | "left" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "inherit";
4872
+ /** Opt into whole-target legend group layout; a requested row never wraps. */
4873
+ blockLayout?: "row" | "column" | "wrap";
4874
+ /** Move the complete occupied group top-left to plot-relative logical pixels. A later position clears this anchor. */
4875
+ at?: { x: number; y: number };
4496
4876
  /** Single top/bottom edge: align complete occupied bounds, including border strokes, to the plot. Side positions require center. */
4497
4877
  align?: "left" | "center" | "right";
4498
- /** Categorical sides require vertical (the default); horizontal edges default to horizontal. */
4499
- direction?: "horizontal" | "vertical";
4500
- /** Categorical sides allow omission or 1; multiple columns require a horizontal edge. */
4878
+ /** Gradient orientation is independent of position; auto is gradient-only. Categorical sides require vertical. */
4879
+ direction?: "horizontal" | "vertical" | "auto";
4880
+ /** Categorical legends accept a positive column count on every supported position. */
4501
4881
  columns?: number;
4502
4882
  /** Single top/bottom edge: gap from the plot to the nearest occupied legend edge. */
4503
4883
  offset?: number;
4504
- titlePosition?: "top" | "left";
4884
+ /** bottom is gradient-only; left retains the existing categorical/opacity rules. */
4885
+ titlePosition?: "top" | "left" | "bottom";
4886
+ /** Explicit spacing override; vertical creation defaults to 18 logical pixels. */
4505
4887
  itemGap?: number;
4506
4888
  }
4507
4889
 
4508
4890
  export interface EditLegendLabelsOptions extends LegendTextOptions {
4509
4891
  target?: string;
4892
+ /** Select one existing block without changing its content. */
4893
+ channel?: LegendChannel;
4510
4894
  }
4511
4895
 
4512
- export interface EditLegendTitleOptions extends LegendTitleStyleOptions {
4896
+ export interface EditLegendTitleOptions extends LegendTitleStyleEditOptions {
4513
4897
  target?: string;
4898
+ /** Select one existing block without changing its content. */
4899
+ channel?: LegendChannel;
4514
4900
  title?: string | "auto" | false;
4515
4901
  }
4516
4902
 
4517
4903
  export interface EditLegendSymbolsOptions {
4904
+ clipHeight?: number | "auto";
4518
4905
  target?: string;
4906
+ /** Select one existing block without changing its content. */
4907
+ channel?: LegendChannel;
4519
4908
  symbol?: LegendSymbolRecipe;
4520
4909
  count?: number;
4521
- gradient?: { length?: number; thickness?: number };
4910
+ gradient?: { length?: number; thickness?: number; opacity?: number };
4522
4911
  }
4523
4912
 
4524
4913
  export interface EditLegendBorderOptions {
4525
4914
  target?: string;
4915
+ /** Select one existing block without changing its content. */
4916
+ channel?: LegendChannel;
4526
4917
  border: boolean | LegendBorderOptions;
4527
4918
  }
4528
4919
 
4529
4920
  export interface EditAxisOptions<P extends string> {
4921
+ target?: string;
4922
+ /** Omitted edits preserve the frame; zero restores the plot-edge frame. */
4923
+ offset?: number;
4530
4924
  position?: P;
4531
4925
  line?: false | AxisLineStyleOptions;
4532
- ticks?: false | Omit<AxisTickOptions<P>, "scale" | "position">;
4533
- labels?: false | Omit<AxisLabelOptions<P>, "scale" | "position">;
4534
- ticksAndLabels?: false | Omit<AxisTicksAndLabelsOptions<P>, "scale" | "position">;
4535
- title?: false | Omit<AxisTitleOptions<P>, "scale" | "position">;
4926
+ ticks?: false | Omit<AxisTickOptions<P>, "scale" | "position" | "target">;
4927
+ labels?: false | Omit<AxisLabelOptions<P>, "scale" | "position" | "target">;
4928
+ ticksAndLabels?: false | Omit<AxisTicksAndLabelsOptions<P>, "scale" | "position" | "target">;
4929
+ title?: false | Omit<AxisTitleOptions<P>, "scale" | "position" | "target">;
4536
4930
  }
4537
4931
 
4538
4932
  export interface TitleTextStyleOptions {
4933
+ fontStyle?: "normal" | "italic";
4539
4934
  color?: string;
4540
4935
  fontSize?: number;
4541
4936
  fontFamily?: string;
@@ -4579,11 +4974,15 @@ export interface RemoveCategoryOrderOptions {
4579
4974
  }
4580
4975
 
4581
4976
  export interface TitleOptions {
4977
+ /** Explicit hard lines are retained; blank lines reserve spacing without painted text. */
4582
4978
  text: string;
4979
+ /** Multiline subtitle with at least one non-empty hard line. */
4583
4980
  subtitle?: string;
4584
4981
  position?: "top" | "bottom" | "left" | "right";
4585
4982
  align?: "left" | "center" | "right";
4586
4983
  offset?: number;
4984
+ /** Signed logical-pixel shift along the selected edge; defaults to zero. */
4985
+ alongOffset?: number;
4587
4986
  gap?: number;
4588
4987
  maxWidth?: number;
4589
4988
  wrap?: "word" | "character";
@@ -4659,6 +5058,8 @@ export class ChartProgram {
4659
5058
  createImputedData(options: ImputedDataOptions): ChartProgram;
4660
5059
  createStackData(options: StackDataOptions): ChartProgram;
4661
5060
  createRegressionData(options: RegressionDataOptions): ChartProgram;
5061
+ createRegressionStatisticsData(options: RegressionStatisticsDataOptions): ChartProgram;
5062
+ editRegressionStatisticsData(options?: EditRegressionStatisticsDataOptions): ChartProgram;
4662
5063
  createIntervalData(options: IntervalDataOptions): ChartProgram;
4663
5064
  createECDFData(options: ECDFDataOptions): ChartProgram;
4664
5065
  createTimeUnitData(options: TimeUnitDataOptions): ChartProgram;
@@ -4684,6 +5085,7 @@ export class ChartProgram {
4684
5085
  editImputedData(options: EditImputedDataOptions): ChartProgram;
4685
5086
  editBin2DData(options: EditBin2DDataOptions): ChartProgram;
4686
5087
 
5088
+ /** One point layer accepts at most 50,000 selected rows, before missing-value filtering. */
4687
5089
  createPointMark(options?: StrokeStyleDetails & {
4688
5090
  id?: string;
4689
5091
  data?: string;
@@ -4729,6 +5131,7 @@ export class ChartProgram {
4729
5131
  data?: string;
4730
5132
  strokeWidth?: number;
4731
5133
  curve?: CurveInterpolation;
5134
+ tension?: number;
4732
5135
  stroke?: string;
4733
5136
  opacity?: number;
4734
5137
  closed?: boolean;
@@ -4737,6 +5140,7 @@ export class ChartProgram {
4737
5140
  target?: string;
4738
5141
  strokeWidth?: number;
4739
5142
  curve?: CurveInterpolation;
5143
+ tension?: number;
4740
5144
  stroke?: string;
4741
5145
  opacity?: number;
4742
5146
  closed?: boolean;
@@ -4744,16 +5148,18 @@ export class ChartProgram {
4744
5148
  createBarMark(options?: RectStyleDetails & {
4745
5149
  id?: string;
4746
5150
  data?: string;
5151
+ orientation?: "vertical" | "horizontal";
4747
5152
  missing?: "error" | "skip";
4748
- fill?: string;
5153
+ fill?: FillPaint;
4749
5154
  opacity?: number;
4750
5155
  stroke?: FilledMarkStroke;
4751
5156
  strokeWidth?: number;
4752
5157
  }): ChartProgram;
4753
5158
  editBarMark(options: RectStyleDetails & {
4754
5159
  target?: string;
5160
+ blend?: "normal" | "difference";
4755
5161
  missing?: "error" | "skip";
4756
- fill?: string;
5162
+ fill?: FillPaint;
4757
5163
  opacity?: number;
4758
5164
  stroke?: FilledMarkStroke;
4759
5165
  strokeWidth?: number;
@@ -4761,7 +5167,7 @@ export class ChartProgram {
4761
5167
  createAreaMark(options?: StrokeStyleDetails & {
4762
5168
  id?: string;
4763
5169
  data?: string;
4764
- fill?: string;
5170
+ fill?: FillPaint;
4765
5171
  opacity?: number;
4766
5172
  stroke?: string;
4767
5173
  strokeWidth?: number;
@@ -4771,7 +5177,7 @@ export class ChartProgram {
4771
5177
  createArcMark(options?: StrokeStyleDetails & {
4772
5178
  id?: string;
4773
5179
  data?: string;
4774
- innerRadius?: number;
5180
+ innerRadius?: ArcInnerRadius;
4775
5181
  padAngle?: number;
4776
5182
  fill?: string;
4777
5183
  opacity?: number;
@@ -4780,7 +5186,7 @@ export class ChartProgram {
4780
5186
  }): ChartProgram;
4781
5187
  editArcMark(options: StrokeStyleDetails & {
4782
5188
  target?: string;
4783
- innerRadius?: number;
5189
+ innerRadius?: ArcInnerRadius;
4784
5190
  padAngle?: number;
4785
5191
  fill?: string;
4786
5192
  opacity?: number;
@@ -4792,6 +5198,7 @@ export class ChartProgram {
4792
5198
  createRuleMark(options?: { id?: string; data?: string; missing?: "error" | "skip" } & RuleStyleOptions): ChartProgram;
4793
5199
  editRuleMark(options: { target?: string; missing?: "error" | "skip" } & RuleStyleOptions): ChartProgram;
4794
5200
  createTextMark(options?: TextMarkOptions): ChartProgram;
5201
+ createTextPlot(options: CreateTextPlotOptions): ChartProgram;
4795
5202
  createMarkLabels(options?: CreateMarkLabelsOptions): ChartProgram;
4796
5203
  editMarkLabelSelection(options: EditMarkLabelSelectionOptions): ChartProgram;
4797
5204
  editMarkLabelPlacement(options: EditMarkLabelPlacementOptions): ChartProgram;
@@ -4804,7 +5211,7 @@ export class ChartProgram {
4804
5211
  removeLabelLayout(options?: RemoveLabelLayoutOptions): ChartProgram;
4805
5212
  editAreaMark(options: StrokeStyleDetails & {
4806
5213
  target?: string;
4807
- fill?: string;
5214
+ fill?: FillPaint;
4808
5215
  opacity?: number;
4809
5216
  stroke?: string | false;
4810
5217
  strokeWidth?: number;
@@ -4924,10 +5331,10 @@ export class ChartProgram {
4924
5331
  editRadialAxisLabels(options?: PolarLabelOptions): ChartProgram;
4925
5332
  editThetaAxisTitle(options?: PolarTitleOptions): ChartProgram;
4926
5333
  editRadialAxisTitle(options?: RadialTitleOptions): ChartProgram;
4927
- createXAxisLine(options?: AxisLineStyleOptions & { scale?: string; position?: XAxisPosition }): ChartProgram;
4928
- createYAxisLine(options?: AxisLineStyleOptions & { scale?: string; position?: YAxisPosition }): ChartProgram;
4929
- editXAxisLine(options?: AxisLineStyleOptions & { position?: XAxisPosition }): ChartProgram;
4930
- editYAxisLine(options?: AxisLineStyleOptions & { position?: YAxisPosition }): ChartProgram;
5334
+ createXAxisLine(options?: AxisLineStyleOptions & { target?: string; scale?: string; position?: XAxisPosition }): ChartProgram;
5335
+ createYAxisLine(options?: AxisLineStyleOptions & { target?: string; scale?: string; position?: YAxisPosition }): ChartProgram;
5336
+ editXAxisLine(options?: AxisLineStyleOptions & { target?: string; position?: XAxisPosition }): ChartProgram;
5337
+ editYAxisLine(options?: AxisLineStyleOptions & { target?: string; position?: YAxisPosition }): ChartProgram;
4931
5338
  createXAxisTicks(options?: AxisTickOptions<XAxisPosition>): ChartProgram;
4932
5339
  createYAxisTicks(options?: AxisTickOptions<YAxisPosition>): ChartProgram;
4933
5340
  editXAxisTicks(options?: Omit<AxisTickOptions<XAxisPosition>, "scale">): ChartProgram;
@@ -4950,8 +5357,8 @@ export class ChartProgram {
4950
5357
  editRadialAxis(options: EditRadialAxisOptions): ChartProgram;
4951
5358
  removeXAxis(options?: RemoveAxisOptions): ChartProgram;
4952
5359
  removeYAxis(options?: RemoveAxisOptions): ChartProgram;
4953
- removeThetaAxis(options?: RemoveAxisOptions): ChartProgram;
4954
- removeRadialAxis(options?: RemoveAxisOptions): ChartProgram;
5360
+ removeThetaAxis(options?: Omit<RemoveAxisOptions, "target">): ChartProgram;
5361
+ removeRadialAxis(options?: Omit<RemoveAxisOptions, "target">): ChartProgram;
4955
5362
  createGrid(options?: CreateGridOptions): ChartProgram;
4956
5363
  createHorizontalGrid(options?: GridDirectionOptions): ChartProgram;
4957
5364
  createVerticalGrid(options?: GridDirectionOptions): ChartProgram;
@@ -4963,7 +5370,7 @@ export class ChartProgram {
4963
5370
  editRadialGrid(options: EditPolarGridOptions): ChartProgram;
4964
5371
  editGrid(options: EditGridDirectionsOptions): ChartProgram;
4965
5372
  removeGrid(options?: RemoveGridOptions): ChartProgram;
4966
- /** Combined categorical and size legends support all four edges with layout "edge". */
5373
+ /** Combined categorical and size legends support all four edges and plot corners with layout "edge". */
4967
5374
  createLegend(options?: LegendOptions): ChartProgram;
4968
5375
  editLegend(options: EditLegendOptions): ChartProgram;
4969
5376
  editLegendBlock(options: EditLegendBlockOptions): ChartProgram;