ggaction 0.0.16 → 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 (299) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +3 -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 +10 -4
  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/bin.js +1 -1
  34. package/src/actions/data/box.js +2 -1
  35. package/src/actions/data/create.js +18 -5
  36. package/src/actions/data/density.js +1 -1
  37. package/src/actions/data/derived.js +15 -1
  38. package/src/actions/data/edit.js +20 -7
  39. package/src/actions/data/filter.js +15 -4
  40. package/src/actions/data/index.js +3 -0
  41. package/src/actions/data/interval.js +2 -0
  42. package/src/actions/data/regression.js +6 -2
  43. package/src/actions/data/revise.js +37 -5
  44. package/src/actions/data/shared.js +33 -4
  45. package/src/actions/data/sort.js +21 -0
  46. package/src/actions/data/stack.js +3 -1
  47. package/src/actions/data/summary.js +1 -1
  48. package/src/actions/encodings/angle.js +4 -1
  49. package/src/actions/encodings/appearance.js +43 -31
  50. package/src/actions/encodings/barWidth.js +36 -11
  51. package/src/actions/encodings/channels.js +0 -1
  52. package/src/actions/encodings/color/continuous.js +5 -2
  53. package/src/actions/encodings/color/index.js +5 -2
  54. package/src/actions/encodings/color/policy.js +10 -3
  55. package/src/actions/encodings/density/resolve.js +1 -6
  56. package/src/actions/encodings/offset.js +4 -1
  57. package/src/actions/encodings/position/policies/arc.js +12 -10
  58. package/src/actions/encodings/position/policies/area.js +3 -3
  59. package/src/actions/encodings/position/policies/bar.js +15 -6
  60. package/src/actions/encodings/position/policies/line.js +17 -6
  61. package/src/actions/encodings/position/resolve.js +9 -3
  62. package/src/actions/encodings/ranged.js +23 -1
  63. package/src/actions/encodings/remove.js +3 -2
  64. package/src/actions/encodings/ruleAppearance.js +4 -1
  65. package/src/actions/encodings/seriesLayout.js +1 -0
  66. package/src/actions/encodings/stroke.js +4 -1
  67. package/src/actions/encodings/strokeDash.js +6 -1
  68. package/src/actions/encodings/text.js +12 -4
  69. package/src/actions/errorBands/create.js +2 -2
  70. package/src/actions/errorBands/edit.js +2 -1
  71. package/src/actions/facets/actions.js +158 -240
  72. package/src/actions/gradientPlots/resolve.js +2 -17
  73. package/src/actions/guides/applicability.js +1 -1
  74. package/src/actions/guides/axes/axis.js +16 -4
  75. package/src/actions/guides/axes/edit.js +4 -4
  76. package/src/actions/guides/axes/labels.js +120 -46
  77. package/src/actions/guides/axes/lines.js +6 -5
  78. package/src/actions/guides/axes/parallel/lifecycle.js +1 -1
  79. package/src/actions/guides/axes/parallel/policy.js +8 -7
  80. package/src/actions/guides/axes/remove.js +3 -2
  81. package/src/actions/guides/axes/tickGroups.js +5 -2
  82. package/src/actions/guides/axes/ticks.js +6 -3
  83. package/src/actions/guides/axes/titles.js +71 -26
  84. package/src/actions/guides/basic.js +2 -0
  85. package/src/actions/guides/facadeLegend.js +10 -2
  86. package/src/actions/guides/grids/grid.js +7 -1
  87. package/src/actions/guides/grids/resolve.js +59 -12
  88. package/src/actions/guides/legends/blocks.js +3 -1
  89. package/src/actions/guides/legends/categorical/actions.js +70 -17
  90. package/src/actions/guides/legends/categorical/components.js +12 -8
  91. package/src/actions/guides/legends/categorical/index.js +6 -0
  92. package/src/actions/guides/legends/categorical/layout.js +37 -8
  93. package/src/actions/guides/legends/categorical/options.js +31 -20
  94. package/src/actions/guides/legends/categorical/resolve.js +2 -2
  95. package/src/actions/guides/legends/categorical/symbols.js +18 -12
  96. package/src/actions/guides/legends/categorical/validation.js +1 -6
  97. package/src/actions/guides/legends/continuous/colorSymbols.js +1 -0
  98. package/src/actions/guides/legends/continuous/common.js +1 -447
  99. package/src/actions/guides/legends/continuous/gradient.js +47 -34
  100. package/src/actions/guides/legends/continuous/interval.js +4 -4
  101. package/src/actions/guides/legends/continuous/opacity.js +19 -12
  102. package/src/actions/guides/legends/edit.js +1 -604
  103. package/src/actions/guides/legends/focused.js +2 -2
  104. package/src/actions/guides/legends/group.js +1 -0
  105. package/src/actions/guides/legends/lane.js +1 -516
  106. package/src/actions/guides/legends/remove.js +3 -0
  107. package/src/actions/guides/legends/sampling.js +1 -1
  108. package/src/actions/guides/legends/size.js +51 -43
  109. package/src/actions/guides/legends/strokeWidth.js +11 -29
  110. package/src/actions/guides/legends/target.js +3 -3
  111. package/src/actions/guides/legends/transition.js +21 -7
  112. package/src/actions/guides/polar/axes/labels.js +4 -2
  113. package/src/actions/guides/polar/axes/titles.js +7 -5
  114. package/src/actions/guides/polar/resolve.js +6 -14
  115. package/src/actions/index.js +16 -16
  116. package/src/actions/marks/arc/actions.js +3 -10
  117. package/src/actions/marks/area/actions.js +8 -5
  118. package/src/actions/marks/area/materialize.js +8 -9
  119. package/src/actions/marks/bar/create.js +17 -4
  120. package/src/actions/marks/bar/edit.js +18 -7
  121. package/src/actions/marks/bar/materialize.js +9 -6
  122. package/src/actions/marks/line/actions.js +11 -4
  123. package/src/actions/marks/line/materialize.js +9 -5
  124. package/src/actions/marks/point/create.js +8 -1
  125. package/src/actions/marks/point/edit.js +13 -6
  126. package/src/actions/marks/point/materialize.js +4 -2
  127. package/src/actions/marks/rect/actions.js +26 -11
  128. package/src/actions/marks/remove.js +2 -0
  129. package/src/actions/marks/rule/actions.js +31 -12
  130. package/src/actions/marks/text/actions.js +42 -11
  131. package/src/actions/marks/text/layout.js +3 -0
  132. package/src/actions/marks/tick/actions.js +23 -8
  133. package/src/actions/primitives/semanticAction.js +37 -3
  134. package/src/actions/primitives/semanticValidation/dataset.js +13 -1
  135. package/src/actions/primitives/semanticValidation/layer.js +26 -2
  136. package/src/actions/primitives/semanticValidation/scale.js +6 -0
  137. package/src/actions/regression/create.js +26 -5
  138. package/src/actions/regression/edit.js +50 -15
  139. package/src/actions/regression/follow.js +22 -0
  140. package/src/actions/regression/resolve.js +2 -6
  141. package/src/actions/scales/channels.js +20 -15
  142. package/src/actions/scales/consumers/common.js +2 -1
  143. package/src/actions/scales/consumers/families.js +16 -5
  144. package/src/actions/scales/create.js +10 -4
  145. package/src/actions/scales/definitions.js +1 -425
  146. package/src/actions/scales/edit.js +3 -3
  147. package/src/actions/scales/editPolicy.js +9 -3
  148. package/src/actions/scales/materialize.js +1 -1
  149. package/src/actions/scales/parallel.js +1 -1
  150. package/src/actions/scales/patch.js +1 -1
  151. package/src/actions/scales/preview.js +49 -2
  152. package/src/actions/scales/quantitativeColor.js +3 -3
  153. package/src/actions/selection/actions.js +1 -13
  154. package/src/actions/theme/reconcile.js +83 -27
  155. package/src/actions/theme/state.js +12 -0
  156. package/src/actions/titles/actions.js +5 -18
  157. package/src/actions/titles/resolve.js +41 -19
  158. package/src/actions/violinPlots/edit.js +3 -20
  159. package/src/core/action.js +3 -2
  160. package/src/core/compositionState.js +4 -1
  161. package/src/core/font.js +9 -2
  162. package/src/core/optionRequirements.js +1 -0
  163. package/src/core/programState.js +5 -1
  164. package/src/core/resourceReferences.js +3 -0
  165. package/src/core/textMetricProfile.js +3 -2
  166. package/src/core/textMetrics.js +41 -4
  167. package/src/core/validation.js +26 -0
  168. package/src/core/vocabulary.js +4 -0
  169. package/src/grammar/aggregate.js +4 -18
  170. package/src/grammar/arcs.js +1 -386
  171. package/src/grammar/areaPaint.js +10 -0
  172. package/src/grammar/areaSeries.js +18 -10
  173. package/src/grammar/bars/geometry.js +30 -3
  174. package/src/grammar/bars/policy.js +12 -1
  175. package/src/grammar/bin.js +41 -22
  176. package/src/grammar/bin2d.js +1 -6
  177. package/src/grammar/boxPlot.js +56 -9
  178. package/src/grammar/categoryOrder.js +1 -6
  179. package/src/grammar/complete.js +15 -19
  180. package/src/grammar/computed.js +92 -25
  181. package/src/grammar/curveCommands.js +29 -16
  182. package/src/grammar/datasetSchema.js +382 -0
  183. package/src/grammar/density.js +53 -5
  184. package/src/grammar/displayLabels.js +28 -0
  185. package/src/grammar/ecdf.js +2 -9
  186. package/src/grammar/facets/dependencies.js +6 -2
  187. package/src/grammar/facets/guides.js +5 -0
  188. package/src/grammar/facets/index.js +2 -5
  189. package/src/grammar/filter.js +133 -39
  190. package/src/grammar/fold.js +2 -12
  191. package/src/grammar/gradientProfile.js +1 -6
  192. package/src/grammar/impute.js +21 -48
  193. package/src/grammar/interval.js +34 -10
  194. package/src/grammar/itemMissing.js +59 -0
  195. package/src/grammar/legendGradient.js +18 -0
  196. package/src/grammar/legendGroups.js +1 -0
  197. package/src/grammar/legendTitleStyle.js +22 -0
  198. package/src/grammar/lineSeries.js +32 -17
  199. package/src/grammar/markLabels.js +5 -2
  200. package/src/grammar/normalize.js +4 -54
  201. package/src/grammar/numeric.js +1 -290
  202. package/src/grammar/parallelCoordinates.js +1 -6
  203. package/src/grammar/parseTime.js +41 -0
  204. package/src/grammar/pathCommands.js +11 -4
  205. package/src/grammar/polar.js +1 -184
  206. package/src/grammar/positionCompatibility.js +3 -3
  207. package/src/grammar/regression/derive.js +63 -16
  208. package/src/grammar/regression/index.js +1 -0
  209. package/src/grammar/regression/models.js +116 -59
  210. package/src/grammar/regression/parameters.js +69 -6
  211. package/src/grammar/roundedRect.js +42 -54
  212. package/src/grammar/scales/appearance.js +1 -206
  213. package/src/grammar/scales/color.js +1 -382
  214. package/src/grammar/scales/colorConsumers.js +5 -2
  215. package/src/grammar/scales/definition.js +1 -190
  216. package/src/grammar/scales/discretized.js +1 -195
  217. package/src/grammar/scales/size.js +1 -456
  218. package/src/grammar/scales/temporal.js +2 -13
  219. package/src/grammar/scales/transformed.js +1 -383
  220. package/src/grammar/scales/types.js +1 -1
  221. package/src/grammar/scales/validation.js +1 -66
  222. package/src/grammar/schemas/concreteGraphic.js +11 -0
  223. package/src/grammar/schemas/graphic.js +3 -0
  224. package/src/grammar/schemas/semanticPath.js +5 -3
  225. package/src/grammar/sort.js +88 -0
  226. package/src/grammar/stack.js +2 -10
  227. package/src/grammar/statisticalReference.js +1 -6
  228. package/src/grammar/summary.js +120 -45
  229. package/src/grammar/text.js +19 -0
  230. package/src/grammar/timeUnit.js +16 -7
  231. package/src/grammar/transformKeys.js +47 -0
  232. package/src/grammar/transformTopology.js +1 -0
  233. package/src/grammar/transforms.js +25 -12
  234. package/src/grammar/valueFormat.js +17 -5
  235. package/src/grammar/weightedStatistics.js +1 -6
  236. package/src/grammar/window.js +4 -58
  237. package/src/inspection.js +495 -0
  238. package/src/inspectionDescriptors.js +3 -0
  239. package/src/layout/canvas.js +1 -110
  240. package/src/layout/facets.js +1 -244
  241. package/src/layout/labels.js +1 -0
  242. package/src/layout/legend.js +13 -0
  243. package/src/layout/legendGroup.js +1 -0
  244. package/src/layout/legendItems.js +59 -15
  245. package/src/layout/legendLane.js +1 -441
  246. package/src/layout/legendText.js +1 -0
  247. package/src/layout/title.js +35 -13
  248. package/src/materialization/bars/aggregate.js +11 -5
  249. package/src/materialization/bars/histogram.js +4 -1
  250. package/src/materialization/bars/ranged.js +19 -6
  251. package/src/materialization/bars/resolve.js +26 -3
  252. package/src/materialization/coordinateBounds.js +8 -0
  253. package/src/materialization/dependencies.js +4 -44
  254. package/src/materialization/facetGuides/layout.js +1 -0
  255. package/src/materialization/facetGuides/placement.js +19 -8
  256. package/src/materialization/facetGuides/preparation.js +15 -7
  257. package/src/materialization/facetHeaders.js +1 -347
  258. package/src/materialization/facets.js +1 -185
  259. package/src/materialization/graphicHierarchy.js +1 -1
  260. package/src/materialization/guides/layout.js +1 -57
  261. package/src/materialization/guides/resources.js +1 -123
  262. package/src/materialization/layout.js +53 -0
  263. package/src/materialization/legendGroups.js +1 -0
  264. package/src/materialization/legendText.js +1 -0
  265. package/src/materialization/legends.js +1 -1
  266. package/src/materialization/marks/capabilities.js +5 -6
  267. package/src/materialization/rect.js +1 -1
  268. package/src/materialization/revisionIdentity.js +19 -0
  269. package/src/materialization/scaleGuideDependencies.js +1 -1
  270. package/src/materialization/scales/map.js +3 -0
  271. package/src/materialization/scales/policies/arc.js +8 -7
  272. package/src/materialization/scales/policies/bar.js +19 -7
  273. package/src/materialization/scales/policies/series.js +2 -1
  274. package/src/materialization/scales/resolve.js +72 -7
  275. package/src/materialization/selection/items/arc.js +1 -1
  276. package/src/materialization/selection/items/bar.js +7 -6
  277. package/src/materialization/selection/items/path.js +7 -6
  278. package/src/materialization/selection/items/rect.js +2 -2
  279. package/src/materialization/text.js +17 -6
  280. package/src/materialization/textLines.js +15 -0
  281. package/src/persistence/codec.js +37 -6
  282. package/src/persistence/validation.js +47 -0
  283. package/src/persistence.js +94 -8
  284. package/src/renderers/canvas/circle.js +6 -3
  285. package/src/renderers/canvas/fill.js +7 -1
  286. package/src/renderers/canvas/index.js +2 -1
  287. package/src/renderers/canvas/line.js +1 -0
  288. package/src/renderers/canvas/path.js +1 -1
  289. package/src/renderers/canvas/rect.js +11 -8
  290. package/src/renderers/canvas/stroke.js +2 -1
  291. package/src/renderers/canvas/text.js +5 -3
  292. package/src/renderers/svg.js +4 -1
  293. package/src/selectors/layers.js +19 -0
  294. package/src/theme/defaults.js +8 -2
  295. package/src/version.js +1 -1
  296. package/types/basic.d.ts +1 -0
  297. package/types/index.d.ts +7 -0
  298. package/types/inspection.d.ts +17 -0
  299. package/types/program.d.ts +494 -112
@@ -135,7 +135,7 @@ export const createIntervalPlot = /* @__PURE__ */ action(
135
135
 
136
136
  const REGRESSION_OPTIONS = Object.freeze([
137
137
  "id", "data", "coordinate", "x", "y", "color", "size", "shape", "point",
138
- "groupBy", "method", "degree", "span", "confidenceMethod", "level", "confidence",
138
+ "groupBy", "method", "degree", "span", "robustIterations", "confidenceMethod", "level", "confidence",
139
139
  "interval", "band", "line", "guides"
140
140
  ]);
141
141
 
@@ -163,7 +163,7 @@ export const createRegressionPlot = /* @__PURE__ */ action(
163
163
  guides: false
164
164
  });
165
165
  const regression = Object.fromEntries([
166
- "groupBy", "method", "degree", "span", "confidenceMethod", "level",
166
+ "groupBy", "method", "degree", "span", "robustIterations", "confidenceMethod", "level",
167
167
  "confidence", "interval", "band", "line"
168
168
  ].filter(key => Object.hasOwn(args, key)).map(key => [key, args[key]]));
169
169
  next = next.createRegression({ target: id, ...regression });
@@ -20,7 +20,7 @@ const OPTIONS = Object.freeze([
20
20
  "strokeDash", "line", "guides"
21
21
  ]);
22
22
  const LINE_OPTIONS = Object.freeze([
23
- "strokeWidth", "curve", "stroke", "opacity", "closed",
23
+ "strokeWidth", "curve", "tension", "stroke", "opacity", "closed",
24
24
  ...STROKE_STYLE_PROPERTIES
25
25
  ]);
26
26
 
@@ -1,52 +1,8 @@
1
1
  import { action } from "../../core/action.js";
2
- import { STROKE_STYLE_PROPERTIES } from "../../grammar/strokeStyle.js";
3
- import {
4
- applyFacadeGuides, normalizeAppearance, normalizeCategoricalColor, normalizeCategoricalGuides,
5
- normalizeArcCategory, normalizeCategoryAggregate, omitUndefinedOptions,
6
- resolveFacadeData, resolveFacadeId, validateFacadeOptions
7
- } from "./shared.js";
8
-
9
- const OPERATION = "createPiePlot";
10
- const OPTIONS = ["id", "data", "coordinate", "category", "value", "aggregate", "color", "arc", "guides"];
11
- const ARC_OPTIONS = [
12
- "innerRadius", "padAngle", "fill", "opacity", "stroke", "strokeWidth",
13
- ...STROKE_STYLE_PROPERTIES
14
- ];
15
- function guideOptions(value, color) {
16
- const guides = normalizeCategoricalGuides(value, OPERATION, color);
17
- if (guides === false) return false;
18
- for (const key of ["axes", "grid"]) {
19
- if (guides[key] !== undefined && guides[key] !== false) {
20
- throw new TypeError(`${OPERATION} guides.${key} only accepts false.`);
21
- }
22
- }
23
- return { ...guides, axes: false, grid: false };
24
- }
2
+ import { createArcPlot } from "./radial.js";
25
3
 
26
4
  export const createPiePlot = /* @__PURE__ */ action({
27
- op: OPERATION, description: "Create a categorical count or weighted-sum pie or donut plot."
5
+ op: "createPiePlot", description: "Create a categorical count or weighted-sum pie or donut plot."
28
6
  }, function (args = {}) {
29
- validateFacadeOptions(args, OPTIONS, OPERATION);
30
- const id = resolveFacadeId(this, args.id, { defaultId: "piePlot", operation: OPERATION });
31
- const data = resolveFacadeData(this, args.data, OPERATION);
32
- const category = normalizeArcCategory(args.category, OPERATION);
33
- const aggregate = normalizeCategoryAggregate(args, OPERATION);
34
- const arc = omitUndefinedOptions(normalizeAppearance(args.arc, ARC_OPTIONS, `${OPERATION} arc`));
35
- const color = args.color === false ? undefined
36
- : normalizeCategoricalColor(args.color === undefined ? category.field : args.color, `${OPERATION} color`);
37
- if (color !== undefined && arc.fill !== undefined) {
38
- throw new Error(`${OPERATION} arc.fill cannot be combined with color; use color:false.`);
39
- }
40
- const guides = guideOptions(args.guides, color);
41
- let next = this.createArcMark({ id, data, ...arc }).encodeTheta({
42
- ...category, target: id, aggregate,
43
- ...(args.coordinate === undefined ? {} : { coordinate: args.coordinate }),
44
- ...(aggregate === "sum" ? { weight: args.value } : {})
45
- });
46
- if (color !== undefined) next = next.encodeColor({ ...color, target: id });
47
- next = applyFacadeGuides(next, guides, id, args.guides ?? {});
48
- return next._withMarkConfig(id, {
49
- ...next.markConfigs[id],
50
- compositionRole: "pie"
51
- });
7
+ return createArcPlot(this, args, { operation: "createPiePlot", defaultId: "piePlot" });
52
8
  });
@@ -1,3 +1,4 @@
1
+ import { findSemanticScale } from "../../selectors/scales.js";
1
2
  import { action } from "../../core/action.js";
2
3
  import { STROKE_STYLE_PROPERTIES } from "../../grammar/strokeStyle.js";
3
4
  import {
@@ -6,21 +7,22 @@ import {
6
7
  resolveFacadeData, resolveFacadeId, validateFacadeOptions
7
8
  } from "./shared.js";
8
9
 
9
- const OPTIONS = ["id", "data", "coordinate", "category", "value", "aggregate", "radiusScale", "color", "arc", "guides"];
10
+ const OPTIONS = ["id", "data", "coordinate", "category", "value", "aggregate", "color", "arc", "guides"];
10
11
  const ARC_OPTIONS = [
11
12
  "innerRadius", "padAngle", "fill", "opacity", "stroke", "strokeWidth",
12
13
  ...STROKE_STYLE_PROPERTIES
13
14
  ];
14
15
  const RADIUS_OPTIONS = ["id", "type", "domain", "range", "zero", "nice", "reverse", "clamp"];
15
16
 
16
- function createMeasuredPlot(program, args, { operation, defaultId, mapping }) {
17
- validateFacadeOptions(args, OPTIONS, operation);
17
+ export function createArcPlot(program, args, { operation, defaultId, mapping }) {
18
+ const measured = mapping !== undefined;
19
+ validateFacadeOptions(args, [...OPTIONS, measured ? "radiusScale" : "radius"], operation);
18
20
  const id = resolveFacadeId(program, args.id, { defaultId, operation });
19
21
  const data = resolveFacadeData(program, args.data, operation);
20
22
  const category = normalizeArcCategory(args.category, operation);
21
23
  const aggregate = normalizeCategoryAggregate(args, operation);
22
24
  const arc = omitUndefinedOptions(normalizeAppearance(args.arc, ARC_OPTIONS, `${operation} arc`));
23
- if (arc.padAngle !== undefined && arc.padAngle !== 0) throw new Error(`${operation} requires padAngle 0.`);
25
+ if (measured && arc.padAngle !== undefined && arc.padAngle !== 0) throw new Error(`${operation} requires padAngle 0.`);
24
26
  const radiusScale = args.radiusScale === undefined ? undefined
25
27
  : omitUndefinedOptions(normalizeAppearance(args.radiusScale, RADIUS_OPTIONS, `${operation} radiusScale`));
26
28
  const color = args.color === false ? undefined
@@ -28,23 +30,43 @@ function createMeasuredPlot(program, args, { operation, defaultId, mapping }) {
28
30
  if (color !== undefined && arc.fill !== undefined) {
29
31
  throw new Error(`${operation} arc.fill cannot be combined with color; use color:false.`);
30
32
  }
31
- const guides = normalizeCategoricalGuides(args.guides, operation, color);
33
+ let guides = normalizeCategoricalGuides(args.guides, operation, color);
34
+ if (!measured && guides !== false) {
35
+ for (const key of ["axes", "grid"]) {
36
+ if (guides[key] !== undefined && guides[key] !== false) {
37
+ throw new TypeError(`${operation} guides.${key} only accepts false.`);
38
+ }
39
+ }
40
+ guides = { ...guides, axes: false, grid: false };
41
+ }
32
42
  let next = program.createArcMark({ id, data, ...arc }).encodeTheta({
33
- ...category, target: id, ...(args.coordinate === undefined ? {} : { coordinate: args.coordinate })
34
- }).encodeR({ target: id, aggregate, mapping,
35
- ...(aggregate === "sum" ? { field: args.value } : {}),
36
- ...(radiusScale === undefined ? {} : { scale: radiusScale }) });
43
+ ...category, target: id, ...(args.coordinate === undefined ? {} : { coordinate: args.coordinate }),
44
+ ...(!measured ? { aggregate, ...(aggregate === "sum" ? { weight: args.value } : {}) } : {})
45
+ });
46
+ if (measured) {
47
+ next = next.encodeR({ target: id, aggregate, mapping,
48
+ ...(aggregate === "sum" ? { field: args.value } : {}),
49
+ ...(radiusScale === undefined ? {} : { scale: radiusScale }) });
50
+ } else if (args.radius !== undefined) {
51
+ const radius = typeof args.radius === "string" ? { field: args.radius }
52
+ : normalizeAppearance(args.radius, ["field", "aggregate", "scale"], `${operation} radius`);
53
+ const scale = radius.scale ?? {};
54
+ next = next.encodeR({ target: id, ...omitUndefinedOptions(radius), scale: {
55
+ ...(scale.type !== "log" && findSemanticScale(next, scale.id ?? "radius") === undefined ? { zero: true } : {}),
56
+ ...scale
57
+ } });
58
+ }
37
59
  if (color !== undefined) next = next.encodeColor({ ...color, target: id });
38
60
  next = applyFacadeGuides(next, guides, id, args.guides ?? {});
39
61
  return next._withMarkConfig(id, {
40
62
  ...next.markConfigs[id],
41
- compositionRole: "rose"
63
+ compositionRole: measured ? "rose" : "pie"
42
64
  });
43
65
  }
44
66
 
45
67
  export const createRosePlot = /* @__PURE__ */ action({ op: "createRosePlot", description: "Create equal-angle sectors with area proportional to category count or sum." }, function (args = {}) {
46
- return createMeasuredPlot(this, args, { operation: "createRosePlot", defaultId: "rosePlot", mapping: "area" });
68
+ return createArcPlot(this, args, { operation: "createRosePlot", defaultId: "rosePlot", mapping: "area" });
47
69
  });
48
70
  export const createRadialBarPlot = /* @__PURE__ */ action({ op: "createRadialBarPlot", description: "Create equal-angle sectors with radial length proportional to category count or sum." }, function (args = {}) {
49
- return createMeasuredPlot(this, args, { operation: "createRadialBarPlot", defaultId: "radialBarPlot", mapping: "radius-length" });
71
+ return createArcPlot(this, args, { operation: "createRadialBarPlot", defaultId: "radialBarPlot", mapping: "radius-length" });
50
72
  });
@@ -1,3 +1,4 @@
1
+ import { encodeStroke } from "../encodings/stroke.js";
1
2
  import { action } from "../../core/action.js";
2
3
  import { validateNonNegativeFinite } from "../../core/validation.js";
3
4
  import { STROKE_STYLE_PROPERTIES } from "../../grammar/strokeStyle.js";
@@ -15,7 +16,7 @@ import {
15
16
  } from "./shared.js";
16
17
 
17
18
  const OPTIONS = Object.freeze([
18
- "id", "data", "coordinate", "x", "y", "color", "size", "shape",
19
+ "id", "data", "coordinate", "x", "y", "color", "stroke", "size", "shape",
19
20
  "point", "guides"
20
21
  ]);
21
22
  const POINT_OPTIONS = Object.freeze([
@@ -43,6 +44,13 @@ export const createScatterPlot = /* @__PURE__ */ action(
43
44
  const x = normalizeFieldEncoding(args.x, "createScatterPlot x");
44
45
  const y = normalizeFieldEncoding(args.y, "createScatterPlot y");
45
46
  const color = normalizeEncoding(args.color, "createScatterPlot color");
47
+ const stroke = normalizeEncoding(args.stroke, "createScatterPlot stroke");
48
+ if (stroke !== undefined) {
49
+ if (typeof stroke.field !== "string" || stroke.field.length === 0 || Object.hasOwn(stroke, "value")) {
50
+ throw new TypeError("createScatterPlot stroke requires a field; constant stroke belongs in point.");
51
+ }
52
+ if (Object.hasOwn(point, "stroke")) throw new Error("createScatterPlot stroke conflicts with point.stroke.");
53
+ }
46
54
  const size = normalizeEncoding(args.size, "createScatterPlot size");
47
55
  const shape = normalizeEncoding(args.shape, "createScatterPlot shape");
48
56
  const guides = normalizeGuides(args.guides, "createScatterPlot");
@@ -51,12 +59,18 @@ export const createScatterPlot = /* @__PURE__ */ action(
51
59
  if (size !== undefined) throw new Error("createScatterPlot point radius conflicts with size.");
52
60
  }
53
61
 
62
+ const initialPoint = { ...point };
63
+ if (stroke !== undefined) delete initialPoint.strokeWidth;
54
64
  let next = this
55
- .createPointMark({ id, data, ...point })
65
+ .createPointMark({ id, data, ...initialPoint })
56
66
  .encodeX(positionArgs(x, { target: id, coordinate: args.coordinate }))
57
67
  .encodeY(positionArgs(y, { target: id, coordinate: args.coordinate }));
58
68
  if (radius !== undefined) next = next.encodePointRadius({ target: id, value: radius });
59
69
  if (color !== undefined) next = next.encodeColor(targetArgs(color, id));
70
+ if (stroke !== undefined) {
71
+ next = encodeStroke.call(next, targetArgs(stroke, id));
72
+ if (Object.hasOwn(point, "strokeWidth")) next = next.editPointMark({ target: id, strokeWidth: point.strokeWidth });
73
+ }
60
74
  if (size !== undefined) next = next.encodeSize(targetArgs(size, id));
61
75
  if (shape !== undefined) next = next.encodeShape(targetArgs(shape, id));
62
76
  return applyFacadeGuides(next, guides, id);
@@ -191,9 +191,9 @@ export function normalizeArcCategory(value, operation) {
191
191
  }
192
192
 
193
193
  export function normalizeCategoryAggregate(args, operation) {
194
- const aggregate = args.aggregate === undefined ? "count" : args.aggregate;
194
+ const aggregate = args.aggregate === undefined ? args.value === undefined ? "count" : "sum" : args.aggregate;
195
195
  if (!["count", "sum"].includes(aggregate) || (aggregate === "sum") !== (args.value !== undefined)) {
196
- throw new Error(`${operation} requires count without value or explicit sum with value.`);
196
+ throw new Error(`${operation} requires count without value or sum with value.`);
197
197
  }
198
198
  if (args.value !== undefined) validateNonEmptyString(args.value, `${operation} value`);
199
199
  return aggregate;
@@ -0,0 +1,35 @@
1
+ import { action } from "../../core/action.js";
2
+ import { TEXT_MARK_STYLE_OPTIONS } from "../../grammar/text.js";
3
+ import {
4
+ applyFacadeGuides, normalizeAppearance, normalizeEncoding, normalizeFieldEncoding,
5
+ normalizeGuides, positionArgs, resolveFacadeData, resolveFacadeId, targetArgs,
6
+ validateFacadeOptions
7
+ } from "./shared.js";
8
+
9
+ const OPTIONS = Object.freeze(["id", "data", "coordinate", "x", "y", "text", "color", "style", "guides"]);
10
+ const STYLE_OPTIONS = Object.freeze(["missing", ...TEXT_MARK_STYLE_OPTIONS.filter(key => key !== "inheritColor")]);
11
+
12
+ export const createTextPlot = /* @__PURE__ */ action({
13
+ op: "createTextPlot", description: "Create a Cartesian text plot from existing chart data."
14
+ }, function (args = {}) {
15
+ validateFacadeOptions(args, OPTIONS, "createTextPlot");
16
+ const id = resolveFacadeId(this, args.id, { defaultId: "textPlot", operation: "createTextPlot" });
17
+ const data = resolveFacadeData(this, args.data, "createTextPlot");
18
+ const x = normalizeFieldEncoding(args.x, "createTextPlot x");
19
+ const y = normalizeFieldEncoding(args.y, "createTextPlot y");
20
+ const text = normalizeEncoding(args.text, "createTextPlot text");
21
+ if (text === undefined) throw new Error("createTextPlot requires text.");
22
+ const color = normalizeEncoding(args.color, "createTextPlot color");
23
+ const style = normalizeAppearance(args.style, STYLE_OPTIONS, "createTextPlot style");
24
+ const guides = normalizeGuides(args.guides, "createTextPlot");
25
+ const apply = program => {
26
+ let next = program.createTextMark({ id, data, ...style })
27
+ .encodeX(positionArgs(x, { target: id, coordinate: args.coordinate }))
28
+ .encodeY(positionArgs(y, { target: id, coordinate: args.coordinate }))
29
+ .encodeText(targetArgs(text, id));
30
+ if (color !== undefined) next = next.encodeColor(targetArgs(color, id));
31
+ return applyFacadeGuides(next, guides, id);
32
+ };
33
+ apply(this);
34
+ return apply(this);
35
+ });
@@ -1,3 +1,4 @@
1
+ import { resolveGraphicBounds } from "../../layout/canvas.js";
1
2
  import { inheritTextMetrics } from "../textMetrics/index.js";
2
3
  import { action, closedAction } from "../../core/action.js";
3
4
  import { ChartProgram as CoreChartProgram } from "../../core/ChartProgram.js";
@@ -19,7 +20,7 @@ const CONCAT_OPTIONS = Object.freeze([
19
20
  "id", "programs", "gap", "align", "padding"
20
21
  ]);
21
22
  const LAYOUT_EDIT_OPTIONS = Object.freeze([
22
- "columns", "gap", "align", "padding"
23
+ "columns", "gap", "spacing", "align", "padding"
23
24
  ]);
24
25
  const REPLACEMENT_OPTIONS = Object.freeze(["target", "program"]);
25
26
  const INSERTION_OPTIONS = Object.freeze(["id", "program", "before", "after"]);
@@ -179,6 +180,7 @@ const editCompositionLayout = /* @__PURE__ */ closedAction(
179
180
  "editCompositionLayout columns is available only on a facet composition."
180
181
  );
181
182
  }
183
+ if (current.type !== "facet" && Object.hasOwn(args, "spacing")) throw new Error("Plot spacing requires a facet composition.");
182
184
  const padding = Object.hasOwn(args, "padding")
183
185
  ? normalizeCompositionPadding(args.padding, current.padding)
184
186
  : current.padding;
@@ -188,6 +190,8 @@ const editCompositionLayout = /* @__PURE__ */ closedAction(
188
190
  (current.facet.grid?.cells ?? []).map(cell => [cell.id, cell])
189
191
  );
190
192
  layout = resolveFacetLayout({
193
+ spacing: option(args, "spacing", current.spacing),
194
+ plots: current.children.map(id => ({ id, ...resolveGraphicBounds(this.children[id]) })),
191
195
  children: current.children.map((id, index) => ({
192
196
  ...childDescriptor({ id, program: this.children[id] }),
193
197
  value: current.facet.values[index],
@@ -218,7 +222,7 @@ const editCompositionLayout = /* @__PURE__ */ closedAction(
218
222
  children: this.children,
219
223
  compositionSpec: {
220
224
  ...current,
221
- ...(current.type === "facet" ? { columns: layout.columns } : {}),
225
+ ...(current.type === "facet" ? { columns: layout.columns, ...(layout.spacing !== undefined ? { spacing: layout.spacing } : current.spacing !== undefined ? { spacing: "canvas" } : {}) } : {}),
222
226
  gap: layout.gap,
223
227
  align: layout.align,
224
228
  padding: layout.padding
@@ -7,7 +7,7 @@ import { derivedCreator, derivedMaterializer } from "./shared.js";
7
7
 
8
8
  const OPTIONS = Object.freeze([
9
9
  "id", "source", "field", "maxBins", "step", "boundaries", "extent",
10
- "nice", "zero", "includeEmpty", "members", "as", "weight"
10
+ "nice", "zero", "includeEmpty", "members", "as", "weight", "missing"
11
11
  ]);
12
12
 
13
13
  export const materializeBinData = /* @__PURE__ */ derivedMaterializer(
@@ -2,7 +2,7 @@ import { BOX_FIELDS, deriveBoxData, normalizeBoxTransform } from "../../grammar/
2
2
  import { derivedCreator, derivedMaterializer } from "./shared.js";
3
3
 
4
4
  const OPTIONS = Object.freeze([
5
- "id", "source", "category", "field", "whisker", "factor", "as"
5
+ "id", "source", "category", "field", "whisker", "factor", "as", "summary"
6
6
  ]);
7
7
 
8
8
  function materializer(type, op, select) {
@@ -28,6 +28,7 @@ function creator(type, op, materialize) {
28
28
  type,
29
29
  category: args.category,
30
30
  field: args.field,
31
+ ...(args.summary === undefined ? {} : { summary: args.summary }),
31
32
  ...(args.whisker === undefined ? {} : { whisker: args.whisker }),
32
33
  ...(args.factor === undefined ? {} : { factor: args.factor }),
33
34
  as: args.as ?? BOX_FIELDS
@@ -2,8 +2,13 @@ import { closedAction } from "../../core/action.js";
2
2
  import { resolveOptionalUserId } from "../../core/identifiers.js";
3
3
  import { validateDataRows } from "../../core/validation.js";
4
4
  import { hasDataset, hasDatasetOwner } from "../../selectors/index.js";
5
+ import {
6
+ inferDatasetSchema,
7
+ normalizeSourceSchema,
8
+ validateRowsAgainstSchema
9
+ } from "../../grammar/datasetSchema.js";
5
10
 
6
- const OPTIONS = Object.freeze(["id", "values"]);
11
+ const OPTIONS = Object.freeze(["id", "values", "schema"]);
7
12
 
8
13
  export const createData = /* @__PURE__ */ closedAction(
9
14
  { op: "createData", description: "Create an immutable named dataset." }, OPTIONS,
@@ -15,12 +20,20 @@ export const createData = /* @__PURE__ */ closedAction(
15
20
  ambiguous: this.semanticSpec.datasets.length > 0
16
21
  });
17
22
  validateDataRows(args.values, "createData");
23
+ const schema = args.schema === undefined
24
+ ? inferDatasetSchema(args.values)
25
+ : normalizeSourceSchema(args.schema);
26
+ validateRowsAgainstSchema(args.values, schema, "createData");
18
27
  if (hasDataset(this, id) || hasDatasetOwner(this, id)) {
19
28
  throw new Error(`Dataset "${id}" already exists.`);
20
29
  }
21
- return this.editSemantic({
22
- property: `dataset[${id}].values`,
23
- value: args.values
24
- });
30
+ // Keep the historical one-primitive trace for inferred sources. The
31
+ // semantic primitive owns deterministic inference so a dataset never
32
+ // exists between actions without its schema.
33
+ return args.schema === undefined
34
+ ? this.editSemantic({ property: `dataset[${id}].values`, value: args.values })
35
+ : this
36
+ .editSemantic({ property: `dataset[${id}].schema`, value: schema })
37
+ .editSemantic({ property: `dataset[${id}].values`, value: args.values });
25
38
  }
26
39
  );
@@ -6,7 +6,7 @@ import { derivedCreator, derivedMaterializer } from "./shared.js";
6
6
 
7
7
  const OPTIONS = Object.freeze([
8
8
  "id", "source", "field", "groupBy", "bandwidth", "extent", "steps",
9
- "kernel", "normalization", "as", "weight"
9
+ "kernel", "normalization", "as", "weight", "missing"
10
10
  ]);
11
11
  const CATEGORICAL_OPTIONS = Object.freeze([...OPTIONS, "placement"]);
12
12
 
@@ -11,6 +11,10 @@ import { requireLayer } from "../../selectors/layers.js";
11
11
  import { applyLayerDataRematerialization } from
12
12
  "../../materialization/dependencies.js";
13
13
  import { collectResourceReferences } from "../../core/resourceReferences.js";
14
+ import {
15
+ assertFieldsAvailable,
16
+ transformInputFields
17
+ } from "../../grammar/datasetSchema.js";
14
18
 
15
19
  const OPTIONS = Object.freeze(["id", "source", "transform"]);
16
20
  const RELEASE_OPTIONS = Object.freeze(["id"]);
@@ -43,9 +47,16 @@ export const createDerivedData = /* @__PURE__ */ closedAction(
43
47
  if (!hasDataset(this, source)) {
44
48
  throw new Error(`Unknown source dataset "${source}".`);
45
49
  }
46
- return this
50
+ const created = this
47
51
  .editSemantic({ property: `dataset[${id}].source`, value: source })
48
52
  .editSemantic({ property: `dataset[${id}].transform`, value: args.transform });
53
+ const input = resolveDatasetReference(created, source, "Source dataset");
54
+ const transform = args.transform[0];
55
+ assertFieldsAvailable(input.schema, transformInputFields(transform), {
56
+ data: input.id,
57
+ operation: "createDerivedData"
58
+ });
59
+ return created;
49
60
  }
50
61
  );
51
62
 
@@ -75,6 +86,9 @@ export const releaseDerivedData = /* @__PURE__ */ closedAction(
75
86
  property: `dataset[${validatedId}]`,
76
87
  remove: true
77
88
  });
89
+ next = next._withoutMaterializationConfig([
90
+ "calculations", "datasets", validatedId
91
+ ]);
78
92
  for (const owner of selfOwners) {
79
93
  const [, family, ownerId] = owner.path;
80
94
  next = next._withoutMaterializationConfig(["data", family, ownerId]);
@@ -13,6 +13,8 @@ import {
13
13
  } from "../../selectors/datasets.js";
14
14
  import { applyLayerDataRematerialization } from
15
15
  "../../materialization/dependencies.js";
16
+ import { withLogicalDataReplacements } from
17
+ "../../materialization/revisionIdentity.js";
16
18
  import {
17
19
  outputFieldChanges,
18
20
  rebindLayerOutputFields,
@@ -36,6 +38,7 @@ const CREATOR_BY_TYPE = Object.freeze({
36
38
  interval: "createIntervalData",
37
39
  normalize: "createNormalizedData",
38
40
  regression: "createRegressionData",
41
+ sort: "createSortedData",
39
42
  stack: "createStackData",
40
43
  summary: "createSummaryData",
41
44
  timeUnit: "createTimeUnitData",
@@ -54,6 +57,7 @@ const REVISION_ROLE = Object.freeze({
54
57
  interval: "IntervalData",
55
58
  normalize: "NormalizedData",
56
59
  regression: "RegressionData",
60
+ sort: "SortedData",
57
61
  stack: "StackData",
58
62
  summary: "SummaryData",
59
63
  timeUnit: "TimeUnitData",
@@ -298,6 +302,11 @@ function directLayerConsumers(program, data) {
298
302
  }
299
303
 
300
304
  export function applyRevisionPlan(program, resolved, plan, { retain = new Set() } = {}) {
305
+ return withLogicalDataReplacements(plan.replacements, () =>
306
+ applyRevisionPlanWithIdentity(program, resolved, plan, { retain }));
307
+ }
308
+
309
+ function applyRevisionPlanWithIdentity(program, resolved, plan, { retain }) {
301
310
  const root = plan.revisions[0];
302
311
  const changes = resolved === undefined ? new Map() : outputFieldChanges(
303
312
  resolved.dataset.transform[0],
@@ -464,18 +473,18 @@ export const editComputedData = /* @__PURE__ */ focusedEditor(
464
473
  "editComputedData", "computed", ["as", "expression"]
465
474
  );
466
475
  export const editFilteredData = /* @__PURE__ */ focusedEditor(
467
- "editFilteredData", "filter", ["field", "oneOf", "predicate", "range"]
476
+ "editFilteredData", "filter", ["field", "oneOf", "noneOf", "predicate", "range", "nulls"]
468
477
  );
469
478
  export const editFoldData = /* @__PURE__ */ focusedEditor(
470
479
  "editFoldData", "fold", ["fields", "as"]
471
480
  );
472
481
  export const editSummaryData = /* @__PURE__ */ focusedEditor(
473
- "editSummaryData", "summary", ["groupBy", "aggregates", "members", "weight"]
482
+ "editSummaryData", "summary", ["groupBy", "aggregates", "members", "weight", "missing", "empty"]
474
483
  );
475
484
  export const editBinData = /* @__PURE__ */ focusedEditor(
476
485
  "editBinData", "bin", [
477
486
  "field", "maxBins", "step", "boundaries", "extent", "nice", "zero",
478
- "includeEmpty", "members", "as", "weight"
487
+ "includeEmpty", "members", "as", "weight", "missing"
479
488
  ]
480
489
  );
481
490
  export const editTimeUnitData = /* @__PURE__ */ focusedEditor(
@@ -492,7 +501,7 @@ export const editWindowData = /* @__PURE__ */ focusedEditor(
492
501
  export const editDensityData = /* @__PURE__ */ focusedEditor(
493
502
  "editDensityData", "density", [
494
503
  "field", "groupBy", "bandwidth", "extent", "steps", "kernel",
495
- "normalization", "as", "weight"
504
+ "normalization", "as", "weight", "missing"
496
505
  ]
497
506
  );
498
507
  export const editStackData = /* @__PURE__ */ focusedEditor(
@@ -500,13 +509,16 @@ export const editStackData = /* @__PURE__ */ focusedEditor(
500
509
  );
501
510
  export const editRegressionData = /* @__PURE__ */ focusedEditor(
502
511
  "editRegressionData", "regression", [
503
- "x", "y", "groupBy", "method", "degree", "span", "confidenceMethod",
504
- "level", "confidence", "interval"
512
+ "x", "y", "groupBy", "method", "degree", "span", "robustIterations", "confidenceMethod",
513
+ "level", "confidence", "interval", "predict"
505
514
  ]
506
515
  );
516
+ export const editSortedData = /* @__PURE__ */ focusedEditor(
517
+ "editSortedData", "sort", ["sortBy"]
518
+ );
507
519
  export const editIntervalData = /* @__PURE__ */ focusedEditor(
508
520
  "editIntervalData", "interval", [
509
- "field", "groupBy", "center", "extent", "method", "level", "as"
521
+ "field", "groupBy", "center", "extent", "method", "level", "missing", "as"
510
522
  ]
511
523
  );
512
524
  export const editECDFData = /* @__PURE__ */ focusedEditor(
@@ -543,6 +555,7 @@ export const EDIT_DERIVED_DATA_ACTIONS = Object.freeze({
543
555
  editDensityData,
544
556
  editStackData,
545
557
  editRegressionData,
558
+ editSortedData,
546
559
  editIntervalData,
547
560
  editECDFData,
548
561
  editNormalizedData,
@@ -27,9 +27,14 @@ import {
27
27
  resolveEligibleLayer
28
28
  } from "../../selectors/index.js";
29
29
  import { MATERIALIZE_OPTIONS, requireDerivedDataset } from "./shared.js";
30
+ import {
31
+ assertFieldsAvailable,
32
+ deriveTransformSchema,
33
+ transformInputFields
34
+ } from "../../grammar/datasetSchema.js";
30
35
 
31
36
  const OPTIONS = Object.freeze([
32
- "id", "source", "field", "oneOf", "predicate", "range"
37
+ "id", "source", "field", "oneOf", "noneOf", "predicate", "range", "nulls"
33
38
  ]);
34
39
  const MARK_SELECTOR_KEYS = Object.freeze([
35
40
  "grain", "field", "channel", "property", "op", "value", "values",
@@ -58,10 +63,16 @@ export const materializeFilteredData = /* @__PURE__ */ closedAction(
58
63
  args.id,
59
64
  "filter"
60
65
  );
61
- return this.editSemantic({
62
- property: `dataset[${id}].values`,
63
- value: deriveFilteredRows(source.values, transform)
66
+ assertFieldsAvailable(source.schema, transformInputFields(transform), {
67
+ data: source.id,
68
+ operation: "materializeFilteredData"
69
+ });
70
+ const values = deriveFilteredRows(source.values, transform);
71
+ const schema = deriveTransformSchema(source.schema, transform, values, {
72
+ sourceId: source.id,
73
+ ownerId: id
64
74
  });
75
+ return this.editSemantic({ property: `dataset[${id}].values`, value: values });
65
76
  }
66
77
  );
67
78
 
@@ -48,6 +48,7 @@ import {
48
48
  import { createCompleteData, materializeCompleteData } from "./complete.js";
49
49
  import { createImputedData, materializeImputedData } from "./impute.js";
50
50
  import { createStackData, materializeStackData } from "./stack.js";
51
+ import { createSortedData, materializeSortedData } from "./sort.js";
51
52
  import { EDIT_DERIVED_DATA_ACTIONS } from "./edit.js";
52
53
  import { createBoxSummaryData, createBoxOutlierData, materializeBoxSummaryData, materializeBoxOutlierData } from "./box.js";
53
54
 
@@ -96,6 +97,8 @@ export function registerDataActions(ProgramClass) {
96
97
  materializeImputedData,
97
98
  createStackData,
98
99
  materializeStackData,
100
+ createSortedData,
101
+ materializeSortedData,
99
102
  createTimeUnitData,
100
103
  materializeTimeUnitData,
101
104
  createBin2DData,
@@ -13,6 +13,7 @@ const OPTIONS = Object.freeze([
13
13
  "extent",
14
14
  "method",
15
15
  "level",
16
+ "missing",
16
17
  "as"
17
18
  ]);
18
19
 
@@ -42,6 +43,7 @@ export const createIntervalData = /* @__PURE__ */ derivedCreator(
42
43
  extent: args.extent,
43
44
  method: args.method,
44
45
  level: args.level,
46
+ missing: args.missing,
45
47
  as
46
48
  });
47
49
  },
@@ -9,8 +9,9 @@ import { resolveDatasetReference } from "../../selectors/datasets.js";
9
9
  import { derivedMaterializer } from "./shared.js";
10
10
 
11
11
  const OPTIONS = Object.freeze([
12
- "id", "source", "x", "y", "groupBy", "method", "degree", "span",
12
+ "id", "source", "x", "y", "groupBy", "method", "degree", "span", "robustIterations",
13
13
  "confidenceMethod", "level", "confidence", "interval"
14
+ , "predict", "missing"
14
15
  ]);
15
16
 
16
17
  export const materializeRegressionData = /* @__PURE__ */ derivedMaterializer(
@@ -24,10 +25,13 @@ export const materializeRegressionData = /* @__PURE__ */ derivedMaterializer(
24
25
  method: transform.method,
25
26
  degree: transform.degree,
26
27
  span: transform.span,
28
+ robustIterations: transform.robustIterations,
27
29
  confidenceMethod: transform.confidenceMethod,
28
30
  level: transform.level,
29
31
  confidence: transform.confidence,
30
- interval: transform.interval
32
+ interval: transform.interval,
33
+ predict: transform.predict
34
+ , missing: transform.missing
31
35
  })
32
36
  );
33
37