ggaction 0.0.23 → 0.0.26

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 (228) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +2 -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-resolver.js +1 -1
  7. package/package.json +1 -1
  8. package/src/accessibility.js +13 -0
  9. package/src/actions/canvas/actions.js +2 -1
  10. package/src/actions/canvas/fitting.js +68 -13
  11. package/src/actions/charts/beeswarm.js +2 -1
  12. package/src/actions/charts/ecdf.js +2 -1
  13. package/src/actions/charts/endpoints.js +25 -16
  14. package/src/actions/charts/heatmap.js +6 -4
  15. package/src/actions/charts/missing.js +17 -0
  16. package/src/actions/charts/radar.js +70 -33
  17. package/src/actions/charts/raincloud.js +18 -4
  18. package/src/actions/charts/rug-strip.js +2 -2
  19. package/src/actions/charts/shared.js +17 -0
  20. package/src/actions/composition/actions.js +24 -7
  21. package/src/actions/composition/adjacent.js +90 -0
  22. package/src/actions/composition/index.js +11 -1
  23. package/src/actions/composition/layer.js +42 -0
  24. package/src/actions/composition/layerPlan.js +176 -0
  25. package/src/actions/composition/targets.js +105 -0
  26. package/src/actions/data/basicBin2d.js +1 -1
  27. package/src/actions/data/bin2d.js +2 -2
  28. package/src/actions/data/derived.js +3 -0
  29. package/src/actions/data/filter.js +1 -1
  30. package/src/actions/data/raincloudFilter.js +3 -1
  31. package/src/actions/encodings/appearance.js +26 -7
  32. package/src/actions/encodings/channels.js +1 -0
  33. package/src/actions/encodings/color/continuous.js +37 -34
  34. package/src/actions/encodings/color/index.js +57 -43
  35. package/src/actions/encodings/color/policy.js +15 -0
  36. package/src/actions/encodings/density/resolve.js +3 -2
  37. package/src/actions/encodings/density.js +2 -2
  38. package/src/actions/encodings/offset.js +2 -0
  39. package/src/actions/encodings/pathOrder.js +2 -0
  40. package/src/actions/encodings/position/areaAlignment.js +42 -0
  41. package/src/actions/encodings/position/index.js +37 -3
  42. package/src/actions/encodings/position/policies/line.js +1 -1
  43. package/src/actions/encodings/ranged.js +4 -2
  44. package/src/actions/encodings/remove.js +13 -10
  45. package/src/actions/encodings/ruleAppearance.js +14 -2
  46. package/src/actions/facets/actions.js +1 -1
  47. package/src/actions/guides/axes/axes.js +2 -1
  48. package/src/actions/guides/axes/components.js +5 -0
  49. package/src/actions/guides/axes/edit.js +1 -188
  50. package/src/actions/guides/axes/labels.js +2 -537
  51. package/src/actions/guides/axes/parallel/lifecycle.js +11 -4
  52. package/src/actions/guides/axes/parallel/policy.js +5 -2
  53. package/src/actions/guides/axes/parallel/resolve.js +3 -1
  54. package/src/actions/guides/axes/parallel.js +9 -4
  55. package/src/actions/guides/axes/tickGroups.js +16 -1
  56. package/src/actions/guides/axes/ticks.js +33 -24
  57. package/src/actions/guides/axes/titles.js +1 -389
  58. package/src/actions/guides/facadeLegend.js +3 -2
  59. package/src/actions/guides/grids/grid.js +3 -2
  60. package/src/actions/guides/grids/resolve.js +2 -1
  61. package/src/actions/guides/guides.js +3 -2
  62. package/src/actions/guides/legends/automatic.js +28 -0
  63. package/src/actions/guides/legends/blocks.js +15 -21
  64. package/src/actions/guides/legends/categorical/actions.js +1 -1
  65. package/src/actions/guides/legends/categorical/components.js +4 -3
  66. package/src/actions/guides/legends/categorical/layout.js +5 -2
  67. package/src/actions/guides/legends/categorical/options.js +9 -14
  68. package/src/actions/guides/legends/categorical/recipes.js +3 -0
  69. package/src/actions/guides/legends/categorical/resolve.js +7 -5
  70. package/src/actions/guides/legends/colorSize.js +51 -14
  71. package/src/actions/guides/legends/continuous/common.js +1 -1
  72. package/src/actions/guides/legends/continuous/gradient.js +1 -1
  73. package/src/actions/guides/legends/continuous/opacity.js +2 -0
  74. package/src/actions/guides/legends/edit.js +1 -1
  75. package/src/actions/guides/legends/focused.js +2 -2
  76. package/src/actions/guides/legends/group.js +1 -1
  77. package/src/actions/guides/legends/lane.js +1 -1
  78. package/src/actions/guides/legends/lifecycle.js +2 -2
  79. package/src/actions/guides/legends/remove.js +18 -4
  80. package/src/actions/guides/legends/size.js +1 -1
  81. package/src/actions/guides/legends/transition.js +15 -6
  82. package/src/actions/guides/polar/axes/facade.js +4 -2
  83. package/src/actions/guides/polar/axes/labels.js +6 -1
  84. package/src/actions/guides/polar/axes/shared.js +4 -4
  85. package/src/actions/guides/polar/axes/titles.js +13 -2
  86. package/src/actions/guides/polar/grids.js +6 -3
  87. package/src/actions/guides/tickValues.js +7 -1
  88. package/src/actions/index.js +2 -0
  89. package/src/actions/marks/area/actions.js +9 -2
  90. package/src/actions/marks/area/materialize.js +1 -1
  91. package/src/actions/marks/bar/materialize.js +4 -4
  92. package/src/actions/marks/lifecycle.js +14 -0
  93. package/src/actions/marks/line/actions.js +3 -0
  94. package/src/actions/marks/line/materialize.js +4 -2
  95. package/src/actions/marks/point/edit.js +2 -0
  96. package/src/actions/marks/point/jitter.js +2 -0
  97. package/src/actions/marks/point/materialize.js +5 -4
  98. package/src/actions/marks/point/packing.js +2 -0
  99. package/src/actions/marks/references.js +5 -3
  100. package/src/actions/marks/remove.js +16 -0
  101. package/src/actions/marks/shared.js +2 -1
  102. package/src/actions/marks/text/actions.js +5 -2
  103. package/src/actions/overlays/index.js +168 -0
  104. package/src/actions/overlays/snapshot.js +45 -0
  105. package/src/actions/primitives/editGraphics.js +21 -27
  106. package/src/actions/primitives/semanticAction.js +4 -5
  107. package/src/actions/primitives/semanticValidation/guide.js +1 -0
  108. package/src/actions/primitives/semanticValidation/layer.js +7 -0
  109. package/src/actions/scales/consumers/common.js +10 -0
  110. package/src/actions/scales/consumers/families.js +1 -1
  111. package/src/actions/scales/preview.js +1 -1
  112. package/src/actions/selection/actions.js +63 -11
  113. package/src/actions/titles/actions.js +3 -14
  114. package/src/actions/titles/resolve.js +23 -10
  115. package/src/core/action.js +41 -25
  116. package/src/core/compositionScales.js +12 -0
  117. package/src/core/compositionState.js +20 -3
  118. package/src/core/facetGap.js +44 -0
  119. package/src/core/immutable.js +11 -6
  120. package/src/core/programState.js +16 -0
  121. package/src/core/resourceReferences.js +19 -3
  122. package/src/core/validation.js +7 -0
  123. package/src/core/vocabulary.js +8 -2
  124. package/src/grammar/actionTargets.js +24 -0
  125. package/src/grammar/axisTextPlacement.js +1 -1
  126. package/src/grammar/bin2d.js +41 -4
  127. package/src/grammar/colorSizeLegend.js +56 -5
  128. package/src/grammar/displayLabels.js +10 -0
  129. package/src/grammar/facetHeaders.js +1 -1
  130. package/src/grammar/facets/dependencies.js +10 -3
  131. package/src/grammar/facets/guides.js +2 -1
  132. package/src/grammar/facets/legendIntent.js +7 -5
  133. package/src/grammar/legendBlocks.js +1 -1
  134. package/src/grammar/legendCombinations.js +1 -1
  135. package/src/grammar/legendGroups.js +1 -1
  136. package/src/grammar/legendItemsOffset.js +12 -0
  137. package/src/grammar/legendOverflow.js +25 -0
  138. package/src/grammar/lineSeries.js +1 -1
  139. package/src/grammar/markSelection.js +23 -0
  140. package/src/grammar/overlay.js +51 -0
  141. package/src/grammar/parallelCoordinates.js +1 -208
  142. package/src/grammar/pathCommands.js +8 -2
  143. package/src/grammar/pathSeries.js +1 -1
  144. package/src/grammar/plotComposition.js +152 -0
  145. package/src/grammar/pointShapes.js +18 -0
  146. package/src/grammar/scales/transformed.js +1 -1
  147. package/src/grammar/schemas/concreteGraphic.js +8 -1
  148. package/src/grammar/schemas/graphicBounds.js +8 -1
  149. package/src/grammar/schemas/graphicTree.js +18 -2
  150. package/src/grammar/schemas/semanticPath.js +3 -0
  151. package/src/grammar/strokeStyle.js +14 -8
  152. package/src/grammar/text.js +72 -0
  153. package/src/inspection.js +1 -1
  154. package/src/inspectionDescriptors.js +1 -1
  155. package/src/layout/composition.js +32 -10
  156. package/src/layout/compositionLegend.js +91 -0
  157. package/src/layout/facetContentFlow.js +15 -7
  158. package/src/layout/facetHeaderTitles.js +1 -1
  159. package/src/layout/facets.js +1 -1
  160. package/src/layout/labels.js +55 -27
  161. package/src/layout/legend.js +3 -2
  162. package/src/layout/legendGroup.js +1 -1
  163. package/src/layout/legendItems.js +7 -6
  164. package/src/layout/legendLane.js +1 -1
  165. package/src/layout/legendText.js +1 -1
  166. package/src/layout/title.js +1 -1
  167. package/src/materialization/adjacentSource.js +27 -0
  168. package/src/materialization/composition.js +165 -52
  169. package/src/materialization/compositionLegends.js +120 -0
  170. package/src/materialization/compositionScales.js +125 -0
  171. package/src/materialization/compositionTitle.js +96 -0
  172. package/src/materialization/facetGuides/edit.js +22 -2
  173. package/src/materialization/facetGuides/layout.js +1 -1
  174. package/src/materialization/facetGuides/owner.js +4 -3
  175. package/src/materialization/facetGuides/ownerLayout.js +12 -6
  176. package/src/materialization/facetGuides/placement.js +19 -22
  177. package/src/materialization/facetGuides/preparation.js +17 -5
  178. package/src/materialization/facetHeaders.js +5 -1
  179. package/src/materialization/facets.js +1 -1
  180. package/src/materialization/guides/layout.js +1 -1
  181. package/src/materialization/guides/resources.js +1 -1
  182. package/src/materialization/guides/visibility.js +105 -0
  183. package/src/materialization/legendClip.js +1 -1
  184. package/src/materialization/legendGroups.js +1 -1
  185. package/src/materialization/legendItemsOffset.js +68 -0
  186. package/src/materialization/legendSuppression.js +22 -0
  187. package/src/materialization/legends.js +3 -2
  188. package/src/materialization/marks/capabilities.js +4 -0
  189. package/src/materialization/marks/index.js +5 -1
  190. package/src/materialization/marks/pathOrder.js +1 -1
  191. package/src/materialization/marks/policies.js +2 -1
  192. package/src/materialization/overlayItems.js +154 -0
  193. package/src/materialization/planner.js +19 -4
  194. package/src/materialization/scales/policies/binnedPosition.js +43 -5
  195. package/src/materialization/scales/policies/series.js +12 -4
  196. package/src/materialization/scales/resolve.js +2 -0
  197. package/src/materialization/selection/items/bar.js +21 -3
  198. package/src/materialization/selection/items/common.js +18 -5
  199. package/src/materialization/selection/items/overlay.js +15 -0
  200. package/src/materialization/selection/items/path.js +1 -0
  201. package/src/materialization/selection/items/point.js +2 -3
  202. package/src/materialization/selection/items/tick.js +3 -12
  203. package/src/materialization/selection/path.js +2 -2
  204. package/src/materialization/selection/policies/bar.js +2 -0
  205. package/src/materialization/selection/policies/index.js +35 -1
  206. package/src/materialization/selection/policies/point.js +2 -0
  207. package/src/materialization/selection/policies/text.js +17 -0
  208. package/src/materialization/selection/rows.js +103 -0
  209. package/src/materialization/selection/state.js +19 -3
  210. package/src/materialization/selection/styles.js +8 -0
  211. package/src/materialization/text.js +6 -489
  212. package/src/materialization/textGeometry.js +503 -0
  213. package/src/materialization/textLines.js +20 -0
  214. package/src/persistence/validation.js +116 -25
  215. package/src/renderers/canvas/index.js +12 -7
  216. package/src/renderers/canvas/text.js +5 -5
  217. package/src/renderers/nativeBackend.js +25 -0
  218. package/src/renderers/pdf.js +3 -3
  219. package/src/renderers/png.js +4 -3
  220. package/src/renderers/svgSerialization.js +1 -643
  221. package/src/scene.js +5 -3
  222. package/src/selectors/plotComposition.js +115 -0
  223. package/src/selectors/selectionTargets.js +19 -0
  224. package/src/version.js +1 -1
  225. package/types/basic.d.ts +4 -2
  226. package/types/index.d.ts +14 -0
  227. package/types/inspection.d.ts +34 -0
  228. package/types/program.d.ts +572 -372
@@ -0,0 +1,115 @@
1
+ import { findLayer } from './layers.js';
2
+ import { ownership, ownedChildren } from './markOwners.js';
3
+ import { resolveEligibleLayer } from './layers.js';
4
+ import { findCoordinate } from './coordinates.js';
5
+
6
+ const sameUnit = new Set(['mean', 'median', 'min', 'max', 'q1', 'q3', 'quantile', 'lower', 'upper', 'center', 'value', 'ciLower', 'ciUpper', 'stderr', 'stdev', 'iqr']);
7
+ export function measurementUnit(operations = []) {
8
+ return operations.filter(op => !sameUnit.has(op)).join(':') || 'value';
9
+ }
10
+
11
+ // Resolve provenance, never generated field-name conventions. Stops at an
12
+ // ordinary source (including a user-authored filtered/transformed dataset).
13
+ export function compositionChannel(program, encoding, data) {
14
+ if (!encoding?.field && encoding?.aggregate !== 'count') return undefined;
15
+ let field = encoding.field, current = data, fields, derived;
16
+ const operations = encoding.aggregate ? [encoding.aggregate] : [];
17
+ const visited = new Set();
18
+ while (current && !visited.has(current)) {
19
+ visited.add(current);
20
+ const dataset = program.semanticSpec.datasets.find(d => d.id === current);
21
+ let recognized = false;
22
+ for (const t of [...(dataset?.transform ?? [])].reverse()) {
23
+ const key = Array.isArray(t.as) ? t.as.indexOf(field) : Object.entries(t.as ?? {}).find(([, value]) => value === field)?.[0];
24
+ if (t.type === 'summary') {
25
+ const a = t.aggregates.find(a => a.as === field);
26
+ if (a) { field = a.field ?? field; operations.unshift(typeof a.op==='string'?a.op:a.op.op); }
27
+ recognized = true;
28
+ } else if (['boxSummary', 'boxOutlier', 'gradientProfile', 'interval'].includes(t.type)) {
29
+ if (key !== undefined && key !== 'category') { field = t.field; operations.unshift(key === 'count' ? 'count' : key === 'center' ? t.center ?? 'median' : 'quantile'); }
30
+ recognized = true;
31
+ } else if (t.type === 'density') {
32
+ if (key === 0 || key === 1) { field = t.field; if (key === 1) { operations.unshift('density'); derived = { normalization: t.normalization, weight: t.weight }; } }
33
+ recognized = true;
34
+ } else if (t.type === 'ecdf') {
35
+ if (key !== undefined) { field = t.field; if (key !== 'value') operations.unshift(key === 'probability' ? 'probability' : 'cumulative-count'); }
36
+ recognized = true;
37
+ } else if (t.type === 'bin2d') {
38
+ if (key?.startsWith('x')) field = t.x;
39
+ else if (key?.startsWith('y')) field = t.y;
40
+ else if (key === 'count') { field = undefined; fields = [t.x, t.y]; operations.unshift('count'); }
41
+ recognized = true;
42
+ } else if (t.type === 'horizon') {
43
+ if (key === 'x') field = t.x.field;
44
+ else { field = t.y.field; operations.unshift('folded'); derived = { bands:t.bands, baseline:t.baseline, extent:t.extent, resolve:t.resolve }; }
45
+ recognized = true;
46
+ } else if (t.type === 'fold') {
47
+ if (key === 'key' || key === 'value') { field = undefined; fields = t.fields; operations.unshift(key === 'key' ? 'dimensions' : 'profile'); }
48
+ recognized = true;
49
+ } else if (t.type === 'regression' || t.type === 'complete') recognized = true;
50
+ else if (t.type === 'filter' && Object.values(program.markConfigs).some(config =>
51
+ (config.raincloudPlot?.ownedData ?? config.endpointPlot?.ownedData ?? []).includes(current))) {
52
+ // These filters implement one facade's complete-case population; they
53
+ // do not introduce a user-selected data source or new field meaning.
54
+ recognized = true;
55
+ }
56
+ }
57
+ if (!recognized || !dataset.source) break;
58
+ current = dataset.source;
59
+ }
60
+ if (encoding.stack === 'normalize' || encoding.stack?.mode === 'normalize') operations.push('normalized');
61
+ return { ...(field === undefined ? {} : { field }), ...(fields ? { fields } : {}), fieldType: encoding.fieldType,
62
+ scale: encoding.scale, data: current, measurement: { unit: measurementUnit(operations), operations,
63
+ ...(derived ? { parameters: derived } : {}) },
64
+ ...(encoding.bin === undefined ? {} : { bin: encoding.bin }),
65
+ ...(encoding.temporalUnit === undefined ? {} : { temporalUnit: encoding.temporalUnit }) };
66
+ }
67
+
68
+ export function plotComposition(program, target) {
69
+ const owners = ownership(program);
70
+ // Public IDs of compound facades can differ from their concrete owner.
71
+ if (target && !findLayer(program, target)) target = program.semanticSpec.layers.find(l => program.markConfigs[l.id]?.raincloudPlot?.id === target)?.id ?? target;
72
+ while (owners.has(target)) target = owners.get(target);
73
+ const layer = resolveEligibleLayer(program, { target, label: 'plot composition', predicate: l => !owners.has(l.id) && !l.derivedBindings?.overlay && l.data !== undefined });
74
+ const owned = new Set([layer.id]);
75
+ const visit = id => { for (const child of ownedChildren(program, id)) if (!owned.has(child)) { owned.add(child); visit(child); } };
76
+ visit(layer.id);
77
+ const channels = Object.fromEntries(Object.entries(layer.encoding ?? {}).flatMap(([channel, encoding]) => {
78
+ const value = compositionChannel(program, encoding, layer.data); return value ? [[channel, value]] : [];
79
+ }));
80
+ if (layer.mark.type === 'arc' && ['count','sum'].includes(layer.encoding.theta?.aggregate)) {
81
+ channels.theta.measurement = { unit:'partition', operations:['partition'], parameters:{
82
+ aggregate:layer.encoding.theta.aggregate, ...(layer.encoding.theta.weight ? {weight:layer.encoding.theta.weight} : {})
83
+ } };
84
+ }
85
+ const dimensionEncoding = layer.encoding?.parallel?.dimensions;
86
+ const dimensions = dimensionEncoding?.map(e => compositionChannel(program, e, layer.data));
87
+ const data = Object.values(channels).find(c => c.data)?.data ?? layer.data;
88
+ const config = program.markConfigs[layer.id] ?? {};
89
+ return { version:1, owner:layer.id, ownedMarks:[...owned], data, coordinate:findCoordinate(program,layer.coordinate),
90
+ mark:layer.mark.type, channels, ...(dimensions ? { dimensions } : {}),
91
+ ...(config.compositionRole ? { role:config.compositionRole } : {}),
92
+ ...(layer.encoding.group ? { groupBy:layer.encoding.group.field ?? layer.encoding.group.fields } : {}) };
93
+ }
94
+
95
+ // Re-encoding one independent consumer must not silently change the meaning of
96
+ // a resource still used by another plot. A new explicit scale remains possible.
97
+ export function assertSharedPositionMeaning(program, layer, channel, encoding) {
98
+ const previous = layer.encoding?.[channel];
99
+ const companion = {x:'y',y:'x',theta:'radius',radius:'theta'}[channel];
100
+ // New marks can inherit an incomplete position while their first bindings are authored.
101
+ if (!layer.encoding?.[companion] && !(layer.mark.type==='arc' && layer.encoding?.theta?.aggregate)) return;
102
+ if (!previous?.scale || previous.scale !== encoding.scale) return;
103
+ const before = compositionChannel(program, previous, layer.data);
104
+ const after = compositionChannel(program, encoding, layer.data);
105
+ const signature = role => role && JSON.stringify([role.field, role.fields, role.fieldType,
106
+ role.measurement.unit, role.temporalUnit]);
107
+ if (!before || !after || signature(before) === signature(after)) return;
108
+ const owners = ownership(program);
109
+ const owner = id => { while (owners.has(id)) id = owners.get(id); return id; };
110
+ const conflict = program.semanticSpec.layers.find(other => other.id !== layer.id &&
111
+ owner(other.id) !== owner(layer.id) && !other.derivedBindings?.overlay &&
112
+ other.encoding?.[channel]?.scale === previous.scale &&
113
+ signature(compositionChannel(program, other.encoding[channel], other.data)) === signature(before));
114
+ if (conflict) throw new Error(`Scale "${previous.scale}" is shared with plot "${owner(conflict.id)}". Keep the same positional meaning or supply a different scale.id.`);
115
+ }
@@ -0,0 +1,19 @@
1
+ import { ownedChildren } from './markOwners.js';
2
+ import { findLayer } from './layers.js';
3
+
4
+ export function highlightTargets(program, target) {
5
+ const owners = Object.entries(program.markConfigs).filter(([, config]) => config.raincloudPlot?.id === target);
6
+ const root = findLayer(program, target)?.id ?? (owners.length === 1 ? owners[0][0] : undefined);
7
+ if (!root) return [target];
8
+ const result = new Set([root]);
9
+ const visit = id => {
10
+ for (const child of ownedChildren(program, id)) {
11
+ // Independent overlays and statistical additions keep their own scope.
12
+ const layer = findLayer(program, child);
13
+ if (layer.derivedBindings?.overlay || program.markConfigs[child]?.statisticalReference || layer.mark.type === 'text') continue;
14
+ if (!result.has(child)) { result.add(child); visit(child); }
15
+ }
16
+ };
17
+ visit(root);
18
+ return [...result];
19
+ }
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Must match package.json; enforced by the snapshot producer-version test.
2
- export const packageVersion = "0.0.23";
2
+ export const packageVersion = "0.0.26";
package/types/basic.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ChartProgram, BasicSeriesLayoutOptions, CreateDataOptions } from "./program.js";
1
+ import type { ChartProgram, BasicSeriesLayoutOptions, CreateDataOptions, ScopedActionTarget } from "./program.js";
2
2
 
3
3
  export type {
4
4
  LinearNiceCountOptions,
@@ -10,11 +10,13 @@ export type {
10
10
  CartesianGuideDashMap,
11
11
  AxisTicksAndLabelsOptions,
12
12
  AxisTitleOptions,
13
+ AxisTitleOffset,
13
14
  DisplayLabelMap,
14
15
  DisplayLabelOptions,
15
16
  ApplyThemeOptions,
16
17
  BarWidthOptions,
17
18
  BasicSeriesLayoutOptions,
19
+ Bin2DAssignment,
18
20
  Bin2DDataOptions,
19
21
  CanvasOptions,
20
22
  ColorEncodingOptions,
@@ -117,7 +119,7 @@ type BasicMethodKey =
117
119
  | "createGuides";
118
120
 
119
121
  type RebindMethod<T> = T extends (...args: infer Args) => ChartProgram
120
- ? (...args: Args) => BasicChartProgram
122
+ ? (...args: { [K in keyof Args]: Exclude<Args[K], { target: ScopedActionTarget | readonly unknown[] }> }) => BasicChartProgram
121
123
  : never;
122
124
 
123
125
  export type BasicChartProgram =
package/types/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import type { ChartProgram, CompositionOptions } from "./program.js";
2
2
 
3
3
  export type {
4
+ CreateOverlayOptions,
5
+ EditOverlayOptions,
6
+ OverlayLineAppearance,
7
+ OverlayPointAppearance,
4
8
  LinearNiceCountOptions,
5
9
  AxisTickRounding,
6
10
  ArcInnerRadius,
@@ -27,6 +31,7 @@ export type {
27
31
  AxisTicksAndLabelsOptions,
28
32
  AxisTickStyleOptions,
29
33
  AxisTitleOptions,
34
+ AxisTitleOffset,
30
35
  AxisValue,
31
36
  DisplayLabelMap,
32
37
  DisplayLabelOptions,
@@ -36,6 +41,7 @@ export type {
36
41
  BinnedHeatmapColorOptions,
37
42
  BinnedHeatmapOptions,
38
43
  BinnedHeatmapPositionChannel,
44
+ Bin2DAssignment,
39
45
  Bin2DCounts,
40
46
  Bin2DDataOptions,
41
47
  Bin2DExtent,
@@ -71,6 +77,13 @@ export type {
71
77
  NamedCompleteAxis,
72
78
  ConcatCompositionSpec,
73
79
  CompositionAlign,
80
+ CompositionShares,
81
+ ScopedActionTarget,
82
+ ActionTargetList,
83
+ TargetedOptions,
84
+ EditCompositionScalesOptions,
85
+ AdjacentPlotSpecification,
86
+ CreateAdjacentPlotOptions,
74
87
  CompositionOptions,
75
88
  EditFacetSourceOptions,
76
89
  FacetHeaderRole,
@@ -287,6 +300,7 @@ export type {
287
300
  FieldType,
288
301
  FillPaint,
289
302
  FacetCompositionSpec,
303
+ FacetGap,
290
304
  FacetGuideOptions,
291
305
  FacetOptions,
292
306
  FacetTopLaneMode,
@@ -15,3 +15,37 @@ export function getDatasetSchema(program: ProgramInput, options: {readonly data:
15
15
  export function describeAction(program: ProgramInput, options: {readonly action:string;readonly target?:InspectionTarget;readonly options?:Readonly<Record<string,unknown>>}): ActionDescription;
16
16
  export function comparePrograms(before: ProgramInput, after: ProgramInput, options?: {readonly target?:InspectionTarget}): ProgramComparison;
17
17
  export function inspectProgram(program: ProgramInput, options?: {readonly target?:InspectionTarget}): ProgramInspection;
18
+
19
+ export interface PlotCompositionChannel {
20
+ readonly field?: string;
21
+ readonly fields?: readonly string[];
22
+ readonly fieldType: string;
23
+ readonly scale: string;
24
+ readonly data: string;
25
+ readonly measurement: Readonly<{ unit: string; operations: readonly string[]; parameters?: Readonly<Record<string, unknown>> }>;
26
+ readonly bin?: Readonly<Record<string, unknown>>;
27
+ readonly temporalUnit?: string;
28
+ }
29
+ export interface PlotComposition {
30
+ readonly version: 1;
31
+ readonly owner: string;
32
+ readonly ownedMarks: readonly string[];
33
+ readonly data: string;
34
+ readonly coordinate?: Readonly<{ id: string; type: string }>;
35
+ readonly mark: string;
36
+ readonly channels: Readonly<Record<string, PlotCompositionChannel>>;
37
+ readonly dimensions?: readonly PlotCompositionChannel[];
38
+ readonly role?: string;
39
+ readonly groupBy?: string | readonly string[];
40
+ }
41
+ export function getPlotComposition(program: ProgramInput, options?: { readonly target?: string | { readonly childPath: readonly string[]; readonly id: string }; readonly childPath?: readonly string[] }): PlotComposition;
42
+
43
+ export interface MarkItemInspection {
44
+ readonly key: string; readonly target: string; readonly markType: string; readonly grain: "item" | "stack";
45
+ readonly fields: Readonly<Record<string, unknown>>; readonly channels: Readonly<Record<string, unknown>>;
46
+ readonly properties: Readonly<Record<string, unknown>>;
47
+ readonly geometry: readonly {readonly type: string; readonly properties: Readonly<Record<string, unknown>>}[];
48
+ readonly rows: readonly { readonly data: string; readonly index: number }[];
49
+ readonly bounds: Readonly<{left:number;top:number;right:number;bottom:number}> | null;
50
+ }
51
+ export function getMarkItems(program: ProgramInput, options?: {target?: string | {childPath?:readonly string[];id:string};grain?:"item"|"stack"}): readonly MarkItemInspection[];