ggaction 0.0.17 → 0.0.18

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 (263) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +2 -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 +16 -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 +4 -4
  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/edit.js +1 -1
  35. package/src/actions/data/regression.js +2 -1
  36. package/src/actions/data/shared.js +3 -2
  37. package/src/actions/data/stack.js +3 -1
  38. package/src/actions/encodings/appearance.js +37 -29
  39. package/src/actions/encodings/barWidth.js +36 -11
  40. package/src/actions/encodings/channels.js +0 -1
  41. package/src/actions/encodings/color/continuous.js +1 -1
  42. package/src/actions/encodings/color/index.js +1 -1
  43. package/src/actions/encodings/color/policy.js +10 -3
  44. package/src/actions/encodings/density/resolve.js +1 -6
  45. package/src/actions/encodings/position/policies/arc.js +12 -10
  46. package/src/actions/encodings/position/policies/area.js +3 -3
  47. package/src/actions/encodings/position/policies/bar.js +15 -6
  48. package/src/actions/encodings/position/policies/line.js +17 -6
  49. package/src/actions/encodings/position/resolve.js +3 -2
  50. package/src/actions/encodings/ranged.js +17 -0
  51. package/src/actions/encodings/remove.js +3 -2
  52. package/src/actions/encodings/seriesLayout.js +1 -0
  53. package/src/actions/encodings/text.js +6 -3
  54. package/src/actions/errorBands/create.js +2 -2
  55. package/src/actions/errorBands/edit.js +2 -1
  56. package/src/actions/facets/actions.js +158 -240
  57. package/src/actions/gradientPlots/resolve.js +2 -17
  58. package/src/actions/guides/applicability.js +1 -1
  59. package/src/actions/guides/axes/axis.js +16 -4
  60. package/src/actions/guides/axes/edit.js +4 -4
  61. package/src/actions/guides/axes/labels.js +120 -46
  62. package/src/actions/guides/axes/lines.js +6 -5
  63. package/src/actions/guides/axes/parallel/lifecycle.js +1 -1
  64. package/src/actions/guides/axes/parallel/policy.js +8 -7
  65. package/src/actions/guides/axes/remove.js +3 -2
  66. package/src/actions/guides/axes/tickGroups.js +5 -2
  67. package/src/actions/guides/axes/ticks.js +6 -3
  68. package/src/actions/guides/axes/titles.js +71 -26
  69. package/src/actions/guides/basic.js +2 -0
  70. package/src/actions/guides/facadeLegend.js +10 -2
  71. package/src/actions/guides/grids/grid.js +7 -1
  72. package/src/actions/guides/grids/resolve.js +59 -12
  73. package/src/actions/guides/legends/blocks.js +3 -1
  74. package/src/actions/guides/legends/categorical/actions.js +70 -17
  75. package/src/actions/guides/legends/categorical/components.js +12 -8
  76. package/src/actions/guides/legends/categorical/index.js +6 -0
  77. package/src/actions/guides/legends/categorical/layout.js +37 -8
  78. package/src/actions/guides/legends/categorical/options.js +31 -20
  79. package/src/actions/guides/legends/categorical/resolve.js +2 -2
  80. package/src/actions/guides/legends/categorical/symbols.js +18 -12
  81. package/src/actions/guides/legends/categorical/validation.js +1 -6
  82. package/src/actions/guides/legends/continuous/colorSymbols.js +1 -0
  83. package/src/actions/guides/legends/continuous/common.js +1 -447
  84. package/src/actions/guides/legends/continuous/gradient.js +47 -34
  85. package/src/actions/guides/legends/continuous/interval.js +4 -4
  86. package/src/actions/guides/legends/continuous/opacity.js +19 -12
  87. package/src/actions/guides/legends/edit.js +1 -604
  88. package/src/actions/guides/legends/focused.js +2 -2
  89. package/src/actions/guides/legends/group.js +1 -0
  90. package/src/actions/guides/legends/lane.js +1 -516
  91. package/src/actions/guides/legends/remove.js +3 -0
  92. package/src/actions/guides/legends/sampling.js +1 -1
  93. package/src/actions/guides/legends/size.js +51 -43
  94. package/src/actions/guides/legends/strokeWidth.js +11 -29
  95. package/src/actions/guides/legends/target.js +3 -3
  96. package/src/actions/guides/legends/transition.js +21 -7
  97. package/src/actions/guides/polar/axes/labels.js +4 -2
  98. package/src/actions/guides/polar/axes/titles.js +7 -5
  99. package/src/actions/guides/polar/resolve.js +6 -14
  100. package/src/actions/index.js +16 -16
  101. package/src/actions/marks/arc/actions.js +3 -10
  102. package/src/actions/marks/area/actions.js +8 -5
  103. package/src/actions/marks/area/materialize.js +8 -9
  104. package/src/actions/marks/bar/create.js +10 -4
  105. package/src/actions/marks/bar/edit.js +8 -4
  106. package/src/actions/marks/bar/materialize.js +9 -6
  107. package/src/actions/marks/line/actions.js +11 -4
  108. package/src/actions/marks/line/materialize.js +9 -5
  109. package/src/actions/marks/point/edit.js +1 -1
  110. package/src/actions/marks/rect/actions.js +3 -3
  111. package/src/actions/marks/remove.js +2 -0
  112. package/src/actions/marks/rule/actions.js +7 -4
  113. package/src/actions/marks/text/actions.js +17 -5
  114. package/src/actions/marks/text/layout.js +3 -0
  115. package/src/actions/primitives/semanticValidation/layer.js +4 -0
  116. package/src/actions/regression/create.js +1 -1
  117. package/src/actions/regression/edit.js +3 -3
  118. package/src/actions/regression/resolve.js +2 -6
  119. package/src/actions/scales/channels.js +9 -4
  120. package/src/actions/scales/consumers/families.js +16 -5
  121. package/src/actions/scales/create.js +8 -3
  122. package/src/actions/scales/definitions.js +1 -425
  123. package/src/actions/scales/edit.js +2 -2
  124. package/src/actions/scales/editPolicy.js +9 -3
  125. package/src/actions/scales/materialize.js +1 -1
  126. package/src/actions/scales/preview.js +21 -1
  127. package/src/actions/scales/quantitativeColor.js +3 -3
  128. package/src/actions/selection/actions.js +1 -13
  129. package/src/actions/theme/reconcile.js +81 -27
  130. package/src/actions/theme/state.js +12 -0
  131. package/src/actions/titles/actions.js +5 -18
  132. package/src/actions/titles/resolve.js +41 -19
  133. package/src/actions/violinPlots/edit.js +3 -20
  134. package/src/core/compositionState.js +4 -1
  135. package/src/core/font.js +9 -2
  136. package/src/core/optionRequirements.js +1 -0
  137. package/src/core/resourceReferences.js +3 -0
  138. package/src/core/textMetricProfile.js +3 -2
  139. package/src/core/textMetrics.js +41 -4
  140. package/src/core/validation.js +26 -0
  141. package/src/core/vocabulary.js +4 -0
  142. package/src/grammar/aggregate.js +4 -18
  143. package/src/grammar/arcs.js +1 -386
  144. package/src/grammar/areaPaint.js +10 -0
  145. package/src/grammar/areaSeries.js +18 -10
  146. package/src/grammar/bars/geometry.js +30 -3
  147. package/src/grammar/bars/policy.js +12 -1
  148. package/src/grammar/bin.js +2 -12
  149. package/src/grammar/bin2d.js +1 -6
  150. package/src/grammar/boxPlot.js +56 -9
  151. package/src/grammar/categoryOrder.js +1 -6
  152. package/src/grammar/complete.js +15 -19
  153. package/src/grammar/computed.js +92 -25
  154. package/src/grammar/curveCommands.js +29 -16
  155. package/src/grammar/datasetSchema.js +3 -7
  156. package/src/grammar/displayLabels.js +28 -0
  157. package/src/grammar/ecdf.js +2 -9
  158. package/src/grammar/facets/dependencies.js +6 -2
  159. package/src/grammar/facets/guides.js +5 -0
  160. package/src/grammar/facets/index.js +2 -5
  161. package/src/grammar/fold.js +2 -12
  162. package/src/grammar/gradientProfile.js +1 -6
  163. package/src/grammar/impute.js +21 -48
  164. package/src/grammar/interval.js +2 -9
  165. package/src/grammar/legendGradient.js +18 -0
  166. package/src/grammar/legendGroups.js +1 -0
  167. package/src/grammar/legendTitleStyle.js +22 -0
  168. package/src/grammar/lineSeries.js +32 -17
  169. package/src/grammar/markLabels.js +5 -2
  170. package/src/grammar/normalize.js +4 -54
  171. package/src/grammar/numeric.js +1 -290
  172. package/src/grammar/parallelCoordinates.js +1 -6
  173. package/src/grammar/parseTime.js +41 -0
  174. package/src/grammar/pathCommands.js +11 -4
  175. package/src/grammar/polar.js +1 -184
  176. package/src/grammar/positionCompatibility.js +3 -3
  177. package/src/grammar/regression/derive.js +7 -1
  178. package/src/grammar/regression/models.js +83 -55
  179. package/src/grammar/regression/parameters.js +14 -3
  180. package/src/grammar/roundedRect.js +42 -54
  181. package/src/grammar/scales/appearance.js +1 -206
  182. package/src/grammar/scales/color.js +1 -382
  183. package/src/grammar/scales/colorConsumers.js +5 -2
  184. package/src/grammar/scales/definition.js +1 -197
  185. package/src/grammar/scales/discretized.js +1 -195
  186. package/src/grammar/scales/size.js +1 -456
  187. package/src/grammar/scales/temporal.js +2 -13
  188. package/src/grammar/scales/transformed.js +1 -383
  189. package/src/grammar/scales/types.js +1 -1
  190. package/src/grammar/scales/validation.js +1 -66
  191. package/src/grammar/schemas/concreteGraphic.js +11 -0
  192. package/src/grammar/schemas/graphic.js +3 -0
  193. package/src/grammar/schemas/semanticPath.js +2 -1
  194. package/src/grammar/stack.js +2 -10
  195. package/src/grammar/statisticalReference.js +1 -6
  196. package/src/grammar/summary.js +3 -26
  197. package/src/grammar/text.js +19 -0
  198. package/src/grammar/timeUnit.js +16 -7
  199. package/src/grammar/transformKeys.js +47 -0
  200. package/src/grammar/transforms.js +4 -1
  201. package/src/grammar/valueFormat.js +17 -5
  202. package/src/grammar/weightedStatistics.js +1 -6
  203. package/src/grammar/window.js +4 -58
  204. package/src/inspectionDescriptors.js +1 -1
  205. package/src/layout/canvas.js +1 -110
  206. package/src/layout/facets.js +1 -244
  207. package/src/layout/labels.js +1 -0
  208. package/src/layout/legend.js +13 -0
  209. package/src/layout/legendGroup.js +1 -0
  210. package/src/layout/legendItems.js +59 -15
  211. package/src/layout/legendLane.js +1 -441
  212. package/src/layout/legendText.js +1 -0
  213. package/src/layout/title.js +35 -13
  214. package/src/materialization/bars/aggregate.js +11 -5
  215. package/src/materialization/bars/histogram.js +4 -1
  216. package/src/materialization/bars/ranged.js +19 -6
  217. package/src/materialization/bars/resolve.js +22 -1
  218. package/src/materialization/coordinateBounds.js +8 -0
  219. package/src/materialization/dependencies.js +4 -44
  220. package/src/materialization/facetGuides/layout.js +1 -0
  221. package/src/materialization/facetGuides/placement.js +19 -8
  222. package/src/materialization/facetGuides/preparation.js +15 -7
  223. package/src/materialization/facetHeaders.js +1 -347
  224. package/src/materialization/facets.js +1 -185
  225. package/src/materialization/graphicHierarchy.js +1 -1
  226. package/src/materialization/guides/layout.js +1 -57
  227. package/src/materialization/guides/resources.js +1 -123
  228. package/src/materialization/layout.js +53 -0
  229. package/src/materialization/legendGroups.js +1 -0
  230. package/src/materialization/legendText.js +1 -0
  231. package/src/materialization/legends.js +1 -1
  232. package/src/materialization/marks/capabilities.js +5 -6
  233. package/src/materialization/rect.js +1 -1
  234. package/src/materialization/scaleGuideDependencies.js +1 -1
  235. package/src/materialization/scales/map.js +3 -0
  236. package/src/materialization/scales/policies/arc.js +8 -7
  237. package/src/materialization/scales/policies/bar.js +19 -7
  238. package/src/materialization/scales/policies/series.js +2 -1
  239. package/src/materialization/scales/resolve.js +5 -3
  240. package/src/materialization/selection/items/arc.js +1 -1
  241. package/src/materialization/selection/items/bar.js +7 -6
  242. package/src/materialization/selection/items/path.js +7 -6
  243. package/src/materialization/selection/items/rect.js +2 -2
  244. package/src/materialization/text.js +13 -4
  245. package/src/materialization/textLines.js +15 -0
  246. package/src/persistence/codec.js +37 -6
  247. package/src/persistence/validation.js +47 -0
  248. package/src/persistence.js +18 -5
  249. package/src/renderers/canvas/circle.js +6 -3
  250. package/src/renderers/canvas/fill.js +7 -1
  251. package/src/renderers/canvas/index.js +2 -1
  252. package/src/renderers/canvas/line.js +1 -0
  253. package/src/renderers/canvas/path.js +1 -1
  254. package/src/renderers/canvas/rect.js +11 -8
  255. package/src/renderers/canvas/stroke.js +2 -1
  256. package/src/renderers/canvas/text.js +5 -3
  257. package/src/renderers/svg.js +4 -1
  258. package/src/selectors/layers.js +19 -0
  259. package/src/theme/defaults.js +8 -2
  260. package/src/version.js +1 -1
  261. package/types/basic.d.ts +1 -0
  262. package/types/index.d.ts +7 -0
  263. package/types/program.d.ts +347 -85
@@ -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;
@@ -208,6 +216,9 @@ export interface FacetOptions {
208
216
  padding?: number | CompositionPadding;
209
217
  scales?: FacetScaleResolutions;
210
218
  guides?: FacetGuideOptions;
219
+ headers?: FacetHeadersOptions;
220
+ /** Interpret gap between child canvases (default) or inner plot regions. */
221
+ spacing?: "canvas" | "plot";
211
222
  }
212
223
  export interface FacetGridRole {
213
224
  field: string;
@@ -224,6 +235,9 @@ export interface FacetGridOptions {
224
235
  padding?: number | CompositionPadding;
225
236
  scales?: FacetScaleResolutions;
226
237
  guides?: FacetGuideOptions;
238
+ headers?: FacetHeadersOptions;
239
+ /** Interpret gap between child canvases (default) or inner plot regions. */
240
+ spacing?: "canvas" | "plot";
227
241
  }
228
242
  export interface RepeatChartsOptions {
229
243
  id?: string;
@@ -236,6 +250,9 @@ export interface RepeatChartsOptions {
236
250
  padding?: number | CompositionPadding;
237
251
  scales?: FacetScaleResolutions;
238
252
  guides?: FacetGuideOptions;
253
+ headers?: FacetHeadersOptions;
254
+ /** Interpret gap between child canvases (default) or inner plot regions. */
255
+ spacing?: "canvas" | "plot";
239
256
  }
240
257
  export interface EditFacetSourceOptions { program: ChartProgram; }
241
258
  export interface EditFacetHeadersOptions {
@@ -249,6 +266,10 @@ export interface EditFacetHeadersOptions {
249
266
  side?: FacetHeaderSide;
250
267
  align?: FacetHeaderAlign;
251
268
  }
269
+ export type FacetHeadersOptions = Omit<EditFacetHeadersOptions, "role" | "side"> & {
270
+ row?: Omit<EditFacetHeadersOptions, "role">;
271
+ column?: Omit<EditFacetHeadersOptions, "role">;
272
+ };
252
273
  export type FacetHeaderRole = "all" | "row" | "column";
253
274
  export type FacetHeaderSide = "top" | "bottom" | "left" | "right";
254
275
  export type FacetHeaderAlign = "start" | "center" | "end";
@@ -265,6 +286,7 @@ export interface FacetCompositionSpec {
265
286
  readonly type: "facet";
266
287
  readonly children: readonly string[];
267
288
  readonly columns: number;
289
+ readonly spacing?: "canvas" | "plot";
268
290
  readonly gap: number;
269
291
  readonly align: CompositionAlign;
270
292
  readonly padding: Readonly<Required<CompositionPadding>>;
@@ -389,6 +411,7 @@ export type DatasetRegressionTransform = {
389
411
  method: "linear";
390
412
  degree?: never;
391
413
  span?: never;
414
+ robustIterations?: never;
392
415
  } & ({ interval: false; confidenceMethod?: never; level?: never; confidence?: never } | ({ interval: "mean" | "prediction" } & (
393
416
  | { confidenceMethod: ConfidenceIntervalMethod; level: number; confidence?: never }
394
417
  | { confidence: number; confidenceMethod?: never; level?: never }
@@ -397,6 +420,7 @@ export type DatasetRegressionTransform = {
397
420
  method: "polynomial";
398
421
  degree: number;
399
422
  span?: never;
423
+ robustIterations?: never;
400
424
  } & ({ interval: false; confidenceMethod?: never; level?: never; confidence?: never } | ({ interval: "mean" | "prediction" } & (
401
425
  | { confidenceMethod: ConfidenceIntervalMethod; level: number; confidence?: never }
402
426
  | { confidence: number; confidenceMethod?: never; level?: never }
@@ -404,6 +428,7 @@ export type DatasetRegressionTransform = {
404
428
  | {
405
429
  method: "loess";
406
430
  span: number;
431
+ robustIterations?: number;
407
432
  degree?: never;
408
433
  confidenceMethod?: never;
409
434
  level?: never;
@@ -761,11 +786,28 @@ export interface DatasetFoldTransform {
761
786
  readonly value: string;
762
787
  };
763
788
  }
789
+ export type ParseTimeFormat = "auto" | "%Y-%m-%d" | "%d/%m/%Y" | "%m/%d/%Y";
764
790
  export type ComputedExpression =
765
791
  | { readonly field: string }
766
792
  | { readonly constant: number | string | boolean | null }
767
793
  | {
768
- readonly op: "negate" | "absolute" | "log" | "sqrt" | "not" | "isNull";
794
+ readonly op: "getPath";
795
+ readonly operand: { readonly field: string };
796
+ readonly path: readonly [string, ...string[]];
797
+ }
798
+ | {
799
+ readonly op: "replaceLiteral";
800
+ readonly operand: ComputedExpression;
801
+ readonly search: string;
802
+ readonly replacement: string;
803
+ }
804
+ | {
805
+ readonly op: "parseTime";
806
+ readonly operand: ComputedExpression;
807
+ readonly format?: ParseTimeFormat;
808
+ }
809
+ | {
810
+ readonly op: "negate" | "absolute" | "log" | "sqrt" | "not" | "isNull" | "toNumber";
769
811
  readonly operand: ComputedExpression;
770
812
  }
771
813
  | {
@@ -852,6 +894,7 @@ type DatasetImputedBaseTransform = {
852
894
  readonly maxGap?: number;
853
895
  };
854
896
  export type DatasetImputedTransform = DatasetImputedBaseTransform & (
897
+ | { readonly method: "mean"; readonly value?: never; readonly sortBy: readonly DatasetWindowSort[]; }
855
898
  | {
856
899
  readonly method: "constant";
857
900
  readonly value: DatasetScalar;
@@ -1082,6 +1125,10 @@ export type StrokeStyleDetails = {
1082
1125
  };
1083
1126
  export type RectStyleDetails = StrokeStyleDetails & {
1084
1127
  cornerRadius?: number;
1128
+ cornerRadiusTopLeft?: number;
1129
+ cornerRadiusTopRight?: number;
1130
+ cornerRadiusBottomRight?: number;
1131
+ cornerRadiusBottomLeft?: number;
1085
1132
  };
1086
1133
  export type PaletteName =
1087
1134
  | "accent"
@@ -1156,6 +1203,7 @@ export interface DatasetFieldLineage {
1156
1203
  readonly role: string;
1157
1204
  }
1158
1205
  export interface DatasetSchemaField {
1206
+ /** Lossless stored row key; empty names cannot be used as action field references. */
1159
1207
  readonly name: string;
1160
1208
  readonly storageType: DatasetStorageType;
1161
1209
  readonly nullable: boolean;
@@ -1169,6 +1217,7 @@ export interface DatasetSchema {
1169
1217
  readonly fields: readonly DatasetSchemaField[];
1170
1218
  }
1171
1219
  export interface SourceSchemaField {
1220
+ /** Exact source row key, including an empty string or whitespace. */
1172
1221
  name: string;
1173
1222
  storageType: Exclude<DatasetStorageType, "unknown" | "mixed">;
1174
1223
  nullable?: boolean;
@@ -1240,6 +1289,15 @@ export interface CanvasOptions {
1240
1289
  height?: number;
1241
1290
  background?: string;
1242
1291
  margin?: number | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
1292
+ /** Exact inner dimensions with automatic outer guide margins; false disables this mode. */
1293
+ plot?: { width: number; height: number } | false;
1294
+ /** Optional inner plot outline. Defaults off; an object replaces the complete style on edit. */
1295
+ plotBorder?: false | {
1296
+ /** Non-empty color string. Defaults to #ddd. */
1297
+ color?: string;
1298
+ /** Positive finite width smaller than both plot dimensions. Defaults to 1. */
1299
+ lineWidth?: number;
1300
+ };
1243
1301
  }
1244
1302
 
1245
1303
  export interface FitCanvasOptions {
@@ -1261,7 +1319,7 @@ export type RotationUnit = "radians" | "degrees";
1261
1319
  export type RotationInput = number | { value: number; unit: RotationUnit };
1262
1320
  type ValueFormatDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
1263
1321
  type ValueFormatPrecision = ValueFormatDigit | 10 | 11 | 12 | `0${ValueFormatDigit}`;
1264
- type TimeAxisDirective = "Y" | "m" | "d" | "b";
1322
+ type TimeAxisDirective = "Y" | "m" | "d" | "b" | "H" | "M" | "S" | "L";
1265
1323
  export type NumericFormatString = `.${ValueFormatPrecision}${"f" | "%" | "e"}`;
1266
1324
  export type UtcFormatString = `${string}%${TimeAxisDirective}${string}`;
1267
1325
  export type ValueFormat = "auto" | NumericFormatString | UtcFormatString;
@@ -1277,6 +1335,10 @@ export interface AxisLineStyleOptions {
1277
1335
  export interface AxisTickStyleOptions extends AxisLineStyleOptions {
1278
1336
  length?: number;
1279
1337
  }
1338
+ export interface CartesianAxisTickStyleOptions extends AxisTickStyleOptions {
1339
+ /** Signed logical pixels along the axis: positive right for x, down for y. */
1340
+ alongOffset?: number;
1341
+ }
1280
1342
  export interface AxisLabelStyleOptions {
1281
1343
  offset?: number;
1282
1344
  format?: AxisFormat;
@@ -1285,6 +1347,18 @@ export interface AxisLabelStyleOptions {
1285
1347
  fontFamily?: string;
1286
1348
  fontWeight?: string | number;
1287
1349
  }
1350
+ export type CartesianAxisLabelColorMap = ReadonlyArray<Readonly<{
1351
+ value: DatasetScalar;
1352
+ color: string;
1353
+ }>>;
1354
+ export interface CartesianAxisLabelStyleOptions extends AxisLabelStyleOptions {
1355
+ /** Typed raw-tick color overrides; missing entries use color. Auto removes the map. */
1356
+ colorMap?: CartesianAxisLabelColorMap | "auto";
1357
+ /** Keep unrotated label bounds inside the mapped axis span; defaults to false. */
1358
+ flush?: boolean;
1359
+ /** Signed displacement from the mapped tick position, independent of outward offset. */
1360
+ alongOffset?: number;
1361
+ }
1288
1362
  export interface AxisLabelLayoutOptions {
1289
1363
  /** Legacy numbers are radians; structured values make radians or degrees explicit. */
1290
1364
  rotation?: RotationInput;
@@ -1300,10 +1374,11 @@ export interface AxisTicksAndLabelsOptions<P extends string> {
1300
1374
  position?: P;
1301
1375
  count?: number;
1302
1376
  values?: readonly AxisValue[];
1303
- ticks?: AxisTickStyleOptions;
1304
- labels?: AxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
1377
+ ticks?: CartesianAxisTickStyleOptions;
1378
+ labels?: CartesianAxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
1305
1379
  }
1306
1380
  export interface AxisTitleOptions<P extends string> {
1381
+ /** Hard breaks retain ordered centered lines, spaced at 1.2 times fontSize. */
1307
1382
  text?: string;
1308
1383
  scale?: string;
1309
1384
  position?: P;
@@ -1334,14 +1409,15 @@ export interface CreateAxesOptions {
1334
1409
  radius?: false | CompleteRadialAxisOptions;
1335
1410
  }
1336
1411
  export interface AxisTickOptions<P extends string>
1337
- extends AxisTickStyleOptions {
1412
+ extends CartesianAxisTickStyleOptions {
1338
1413
  scale?: string;
1339
1414
  position?: P;
1340
1415
  count?: number;
1341
1416
  values?: readonly AxisValue[];
1342
1417
  }
1418
+ /** Cartesian label maps use typed category values or finite numeric/timestamp keys on continuous scales. Empty mapped labels are omitted without removing ticks. */
1343
1419
  export interface AxisLabelOptions<P extends string>
1344
- extends AxisLabelStyleOptions, AxisLabelLayoutOptions, DisplayLabelOptions {
1420
+ extends CartesianAxisLabelStyleOptions, AxisLabelLayoutOptions, DisplayLabelOptions {
1345
1421
  scale?: string;
1346
1422
  position?: P;
1347
1423
  count?: number;
@@ -1464,17 +1540,29 @@ export interface EditRadialAxisOptions
1464
1540
  }
1465
1541
 
1466
1542
  export interface GridDirectionOptions {
1543
+ /** Signed logical pixels along the scale: vertical lines right, horizontal lines down. */
1544
+ alongOffset?: number;
1545
+ /** Grid draw order relative to marks at zero: positive above, nonpositive behind. */
1546
+ zIndex?: number;
1547
+ /** Band centers by default; boundary draws both edges of each selected band. */
1548
+ bandPosition?: "center" | "boundary";
1467
1549
  scale?: string;
1468
1550
  coordinate?: string;
1469
1551
  count?: number;
1470
- values?: readonly number[];
1552
+ values?: readonly CategoryValue[];
1471
1553
  color?: string;
1472
1554
  lineWidth?: number;
1473
1555
  strokeDash?: readonly number[];
1474
1556
  }
1475
1557
  export interface EditGridOptions {
1558
+ /** Absolute signed logical-pixel displacement; omission preserves the current value. */
1559
+ alongOffset?: number;
1560
+ /** Preserve omitted order; finite values sort Cartesian grids relative to marks at zero. */
1561
+ zIndex?: number;
1562
+ /** Band centers by default; boundary draws both edges of each selected band. */
1563
+ bandPosition?: "center" | "boundary";
1476
1564
  count?: number;
1477
- values?: readonly number[] | "auto";
1565
+ values?: readonly CategoryValue[] | "auto";
1478
1566
  color?: string;
1479
1567
  lineWidth?: number;
1480
1568
  strokeDash?: readonly number[];
@@ -1521,7 +1609,7 @@ type CartesianAxesOptions = Omit<
1521
1609
  coordinate?: { id?: string; type?: "auto" | "cartesian" };
1522
1610
  };
1523
1611
  type CAxisTicks<P extends string> = Omit<AxisTicksAndLabelsOptions<P>, "labels"> & {
1524
- labels?: AxisLabelStyleOptions & AxisLabelLayoutOptions;
1612
+ labels?: CartesianAxisLabelStyleOptions & AxisLabelLayoutOptions & DisplayLabelOptions;
1525
1613
  };
1526
1614
  type CAxis<P extends string> = Omit<CompleteAxisOptions<P>, "ticksAndLabels"> & {
1527
1615
  ticksAndLabels?: false | Omit<CAxisTicks<P>, "scale" | "position">;
@@ -1531,11 +1619,14 @@ type CAxes = Omit<CartesianAxesOptions, "x" | "y"> & {
1531
1619
  y?: false | CAxis<YAxisPosition>;
1532
1620
  };
1533
1621
  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
- };
1622
+ type FilledLegendSymbolRecipe = "auto"
1623
+ | { width?: number; height?: number; stroke?: string; strokeWidth?: number }
1624
+ | { layers: readonly LegendSymbolLayer[] };
1625
+ type FilledMarkLegendOptions = Omit<LegendOptions, "symbol" | "representation"> & (
1626
+ | { representation?: "gradient"; symbol?: FilledLegendSymbolRecipe }
1627
+ | { representation: "symbols"; symbol?: "auto" | { type?: "point"; radius?: number; stroke?: string; strokeWidth?: number } }
1628
+ );
1629
+ type DistributiveLegendOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
1539
1630
  type CategoricalLegendTextOptions = {
1540
1631
  offset?: number;
1541
1632
  color?: string;
@@ -1546,7 +1637,7 @@ type CategoricalLegendTextOptions = {
1546
1637
  };
1547
1638
  type PathLegendOptions = Omit<
1548
1639
  LegendOptions,
1549
- "symbol" | "gradient" | "count" | "values" | "labels"
1640
+ "symbol" | "gradient" | "count" | "values" | "labels" | "representation"
1550
1641
  > & {
1551
1642
  symbol?: "auto" | { length?: number; lineWidth?: number }
1552
1643
  | { layers: readonly LegendSymbolLayer[] };
@@ -1555,7 +1646,7 @@ type PathLegendOptions = Omit<
1555
1646
  type CartesianGuideOptions = {
1556
1647
  axes?: false | CartesianAxesOptions;
1557
1648
  grid?: false | CartesianGridOptions;
1558
- legend?: false | (Omit<FilledMarkLegendOptions, "order"> & { order?: CartesianLegendOrder });
1649
+ legend?: false | (DistributiveLegendOmit<FilledMarkLegendOptions, "order"> & { order?: CartesianLegendOrder });
1559
1650
  };
1560
1651
  type CartesianPathGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1561
1652
  legend?: false | (Omit<PathLegendOptions, "order"> & { order?: LegendValueOrder });
@@ -1563,8 +1654,9 @@ type CartesianPathGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1563
1654
  type CartesianCategoricalGuideOptions = Omit<CartesianGuideOptions, "legend"> & {
1564
1655
  legend?: false | (Omit<
1565
1656
  FilledMarkLegendOptions,
1566
- "count" | "values" | "gradient" | "labels" | "order"
1657
+ "count" | "values" | "gradient" | "labels" | "order" | "representation" | "symbol"
1567
1658
  > & {
1659
+ symbol?: FilledLegendSymbolRecipe;
1568
1660
  labels?: CategoricalLegendTextOptions;
1569
1661
  order?: CartesianLegendOrder;
1570
1662
  });
@@ -1576,7 +1668,7 @@ type CCategoricalGuides = Omit<CartesianCategoricalGuideOptions, "axes"> & {
1576
1668
  axes?: false | CAxes;
1577
1669
  };
1578
1670
  type ColorGuides = Omit<CartesianGuideOptions, "legend"> & {
1579
- legend?: false | (Omit<FilledMarkLegendOptions, "values" | "order"> & {
1671
+ legend?: false | (DistributiveLegendOmit<FilledMarkLegendOptions, "order"> & {
1580
1672
  order?: CartesianLegendOrder;
1581
1673
  });
1582
1674
  };
@@ -1617,9 +1709,11 @@ export type PolarFrameCenter = {
1617
1709
  export type PolarFrameRadius =
1618
1710
  | { unit: "fraction"; value: number }
1619
1711
  | { unit: "px"; value: number };
1712
+ export type ArcInnerRadius = number | { unit: "px"; value: number };
1620
1713
  export type PolarFrameOptions = "auto" | {
1621
1714
  center?: PolarFrameCenter;
1622
1715
  radius?: PolarFrameRadius;
1716
+ overflow?: "error" | "allow";
1623
1717
  };
1624
1718
 
1625
1719
  type EditCoordinateTarget = {
@@ -1724,6 +1818,14 @@ type ContinuousSizeScaleOptions = SizeScaleCommonOptions &
1724
1818
  domain?: "auto" | readonly [number, number];
1725
1819
  range?: "auto" | readonly [number, number];
1726
1820
  };
1821
+ export type CategoricalSizeScaleOptions = SizeScaleCommonOptions & {
1822
+ type?: "ordinal";
1823
+ domain?: "auto" | readonly (string | number | boolean)[];
1824
+ range?: "auto" | readonly [number, ...number[]];
1825
+ clamp?: never;
1826
+ base?: never;
1827
+ exponent?: never;
1828
+ };
1727
1829
  export type SizeScaleOptions =
1728
1830
  | (ContinuousSizeScaleOptions & {
1729
1831
  type?: "linear";
@@ -1772,6 +1874,7 @@ export type SizeScaleOptions =
1772
1874
  export type ShapeScaleOptions = ScaleFields<"id"> & {
1773
1875
  type?: "ordinal";
1774
1876
  domain?: "auto" | readonly unknown[];
1877
+ /** One entry per domain value; explicit repeated shapes are allowed. Auto uses distinct shapes. */
1775
1878
  range?: "auto" | readonly PointShape[];
1776
1879
  unknown?: PointShape;
1777
1880
  };
@@ -1832,8 +1935,8 @@ export type EditStrokeScaleOptions = { target: string } & Omit<
1832
1935
  >;
1833
1936
  type ExistingSizeScaleEditPatch = {
1834
1937
  type?: never;
1835
- domain?: "auto" | readonly [number, ...number[]];
1836
- range?: "auto" | readonly [number, number, ...number[]];
1938
+ domain?: "auto" | readonly [string | number | boolean, ...(string | number | boolean)[]];
1939
+ range?: "auto" | readonly [number, ...number[]];
1837
1940
  unknown?: number;
1838
1941
  clamp?: boolean;
1839
1942
  reverse?: boolean;
@@ -1841,6 +1944,7 @@ type ExistingSizeScaleEditPatch = {
1841
1944
  exponent?: number;
1842
1945
  };
1843
1946
  type SizeScaleTypeEditPatch =
1947
+ | (WithoutScaleId<CategoricalSizeScaleOptions> & { type: "ordinal" })
1844
1948
  | (Omit<WithoutScaleId<SizeScaleOptions>, "type"> & { type?: "linear" })
1845
1949
  | (Omit<Extract<WithoutScaleId<SizeScaleOptions>, { type: "log" }>, "type"> & {
1846
1950
  type: "log";
@@ -1979,6 +2083,8 @@ export type RadialEncodingOptions = {
1979
2083
  coordinate?: string;
1980
2084
  } & (
1981
2085
  | { field: string; mapping?: false; aggregate?: never; scale?: RadiusScaleOptions }
2086
+ | { field: string; mapping?: never; aggregate: "sum"; scale?: RadiusScaleOptions }
2087
+ | { field?: never; mapping?: never; aggregate: "count"; scale?: RadiusScaleOptions }
1982
2088
  | { field: string; mapping?: RadialMapping; aggregate: "sum"; scale?: MeasuredRadiusScaleOptions }
1983
2089
  | { field?: never; mapping?: RadialMapping; aggregate: "count"; scale?: MeasuredRadiusScaleOptions }
1984
2090
  );
@@ -2223,7 +2329,8 @@ type TimeUnitDataBaseOptions = {
2223
2329
  source?: string;
2224
2330
  field: string;
2225
2331
  temporalUnit?: TemporalInputUnit;
2226
- as: string;
2332
+ /** Defaults to `${field}_${unit}`; collisions are rejected. */
2333
+ as?: string;
2227
2334
  timeZone?: string;
2228
2335
  };
2229
2336
  export type TimeUnitDataOptions = TimeUnitDataBaseOptions & (
@@ -2345,6 +2452,7 @@ type ImputedDataBaseOptions = {
2345
2452
  maxGap?: number;
2346
2453
  };
2347
2454
  export type ImputedDataOptions = ImputedDataBaseOptions & (
2455
+ | { method?: "mean"; value?: never; sortBy?: readonly WindowSort[]; }
2348
2456
  | {
2349
2457
  method: "constant";
2350
2458
  value: DatasetScalar;
@@ -2362,7 +2470,7 @@ export type ImputedDataOptions = ImputedDataBaseOptions & (
2362
2470
  }
2363
2471
  );
2364
2472
  export interface StackDataOptions {
2365
- id: string;
2473
+ id?: string;
2366
2474
  source?: string;
2367
2475
  category: string;
2368
2476
  group: string;
@@ -2553,11 +2661,24 @@ export type BoxPlotPositionChannel =
2553
2661
  | BoxPlotCategoryChannel
2554
2662
  | BoxPlotMeasureChannel;
2555
2663
 
2556
- export type BoxPlotWhisker =
2664
+ export type BoxPlotWhisker = (
2557
2665
  | { type?: "tukey"; factor?: number }
2558
- | { type: "minmax"; factor?: never };
2666
+ | { type: "minmax"; factor?: never }
2667
+ ) & Pick<ErrorBarOptions, "caps" | "capSize" | "stroke" | "strokeWidth" | "strokeDash" | "opacity" |
2668
+ "lineCap" | "lineJoin" | "miterLimit">;
2669
+
2670
+ export interface BoxPlotSummaryFields {
2671
+ min: string;
2672
+ q1: string;
2673
+ median: string;
2674
+ q3: string;
2675
+ max: string;
2676
+ }
2677
+
2678
+ type BoxPlotWidth = { band?: number; pixels?: never } | { band?: never; pixels: number };
2559
2679
 
2560
2680
  export interface BoxPlotOptions {
2681
+ summary?: BoxPlotSummaryFields;
2561
2682
  id?: string;
2562
2683
  target?: string;
2563
2684
  data?: string;
@@ -2565,7 +2686,7 @@ export interface BoxPlotOptions {
2565
2686
  y?: BoxPlotPositionChannel;
2566
2687
  coordinate?: string;
2567
2688
  whisker?: BoxPlotWhisker;
2568
- width?: { band?: number };
2689
+ width?: BoxPlotWidth;
2569
2690
  outliers?: boolean;
2570
2691
  box?: RectStyleDetails & {
2571
2692
  fill?: string;
@@ -2574,6 +2695,7 @@ export interface BoxPlotOptions {
2574
2695
  strokeWidth?: number;
2575
2696
  };
2576
2697
  median?: StrokeStyleDetails & {
2698
+ width?: { pixels: number } | "auto";
2577
2699
  stroke?: string;
2578
2700
  strokeWidth?: number;
2579
2701
  };
@@ -2586,12 +2708,13 @@ export interface BoxPlotOptions {
2586
2708
  }
2587
2709
 
2588
2710
  export interface EditBoxPlotOptions {
2711
+ summary?: BoxPlotSummaryFields | false;
2589
2712
  target?: string;
2590
2713
  data?: string;
2591
2714
  x?: BoxPlotPositionChannel;
2592
2715
  y?: BoxPlotPositionChannel;
2593
2716
  whisker?: BoxPlotWhisker;
2594
- width?: { band?: number };
2717
+ width?: BoxPlotWidth;
2595
2718
  outliers?: boolean;
2596
2719
  box?: RectStyleDetails & {
2597
2720
  fill?: string;
@@ -2600,6 +2723,7 @@ export interface EditBoxPlotOptions {
2600
2723
  strokeWidth?: number;
2601
2724
  };
2602
2725
  median?: StrokeStyleDetails & {
2726
+ width?: { pixels: number } | "auto";
2603
2727
  stroke?: string;
2604
2728
  strokeWidth?: number;
2605
2729
  };
@@ -2688,7 +2812,7 @@ export type ViolinPlotColorOptions =
2688
2812
  };
2689
2813
 
2690
2814
  export interface ViolinPlotAreaOptions extends StrokeStyleDetails {
2691
- fill?: string;
2815
+ fill?: FillPaint;
2692
2816
  opacity?: number;
2693
2817
  stroke?: string;
2694
2818
  strokeWidth?: number;
@@ -2763,6 +2887,11 @@ type LineXPositionChannel =
2763
2887
  temporalUnit?: TemporalInputUnit;
2764
2888
  scale?: NonPointTemporalPositionScaleOptions;
2765
2889
  }
2890
+ | {
2891
+ fieldType: "nominal" | "ordinal";
2892
+ bin?: never;
2893
+ scale?: NonPointCategoricalPositionScaleOptions;
2894
+ }
2766
2895
  ));
2767
2896
  type LineYPositionChannel =
2768
2897
  | string
@@ -2788,13 +2917,14 @@ type BarYPositionChannel =
2788
2917
  | string
2789
2918
  | {
2790
2919
  field: string;
2920
+ bin?: never;
2791
2921
  fieldType: "temporal";
2792
2922
  temporalUnit?: TemporalInputUnit;
2793
2923
  aggregate?: never;
2794
2924
  stack?: never;
2795
2925
  scale?: NonPointTemporalPositionScaleOptions;
2796
2926
  }
2797
- | ({ field: string; stack?: StackMode } & (
2927
+ | ({ field: string; bin?: never; stack?: StackMode } & (
2798
2928
  | {
2799
2929
  fieldType?: "quantitative";
2800
2930
  aggregate?: never;
@@ -2829,7 +2959,7 @@ type BasicColorChannel =
2829
2959
  field: string;
2830
2960
  fieldType: "temporal";
2831
2961
  temporalUnit?: TemporalInputUnit;
2832
- scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
2962
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint" | "type" | "base" | "constant"> & { midpoint?: "auto"; type?: "sequential" };
2833
2963
  palette?: Palette;
2834
2964
  };
2835
2965
  type NonPointCategoricalColorChannel =
@@ -2894,14 +3024,10 @@ type RectColorChannel =
2894
3024
  field: string;
2895
3025
  fieldType: "temporal";
2896
3026
  temporalUnit?: TemporalInputUnit;
2897
- scale?: Omit<NonPointContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
3027
+ scale?: Omit<NonPointContinuousColorScaleOptions, "midpoint" | "type" | "base" | "constant"> & { midpoint?: "auto"; type?: "sequential" };
2898
3028
  palette?: Palette;
2899
3029
  };
2900
- export type BasicSizeChannel = string | {
2901
- field: string;
2902
- fieldType?: "quantitative";
2903
- scale?: SizeScaleOptions;
2904
- };
3030
+ export type BasicSizeChannel = string | WithoutEncodingTarget<SizeEncodingOptions>;
2905
3031
  export type BasicShapeChannel = string | {
2906
3032
  field: string;
2907
3033
  fieldType?: "nominal";
@@ -2965,6 +3091,7 @@ export interface CreateScatterPlotOptions {
2965
3091
  x: PointFacadePositionChannel;
2966
3092
  y: PointFacadePositionChannel;
2967
3093
  color?: BasicColorChannel;
3094
+ stroke?: string | WithoutEncodingTarget<Extract<StrokeEncodingOptions, { field: string }>>;
2968
3095
  size?: BasicSizeChannel;
2969
3096
  shape?: BasicShapeChannel;
2970
3097
  point?: StrokeStyleDetails & {
@@ -3133,7 +3260,7 @@ type PolarLegendOrder = LegendValueOrder | { channel: "theta"; values?: never };
3133
3260
  type PolarPathLegendOptions = Omit<PathLegendOptions, "order"> & {
3134
3261
  order?: PolarLegendOrder;
3135
3262
  };
3136
- type PolarPointLegendOptions = Omit<FilledMarkLegendOptions, "order"> & {
3263
+ type PolarPointLegendOptions = DistributiveLegendOmit<FilledMarkLegendOptions, "order"> & {
3137
3264
  order?: PolarLegendOrder;
3138
3265
  };
3139
3266
  export type PolarPathGuideOptions = Omit<PolarChartGuideOptions, "legend"> & {
@@ -3163,7 +3290,7 @@ export interface CreatePolarLinePlotOptions {
3163
3290
  color?: LineCategoricalColorChannel;
3164
3291
  groupBy?: string | readonly [string, ...string[]];
3165
3292
  strokeDash?: BasicStrokeDashChannel;
3166
- line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve"> & {
3293
+ line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve" | "tension"> & {
3167
3294
  curve?: "linear";
3168
3295
  closed?: boolean;
3169
3296
  };
@@ -3229,7 +3356,7 @@ export type CreateRadarPlotOptions = {
3229
3356
  ];
3230
3357
  color?: LineCategoricalColorChannel;
3231
3358
  strokeDash?: BasicStrokeDashChannel;
3232
- line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve"> & {
3359
+ line?: Omit<NonNullable<CreateLinePlotOptions["line"]>, "closed" | "curve" | "tension"> & {
3233
3360
  curve?: "linear";
3234
3361
  closed?: true;
3235
3362
  };
@@ -3258,8 +3385,17 @@ export interface RugTickOptions extends StrokeStyleDetails {
3258
3385
  strokeWidth?: number;
3259
3386
  opacity?: number;
3260
3387
  }
3261
- export type RugGuideOptions = Omit<CartesianGuideOptions, "axes" | "legend"> & {
3388
+ type ContinuousGridDirectionOptions = Omit<GridDirectionOptions, "bandPosition"> & {
3389
+ /** Continuous position scales do not have categorical band edges. */
3390
+ bandPosition?: never;
3391
+ };
3392
+ type ContinuousCartesianGridOptions = {
3393
+ vertical?: boolean | ContinuousGridDirectionOptions;
3394
+ horizontal?: boolean | ContinuousGridDirectionOptions;
3395
+ };
3396
+ export type RugGuideOptions = Omit<CartesianGuideOptions, "axes" | "legend" | "grid"> & {
3262
3397
  axes?: false | CAxes;
3398
+ grid?: false | ContinuousCartesianGridOptions;
3263
3399
  legend?: false;
3264
3400
  };
3265
3401
  export type CreateRugPlotOptions = {
@@ -3423,6 +3559,7 @@ export type GroupEncodingOptions = { target?: string; fieldType?: "nominal" } &
3423
3559
  export interface SeriesLayoutOptions { target?: string; mode: ColorLayout; }
3424
3560
  export interface BasicSeriesLayoutOptions { target?: string; mode: Exclude<ColorLayout, "center">; }
3425
3561
  export type AreaPlotIndependentChannel = string | ({ field: string } & (
3562
+ | { fieldType: "nominal" | "ordinal"; scale?: NonPointCategoricalPositionScaleOptions }
3426
3563
  | { fieldType?: "quantitative"; scale?: NonPointQuantitativePositionScaleOptions }
3427
3564
  | { fieldType: "temporal"; temporalUnit?: TemporalInputUnit; scale?: NonPointTemporalPositionScaleOptions }
3428
3565
  ));
@@ -3436,8 +3573,8 @@ export type CreateAreaPlotOptions = {
3436
3573
  groupBy?: string | readonly [string, ...string[]];
3437
3574
  layout?: Exclude<ColorLayout, "group">; missing?: "error" | "break";
3438
3575
  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;
3576
+ area?: StrokeStyleDetails & { fill?: FillPaint; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3577
+ guides?: false | (Omit<DensityPlotGuideOptions, "grid"> & { grid?: false | CartesianGridOptions });
3441
3578
  } & (
3442
3579
  | { valueChannel?: "y"; x: AreaPlotIndependentChannel; y: Exclude<AreaPlotMeasureChannel, { lower: unknown }>; baseline?: number }
3443
3580
  | { valueChannel?: "y"; x: AreaPlotIndependentChannel; y: Extract<AreaPlotMeasureChannel, { lower: unknown }>; baseline?: never }
@@ -3457,11 +3594,22 @@ export interface CreateLinePlotOptions {
3457
3594
  line?: StrokeStyleDetails & {
3458
3595
  strokeWidth?: number;
3459
3596
  curve?: CurveInterpolation;
3597
+ tension?: number;
3460
3598
  stroke?: string;
3461
3599
  opacity?: number;
3462
3600
  closed?: false;
3463
3601
  };
3464
- guides?: false | CPathGuides;
3602
+ guides?: false | (Omit<CPathGuides, "legend" | "grid"> & {
3603
+ grid?: false | (Omit<CartesianGridOptions, "horizontal"> & {
3604
+ horizontal?: boolean | (Omit<GridDirectionOptions, "bandPosition"> & {
3605
+ /** Line y is continuous; band positioning is available only for categorical x grids. */
3606
+ bandPosition?: never;
3607
+ });
3608
+ });
3609
+ legend?: false | (Omit<PathLegendOptions, "order"> & {
3610
+ order?: LegendValueOrder | { channel: "x"; values?: never };
3611
+ });
3612
+ });
3465
3613
  }
3466
3614
 
3467
3615
  type BasicHistogramEncoding =
@@ -3473,22 +3621,44 @@ type BasicHistogramEncoding =
3473
3621
  : never
3474
3622
  : never;
3475
3623
 
3476
- export interface CreateBarPlotOptions {
3624
+ export type BarRangePositionChannel = {
3625
+ lower: string;
3626
+ upper: string;
3627
+ fieldType?: "quantitative";
3628
+ scale?: NonPointZeroSupportingPositionScaleOptions;
3629
+ field?: never;
3630
+ aggregate?: never;
3631
+ stack?: never;
3632
+ };
3633
+ type BarFieldPosition<T> = T extends string ? T : T & { lower?: never; upper?: never };
3634
+ type BarRangeOppositePositionChannel = string | {
3635
+ field: string;
3636
+ fieldType?: "nominal" | "ordinal" | "temporal";
3637
+ temporalUnit?: TemporalInputUnit;
3638
+ scale?: NonPointBandPositionScaleOptions | NonPointTemporalPositionScaleOptions;
3639
+ bin?: never;
3640
+ aggregate?: never;
3641
+ stack?: never;
3642
+ };
3643
+ export type CreateBarPlotOptions = {
3477
3644
  id?: string;
3478
3645
  data?: string;
3479
3646
  coordinate?: string;
3480
- x: BandPositionChannel;
3481
- y: BarYPositionChannel;
3647
+ orientation?: "vertical" | "horizontal";
3482
3648
  color?: BarColorChannel;
3483
- width?: Omit<BarWidthOptions, "target">;
3649
+ width?: Omit<BarWidthOptions, "target" | "interval">;
3484
3650
  bar?: RectStyleDetails & {
3485
- fill?: string;
3651
+ fill?: FillPaint;
3486
3652
  opacity?: number;
3487
3653
  stroke?: FilledMarkStroke;
3488
3654
  strokeWidth?: number;
3489
3655
  };
3490
3656
  guides?: false | ColorGuides;
3491
- }
3657
+ } & (
3658
+ | { x: BarFieldPosition<BandPositionChannel>; y: BarFieldPosition<BarYPositionChannel> }
3659
+ | { x: BarRangePositionChannel; y: BarRangeOppositePositionChannel }
3660
+ | { x: BarRangeOppositePositionChannel; y: BarRangePositionChannel }
3661
+ );
3492
3662
 
3493
3663
  export type CreateHistogramOptions = BasicHistogramEncoding & {
3494
3664
  id?: string;
@@ -3497,7 +3667,7 @@ export type CreateHistogramOptions = BasicHistogramEncoding & {
3497
3667
  field: string;
3498
3668
  color?: HistogramCategoricalColorChannel;
3499
3669
  bar?: RectStyleDetails & {
3500
- fill?: string;
3670
+ fill?: FillPaint;
3501
3671
  opacity?: number;
3502
3672
  stroke?: FilledMarkStroke;
3503
3673
  strokeWidth?: number;
@@ -3507,7 +3677,7 @@ export type CreateHistogramOptions = BasicHistogramEncoding & {
3507
3677
 
3508
3678
  export type HorizonPlotGuideOptions = {
3509
3679
  axes?: false | (Omit<CAxes, "y"> & { y?: false });
3510
- grid?: false | (Pick<CartesianGridOptions, "vertical"> & { horizontal?: false });
3680
+ grid?: false | { vertical?: boolean | ContinuousGridDirectionOptions; horizontal?: false };
3511
3681
  legend?: false;
3512
3682
  };
3513
3683
  export interface CreateHorizonPlotOptions {
@@ -3529,7 +3699,8 @@ export interface CreateHorizonPlotOptions {
3529
3699
  }
3530
3700
 
3531
3701
  export type DensityPlotLegendOptions = Omit<PieLegendOptions, "order"> & { order?: LegendValueOrder };
3532
- export type DensityPlotGuideOptions = Omit<CCategoricalGuides, "legend"> & {
3702
+ export type DensityPlotGuideOptions = Omit<CCategoricalGuides, "legend" | "grid"> & {
3703
+ grid?: false | ContinuousCartesianGridOptions;
3533
3704
  legend?: false | DensityPlotLegendOptions;
3534
3705
  };
3535
3706
  export interface CreateDensityPlotOptions {
@@ -3555,7 +3726,7 @@ export interface CreateDensityPlotOptions {
3555
3726
  palette?: Palette;
3556
3727
  layout?: "overlay";
3557
3728
  };
3558
- area?: StrokeStyleDetails & { fill?: string; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3729
+ area?: StrokeStyleDetails & { fill?: FillPaint; opacity?: number; stroke?: string; strokeWidth?: number; curve?: CurveInterpolation };
3559
3730
  guides?: false | DensityPlotGuideOptions;
3560
3731
  }
3561
3732
 
@@ -3572,32 +3743,38 @@ export type PieColor = string | {
3572
3743
  };
3573
3744
  export type PieLegendOptions = Omit<
3574
3745
  FilledMarkLegendOptions,
3575
- "count" | "values" | "gradient" | "channels" | "order" | "labels"
3746
+ "count" | "values" | "gradient" | "channels" | "order" | "labels" | "representation" | "symbol"
3576
3747
  > & {
3748
+ symbol?: FilledLegendSymbolRecipe;
3577
3749
  channels?: readonly ["color"];
3578
3750
  order?: LegendValueOrder | { channel: "theta"; values?: never };
3579
3751
  labels?: CategoricalLegendTextOptions;
3580
3752
  };
3753
+ export type PieRadiusChannel = string | {
3754
+ scale?: RadiusScaleOptions;
3755
+ } & ({ field: string; aggregate?: "sum" } | { field?: never; aggregate: "count" });
3756
+
3581
3757
  export type CreatePiePlotOptions = {
3582
3758
  id?: string;
3583
3759
  data?: string;
3584
3760
  coordinate?: string;
3585
3761
  category: PieCategory;
3586
3762
  color?: false | PieColor;
3587
- arc?: StrokeStyleDetails & { innerRadius?: number; padAngle?: number; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3763
+ radius?: PieRadiusChannel;
3764
+ arc?: StrokeStyleDetails & { innerRadius?: ArcInnerRadius; padAngle?: number; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3588
3765
  guides?: false | { axes?: false; grid?: false; legend?: false | PieLegendOptions };
3589
- } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate: "sum" });
3766
+ } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate?: "sum" });
3590
3767
 
3591
3768
  export type MeasuredRadialGuideOptions = {
3592
3769
  axes?: false | CategoricalPolarAxesOptions;
3593
3770
  grid?: false | CategoricalPolarGridOptions;
3594
3771
  legend?: false | PieLegendOptions;
3595
3772
  };
3596
- export type CreateRosePlotOptions = Omit<CreatePiePlotOptions, "guides" | "arc" | "aggregate" | "value"> & {
3773
+ export type CreateRosePlotOptions = Omit<CreatePiePlotOptions, "guides" | "arc" | "aggregate" | "value" | "radius"> & {
3597
3774
  radiusScale?: MeasuredRadiusScaleOptions;
3598
- arc?: StrokeStyleDetails & { innerRadius?: number; padAngle?: 0; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3775
+ arc?: StrokeStyleDetails & { innerRadius?: ArcInnerRadius; padAngle?: 0; fill?: string; opacity?: number; stroke?: string; strokeWidth?: number };
3599
3776
  guides?: false | MeasuredRadialGuideOptions;
3600
- } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate: "sum" });
3777
+ } & ({ value?: never; aggregate?: "count" } | { value: string; aggregate?: "sum" });
3601
3778
  export type CreateRadialBarPlotOptions = CreateRosePlotOptions;
3602
3779
 
3603
3780
  export interface HeatmapBaseOptions {
@@ -3624,7 +3801,7 @@ export interface PreGriddedHeatmapOptions extends HeatmapBaseOptions {
3624
3801
  x: HeatmapCategoryPositionChannel;
3625
3802
  y: HeatmapCategoryPositionChannel;
3626
3803
  bin?: never;
3627
- color: RectColorChannel;
3804
+ color?: RectColorChannel;
3628
3805
  }
3629
3806
 
3630
3807
  export interface BinnedHeatmapPositionChannel {
@@ -3697,7 +3874,7 @@ export interface ErrorBandOptions extends StrokeStyleDetails {
3697
3874
  y?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3698
3875
  groupBy?: string;
3699
3876
  coordinate?: string;
3700
- fill?: string;
3877
+ fill?: FillPaint;
3701
3878
  opacity?: number;
3702
3879
  curve?: CurveInterpolation;
3703
3880
  boundaries?: false | (StrokeStyleDetails & {
@@ -3715,7 +3892,7 @@ export interface EditErrorBandOptions extends StrokeStyleDetails {
3715
3892
  x?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3716
3893
  y?: ErrorBandPositionChannel | ErrorBandIntervalChannel;
3717
3894
  groupBy?: string | false;
3718
- fill?: string | false;
3895
+ fill?: FillPaint | false;
3719
3896
  opacity?: number;
3720
3897
  curve?: CurveInterpolation;
3721
3898
  statistics?: {
@@ -3785,6 +3962,12 @@ export interface YOffsetEncodingOptions extends OffsetEncodingOptions {}
3785
3962
  export type TextFormat = ValueFormat;
3786
3963
 
3787
3964
  export interface TextMarkOptions {
3965
+ /** Logical-pixel baseline spacing; defaults to 1.2 times fontSize. */
3966
+ lineHeight?: number;
3967
+ /** Anchor the first line or center the complete multiline block. */
3968
+ blockAlign?: "first" | "middle";
3969
+ /** Follow resolved source appearance; an explicit fill takes precedence. Source-owned labels only. */
3970
+ inheritColor?: "fill" | "stroke" | false;
3788
3971
  id?: string;
3789
3972
  data?: string;
3790
3973
  /** Explicit source mark. Mutually exclusive with data; may be incomplete. */
@@ -3918,6 +4101,18 @@ type AnnotationBaseOptions = Omit<TextMarkOptions, "id" | "data" | "source" | "t
3918
4101
 
3919
4102
  type AnnotationAnchor =
3920
4103
  | {
4104
+ anchor: "plot-center";
4105
+ x?: never;
4106
+ y?: never;
4107
+ space?: never;
4108
+ source?: never;
4109
+ align?: never;
4110
+ baseline?: never;
4111
+ data?: string;
4112
+ coordinate?: string;
4113
+ }
4114
+ | {
4115
+ anchor?: never;
3921
4116
  x?: never;
3922
4117
  y?: never;
3923
4118
  space?: never;
@@ -3926,6 +4121,7 @@ type AnnotationAnchor =
3926
4121
  coordinate?: never;
3927
4122
  }
3928
4123
  | {
4124
+ anchor?: never;
3929
4125
  x: unknown;
3930
4126
  y: unknown;
3931
4127
  space?: "data";
@@ -3934,6 +4130,7 @@ type AnnotationAnchor =
3934
4130
  coordinate?: never;
3935
4131
  }
3936
4132
  | {
4133
+ anchor?: never;
3937
4134
  x: number;
3938
4135
  y: number;
3939
4136
  space: "plot";
@@ -3944,9 +4141,30 @@ type AnnotationAnchor =
3944
4141
 
3945
4142
  export type CreateAnnotationOptions = AnnotationBaseOptions & AnnotationAnchor;
3946
4143
 
4144
+ type TextPlotPositionChannel =
4145
+ | string
4146
+ | ({ field: string } & PositionScaleBranches<
4147
+ NonPointQuantitativePositionScaleOptions,
4148
+ NonPointTemporalPositionScaleOptions,
4149
+ NonPointCategoricalPositionScaleOptions>)
4150
+ | WithoutEncodingTarget<Extract<DatumPositionEncodingOptions, { datum: unknown }>> & { coordinate?: never };
4151
+
4152
+ export interface CreateTextPlotOptions {
4153
+ id?: string;
4154
+ data?: string;
4155
+ coordinate?: string;
4156
+ x: TextPlotPositionChannel;
4157
+ y: TextPlotPositionChannel;
4158
+ text: string | WithoutEncodingTarget<Extract<TextEncodingOptions, { field: string } | { value: unknown }>>;
4159
+ color?: RectColorChannel;
4160
+ style?: Omit<TextMarkOptions, "id" | "data" | "source" | "text" | "inheritColor">;
4161
+ guides?: false | ColorGuides;
4162
+ }
4163
+
3947
4164
  export type BarWidthOptions = { target?: string } & (
3948
- | { band?: number; pixels?: never }
3949
- | { band?: never; pixels: number }
4165
+ | { band?: number; pixels?: never; interval?: never }
4166
+ | { band?: never; pixels: number; interval?: never }
4167
+ | { band?: never; pixels?: never; interval: { unit: Exclude<TimeUnit, "week" | "weekday">; insetStart?: number; insetEnd?: number } }
3950
4168
  );
3951
4169
 
3952
4170
  export interface DashScaleOptions {
@@ -3975,7 +4193,9 @@ export type StrokeDashEncodingOptions =
3975
4193
  export type NonPointContinuousColorScaleOptions = ScaleFields<
3976
4194
  "id" | "interpolate" | "midpoint" | "clamp" | "reverse"
3977
4195
  > & {
3978
- type?: "sequential";
4196
+ type?: "sequential" | "log" | "sqrt" | "symlog";
4197
+ base?: number;
4198
+ constant?: number;
3979
4199
  domain?: "auto" | readonly [unknown, unknown];
3980
4200
  range?: "auto" | readonly [string, string, ...string[]];
3981
4201
  palette?: PaletteName | {
@@ -4039,7 +4259,7 @@ export type ColorEncodingOptions =
4039
4259
  fieldType: "temporal";
4040
4260
  temporalUnit?: TemporalInputUnit;
4041
4261
  aggregate?: never;
4042
- scale?: Omit<ContinuousColorScaleOptions, "midpoint"> & { midpoint?: "auto" };
4262
+ scale?: Omit<ContinuousColorScaleOptions, "midpoint" | "type" | "base" | "constant"> & { midpoint?: "auto"; type?: "sequential" };
4043
4263
  palette?: Palette;
4044
4264
  layout?: never;
4045
4265
  };
@@ -4162,9 +4382,10 @@ export type StrokeWidthEncodingOptions =
4162
4382
  export type SizeEncodingOptions = {
4163
4383
  field: string;
4164
4384
  target?: string;
4165
- fieldType?: "quantitative";
4166
- scale?: SizeScaleOptions;
4167
- };
4385
+ } & (
4386
+ | { fieldType?: "quantitative"; scale?: SizeScaleOptions }
4387
+ | { fieldType: "nominal" | "ordinal"; scale?: CategoricalSizeScaleOptions }
4388
+ );
4168
4389
 
4169
4390
  export type ShapeEncodingOptions = {
4170
4391
  field: string;
@@ -4259,6 +4480,7 @@ type RegressionParameterOptions =
4259
4480
  method?: "linear";
4260
4481
  degree?: never;
4261
4482
  span?: never;
4483
+ robustIterations?: never;
4262
4484
  confidenceMethod?: ConfidenceIntervalMethod;
4263
4485
  level?: number;
4264
4486
  confidence?: number;
@@ -4269,6 +4491,7 @@ type RegressionParameterOptions =
4269
4491
  method: "polynomial";
4270
4492
  degree?: number;
4271
4493
  span?: never;
4494
+ robustIterations?: never;
4272
4495
  confidenceMethod?: ConfidenceIntervalMethod;
4273
4496
  level?: number;
4274
4497
  confidence?: number;
@@ -4279,6 +4502,8 @@ type RegressionParameterOptions =
4279
4502
  method: "loess";
4280
4503
  degree?: never;
4281
4504
  span?: number;
4505
+ /** Residual reweighting passes, integer 0..32; default 0. */
4506
+ robustIterations?: number;
4282
4507
  confidenceMethod?: never;
4283
4508
  level?: never;
4284
4509
  confidence?: never;
@@ -4326,6 +4551,7 @@ export interface EditRegressionOptions {
4326
4551
  method?: RegressionMethod;
4327
4552
  degree?: number;
4328
4553
  span?: number;
4554
+ robustIterations?: number;
4329
4555
  confidenceMethod?: ConfidenceIntervalMethod;
4330
4556
  level?: number;
4331
4557
  confidence?: number;
@@ -4374,6 +4600,8 @@ export interface LegendTextOptions {
4374
4600
  }
4375
4601
 
4376
4602
  export interface LegendTitleStyleOptions {
4603
+ /** Align a top title inside its measured content block; omission keeps native layout defaults. */
4604
+ align?: "left" | "center" | "right";
4377
4605
  color?: string;
4378
4606
  fontSize?: number;
4379
4607
  fontFamily?: string;
@@ -4419,32 +4647,45 @@ export type LegendOrder = LegendValueOrder |
4419
4647
  { channel: "x" | "y" | "theta"; values?: never };
4420
4648
 
4421
4649
  export interface LegendOptions {
4650
+ /** Continuous color only. Omission creates the existing gradient; symbols samples the same scale without changing marks. */
4651
+ representation?: "gradient" | "symbols";
4422
4652
  /** Categorical, interval, size, or stroke-width layout. Defaults to edge; legacy-bottom is categorical and requires bottom position. */
4423
4653
  layout?: "edge" | "legacy-bottom";
4654
+ /** Categorical and ordinal-size display limit; omitted or false shows every item. */
4655
+ overflow?: false | { maxItems: number; summary?: "ellipsis-count" };
4424
4656
  /** Categorical item order; preserves the appearance scale's assignments. */
4425
4657
  order?: LegendOrder;
4426
4658
  target?: string;
4427
4659
  /** Exact requested content; omission infers encoded point color/shape/size. Explicit subsets include size only when listed. */
4428
4660
  channels?: readonly ("color" | "stroke" | "strokeDash" | "strokeWidth" | "shape" | "size" | "opacity")[];
4429
- position?: "right" | "left" | "bottom" | "top";
4661
+ /** Outside right/left: complete legend stack top aligns with the plot top, including borders and excluding chart titles. */
4662
+ position?: "right" | "left" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
4663
+ /** Arrange every legend block owned by the selected target. Item direction and columns remain independent. */
4664
+ blockLayout?: "row" | "column" | "wrap";
4665
+ /** Occupied group top-left relative to the plot. Cannot be supplied with position, align, or offset in the same call. */
4666
+ at?: { x: number; y: number };
4430
4667
  /** Single top/bottom edge: align complete occupied bounds, including border strokes, to the plot. Side positions require center. */
4431
4668
  align?: "left" | "center" | "right";
4432
4669
  /** Categorical sides require vertical (the default); horizontal edges default to horizontal. */
4433
4670
  direction?: "horizontal" | "vertical";
4434
- /** Categorical sides allow omission or 1; multiple columns require a horizontal edge. */
4671
+ /** Categorical legends accept a positive column count on every supported position. */
4435
4672
  columns?: number;
4436
4673
  /** Single top/bottom edge: gap from the plot to the nearest occupied legend edge. */
4437
4674
  offset?: number;
4438
4675
  titlePosition?: "top" | "left";
4439
- title?: string;
4440
- /** Exact ascending samples for continuous size, opacity, or stroke-width legends. Cannot be combined with count. */
4676
+ /** false hides the title while retaining its inferred field text. */
4677
+ /** LF, CRLF and CR preserve explicit title lines, including blank lines. */
4678
+ title?: string | false;
4679
+ /** Exact ascending samples for continuous size, opacity, stroke-width, or color with representation symbols. Cannot be combined with count. */
4441
4680
  values?: readonly number[];
4442
4681
  count?: number;
4443
- gradient?: { length?: number; thickness?: number };
4682
+ /** Body-only opacity defaults to 1; edits preserve omitted fields. */
4683
+ gradient?: { length?: number; thickness?: number; opacity?: number };
4444
4684
  symbol?: LegendSymbolRecipe;
4445
4685
  labels?: LegendTextOptions;
4446
4686
  /** New categorical+size blocks share typography on every edge; retained standalone size styles remain independent. */
4447
4687
  titleStyle?: LegendTitleStyleOptions;
4688
+ /** Vertical items default to 18 logical pixels; the pitch grows to fit samples and labels. */
4448
4689
  itemGap?: number;
4449
4690
  border?: boolean | LegendBorderOptions;
4450
4691
  }
@@ -4477,11 +4718,17 @@ export interface EditLegendBlockOptions {
4477
4718
  gap?: number;
4478
4719
  text?: LegendBlockTextPatch;
4479
4720
  symbol?: LegendBlockSymbolPatch;
4721
+ /** An empty mapped label omits only text; its category and symbol remain. */
4480
4722
  labelMap?: DisplayLabelMap | "auto";
4481
4723
  }
4482
4724
 
4725
+ export interface LegendTitleStyleEditOptions extends Omit<LegendTitleStyleOptions, "align"> {
4726
+ align?: "left" | "center" | "right" | "auto";
4727
+ }
4728
+
4483
4729
  export interface EditLegendOptions
4484
- extends Omit<LegendOptions, "title" | "values"> {
4730
+ extends Omit<LegendOptions, "title" | "values" | "titleStyle"> {
4731
+ titleStyle?: LegendTitleStyleEditOptions;
4485
4732
  /** Exact final content set for the whole target; omission preserves content. */
4486
4733
  channels?: LegendOptions["channels"];
4487
4734
  title?: string | "auto" | false;
@@ -4492,16 +4739,22 @@ export interface EditLegendOptions
4492
4739
  export interface EditLegendLayoutOptions {
4493
4740
  target?: string;
4494
4741
  layout?: "edge" | "legacy-bottom";
4495
- position?: "right" | "left" | "bottom" | "top";
4742
+ /** Outside right/left: complete legend stack top aligns with the plot top, including borders and excluding chart titles. */
4743
+ position?: "right" | "left" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
4744
+ /** Opt into whole-target legend group layout; a requested row never wraps. */
4745
+ blockLayout?: "row" | "column" | "wrap";
4746
+ /** Move the complete occupied group top-left to plot-relative logical pixels. A later position clears this anchor. */
4747
+ at?: { x: number; y: number };
4496
4748
  /** Single top/bottom edge: align complete occupied bounds, including border strokes, to the plot. Side positions require center. */
4497
4749
  align?: "left" | "center" | "right";
4498
4750
  /** Categorical sides require vertical (the default); horizontal edges default to horizontal. */
4499
4751
  direction?: "horizontal" | "vertical";
4500
- /** Categorical sides allow omission or 1; multiple columns require a horizontal edge. */
4752
+ /** Categorical legends accept a positive column count on every supported position. */
4501
4753
  columns?: number;
4502
4754
  /** Single top/bottom edge: gap from the plot to the nearest occupied legend edge. */
4503
4755
  offset?: number;
4504
4756
  titlePosition?: "top" | "left";
4757
+ /** Explicit spacing override; vertical creation defaults to 18 logical pixels. */
4505
4758
  itemGap?: number;
4506
4759
  }
4507
4760
 
@@ -4509,7 +4762,7 @@ export interface EditLegendLabelsOptions extends LegendTextOptions {
4509
4762
  target?: string;
4510
4763
  }
4511
4764
 
4512
- export interface EditLegendTitleOptions extends LegendTitleStyleOptions {
4765
+ export interface EditLegendTitleOptions extends LegendTitleStyleEditOptions {
4513
4766
  target?: string;
4514
4767
  title?: string | "auto" | false;
4515
4768
  }
@@ -4518,7 +4771,7 @@ export interface EditLegendSymbolsOptions {
4518
4771
  target?: string;
4519
4772
  symbol?: LegendSymbolRecipe;
4520
4773
  count?: number;
4521
- gradient?: { length?: number; thickness?: number };
4774
+ gradient?: { length?: number; thickness?: number; opacity?: number };
4522
4775
  }
4523
4776
 
4524
4777
  export interface EditLegendBorderOptions {
@@ -4536,6 +4789,7 @@ export interface EditAxisOptions<P extends string> {
4536
4789
  }
4537
4790
 
4538
4791
  export interface TitleTextStyleOptions {
4792
+ fontStyle?: "normal" | "italic";
4539
4793
  color?: string;
4540
4794
  fontSize?: number;
4541
4795
  fontFamily?: string;
@@ -4579,11 +4833,15 @@ export interface RemoveCategoryOrderOptions {
4579
4833
  }
4580
4834
 
4581
4835
  export interface TitleOptions {
4836
+ /** Explicit hard lines are retained; blank lines reserve spacing without painted text. */
4582
4837
  text: string;
4838
+ /** Multiline subtitle with at least one non-empty hard line. */
4583
4839
  subtitle?: string;
4584
4840
  position?: "top" | "bottom" | "left" | "right";
4585
4841
  align?: "left" | "center" | "right";
4586
4842
  offset?: number;
4843
+ /** Signed logical-pixel shift along the selected edge; defaults to zero. */
4844
+ alongOffset?: number;
4587
4845
  gap?: number;
4588
4846
  maxWidth?: number;
4589
4847
  wrap?: "word" | "character";
@@ -4729,6 +4987,7 @@ export class ChartProgram {
4729
4987
  data?: string;
4730
4988
  strokeWidth?: number;
4731
4989
  curve?: CurveInterpolation;
4990
+ tension?: number;
4732
4991
  stroke?: string;
4733
4992
  opacity?: number;
4734
4993
  closed?: boolean;
@@ -4737,6 +4996,7 @@ export class ChartProgram {
4737
4996
  target?: string;
4738
4997
  strokeWidth?: number;
4739
4998
  curve?: CurveInterpolation;
4999
+ tension?: number;
4740
5000
  stroke?: string;
4741
5001
  opacity?: number;
4742
5002
  closed?: boolean;
@@ -4744,8 +5004,9 @@ export class ChartProgram {
4744
5004
  createBarMark(options?: RectStyleDetails & {
4745
5005
  id?: string;
4746
5006
  data?: string;
5007
+ orientation?: "vertical" | "horizontal";
4747
5008
  missing?: "error" | "skip";
4748
- fill?: string;
5009
+ fill?: FillPaint;
4749
5010
  opacity?: number;
4750
5011
  stroke?: FilledMarkStroke;
4751
5012
  strokeWidth?: number;
@@ -4753,7 +5014,7 @@ export class ChartProgram {
4753
5014
  editBarMark(options: RectStyleDetails & {
4754
5015
  target?: string;
4755
5016
  missing?: "error" | "skip";
4756
- fill?: string;
5017
+ fill?: FillPaint;
4757
5018
  opacity?: number;
4758
5019
  stroke?: FilledMarkStroke;
4759
5020
  strokeWidth?: number;
@@ -4761,7 +5022,7 @@ export class ChartProgram {
4761
5022
  createAreaMark(options?: StrokeStyleDetails & {
4762
5023
  id?: string;
4763
5024
  data?: string;
4764
- fill?: string;
5025
+ fill?: FillPaint;
4765
5026
  opacity?: number;
4766
5027
  stroke?: string;
4767
5028
  strokeWidth?: number;
@@ -4771,7 +5032,7 @@ export class ChartProgram {
4771
5032
  createArcMark(options?: StrokeStyleDetails & {
4772
5033
  id?: string;
4773
5034
  data?: string;
4774
- innerRadius?: number;
5035
+ innerRadius?: ArcInnerRadius;
4775
5036
  padAngle?: number;
4776
5037
  fill?: string;
4777
5038
  opacity?: number;
@@ -4780,7 +5041,7 @@ export class ChartProgram {
4780
5041
  }): ChartProgram;
4781
5042
  editArcMark(options: StrokeStyleDetails & {
4782
5043
  target?: string;
4783
- innerRadius?: number;
5044
+ innerRadius?: ArcInnerRadius;
4784
5045
  padAngle?: number;
4785
5046
  fill?: string;
4786
5047
  opacity?: number;
@@ -4792,6 +5053,7 @@ export class ChartProgram {
4792
5053
  createRuleMark(options?: { id?: string; data?: string; missing?: "error" | "skip" } & RuleStyleOptions): ChartProgram;
4793
5054
  editRuleMark(options: { target?: string; missing?: "error" | "skip" } & RuleStyleOptions): ChartProgram;
4794
5055
  createTextMark(options?: TextMarkOptions): ChartProgram;
5056
+ createTextPlot(options: CreateTextPlotOptions): ChartProgram;
4795
5057
  createMarkLabels(options?: CreateMarkLabelsOptions): ChartProgram;
4796
5058
  editMarkLabelSelection(options: EditMarkLabelSelectionOptions): ChartProgram;
4797
5059
  editMarkLabelPlacement(options: EditMarkLabelPlacementOptions): ChartProgram;
@@ -4804,7 +5066,7 @@ export class ChartProgram {
4804
5066
  removeLabelLayout(options?: RemoveLabelLayoutOptions): ChartProgram;
4805
5067
  editAreaMark(options: StrokeStyleDetails & {
4806
5068
  target?: string;
4807
- fill?: string;
5069
+ fill?: FillPaint;
4808
5070
  opacity?: number;
4809
5071
  stroke?: string | false;
4810
5072
  strokeWidth?: number;
@@ -4963,7 +5225,7 @@ export class ChartProgram {
4963
5225
  editRadialGrid(options: EditPolarGridOptions): ChartProgram;
4964
5226
  editGrid(options: EditGridDirectionsOptions): ChartProgram;
4965
5227
  removeGrid(options?: RemoveGridOptions): ChartProgram;
4966
- /** Combined categorical and size legends support all four edges with layout "edge". */
5228
+ /** Combined categorical and size legends support all four edges and plot corners with layout "edge". */
4967
5229
  createLegend(options?: LegendOptions): ChartProgram;
4968
5230
  editLegend(options: EditLegendOptions): ChartProgram;
4969
5231
  editLegendBlock(options: EditLegendBlockOptions): ChartProgram;