ggaction 0.0.15 → 0.0.16

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 (236) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +22 -2
  3. package/knowledge/action-cards.json +1 -1
  4. package/knowledge/intent-taxonomy.json +1 -1
  5. package/knowledge/mcp-resources.json +1 -1
  6. package/knowledge/task-packet.schema.json +1 -1
  7. package/knowledge/task-resolver.js +1 -1
  8. package/package.json +33 -6
  9. package/src/BasicChartProgram.js +3 -1
  10. package/src/ChartProgram.js +2 -0
  11. package/src/accessibility.js +157 -0
  12. package/src/actions/boxPlots/components.js +6 -8
  13. package/src/actions/boxPlots/create.js +4 -5
  14. package/src/actions/boxPlots/edit.js +3 -4
  15. package/src/actions/boxPlots/materialize.js +1 -1
  16. package/src/actions/canvas/actions.js +3 -3
  17. package/src/actions/canvas/fitting.js +1 -1
  18. package/src/actions/categoryOrder/index.js +6 -8
  19. package/src/actions/charts/area.js +1 -1
  20. package/src/actions/charts/bar.js +1 -1
  21. package/src/actions/charts/beeswarm.js +1 -1
  22. package/src/actions/charts/density.js +1 -1
  23. package/src/actions/charts/ecdf.js +2 -2
  24. package/src/actions/charts/endpoints.js +4 -4
  25. package/src/actions/charts/heatmap.js +1 -1
  26. package/src/actions/charts/histogram.js +1 -1
  27. package/src/actions/charts/horizon.js +1 -1
  28. package/src/actions/charts/interval-regression.js +2 -2
  29. package/src/actions/charts/line.js +1 -1
  30. package/src/actions/charts/parallel.js +1 -1
  31. package/src/actions/charts/pie.js +1 -1
  32. package/src/actions/charts/polar.js +2 -2
  33. package/src/actions/charts/radar.js +1 -1
  34. package/src/actions/charts/radial.js +2 -2
  35. package/src/actions/charts/raincloud.js +2 -2
  36. package/src/actions/charts/rug-strip.js +2 -2
  37. package/src/actions/charts/scatter.js +1 -1
  38. package/src/actions/composition/actions.js +20 -24
  39. package/src/actions/coordinates/actions.js +1 -1
  40. package/src/actions/coordinates/edit.js +1 -1
  41. package/src/actions/data/basicBin2d.js +4 -5
  42. package/src/actions/data/bin.js +2 -2
  43. package/src/actions/data/bin2d.js +6 -8
  44. package/src/actions/data/bin2dMaterialize.js +4 -5
  45. package/src/actions/data/box.js +4 -4
  46. package/src/actions/data/complete.js +2 -2
  47. package/src/actions/data/computed.js +2 -2
  48. package/src/actions/data/create.js +5 -12
  49. package/src/actions/data/density.js +3 -3
  50. package/src/actions/data/derived.js +10 -14
  51. package/src/actions/data/ecdf.js +2 -2
  52. package/src/actions/data/edit.js +35 -23
  53. package/src/actions/data/filter.js +14 -20
  54. package/src/actions/data/fold.js +2 -2
  55. package/src/actions/data/gradientProfile.js +2 -2
  56. package/src/actions/data/horizon.js +2 -2
  57. package/src/actions/data/impute.js +2 -2
  58. package/src/actions/data/index.js +55 -54
  59. package/src/actions/data/interval.js +2 -2
  60. package/src/actions/data/intervalEdit.js +26 -18
  61. package/src/actions/data/normalize.js +2 -2
  62. package/src/actions/data/regression.js +5 -6
  63. package/src/actions/data/revise.js +48 -0
  64. package/src/actions/data/revisionBindings.js +13 -33
  65. package/src/actions/data/stack.js +2 -2
  66. package/src/actions/data/summary.js +2 -2
  67. package/src/actions/data/timeUnit.js +2 -2
  68. package/src/actions/data/window.js +2 -2
  69. package/src/actions/encodings/angle.js +1 -1
  70. package/src/actions/encodings/appearance.js +4 -4
  71. package/src/actions/encodings/barWidth.js +1 -1
  72. package/src/actions/encodings/channels.js +2 -2
  73. package/src/actions/encodings/color/index.js +1 -1
  74. package/src/actions/encodings/density.js +2 -2
  75. package/src/actions/encodings/histogram.js +1 -1
  76. package/src/actions/encodings/horizon.js +6 -8
  77. package/src/actions/encodings/offset.js +2 -2
  78. package/src/actions/encodings/parallel.js +4 -5
  79. package/src/actions/encodings/pathOrder.js +6 -11
  80. package/src/actions/encodings/position/index.js +4 -4
  81. package/src/actions/encodings/ranged.js +5 -5
  82. package/src/actions/encodings/remove.js +4 -5
  83. package/src/actions/encodings/ruleAppearance.js +1 -1
  84. package/src/actions/encodings/seriesLayout.js +1 -1
  85. package/src/actions/encodings/stroke.js +1 -1
  86. package/src/actions/encodings/strokeDash.js +2 -2
  87. package/src/actions/encodings/text.js +1 -1
  88. package/src/actions/errorBands/create.js +11 -17
  89. package/src/actions/errorBands/edit.js +13 -131
  90. package/src/actions/errorBars/create.js +8 -13
  91. package/src/actions/errorBars/edit.js +10 -121
  92. package/src/actions/facets/actions.js +30 -16
  93. package/src/actions/facets/derive.js +8 -2
  94. package/src/actions/facets/guides.js +4 -5
  95. package/src/actions/facets/replay.js +4 -5
  96. package/src/actions/gradientPlots/components.js +5 -6
  97. package/src/actions/gradientPlots/create.js +4 -5
  98. package/src/actions/gradientPlots/edit.js +4 -5
  99. package/src/actions/gradientPlots/materialize.js +2 -2
  100. package/src/actions/gradientPlots/rebind.js +4 -5
  101. package/src/actions/guides/axes/axes.js +23 -4
  102. package/src/actions/guides/axes/axis.js +2 -2
  103. package/src/actions/guides/axes/edit.js +2 -2
  104. package/src/actions/guides/axes/labels.js +9 -9
  105. package/src/actions/guides/axes/lines.js +9 -7
  106. package/src/actions/guides/axes/parallel/lifecycle.js +13 -13
  107. package/src/actions/guides/axes/parallel.js +5 -5
  108. package/src/actions/guides/axes/remove.js +4 -4
  109. package/src/actions/guides/axes/tickGroups.js +4 -4
  110. package/src/actions/guides/axes/ticks.js +13 -4
  111. package/src/actions/guides/axes/titles.js +10 -10
  112. package/src/actions/guides/grids/grid.js +18 -29
  113. package/src/actions/guides/guides.js +1 -1
  114. package/src/actions/guides/legends/blocks.js +1 -1
  115. package/src/actions/guides/legends/categorical/actions.js +4 -4
  116. package/src/actions/guides/legends/categorical/components.js +38 -33
  117. package/src/actions/guides/legends/categorical/layout.js +1 -1
  118. package/src/actions/guides/legends/categorical/symbols.js +27 -30
  119. package/src/actions/guides/legends/continuous/common.js +46 -8
  120. package/src/actions/guides/legends/continuous/gradient.js +89 -155
  121. package/src/actions/guides/legends/continuous/interval.js +13 -13
  122. package/src/actions/guides/legends/continuous/opacity.js +30 -79
  123. package/src/actions/guides/legends/continuous/stroke.js +22 -322
  124. package/src/actions/guides/legends/edit.js +1 -1
  125. package/src/actions/guides/legends/focused.js +5 -5
  126. package/src/actions/guides/legends/lane.js +6 -6
  127. package/src/actions/guides/legends/remove.js +4 -5
  128. package/src/actions/guides/legends/size.js +21 -82
  129. package/src/actions/guides/legends/strokeWidth.js +17 -77
  130. package/src/actions/guides/polar/axes/facade.js +4 -4
  131. package/src/actions/guides/polar/axes/labels.js +5 -5
  132. package/src/actions/guides/polar/axes/lines.js +9 -15
  133. package/src/actions/guides/polar/axes/ticks.js +9 -15
  134. package/src/actions/guides/polar/axes/titles.js +5 -5
  135. package/src/actions/guides/polar/grids.js +11 -13
  136. package/src/actions/index.js +2 -0
  137. package/src/actions/intervals/revision.js +126 -0
  138. package/src/actions/marks/arc/actions.js +3 -3
  139. package/src/actions/marks/area/actions.js +4 -4
  140. package/src/actions/marks/bar/create.js +1 -1
  141. package/src/actions/marks/bar/edit.js +1 -1
  142. package/src/actions/marks/bar/materialize.js +12 -38
  143. package/src/actions/marks/line/actions.js +3 -3
  144. package/src/actions/marks/point/create.js +1 -1
  145. package/src/actions/marks/point/edit.js +1 -1
  146. package/src/actions/marks/point/jitter.js +6 -8
  147. package/src/actions/marks/point/materialize.js +16 -24
  148. package/src/actions/marks/point/packing.js +6 -8
  149. package/src/actions/marks/rect/actions.js +3 -3
  150. package/src/actions/marks/references.js +8 -10
  151. package/src/actions/marks/remove.js +5 -49
  152. package/src/actions/marks/rule/actions.js +4 -4
  153. package/src/actions/marks/text/actions.js +5 -5
  154. package/src/actions/marks/text/layout.js +12 -20
  155. package/src/actions/marks/text/removal.js +1 -1
  156. package/src/actions/marks/text/selection.js +4 -5
  157. package/src/actions/marks/tick/actions.js +3 -3
  158. package/src/actions/primitives/createGraphics.js +5 -4
  159. package/src/actions/primitives/editGraphics.js +5 -4
  160. package/src/actions/primitives/graphicProperties.js +6 -0
  161. package/src/actions/primitives/semantic.js +10 -3
  162. package/src/actions/primitives/semanticAction.js +7 -4
  163. package/src/actions/primitives/semanticValidation/dataset.js +2 -4
  164. package/src/actions/regression/components.js +10 -14
  165. package/src/actions/regression/create.js +3 -4
  166. package/src/actions/regression/edit.js +3 -4
  167. package/src/actions/resources/remove.js +12 -11
  168. package/src/actions/scales/create.js +1 -1
  169. package/src/actions/scales/edit.js +1 -1
  170. package/src/actions/scales/materialize.js +1 -1
  171. package/src/actions/scales/offset.js +2 -2
  172. package/src/actions/scales/parallel.js +1 -1
  173. package/src/actions/scales/quantitativeColor.js +4 -5
  174. package/src/actions/selection/actions.js +25 -36
  175. package/src/actions/textMetrics/index.js +56 -0
  176. package/src/actions/theme/actions.js +2 -2
  177. package/src/actions/theme/reconcile.js +65 -121
  178. package/src/actions/titles/actions.js +8 -8
  179. package/src/actions/titles/resolve.js +3 -3
  180. package/src/actions/violinPlots/create.js +1 -1
  181. package/src/actions/violinPlots/edit.js +1 -1
  182. package/src/core/action.js +107 -35
  183. package/src/core/diagnostics.js +16 -0
  184. package/src/core/extensionRegistry.js +27 -0
  185. package/src/core/font.js +18 -0
  186. package/src/core/identifiers.js +5 -4
  187. package/src/core/immutable.js +10 -3
  188. package/src/core/optionRequirements.js +8 -0
  189. package/src/core/programState.js +1 -1
  190. package/src/core/resourceReferences.js +15 -6
  191. package/src/core/textMetricProfile.js +28 -0
  192. package/src/core/textMetrics.js +24 -3
  193. package/src/core/validation.js +22 -10
  194. package/src/diagnostics.js +1 -0
  195. package/src/grammar/impute.js +3 -2
  196. package/src/grammar/scales/types.js +8 -0
  197. package/src/grammar/schemas/graphicBounds.js +11 -11
  198. package/src/layout/labels.js +11 -10
  199. package/src/layout/legend.js +4 -4
  200. package/src/layout/legendItems.js +6 -6
  201. package/src/layout/text.js +10 -9
  202. package/src/layout/title.js +9 -9
  203. package/src/materialization/facetGuides/placement.js +1 -1
  204. package/src/materialization/facetGuides/preparation.js +1 -1
  205. package/src/materialization/facetHeaders.js +11 -10
  206. package/src/materialization/guides/layout.js +3 -3
  207. package/src/materialization/scaleGuideDependencies.js +10 -0
  208. package/src/materialization/selection/items/common.js +1 -1
  209. package/src/materialization/text.js +2 -2
  210. package/src/materialization/typography.js +31 -0
  211. package/src/mcp/cli.js +5 -3
  212. package/src/persistence/codec.js +65 -0
  213. package/src/persistence/validation.js +185 -0
  214. package/src/persistence.js +74 -0
  215. package/src/renderers/canvas/index.js +5 -4
  216. package/src/renderers/nativeBackend.js +10 -0
  217. package/src/renderers/options.js +13 -0
  218. package/src/renderers/pdf.js +25 -54
  219. package/src/renderers/png.js +22 -17
  220. package/src/renderers/svg.js +10 -14
  221. package/src/renderers/text.js +1 -11
  222. package/src/selectors/coordinates.js +3 -1
  223. package/src/selectors/datasets.js +8 -6
  224. package/src/selectors/layers.js +6 -4
  225. package/src/selectors/markOwners.js +46 -0
  226. package/src/selectors/scales.js +6 -4
  227. package/src/theme/defaults.js +2 -1
  228. package/src/version.js +2 -0
  229. package/types/accessibility.d.ts +37 -0
  230. package/types/basic.d.ts +4 -2
  231. package/types/diagnostics.d.ts +15 -0
  232. package/types/index.d.ts +5 -0
  233. package/types/pdf.d.ts +9 -0
  234. package/types/persistence.d.ts +7 -0
  235. package/types/png.d.ts +9 -0
  236. package/types/program.d.ts +34 -1
@@ -67,7 +67,7 @@ function resolveCanvasState(program, args) {
67
67
  return cloneAndFreeze(state);
68
68
  }
69
69
 
70
- export const editCanvas = action(
70
+ export const editCanvas = /* @__PURE__ */ action(
71
71
  {
72
72
  op: "editCanvas",
73
73
  description: "Edit canvas properties and authoring bounds."
@@ -104,7 +104,7 @@ export const editCanvas = action(
104
104
  }
105
105
  );
106
106
 
107
- export const createCanvas = action(
107
+ export const createCanvas = /* @__PURE__ */ action(
108
108
  {
109
109
  op: "createCanvas",
110
110
  description: "Create and configure the chart canvas."
@@ -147,7 +147,7 @@ export const createCanvas = action(
147
147
  }
148
148
  );
149
149
 
150
- export const createBasicCanvas = action(
150
+ export const createBasicCanvas = /* @__PURE__ */ action(
151
151
  {
152
152
  op: "createCanvas",
153
153
  description: "Create and configure the chart canvas."
@@ -159,7 +159,7 @@ function layoutSignature(program) {
159
159
  return hash.toString(16).padStart(16, "0");
160
160
  }
161
161
 
162
- export const fitCanvas = action(
162
+ export const fitCanvas = /* @__PURE__ */ action(
163
163
  {
164
164
  op: "fitCanvas",
165
165
  description: "Fit Canvas margins around existing layout resources."
@@ -1,6 +1,6 @@
1
- import { action } from "../../core/action.js";
1
+ import { closedAction } from "../../core/action.js";
2
2
  import { validateUserId } from "../../core/identifiers.js";
3
- import { validateKeys } from "../../core/validation.js";
3
+
4
4
  import { findDataset } from "../../selectors/datasets.js";
5
5
  import { resolveEligibleLayer } from "../../selectors/layers.js";
6
6
  import { findScaleConsumers } from "../scales/consumers/index.js";
@@ -79,10 +79,9 @@ function rematerializeAssignment(program, scaleId) {
79
79
  }));
80
80
  }
81
81
 
82
- export const orderCategories = action(
83
- { op: "orderCategories", description: "Assign semantic order to a categorical position." },
82
+ export const orderCategories = /* @__PURE__ */ closedAction(
83
+ { op: "orderCategories", description: "Assign semantic order to a categorical position." }, ORDER_OPTIONS,
84
84
  function (args = {}) {
85
- validateKeys(args, ORDER_OPTIONS, "orderCategories");
86
85
  const { layer, encoding, dataset } = resolveAssignment(this, args, "orderCategories");
87
86
  const order = normalizeCategoryOrder(args);
88
87
  resolveCategoryOrder(dataset.values, encoding.field, order);
@@ -94,10 +93,9 @@ export const orderCategories = action(
94
93
  }
95
94
  );
96
95
 
97
- export const removeCategoryOrder = action(
98
- { op: "removeCategoryOrder", description: "Restore automatic category order." },
96
+ export const removeCategoryOrder = /* @__PURE__ */ closedAction(
97
+ { op: "removeCategoryOrder", description: "Restore automatic category order." }, REMOVE_OPTIONS,
99
98
  function (args = {}) {
100
- validateKeys(args, REMOVE_OPTIONS, "removeCategoryOrder");
101
99
  const { layer, encoding } = resolveAssignment(
102
100
  this,
103
101
  args,
@@ -11,7 +11,7 @@ import {
11
11
  const OPERATION = "createAreaPlot";
12
12
  const OPTIONS = ["id", "data", "coordinate", "x", "y", "valueChannel", "baseline", "groupBy", "layout", "missing", "color", "area", "guides"];
13
13
 
14
- export const createAreaPlot = action({ op: OPERATION, description: "Create a simple, ranged, or stacked Cartesian area plot." }, function (args = {}) {
14
+ export const createAreaPlot = /* @__PURE__ */ action({ op: OPERATION, description: "Create a simple, ranged, or stacked Cartesian area plot." }, function (args = {}) {
15
15
  validateFacadeOptions(args, OPTIONS, OPERATION);
16
16
  for (const [key, value] of Object.entries(args)) if (value === null) throw new TypeError(`${OPERATION} ${key} cannot be null.`);
17
17
  const id = resolveFacadeId(this, args.id, { defaultId: "areaPlot", operation: OPERATION });
@@ -23,7 +23,7 @@ const BAR_OPTIONS = Object.freeze([
23
23
  "fill", "opacity", "stroke", "strokeWidth", ...RECT_STYLE_PROPERTIES
24
24
  ]);
25
25
 
26
- export const createBarPlot = action(
26
+ export const createBarPlot = /* @__PURE__ */ action(
27
27
  {
28
28
  op: "createBarPlot",
29
29
  description: "Create a Cartesian bar plot from existing chart data."
@@ -29,7 +29,7 @@ function normalizePacking(value, operation) {
29
29
  return { ...packing };
30
30
  }
31
31
 
32
- export const createBeeswarmPlot = action(
32
+ export const createBeeswarmPlot = /* @__PURE__ */ action(
33
33
  {
34
34
  op: "createBeeswarmPlot",
35
35
  description: "Create a Point plot packed within categorical slots."
@@ -14,7 +14,7 @@ const AREA_OPTIONS = [
14
14
  ...STROKE_STYLE_PROPERTIES
15
15
  ];
16
16
 
17
- export const createDensityPlot = action({
17
+ export const createDensityPlot = /* @__PURE__ */ action({
18
18
  op: OPERATION, description: "Create a baseline kernel-density area plot with optional explicit groups."
19
19
  }, function (args = {}) {
20
20
  validateFacadeOptions(args, OPTIONS, OPERATION);
@@ -72,7 +72,7 @@ function resolveOwner(program, requested) {
72
72
  throw new Error("editECDFPlot target is ambiguous; provide target.");
73
73
  }
74
74
 
75
- export const createECDFPlot = action(
75
+ export const createECDFPlot = /* @__PURE__ */ action(
76
76
  {
77
77
  op: "createECDFPlot",
78
78
  description: "Create a right-continuous empirical cumulative distribution plot."
@@ -158,7 +158,7 @@ export const createECDFPlot = action(
158
158
  }
159
159
  );
160
160
 
161
- export const editECDFPlot = action(
161
+ export const editECDFPlot = /* @__PURE__ */ action(
162
162
  {
163
163
  op: "editECDFPlot",
164
164
  description: "Atomically revise an ECDF plot's source or statistical roles."
@@ -254,7 +254,7 @@ function finish(program, { id, source, data, kind, roles, summary, orientation,
254
254
  });
255
255
  }
256
256
 
257
- export const createDotPlot = action(
257
+ export const createDotPlot = /* @__PURE__ */ action(
258
258
  { op: "createDotPlot", description: "Create raw or explicitly summarized categorical dots." },
259
259
  function (args = {}) {
260
260
  const operation = "createDotPlot";
@@ -284,7 +284,7 @@ export const createDotPlot = action(
284
284
  }
285
285
  );
286
286
 
287
- export const createLollipopPlot = action(
287
+ export const createLollipopPlot = /* @__PURE__ */ action(
288
288
  { op: "createLollipopPlot", description: "Create categorical value points with baseline stems." },
289
289
  function (args = {}) {
290
290
  const operation = "createLollipopPlot";
@@ -327,7 +327,7 @@ export const createLollipopPlot = action(
327
327
  }
328
328
  );
329
329
 
330
- export const createDumbbellPlot = action(
330
+ export const createDumbbellPlot = /* @__PURE__ */ action(
331
331
  { op: "createDumbbellPlot", description: "Create two categorical endpoints joined by a connector." },
332
332
  function (args = {}) {
333
333
  const operation = "createDumbbellPlot";
@@ -449,7 +449,7 @@ function reviseRequestedScales(program, ownerId, revised, changes) {
449
449
  return next;
450
450
  }
451
451
 
452
- export const editEndpointPlot = action(
452
+ export const editEndpointPlot = /* @__PURE__ */ action(
453
453
  { op: "editEndpointPlot", description: "Atomically revise an endpoint plot's semantic roles." },
454
454
  function (args = {}) {
455
455
  validateFacadeOptions(args, EDIT_OPTIONS, "editEndpointPlot");
@@ -136,7 +136,7 @@ function binnedGuides(guides, xTitle, yTitle) {
136
136
  };
137
137
  }
138
138
 
139
- export const createHeatmap = action(
139
+ export const createHeatmap = /* @__PURE__ */ action(
140
140
  {
141
141
  op: OPERATION,
142
142
  description: "Create a pre-gridded or rectangularly binned heatmap."
@@ -23,7 +23,7 @@ const HISTOGRAM_OPTIONS = Object.freeze([
23
23
  "maxBins", "binStep", "binBoundaries", "stack", "xScale", "yScale", "weight"
24
24
  ]);
25
25
 
26
- export const createHistogram = action(
26
+ export const createHistogram = /* @__PURE__ */ action(
27
27
  {
28
28
  op: "createHistogram",
29
29
  description: "Create a binned count histogram from existing chart data."
@@ -41,7 +41,7 @@ function guideOptions(value) {
41
41
  return guides;
42
42
  }
43
43
 
44
- export const createHorizonPlot = action({
44
+ export const createHorizonPlot = /* @__PURE__ */ action({
45
45
  op: OPERATION, description: "Create a signed, folded horizon area with original-x guides."
46
46
  }, function (args = {}) {
47
47
  validateFacadeOptions(args, OPTIONS, OPERATION);
@@ -82,7 +82,7 @@ function applyIntervalPointPositions(program, id, config) {
82
82
  return next;
83
83
  }
84
84
 
85
- export const createIntervalPlot = action(
85
+ export const createIntervalPlot = /* @__PURE__ */ action(
86
86
  {
87
87
  op: "createIntervalPlot",
88
88
  description: "Create a center point and matching statistical or explicit interval."
@@ -139,7 +139,7 @@ const REGRESSION_OPTIONS = Object.freeze([
139
139
  "interval", "band", "line", "guides"
140
140
  ]);
141
141
 
142
- export const createRegressionPlot = action(
142
+ export const createRegressionPlot = /* @__PURE__ */ action(
143
143
  {
144
144
  op: "createRegressionPlot",
145
145
  description: "Create a scatter plot with a fitted regression line and optional interval band."
@@ -24,7 +24,7 @@ const LINE_OPTIONS = Object.freeze([
24
24
  ...STROKE_STYLE_PROPERTIES
25
25
  ]);
26
26
 
27
- export const createLinePlot = action(
27
+ export const createLinePlot = /* @__PURE__ */ action(
28
28
  {
29
29
  op: "createLinePlot",
30
30
  description: "Create a Cartesian line plot from existing chart data."
@@ -53,7 +53,7 @@ function scopeParallelGuides(guides, coordinate) {
53
53
  };
54
54
  }
55
55
 
56
- export const createParallelCoordinates = action(
56
+ export const createParallelCoordinates = /* @__PURE__ */ action(
57
57
  {
58
58
  op: "createParallelCoordinates",
59
59
  description: "Create a complete Parallel-coordinates chart."
@@ -23,7 +23,7 @@ function guideOptions(value, color) {
23
23
  return { ...guides, axes: false, grid: false };
24
24
  }
25
25
 
26
- export const createPiePlot = action({
26
+ export const createPiePlot = /* @__PURE__ */ action({
27
27
  op: OPERATION, description: "Create a categorical count or weighted-sum pie or donut plot."
28
28
  }, function (args = {}) {
29
29
  validateFacadeOptions(args, OPTIONS, OPERATION);
@@ -39,7 +39,7 @@ function position(value, operation, channel) {
39
39
  return resolved;
40
40
  }
41
41
 
42
- export const createPolarScatterPlot = action(
42
+ export const createPolarScatterPlot = /* @__PURE__ */ action(
43
43
  {
44
44
  op: "createPolarScatterPlot",
45
45
  description: "Create a Polar scatter plot with distinct radial position and glyph size."
@@ -89,7 +89,7 @@ export const createPolarScatterPlot = action(
89
89
  }
90
90
  );
91
91
 
92
- export const createPolarLinePlot = action(
92
+ export const createPolarLinePlot = /* @__PURE__ */ action(
93
93
  {
94
94
  op: "createPolarLinePlot",
95
95
  description: "Create an open or explicitly closed Polar line plot."
@@ -185,7 +185,7 @@ function scaleWithOrder(category, order, operation) {
185
185
  return { ...category, scale: { ...scale, domain: order } };
186
186
  }
187
187
 
188
- export const createRadarPlot = action(
188
+ export const createRadarPlot = /* @__PURE__ */ action(
189
189
  {
190
190
  op: "createRadarPlot",
191
191
  description: "Create a closed Radar plot from long rows or an explicit wide fold."
@@ -42,9 +42,9 @@ function createMeasuredPlot(program, args, { operation, defaultId, mapping }) {
42
42
  });
43
43
  }
44
44
 
45
- export const createRosePlot = action({ op: "createRosePlot", description: "Create equal-angle sectors with area proportional to category count or sum." }, function (args = {}) {
45
+ export const createRosePlot = /* @__PURE__ */ action({ op: "createRosePlot", description: "Create equal-angle sectors with area proportional to category count or sum." }, function (args = {}) {
46
46
  return createMeasuredPlot(this, args, { operation: "createRosePlot", defaultId: "rosePlot", mapping: "area" });
47
47
  });
48
- export const createRadialBarPlot = action({ op: "createRadialBarPlot", description: "Create equal-angle sectors with radial length proportional to category count or sum." }, function (args = {}) {
48
+ export const createRadialBarPlot = /* @__PURE__ */ action({ op: "createRadialBarPlot", description: "Create equal-angle sectors with radial length proportional to category count or sum." }, function (args = {}) {
49
49
  return createMeasuredPlot(this, args, { operation: "createRadialBarPlot", defaultId: "radialBarPlot", mapping: "radius-length" });
50
50
  });
@@ -376,7 +376,7 @@ function raincloudOwner(program, requested) {
376
376
  throw new Error("editRaincloudPlot target is ambiguous; provide target.");
377
377
  }
378
378
 
379
- export const createRaincloudPlot = action(
379
+ export const createRaincloudPlot = /* @__PURE__ */ action(
380
380
  { op: "createRaincloudPlot", description: "Create a half-density, summary, and raw-point distribution plot." },
381
381
  function (args = {}) {
382
382
  const operation = "createRaincloudPlot";
@@ -385,7 +385,7 @@ export const createRaincloudPlot = action(
385
385
  }
386
386
  );
387
387
 
388
- export const editRaincloudPlot = action(
388
+ export const editRaincloudPlot = /* @__PURE__ */ action(
389
389
  { op: "editRaincloudPlot", description: "Revise one Raincloud plot's shared source and statistical roles." },
390
390
  function (args = {}) {
391
391
  const operation = "editRaincloudPlot";
@@ -79,7 +79,7 @@ function normalizeRugGuides(value, measure, operation) {
79
79
  return { axes, grid, legend: false };
80
80
  }
81
81
 
82
- export const createRugPlot = action(
82
+ export const createRugPlot = /* @__PURE__ */ action(
83
83
  {
84
84
  op: "createRugPlot",
85
85
  description: "Create a one-dimensional Rug plot at an explicit plot edge."
@@ -206,7 +206,7 @@ function normalizeStripGuides(value, actualChannels, hasLegend, operation) {
206
206
  return { axes, grid, legend };
207
207
  }
208
208
 
209
- export const createStripPlot = action(
209
+ export const createStripPlot = /* @__PURE__ */ action(
210
210
  {
211
211
  op: "createStripPlot",
212
212
  description: "Create a one-dimensional Strip plot with an optional categorical slot and jitter."
@@ -23,7 +23,7 @@ const POINT_OPTIONS = Object.freeze([
23
23
  ...STROKE_STYLE_PROPERTIES
24
24
  ]);
25
25
 
26
- export const createScatterPlot = action(
26
+ export const createScatterPlot = /* @__PURE__ */ action(
27
27
  {
28
28
  op: "createScatterPlot",
29
29
  description: "Create a Cartesian scatter plot from existing chart data."
@@ -1,4 +1,5 @@
1
- import { action } from "../../core/action.js";
1
+ import { inheritTextMetrics } from "../textMetrics/index.js";
2
+ import { action, closedAction } from "../../core/action.js";
2
3
  import { ChartProgram as CoreChartProgram } from "../../core/ChartProgram.js";
3
4
  import { freezeOwned, isPlainObject } from "../../core/immutable.js";
4
5
  import { validateUserId } from "../../core/identifiers.js";
@@ -116,7 +117,7 @@ export function applyCompositionState(program, state, tracedChildren = []) {
116
117
  return next.materializeComposition();
117
118
  }
118
119
 
119
- const useProgram = action(
120
+ const useProgram = /* @__PURE__ */ action(
120
121
  {
121
122
  op: "useProgram",
122
123
  description: "Retain one named child program in a composition.",
@@ -131,7 +132,7 @@ const useProgram = action(
131
132
  }
132
133
  );
133
134
 
134
- const materializeComposition = action(
135
+ const materializeComposition = /* @__PURE__ */ action(
135
136
  {
136
137
  op: "materializeComposition",
137
138
  description: "Materialize retained child programs into one graphic tree.",
@@ -159,17 +160,16 @@ function concatAction(direction, op) {
159
160
  );
160
161
  }
161
162
 
162
- export const hconcatAction = concatAction("horizontal", "hconcat");
163
- export const vconcatAction = concatAction("vertical", "vconcat");
163
+ export const hconcatAction = /* @__PURE__ */ concatAction("horizontal", "hconcat");
164
+ export const vconcatAction = /* @__PURE__ */ concatAction("vertical", "vconcat");
164
165
 
165
- const editCompositionLayout = action(
166
+ const editCompositionLayout = /* @__PURE__ */ closedAction(
166
167
  {
167
168
  op: "editCompositionLayout",
168
169
  description: "Edit composition layout.",
169
170
  scope: "composition"
170
- },
171
+ }, LAYOUT_EDIT_OPTIONS,
171
172
  function (args = {}) {
172
- validateOptionObject(args, LAYOUT_EDIT_OPTIONS, "editCompositionLayout");
173
173
  if (!LAYOUT_EDIT_OPTIONS.some(option => Object.hasOwn(args, option))) {
174
174
  throw new TypeError("editCompositionLayout requires at least one layout option.");
175
175
  }
@@ -227,14 +227,13 @@ const editCompositionLayout = action(
227
227
  }
228
228
  );
229
229
 
230
- const replaceCompositionChild = action(
230
+ const replaceCompositionChild = /* @__PURE__ */ closedAction(
231
231
  {
232
232
  op: "replaceCompositionChild",
233
233
  description: "Replace one composition child without changing its slot.",
234
234
  scope: "composition"
235
- },
235
+ }, REPLACEMENT_OPTIONS,
236
236
  function (args = {}) {
237
- validateOptionObject(args, REPLACEMENT_OPTIONS, "replaceCompositionChild");
238
237
  this._assertCompositionProgram("replaceCompositionChild");
239
238
  if (this.compositionSpec.type === "facet") {
240
239
  throw new Error("replaceCompositionChild is not available on a facet composition.");
@@ -246,10 +245,10 @@ const replaceCompositionChild = action(
246
245
  if (!(args.program instanceof CoreChartProgram)) {
247
246
  throw new TypeError("replaceCompositionChild program must be a ChartProgram.");
248
247
  }
249
- const replacement = replayInheritedThemeFrames(
248
+ const replacement = inheritTextMetrics(this, replayInheritedThemeFrames(
250
249
  args.program,
251
250
  this.materializationConfigs.theme
252
- );
251
+ ));
253
252
  childDescriptor({ id: target, program: replacement });
254
253
  const children = freezeOwned({
255
254
  ...this.children,
@@ -269,14 +268,13 @@ function requireConcat(program, operation) {
269
268
  }
270
269
  }
271
270
 
272
- const insertCompositionChild = action(
271
+ const insertCompositionChild = /* @__PURE__ */ closedAction(
273
272
  {
274
273
  op: "insertCompositionChild",
275
274
  description: "Insert one named child into a concat composition.",
276
275
  scope: "composition"
277
- },
276
+ }, INSERTION_OPTIONS,
278
277
  function (args = {}) {
279
- validateOptionObject(args, INSERTION_OPTIONS, "insertCompositionChild");
280
278
  requireConcat(this, "insertCompositionChild");
281
279
  const id = validateUserId(args.id, "Composition child ID");
282
280
  if (Object.hasOwn(this.children, id)) {
@@ -288,10 +286,10 @@ const insertCompositionChild = action(
288
286
  if (args.before !== undefined && args.after !== undefined) {
289
287
  throw new Error("insertCompositionChild before and after are mutually exclusive.");
290
288
  }
291
- const inserted = replayInheritedThemeFrames(
289
+ const inserted = inheritTextMetrics(this, replayInheritedThemeFrames(
292
290
  args.program,
293
291
  this.materializationConfigs.theme
294
- );
292
+ ));
295
293
  childDescriptor({ id, program: inserted });
296
294
  const order = [...this.compositionSpec.children];
297
295
  if (args.before !== undefined || args.after !== undefined) {
@@ -310,14 +308,13 @@ const insertCompositionChild = action(
310
308
  }
311
309
  );
312
310
 
313
- const removeCompositionChild = action(
311
+ const removeCompositionChild = /* @__PURE__ */ closedAction(
314
312
  {
315
313
  op: "removeCompositionChild",
316
314
  description: "Remove one named child from a concat composition.",
317
315
  scope: "composition"
318
- },
316
+ }, REMOVAL_OPTIONS,
319
317
  function (args = {}) {
320
- validateOptionObject(args, REMOVAL_OPTIONS, "removeCompositionChild");
321
318
  requireConcat(this, "removeCompositionChild");
322
319
  const target = validateUserId(args.target, "Composition child target");
323
320
  if (!Object.hasOwn(this.children, target)) {
@@ -338,14 +335,13 @@ const removeCompositionChild = action(
338
335
  }
339
336
  );
340
337
 
341
- const reorderCompositionChildren = action(
338
+ const reorderCompositionChildren = /* @__PURE__ */ closedAction(
342
339
  {
343
340
  op: "reorderCompositionChildren",
344
341
  description: "Reorder every named child in a concat composition.",
345
342
  scope: "composition"
346
- },
343
+ }, REORDER_OPTIONS,
347
344
  function (args = {}) {
348
- validateOptionObject(args, REORDER_OPTIONS, "reorderCompositionChildren");
349
345
  requireConcat(this, "reorderCompositionChildren");
350
346
  if (!Array.isArray(args.order) || args.order.length === 0 ||
351
347
  args.order.some(id => typeof id !== "string" || id.length === 0)) {
@@ -31,7 +31,7 @@ function validateLayers(program, layers) {
31
31
  return ids;
32
32
  }
33
33
 
34
- export const createCoordinate = action(
34
+ export const createCoordinate = /* @__PURE__ */ action(
35
35
  {
36
36
  op: "createCoordinate",
37
37
  description: "Create a semantic coordinate and attach layers to it."
@@ -27,7 +27,7 @@ function applyCoordinatePatch(program, target, property, value) {
27
27
  });
28
28
  }
29
29
 
30
- export const editCoordinate = action(
30
+ export const editCoordinate = /* @__PURE__ */ action(
31
31
  {
32
32
  op: "editCoordinate",
33
33
  description: "Edit coordinate layout constraints and rematerialize its consumers."
@@ -1,6 +1,6 @@
1
- import { action } from "../../core/action.js";
1
+ import { closedAction } from "../../core/action.js";
2
2
  import { validateUserId } from "../../core/identifiers.js";
3
- import { validateKeys } from "../../core/validation.js";
3
+
4
4
  import {
5
5
  deriveBin2DRows,
6
6
  normalizeBin2DTransform
@@ -11,13 +11,12 @@ const OPTIONS = Object.freeze([
11
11
  "id", "source", "x", "y", "bins", "extent", "includeEmpty", "members", "as"
12
12
  ]);
13
13
 
14
- export const createBasicBin2DData = action(
14
+ export const createBasicBin2DData = /* @__PURE__ */ closedAction(
15
15
  {
16
16
  op: "createBin2DData",
17
17
  description: "Create immutable rectangular 2D-bin values."
18
- },
18
+ }, OPTIONS,
19
19
  function (args = {}) {
20
- validateKeys(args, OPTIONS, "createBin2DData");
21
20
  const owner = validateUserId(args.id, "2D bin dataset id");
22
21
  if (this.materializationConfigs.data?.bin2d?.[owner] !== undefined) {
23
22
  throw new Error(`2D bin owner "${owner}" already exists.`);
@@ -10,7 +10,7 @@ const OPTIONS = Object.freeze([
10
10
  "nice", "zero", "includeEmpty", "members", "as", "weight"
11
11
  ]);
12
12
 
13
- export const materializeBinData = derivedMaterializer(
13
+ export const materializeBinData = /* @__PURE__ */ derivedMaterializer(
14
14
  "materializeBinData",
15
15
  "Materialize one immutable one-dimensional bin dataset.",
16
16
  "bin",
@@ -18,7 +18,7 @@ export const materializeBinData = derivedMaterializer(
18
18
  resolveBinTransform
19
19
  );
20
20
 
21
- export const createBinData = derivedCreator(
21
+ export const createBinData = /* @__PURE__ */ derivedCreator(
22
22
  "createBinData",
23
23
  "Create reusable one-dimensional bin bounds, counts, and members.",
24
24
  OPTIONS,
@@ -1,6 +1,6 @@
1
- import { action } from "../../core/action.js";
1
+ import { closedAction } from "../../core/action.js";
2
2
  import { validateUserId } from "../../core/identifiers.js";
3
- import { validateKeys } from "../../core/validation.js";
3
+
4
4
  import {
5
5
  deriveBin2DRows,
6
6
  normalizeBin2DTransform,
@@ -126,13 +126,12 @@ function applyBin2DRevision(program, {
126
126
  });
127
127
  }
128
128
 
129
- export const createBin2DData = action(
129
+ export const createBin2DData = /* @__PURE__ */ closedAction(
130
130
  {
131
131
  op: "createBin2DData",
132
132
  description: "Create or revise immutable rectangular 2D-bin values."
133
- },
133
+ }, OPTIONS,
134
134
  function (args = {}) {
135
- validateKeys(args, OPTIONS, "createBin2DData");
136
135
  const owner = validateUserId(args.id, "2D bin dataset id");
137
136
  const config = ownerConfig(this, owner);
138
137
  const previous = config === undefined
@@ -168,13 +167,12 @@ export const createBin2DData = action(
168
167
  }
169
168
  );
170
169
 
171
- export const editBin2DData = action(
170
+ export const editBin2DData = /* @__PURE__ */ closedAction(
172
171
  {
173
172
  op: "editBin2DData",
174
173
  description: "Partially revise one logical rectangular 2D-bin owner."
175
- },
174
+ }, EDIT_OPTIONS,
176
175
  function (args = {}) {
177
- validateKeys(args, EDIT_OPTIONS, "editBin2DData");
178
176
  if (!EDITABLE.some(option => Object.hasOwn(args, option))) {
179
177
  throw new Error("editBin2DData requires at least one transform or source option.");
180
178
  }
@@ -1,15 +1,14 @@
1
- import { action } from "../../core/action.js";
2
- import { validateKeys } from "../../core/validation.js";
1
+ import { closedAction } from "../../core/action.js";
2
+
3
3
  import { deriveBin2DRows } from "../../grammar/bin2d.js";
4
4
  import { MATERIALIZE_OPTIONS, requireDerivedDataset } from "./shared.js";
5
5
 
6
- export const materializeBin2DData = action(
6
+ export const materializeBin2DData = /* @__PURE__ */ closedAction(
7
7
  {
8
8
  op: "materializeBin2DData",
9
9
  description: "Materialize one immutable rectangular 2D-bin dataset."
10
- },
10
+ }, MATERIALIZE_OPTIONS,
11
11
  function (args = {}) {
12
- validateKeys(args, MATERIALIZE_OPTIONS, "materializeBin2DData");
13
12
  const { id, source, transform } = requireDerivedDataset(
14
13
  this,
15
14
  args.id,
@@ -14,8 +14,8 @@ function materializer(type, op, select) {
14
14
  );
15
15
  }
16
16
 
17
- export const materializeBoxSummaryData = materializer("boxSummary", "materializeBoxSummaryData", value => value.summaries);
18
- export const materializeBoxOutlierData = materializer("boxOutlier", "materializeBoxOutlierData", value => value.outliers);
17
+ export const materializeBoxSummaryData = /* @__PURE__ */ materializer("boxSummary", "materializeBoxSummaryData", value => value.summaries);
18
+ export const materializeBoxOutlierData = /* @__PURE__ */ materializer("boxOutlier", "materializeBoxOutlierData", value => value.outliers);
19
19
 
20
20
  function creator(type, op, materialize) {
21
21
  return derivedCreator(
@@ -36,5 +36,5 @@ function creator(type, op, materialize) {
36
36
  );
37
37
  }
38
38
 
39
- export const createBoxSummaryData = creator("boxSummary", "createBoxSummaryData", "materializeBoxSummaryData");
40
- export const createBoxOutlierData = creator("boxOutlier", "createBoxOutlierData", "materializeBoxOutlierData");
39
+ export const createBoxSummaryData = /* @__PURE__ */ creator("boxSummary", "createBoxSummaryData", "materializeBoxSummaryData");
40
+ export const createBoxOutlierData = /* @__PURE__ */ creator("boxOutlier", "createBoxOutlierData", "materializeBoxOutlierData");
@@ -8,14 +8,14 @@ const OPTIONS = Object.freeze([
8
8
  "id", "source", "key", "groupBy", "values", "sequence", "fill", "members"
9
9
  ]);
10
10
 
11
- export const materializeCompleteData = derivedMaterializer(
11
+ export const materializeCompleteData = /* @__PURE__ */ derivedMaterializer(
12
12
  "materializeCompleteData",
13
13
  "Materialize one immutable completed-key dataset.",
14
14
  "complete",
15
15
  deriveCompleteRows
16
16
  );
17
17
 
18
- export const createCompleteData = derivedCreator(
18
+ export const createCompleteData = /* @__PURE__ */ derivedCreator(
19
19
  "createCompleteData",
20
20
  "Complete one key domain independently within observed groups.",
21
21
  OPTIONS,