ggaction 0.0.7 → 0.0.9

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 (83) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +33 -5
  3. package/knowledge/action-cards.json +10941 -0
  4. package/knowledge/intent-taxonomy.json +183 -0
  5. package/knowledge/mcp-resources.json +95 -0
  6. package/knowledge/task-packet.schema.json +159 -0
  7. package/knowledge/task-resolver.js +1230 -0
  8. package/package.json +10 -1
  9. package/src/actions/basic.js +3 -3
  10. package/src/actions/categoryOrder/index.js +111 -0
  11. package/src/actions/coordinates/actions.js +4 -0
  12. package/src/actions/data/index.js +6 -0
  13. package/src/actions/data/timeUnit.js +48 -0
  14. package/src/actions/encodings/angle.js +77 -0
  15. package/src/actions/encodings/color/index.js +17 -13
  16. package/src/actions/encodings/color/layout.js +2 -0
  17. package/src/actions/encodings/color/policy.js +3 -0
  18. package/src/actions/encodings/index.js +2 -0
  19. package/src/actions/encodings/position/policies/area.js +40 -2
  20. package/src/actions/encodings/position/policies/bar.js +6 -0
  21. package/src/actions/encodings/position/policies/index.js +2 -0
  22. package/src/actions/encodings/position/policies/line.js +5 -1
  23. package/src/actions/encodings/position/policies/tick.js +19 -0
  24. package/src/actions/encodings/remove.js +1 -1
  25. package/src/actions/guides/legends/categorical/actions.js +23 -6
  26. package/src/actions/guides/legends/categorical/index.js +93 -2
  27. package/src/actions/guides/legends/categorical/symbols.js +2 -76
  28. package/src/actions/guides/legends/continuous/common.js +17 -5
  29. package/src/actions/guides/legends/continuous/gradient.js +12 -8
  30. package/src/actions/guides/legends/continuous/opacity.js +70 -17
  31. package/src/actions/guides/legends/edit.js +13 -8
  32. package/src/actions/guides/legends/lane.js +468 -0
  33. package/src/actions/guides/legends/remove.js +3 -7
  34. package/src/actions/index.js +3 -1
  35. package/src/actions/marks/area/actions.js +3 -1
  36. package/src/actions/marks/area/materialize.js +12 -3
  37. package/src/actions/marks/index.js +2 -0
  38. package/src/actions/marks/point/materialize.js +17 -5
  39. package/src/actions/marks/tick/actions.js +225 -0
  40. package/src/actions/marks/tick/index.js +1 -0
  41. package/src/actions/primitives/index.js +27 -0
  42. package/src/actions/primitives/semantic.js +22 -185
  43. package/src/actions/primitives/semanticAction.js +188 -0
  44. package/src/actions/primitives/semanticValidation/dataset.js +7 -3
  45. package/src/actions/primitives/semanticValidation/index.js +28 -15
  46. package/src/actions/primitives/semanticValidation/layer.js +22 -16
  47. package/src/actions/scales/consumers/index.js +8 -0
  48. package/src/actions/scales/consumers/seriesLayout.js +22 -2
  49. package/src/actions/scales/materialize.js +2 -0
  50. package/src/actions/selection/actions.js +5 -2
  51. package/src/core/vocabulary.js +7 -3
  52. package/src/grammar/areaSeries.js +112 -2
  53. package/src/grammar/categoryOrder.js +138 -0
  54. package/src/grammar/direction.js +46 -0
  55. package/src/grammar/facets/index.js +1 -1
  56. package/src/grammar/pointShapes.js +34 -6
  57. package/src/grammar/positionCompatibility.js +4 -0
  58. package/src/grammar/schemas/semanticPath.js +2 -1
  59. package/src/grammar/seriesLayout.js +10 -2
  60. package/src/grammar/timeUnit.js +108 -0
  61. package/src/grammar/transformTopology.js +18 -0
  62. package/src/grammar/transforms.js +25 -18
  63. package/src/grammar/window.js +73 -7
  64. package/src/layout/legendLane.js +338 -0
  65. package/src/materialization/dataProvenance.js +2 -2
  66. package/src/materialization/marks/capabilities.js +9 -0
  67. package/src/materialization/marks/index.js +2 -1
  68. package/src/materialization/marks/pathOrder.js +2 -2
  69. package/src/materialization/marks/policies.js +13 -0
  70. package/src/materialization/scales/policies/series.js +9 -0
  71. package/src/materialization/scales/resolve.js +25 -3
  72. package/src/materialization/selection/items/index.js +1 -0
  73. package/src/materialization/selection/items/path.js +4 -1
  74. package/src/materialization/selection/items/tick.js +42 -0
  75. package/src/materialization/selection/policies/index.js +2 -0
  76. package/src/materialization/selection/policies/tick.js +10 -0
  77. package/src/mcp/adapter.js +206 -0
  78. package/src/mcp/cli.js +11 -0
  79. package/src/mcp/server.js +101 -0
  80. package/types/index.d.ts +10 -0
  81. package/types/program.d.ts +96 -3
  82. package/src/actions/coordinates/index.js +0 -5
  83. package/src/actions/primitives/semanticValue.js +0 -1
@@ -0,0 +1,183 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "constraints": [
4
+ { "id": "program.canvas", "phrases": ["chart canvas", "create canvas", "plot bounds"] },
5
+ { "id": "program.data", "phrases": ["create dataset", "load rows", "inline data"] },
6
+
7
+ { "id": "chart.scatter", "phrases": ["scatter plot", "scatter chart", "point chart"] },
8
+ { "id": "chart.line", "phrases": ["line chart", "line plot", "time series chart"] },
9
+ { "id": "chart.bar", "phrases": ["bar chart", "bar plot", "column chart"] },
10
+ { "id": "chart.histogram", "phrases": ["histogram", "binned distribution", "frequency distribution", "frequency histogram"] },
11
+ { "id": "chart.heatmap", "phrases": ["heatmap", "heat map", "two dimensional distribution"] },
12
+ { "id": "chart.parallel", "phrases": ["parallel coordinates", "parallel coordinate plot"] },
13
+ { "id": "chart.box", "phrases": ["box plot", "boxplot", "quartile plot"] },
14
+ { "id": "chart.violin", "phrases": ["violin plot", "violin chart"] },
15
+ { "id": "chart.gradient", "phrases": ["gradient plot", "density gradient"] },
16
+ { "id": "chart.density", "phrases": ["density plot", "density curve", "kernel density plot"] },
17
+
18
+ { "id": "mark.point", "phrases": ["point mark", "circle marks"] },
19
+ { "id": "mark.tick", "phrases": ["tick mark", "tick plot", "strip plot"] },
20
+ { "id": "mark.text", "phrases": ["text mark", "data labels"] },
21
+ { "id": "mark.line", "phrases": ["line mark", "path mark"] },
22
+ { "id": "mark.bar", "phrases": ["bar mark", "rectangle bars"] },
23
+ { "id": "mark.area", "phrases": ["area mark", "filled area"] },
24
+ { "id": "mark.rule", "phrases": ["rule mark", "reference line mark"], "shadows": ["mark.line"] },
25
+ { "id": "mark.arc", "phrases": ["arc mark", "polar sectors"] },
26
+ { "id": "mark.rect", "phrases": ["rect mark", "rectangle cells"] },
27
+
28
+ { "id": "transform.filter", "phrases": ["filter data", "filtered dataset", "filter rows"] },
29
+ { "id": "transform.density", "phrases": ["density data", "kde data", "kernel density data"] },
30
+ { "id": "transform.regression", "phrases": ["regression data", "fitted rows", "loess data"] },
31
+ { "id": "transform.window", "phrases": ["moving average", "moving mean", "window transform", "rank rows", "lag values"] },
32
+ { "id": "transform.timeUnit", "phrases": ["time unit", "date bucket", "month bucket", "year bucket"] },
33
+ { "id": "transform.bin1d", "phrases": ["bin one field", "one dimensional bins", "histogram bins"] },
34
+ { "id": "transform.bin2d", "phrases": ["bin two fields", "two dimensional bins", "rectangular bins", "binned heatmap"] },
35
+ { "id": "transform.interval", "phrases": ["interval data", "confidence interval data", "summary interval"] },
36
+
37
+ { "id": "statistics.regression", "phrases": ["regression line", "trend line", "fitted line", "regression fit", "best fit line", "fitted trend"] },
38
+ { "id": "statistics.errorBar", "phrases": ["error bars", "error bar"] },
39
+ { "id": "statistics.errorBand", "phrases": ["error band", "uncertainty ribbon", "confidence band"] },
40
+
41
+ { "id": "scale.create", "phrases": ["create scale", "named scale", "custom scale"] },
42
+ { "id": "scale.log", "phrases": ["log scale", "logarithmic scale"] },
43
+ { "id": "scale.time", "phrases": ["time scale", "temporal scale"] },
44
+ { "id": "scale.color", "phrases": ["color scale", "colour scale", "palette scale"] },
45
+
46
+ { "id": "encoding.x", "phrases": ["x encoding", "encode x", "map to x"] },
47
+ { "id": "encoding.y", "phrases": ["y encoding", "encode y", "map to y"] },
48
+ { "id": "encoding.color", "phrases": ["color encoding", "encode color", "map to color", "color legend", "colour legend"] },
49
+ { "id": "encoding.size", "phrases": ["size encoding", "encode size", "map to size"] },
50
+ { "id": "encoding.shape", "phrases": ["shape encoding", "encode shape", "map to shape"] },
51
+ { "id": "encoding.angle", "phrases": ["angle encoding", "encode angle", "rotate ticks", "rotate points"] },
52
+ { "id": "encoding.opacity", "phrases": ["opacity encoding", "encode opacity", "map to opacity"] },
53
+ { "id": "encoding.strokeDash", "phrases": ["stroke dash encoding", "dash encoding", "line style encoding"] },
54
+ { "id": "encoding.strokeWidth", "phrases": ["stroke width encoding", "encode stroke width", "line width encoding"] },
55
+ { "id": "encoding.text", "phrases": ["text encoding", "encode text", "label field"] },
56
+ { "id": "encoding.group", "phrases": ["group encoding", "group series", "series grouping"] },
57
+ { "id": "encoding.theta", "phrases": ["theta encoding", "angular encoding", "encode theta"] },
58
+ { "id": "encoding.radius", "phrases": ["radius encoding", "radial encoding", "encode radius"] },
59
+ { "id": "encoding.parallel", "phrases": ["parallel dimensions", "dimension axes"] },
60
+
61
+ { "id": "guide.all", "phrases": ["create guides", "automatic guides", "all guides"] },
62
+ { "id": "guide.axes", "phrases": ["axes", "axis guides", "x and y axes"] },
63
+ { "id": "guide.xAxis", "phrases": ["x axis", "horizontal axis"] },
64
+ { "id": "guide.yAxis", "phrases": ["y axis", "vertical axis"] },
65
+ { "id": "guide.legend", "phrases": ["legend", "encoding key"] },
66
+ { "id": "guide.grid", "phrases": ["grid lines", "chart grid", "reference grid"] },
67
+ { "id": "guide.title", "phrases": ["chart title", "add title", "title and subtitle"] },
68
+ { "id": "guide.subtitle", "phrases": ["subtitle", "title and subtitle"] },
69
+
70
+ { "id": "layout.legend.bottom", "phrases": ["legend at bottom", "bottom legend"], "exclusiveGroup": "legend.position" },
71
+ { "id": "layout.legend.top", "phrases": ["legend at top", "top legend"], "exclusiveGroup": "legend.position" },
72
+ { "id": "layout.legend.left", "phrases": ["legend at left", "left legend"], "exclusiveGroup": "legend.position" },
73
+ { "id": "layout.legend.right", "phrases": ["legend at right", "right legend"], "exclusiveGroup": "legend.position" },
74
+ { "id": "layout.labels", "phrases": ["avoid label overlap", "label collision", "layout labels"] },
75
+ { "id": "layout.jitter", "phrases": ["jitter points", "point jitter", "reduce overplotting"] },
76
+ { "id": "layout.categoryOrder", "phrases": ["order categories", "sort categories", "category order"] },
77
+ { "id": "layout.facet", "phrases": ["facet chart", "small multiples", "repeat chart by field"] },
78
+
79
+ { "id": "selection.store", "phrases": ["store selection", "reusable selection", "select marks"] },
80
+ { "id": "selection.highlight", "phrases": ["highlight marks", "highlight selected", "conditional highlight"] },
81
+ { "id": "selection.filter", "phrases": ["filter marks", "retain matching marks"] },
82
+
83
+ { "id": "composition.horizontal", "phrases": ["horizontal concat", "horizontally concatenate", "charts side by side"] },
84
+ { "id": "composition.vertical", "phrases": ["vertical concat", "vertically concatenate", "stack charts vertically"] },
85
+
86
+ { "id": "renderer.canvas", "phrases": ["render to canvas", "browser canvas", "canvas renderer", "on canvas", "on the chart canvas"] },
87
+ { "id": "renderer.svg", "phrases": ["render svg", "export svg", "svg output", "as svg", "vector svg", "svg document"] },
88
+ { "id": "renderer.png", "phrases": ["render png", "export png", "png output", "as png"] },
89
+ { "id": "renderer.pdf", "phrases": ["render pdf", "export pdf", "pdf output", "as pdf", "vector pdf", "pdf document"] },
90
+
91
+ { "id": "unsupported.geo", "phrases": ["map chart", "geographic chart", "geo projection", "choropleth"], "unsupported": "Geographic projections and map marks are outside the current ggaction contract." },
92
+ { "id": "unsupported.animation", "phrases": ["animate chart", "chart animation", "animated transition"], "unsupported": "Animation is outside the current static-chart contract." },
93
+ { "id": "unsupported.interaction", "phrases": ["interactive tooltip", "zoom interaction", "pan interaction", "brush interaction"], "unsupported": "Interactive runtime behaviors are outside the current static-chart contract." },
94
+ { "id": "unsupported.3d", "phrases": ["3d chart", "three dimensional chart", "three dimensional plot"], "unsupported": "Three-dimensional charts are not supported." },
95
+ { "id": "unsupported.jpg", "phrases": ["export jpg", "render jpeg", "jpeg output", "jpeg image", "jpg image"], "unsupported": "JPEG is not a current renderer; use SVG, PNG, PDF, or Browser Canvas." }
96
+ ],
97
+ "providers": [
98
+ { "id": "action.createCanvas", "kind": "action", "name": "createCanvas", "order": 10, "anchors": ["program.canvas"], "covers": ["program.canvas"], "baseOptions": {} },
99
+ { "id": "action.createData", "kind": "action", "name": "createData", "order": 20, "anchors": ["program.data"], "covers": ["program.data"], "baseOptions": { "values": "[{ category: \"A\", x: 1, y: 2, value: 3 }]" } },
100
+
101
+ { "id": "action.createScatterPlot", "kind": "action", "name": "createScatterPlot", "order": 40, "anchors": ["chart.scatter"], "covers": ["chart.scatter", "encoding.x", "encoding.y", "encoding.color", "encoding.size", "encoding.shape", "guide.axes", "guide.legend"], "baseOptions": { "x": "\"x\"", "y": "\"y\"" }, "optionsByConstraint": { "encoding.color": { "color": "\"category\"" }, "encoding.size": { "size": "\"value\"" }, "encoding.shape": { "shape": "\"category\"" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
102
+ { "id": "action.createLinePlot", "kind": "action", "name": "createLinePlot", "order": 40, "anchors": ["chart.line"], "covers": ["chart.line", "encoding.x", "encoding.y", "encoding.color", "encoding.group", "encoding.strokeDash", "guide.axes", "guide.legend"], "baseOptions": { "x": "\"x\"", "y": "\"y\"" }, "optionsByConstraint": { "encoding.color": { "color": "\"category\"" }, "encoding.group": { "groupBy": "\"category\"" }, "encoding.strokeDash": { "strokeDash": "{ field: \"category\" }" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
103
+ { "id": "action.createBarPlot", "kind": "action", "name": "createBarPlot", "order": 40, "anchors": ["chart.bar"], "covers": ["chart.bar", "encoding.x", "encoding.y", "encoding.color", "guide.axes", "guide.legend"], "baseOptions": { "x": "\"category\"", "y": "\"value\"" }, "optionsByConstraint": { "encoding.color": { "color": "\"category\"" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
104
+ { "id": "action.createHistogram", "kind": "action", "name": "createHistogram", "order": 40, "anchors": ["chart.histogram"], "covers": ["chart.histogram", "transform.bin1d", "encoding.color", "guide.axes", "guide.legend"], "baseOptions": { "field": "\"value\"" }, "optionsByConstraint": { "encoding.color": { "color": "\"category\"" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
105
+ { "id": "action.createHeatmap", "kind": "action", "name": "createHeatmap", "order": 40, "anchors": ["chart.heatmap"], "covers": ["chart.heatmap", "transform.bin2d", "encoding.x", "encoding.y", "encoding.color", "guide.axes", "guide.legend"], "baseOptions": { "x": "\"x\"", "y": "\"y\"", "bin": "{}" }, "optionsByConstraint": { "encoding.color": { "color": "{}" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
106
+ { "id": "action.createParallelCoordinates", "kind": "action", "name": "createParallelCoordinates", "order": 40, "anchors": ["chart.parallel"], "covers": ["chart.parallel", "encoding.parallel", "encoding.color", "encoding.strokeDash", "guide.axes", "guide.legend"], "baseOptions": { "dimensions": "[\"a\", \"b\"]" }, "optionsByConstraint": { "encoding.color": { "color": "\"category\"" }, "encoding.strokeDash": { "strokeDash": "{ field: \"category\" }" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
107
+ { "id": "action.createBoxPlot", "kind": "action", "name": "createBoxPlot", "order": 40, "anchors": ["chart.box"], "covers": ["chart.box", "guide.axes"], "baseOptions": {}, "optionsByConstraint": { "guide.axes": { "guides": "{}" } } },
108
+ { "id": "action.createViolinPlot", "kind": "action", "name": "createViolinPlot", "order": 40, "anchors": ["chart.violin"], "covers": ["chart.violin", "encoding.color", "guide.axes", "guide.legend"], "baseOptions": { "x": "\"category\"", "y": "\"value\"" }, "optionsByConstraint": { "encoding.color": { "color": "\"category\"" }, "guide.axes": { "guides": "{}" }, "guide.legend": { "guides": "{ legend: {} }" } } },
109
+ { "id": "action.createGradientPlot", "kind": "action", "name": "createGradientPlot", "order": 40, "anchors": ["chart.gradient"], "covers": ["chart.gradient", "guide.axes"], "baseOptions": {}, "optionsByConstraint": { "guide.axes": { "guides": "{}" } } },
110
+ { "id": "action.encodeDensity", "kind": "action", "name": "encodeDensity", "order": 50, "anchors": ["chart.density"], "covers": ["chart.density"], "baseOptions": { "field": "\"value\"" } },
111
+
112
+ { "id": "action.createPointMark", "kind": "action", "name": "createPointMark", "order": 40, "anchors": ["mark.point"], "covers": ["mark.point"], "baseOptions": {} },
113
+ { "id": "action.createTickMark", "kind": "action", "name": "createTickMark", "order": 40, "anchors": ["mark.tick"], "covers": ["mark.tick"], "baseOptions": {} },
114
+ { "id": "action.createTextMark", "kind": "action", "name": "createTextMark", "order": 40, "anchors": ["mark.text"], "covers": ["mark.text"], "baseOptions": {} },
115
+ { "id": "action.createLineMark", "kind": "action", "name": "createLineMark", "order": 40, "anchors": ["mark.line"], "covers": ["mark.line"], "baseOptions": {} },
116
+ { "id": "action.createBarMark", "kind": "action", "name": "createBarMark", "order": 40, "anchors": ["mark.bar"], "covers": ["mark.bar"], "baseOptions": {} },
117
+ { "id": "action.createAreaMark", "kind": "action", "name": "createAreaMark", "order": 40, "anchors": ["mark.area"], "covers": ["mark.area"], "baseOptions": {} },
118
+ { "id": "action.createRuleMark", "kind": "action", "name": "createRuleMark", "order": 40, "anchors": ["mark.rule"], "covers": ["mark.rule"], "baseOptions": {} },
119
+ { "id": "action.createArcMark", "kind": "action", "name": "createArcMark", "order": 40, "anchors": ["mark.arc"], "covers": ["mark.arc"], "baseOptions": {} },
120
+ { "id": "action.createRectMark", "kind": "action", "name": "createRectMark", "order": 40, "anchors": ["mark.rect"], "covers": ["mark.rect"], "baseOptions": {} },
121
+
122
+ { "id": "action.filterData", "kind": "action", "name": "filterData", "order": 30, "anchors": ["transform.filter"], "covers": ["transform.filter"], "baseOptions": { "id": "\"filtered\"", "field": "\"value\"", "predicate": "{ op: \"gt\", value: 0 }" } },
123
+ { "id": "action.createDensityData", "kind": "action", "name": "createDensityData", "order": 30, "anchors": ["transform.density"], "covers": ["transform.density"], "baseOptions": { "id": "\"density\"", "field": "\"value\"" } },
124
+ { "id": "action.createRegressionData", "kind": "action", "name": "createRegressionData", "order": 30, "anchors": ["transform.regression"], "covers": ["transform.regression"], "baseOptions": { "id": "\"regression\"", "x": "\"x\"", "y": "\"y\"" } },
125
+ { "id": "action.createWindowData", "kind": "action", "name": "createWindowData", "order": 30, "anchors": ["transform.window"], "covers": ["transform.window"], "baseOptions": { "id": "\"windowed\"", "operations": "[{ op: \"movingMean\", field: \"value\", as: \"movingMean\", frame: { preceding: 2 } }]" } },
126
+ { "id": "action.createTimeUnitData", "kind": "action", "name": "createTimeUnitData", "order": 30, "anchors": ["transform.timeUnit"], "covers": ["transform.timeUnit"], "baseOptions": { "id": "\"monthly\"", "field": "\"date\"", "unit": "\"month\"", "as": "\"month\"" } },
127
+ { "id": "action.encodeHistogram", "kind": "action", "name": "encodeHistogram", "order": 50, "anchors": ["transform.bin1d"], "covers": ["transform.bin1d"], "baseOptions": { "field": "\"value\"" } },
128
+ { "id": "action.createBin2DData", "kind": "action", "name": "createBin2DData", "order": 30, "anchors": ["transform.bin2d"], "covers": ["transform.bin2d"], "baseOptions": { "id": "\"bins\"", "x": "\"x\"", "y": "\"y\"" } },
129
+ { "id": "action.createIntervalData", "kind": "action", "name": "createIntervalData", "order": 30, "anchors": ["transform.interval"], "covers": ["transform.interval"], "baseOptions": { "id": "\"interval\"", "field": "\"value\"" } },
130
+
131
+ { "id": "action.createRegression", "kind": "action", "name": "createRegression", "order": 60, "anchors": ["statistics.regression"], "covers": ["mark.line", "transform.regression", "statistics.regression", "statistics.errorBand"], "baseOptions": {} },
132
+ { "id": "action.createErrorBar", "kind": "action", "name": "createErrorBar", "order": 60, "anchors": ["statistics.errorBar"], "covers": ["statistics.errorBar"], "baseOptions": {} },
133
+ { "id": "action.createErrorBand", "kind": "action", "name": "createErrorBand", "order": 61, "anchors": ["statistics.errorBand"], "covers": ["statistics.errorBand"], "baseOptions": {} },
134
+
135
+ { "id": "action.createScale", "kind": "action", "name": "createScale", "order": 35, "anchors": ["scale.create"], "covers": ["scale.create"], "baseOptions": { "id": "\"scale-1\"" } },
136
+ { "id": "action.createLogScale", "kind": "action", "name": "createScale", "order": 35, "anchors": ["scale.log"], "covers": ["scale.log"], "baseOptions": { "id": "\"scale-1\"", "type": "\"log\"" } },
137
+ { "id": "action.createTimeScale", "kind": "action", "name": "createScale", "order": 35, "anchors": ["scale.time"], "covers": ["scale.time"], "baseOptions": { "id": "\"scale-1\"", "type": "\"time\"" } },
138
+ { "id": "action.createColorScale", "kind": "action", "name": "createScale", "order": 35, "anchors": ["scale.color"], "covers": ["scale.color"], "baseOptions": { "id": "\"color-scale\"", "type": "\"ordinal\"", "range": "{ palette: \"tableau10\" }" } },
139
+
140
+ { "id": "action.encodeX", "kind": "action", "name": "encodeX", "order": 50, "anchors": ["encoding.x"], "covers": ["encoding.x"], "baseOptions": { "field": "\"x\"" } },
141
+ { "id": "action.encodeY", "kind": "action", "name": "encodeY", "order": 50, "anchors": ["encoding.y"], "covers": ["encoding.y"], "baseOptions": { "field": "\"y\"" } },
142
+ { "id": "action.encodeColor", "kind": "action", "name": "encodeColor", "order": 55, "anchors": ["encoding.color"], "covers": ["encoding.color"], "baseOptions": { "field": "\"category\"" } },
143
+ { "id": "action.encodeSize", "kind": "action", "name": "encodeSize", "order": 55, "anchors": ["encoding.size"], "covers": ["encoding.size"], "baseOptions": { "field": "\"value\"" } },
144
+ { "id": "action.encodeShape", "kind": "action", "name": "encodeShape", "order": 55, "anchors": ["encoding.shape"], "covers": ["encoding.shape"], "baseOptions": { "field": "\"category\"" } },
145
+ { "id": "action.encodeAngle", "kind": "action", "name": "encodeAngle", "order": 55, "anchors": ["encoding.angle"], "covers": ["encoding.angle"], "baseOptions": { "value": "45" } },
146
+ { "id": "action.encodeOpacity", "kind": "action", "name": "encodeOpacity", "order": 55, "anchors": ["encoding.opacity"], "covers": ["encoding.opacity"], "baseOptions": { "field": "\"value\"" } },
147
+ { "id": "action.encodeStrokeDash", "kind": "action", "name": "encodeStrokeDash", "order": 55, "anchors": ["encoding.strokeDash"], "covers": ["encoding.strokeDash"], "baseOptions": { "field": "\"category\"" } },
148
+ { "id": "action.encodeStrokeWidth", "kind": "action", "name": "encodeStrokeWidth", "order": 55, "anchors": ["encoding.strokeWidth"], "covers": ["encoding.strokeWidth"], "baseOptions": { "value": "2" } },
149
+ { "id": "action.encodeText", "kind": "action", "name": "encodeText", "order": 55, "anchors": ["encoding.text"], "covers": ["encoding.text"], "baseOptions": { "field": "\"label\"" } },
150
+ { "id": "action.encodeGroup", "kind": "action", "name": "encodeGroup", "order": 52, "anchors": ["encoding.group"], "covers": ["encoding.group"], "baseOptions": { "field": "\"category\"" } },
151
+ { "id": "action.encodeTheta", "kind": "action", "name": "encodeTheta", "order": 50, "anchors": ["encoding.theta"], "covers": ["encoding.theta"], "baseOptions": { "field": "\"angle\"" } },
152
+ { "id": "action.encodeR", "kind": "action", "name": "encodeR", "order": 50, "anchors": ["encoding.radius"], "covers": ["encoding.radius"], "baseOptions": { "field": "\"value\"" } },
153
+ { "id": "action.encodeParallelCoordinates", "kind": "action", "name": "encodeParallelCoordinates", "order": 50, "anchors": ["encoding.parallel"], "covers": ["encoding.parallel"], "baseOptions": { "dimensions": "[\"a\", \"b\"]" } },
154
+
155
+ { "id": "action.createGuides", "kind": "action", "name": "createGuides", "order": 70, "anchors": ["guide.all"], "covers": ["guide.all", "guide.axes", "guide.legend", "guide.grid"], "baseOptions": {} },
156
+ { "id": "action.createAxes", "kind": "action", "name": "createAxes", "order": 70, "anchors": ["guide.axes"], "covers": ["guide.axes"], "baseOptions": {} },
157
+ { "id": "action.createXAxis", "kind": "action", "name": "createXAxis", "order": 70, "anchors": ["guide.xAxis"], "covers": ["guide.xAxis"], "baseOptions": {} },
158
+ { "id": "action.createYAxis", "kind": "action", "name": "createYAxis", "order": 70, "anchors": ["guide.yAxis"], "covers": ["guide.yAxis"], "baseOptions": {} },
159
+ { "id": "action.createLegend", "kind": "action", "name": "createLegend", "order": 70, "anchors": ["guide.legend"], "covers": ["guide.legend"], "baseOptions": {} },
160
+ { "id": "action.createGrid", "kind": "action", "name": "createGrid", "order": 70, "anchors": ["guide.grid"], "covers": ["guide.grid"], "baseOptions": {} },
161
+ { "id": "action.createTitle", "kind": "action", "name": "createTitle", "order": 70, "anchors": ["guide.title", "guide.subtitle"], "covers": ["guide.title", "guide.subtitle"], "baseOptions": { "text": "\"Chart title\"" }, "optionsByConstraint": { "guide.subtitle": { "subtitle": "\"Chart subtitle\"" } } },
162
+
163
+ { "id": "action.legendBottom", "kind": "action", "name": "editLegendLayout", "order": 80, "anchors": ["layout.legend.bottom"], "covers": ["layout.legend.bottom"], "baseOptions": { "position": "\"bottom\"" } },
164
+ { "id": "action.legendTop", "kind": "action", "name": "editLegendLayout", "order": 80, "anchors": ["layout.legend.top"], "covers": ["layout.legend.top"], "baseOptions": { "position": "\"top\"" } },
165
+ { "id": "action.legendLeft", "kind": "action", "name": "editLegendLayout", "order": 80, "anchors": ["layout.legend.left"], "covers": ["layout.legend.left"], "baseOptions": { "position": "\"left\"" } },
166
+ { "id": "action.legendRight", "kind": "action", "name": "editLegendLayout", "order": 80, "anchors": ["layout.legend.right"], "covers": ["layout.legend.right"], "baseOptions": { "position": "\"right\"" } },
167
+ { "id": "action.layoutLabels", "kind": "action", "name": "layoutLabels", "order": 80, "anchors": ["layout.labels"], "covers": ["layout.labels"], "baseOptions": { "axis": "\"y\"" } },
168
+ { "id": "action.jitterPoints", "kind": "action", "name": "jitterPoints", "order": 80, "anchors": ["layout.jitter"], "covers": ["layout.jitter"], "baseOptions": { "channel": "\"x\"", "maxOffset": "{ pixels: 4 }" } },
169
+ { "id": "action.orderCategories", "kind": "action", "name": "orderCategories", "order": 80, "anchors": ["layout.categoryOrder"], "covers": ["layout.categoryOrder"], "baseOptions": { "channel": "\"x\"", "by": "\"category\"" } },
170
+ { "id": "action.facet", "kind": "action", "name": "facet", "order": 80, "anchors": ["layout.facet"], "covers": ["layout.facet", "guide.axes", "guide.legend"], "baseOptions": { "field": "\"category\"" }, "optionsByConstraint": { "guide.axes": { "guides": "{ axes: \"outer\", legend: \"shared\" }" }, "guide.legend": { "guides": "{ axes: \"outer\", legend: \"shared\" }" } } },
171
+
172
+ { "id": "action.selectMarks", "kind": "action", "name": "selectMarks", "order": 75, "anchors": ["selection.store"], "covers": ["selection.store"], "baseOptions": { "id": "\"selection-1\"", "field": "\"category\"", "op": "\"eq\"", "value": "\"A\"" } },
173
+ { "id": "action.highlightMarks", "kind": "action", "name": "highlightMarks", "order": 76, "anchors": ["selection.highlight"], "covers": ["selection.highlight"], "baseOptions": { "select": "{ field: \"category\", op: \"eq\", value: \"A\" }", "color": "\"#f28e2b\"" } },
174
+ { "id": "action.filterMarks", "kind": "action", "name": "filterMarks", "order": 75, "anchors": ["selection.filter"], "covers": ["selection.filter"], "baseOptions": { "field": "\"value\"", "op": "\"gt\"", "value": "0" } },
175
+
176
+ { "id": "runtime.hconcat", "kind": "runtime", "name": "hconcat", "order": 90, "anchors": ["composition.horizontal"], "covers": ["composition.horizontal"], "signature": "hconcat(options: CompositionOptions): ChartProgram;", "call": "hconcat({ programs: [program, program] })", "route": "/reference/runtime/#ggaction" },
177
+ { "id": "runtime.vconcat", "kind": "runtime", "name": "vconcat", "order": 90, "anchors": ["composition.vertical"], "covers": ["composition.vertical"], "signature": "vconcat(options: CompositionOptions): ChartProgram;", "call": "vconcat({ programs: [program, program] })", "route": "/reference/runtime/#ggaction" },
178
+ { "id": "runtime.render", "kind": "runtime", "name": "render", "order": 100, "anchors": ["renderer.canvas"], "covers": ["renderer.canvas"], "signature": "render(program: Pick<ChartProgram, \"graphicSpec\">, context: CanvasRenderingContext2D, options?: { pixelRatio?: number }): void;", "call": "render(program, context)", "route": "/reference/runtime/#ggaction" },
179
+ { "id": "runtime.renderToSVG", "kind": "runtime", "name": "renderToSVG", "order": 100, "anchors": ["renderer.svg"], "covers": ["renderer.svg"], "signature": "renderToSVG(program: Pick<ChartProgram, \"graphicSpec\">, options?: SVGRenderOptions): string;", "call": "renderToSVG(program)", "route": "/reference/runtime/#ggactionsvg" },
180
+ { "id": "runtime.renderToPNG", "kind": "runtime", "name": "renderToPNG", "order": 100, "anchors": ["renderer.png"], "covers": ["renderer.png"], "signature": "renderToPNG(program: Pick<ChartProgram, \"graphicSpec\">, options: { output: string; pixelRatio?: number }): Promise<PNGRenderResult>;", "call": "await renderToPNG(program, { output: \"chart.png\" })", "route": "/reference/runtime/#ggactionpng" },
181
+ { "id": "runtime.renderToPDF", "kind": "runtime", "name": "renderToPDF", "order": 100, "anchors": ["renderer.pdf"], "covers": ["renderer.pdf"], "signature": "renderToPDF(program: Pick<ChartProgram, \"graphicSpec\">, options: PDFRenderOptions): Promise<PDFRenderResult>;", "call": "await renderToPDF(program, { output: \"chart.pdf\" })", "route": "/reference/runtime/#ggactionpdf" }
182
+ ]
183
+ }
@@ -0,0 +1,95 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "overview": {
4
+ "title": "ggaction compact authoring overview",
5
+ "text": "Use search_ggaction once with only the exact user chart request; do not append dataset contents or code scaffolding. The result contains exact authoring imports, chart() initialization, non-duplicated createCanvas and createData prerequisites, immutable executable steps with deterministic runtime dependencies closed, ordered actionPlan entries, exactCalls, required option names, canonical routes, terminal unsupported constraints, and open unresolved decisions. Do not preload the full documentation. Read an action card when one exact action needs more detail. Read only the resource URIs attached to unresolved entries; unsupported entries are terminal and require no documentation read. The server is read-only and never executes chart code."
6
+ },
7
+ "recipes": [
8
+ {
9
+ "id": "scatter-svg",
10
+ "title": "Scatterplot with a bottom color legend and SVG output",
11
+ "summary": "Selects the chart facade, legend layout action, and browser-safe SVG renderer in execution order.",
12
+ "query": "scatter plot with a color legend at bottom as svg"
13
+ },
14
+ {
15
+ "id": "moving-average-line-png",
16
+ "title": "Moving-average line chart as PNG",
17
+ "summary": "Combines a window transform, line facade, guides, and the Node PNG renderer.",
18
+ "query": "moving average line chart with axes and export png"
19
+ },
20
+ {
21
+ "id": "binned-heatmap",
22
+ "title": "Binned heatmap with guides",
23
+ "summary": "Uses the heatmap facade to own 2D binning, position, color, axes, and legend requirements.",
24
+ "query": "binned heatmap with color legend and axes"
25
+ },
26
+ {
27
+ "id": "regression-scatterplot",
28
+ "title": "Scatterplot with a regression layer",
29
+ "summary": "Builds the scatterplot before adding the statistical regression layer.",
30
+ "query": "scatter plot with a regression line"
31
+ },
32
+ {
33
+ "id": "selection-highlight",
34
+ "title": "Stored selection and highlight",
35
+ "summary": "Stores a named mark selection before applying a graphical highlight to that selection.",
36
+ "query": "store selection then highlight marks"
37
+ },
38
+ {
39
+ "id": "parallel-svg",
40
+ "title": "Styled parallel coordinates as SVG",
41
+ "summary": "Combines parallel coordinates, color and dash encodings, guides, and SVG output.",
42
+ "query": "parallel coordinates with color encoding, stroke dash encoding, axes, and legend as svg"
43
+ },
44
+ {
45
+ "id": "facet-shared-guides",
46
+ "title": "Small multiples with shared guides",
47
+ "summary": "Uses the facet action as the owner of the small-multiple layout and shared guides.",
48
+ "query": "small multiples with shared legend and axes"
49
+ },
50
+ {
51
+ "id": "horizontal-composition-svg",
52
+ "title": "Horizontal chart composition as SVG",
53
+ "summary": "Composes complete programs horizontally before serializing the parent program to SVG.",
54
+ "query": "put charts side by side and export svg"
55
+ }
56
+ ],
57
+ "docs": [
58
+ {
59
+ "id": "choose-chart-type",
60
+ "title": "Choose a chart or mark type",
61
+ "route": "/api/basic-charts/",
62
+ "text": "# Choose a chart or mark type\n\nName the intended chart or mark. Common complete chart facades are `createScatterPlot`, `createLinePlot`, `createBarPlot`, `createHistogram`, and `createHeatmap`. For lower-level authoring, choose a mark such as point, line, area, bar, rect, rule, tick, text, or arc, then add its required position encodings. Run `search_ggaction` again with the chosen chart type."
63
+ },
64
+ {
65
+ "id": "choose-renderer",
66
+ "title": "Choose an output renderer",
67
+ "route": "/api/rendering/",
68
+ "text": "# Choose an output renderer\n\nUse `render(program, context)` for Browser Canvas, `renderToSVG(program)` for a browser-safe SVG string, `renderToPNG(program, output)` for Node PNG output, or `renderToPDF(program, output)` for a single-page vector PDF. Run `search_ggaction` again with one explicit format. JPEG output is not currently supported."
69
+ },
70
+ {
71
+ "id": "legend-layout",
72
+ "title": "Resolve legend layout requirements",
73
+ "route": "/api/legends/",
74
+ "text": "# Resolve legend layout requirements\n\nA single legend resource can occupy one position at a time. Choose `top`, `bottom`, `left`, or `right`, or give distinct legends explicit IDs and edit each target separately. Run `search_ggaction` again with one position per legend."
75
+ },
76
+ {
77
+ "id": "unsupported-capabilities",
78
+ "title": "Current static-chart limitations",
79
+ "route": "/supported-features/",
80
+ "text": "# Current static-chart limitations\n\nThe current authoring contract does not provide geographic maps, animation, interactive event handling, 3D charts, or JPEG rendering. The compact resolver reports these requirements explicitly instead of substituting a different chart. Consult the supported-features route before redesigning the task with current static actions."
81
+ },
82
+ {
83
+ "id": "getting-started",
84
+ "title": "Clarify an unrecognized authoring request",
85
+ "route": "/getting-started/",
86
+ "text": "# Clarify an authoring request\n\nDescribe the chart or mark, its data/transform needs, position and appearance encodings, guides or layout, and output format in one request. Exact action names are also accepted. Example: `scatter plot with x and y, a bottom color legend, and SVG output`."
87
+ },
88
+ {
89
+ "id": "action-reference",
90
+ "title": "Resolve a current action gap",
91
+ "route": "/reference/actions/",
92
+ "text": "# Resolve a current action gap\n\nUse the complete action reference only for a constraint that the compact resolver recognized but could not cover. Confirm the exact action signature, required resource ID, and supported options, then rerun `search_ggaction` with the exact action name and complete task request."
93
+ }
94
+ ]
95
+ }
@@ -0,0 +1,159 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ggaction.github.io/ggaction/schemas/task-packet.schema.json",
4
+ "title": "ggaction compact task packet",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "query",
10
+ "matchedConstraints",
11
+ "actionPlan",
12
+ "exactCalls",
13
+ "authoring",
14
+ "unsupported",
15
+ "unresolved",
16
+ "candidates"
17
+ ],
18
+ "properties": {
19
+ "schemaVersion": { "const": 3 },
20
+ "query": { "type": "string", "minLength": 1, "maxLength": 500 },
21
+ "matchedConstraints": {
22
+ "type": "array",
23
+ "maxItems": 30,
24
+ "uniqueItems": true,
25
+ "items": { "type": "string", "minLength": 3, "maxLength": 100 }
26
+ },
27
+ "actionPlan": {
28
+ "type": "array",
29
+ "maxItems": 20,
30
+ "items": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": [
34
+ "step",
35
+ "id",
36
+ "kind",
37
+ "name",
38
+ "constraints",
39
+ "requiredOptions",
40
+ "signature",
41
+ "route"
42
+ ],
43
+ "properties": {
44
+ "step": { "type": "integer", "minimum": 1 },
45
+ "id": { "type": "string", "minLength": 3 },
46
+ "kind": { "enum": ["action", "runtime"] },
47
+ "name": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9]*$" },
48
+ "constraints": {
49
+ "type": "array",
50
+ "minItems": 1,
51
+ "uniqueItems": true,
52
+ "items": { "type": "string", "minLength": 3 }
53
+ },
54
+ "requiredOptions": {
55
+ "type": "array",
56
+ "uniqueItems": true,
57
+ "items": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9]*$" }
58
+ },
59
+ "signature": { "type": "string", "minLength": 8 },
60
+ "route": { "type": "string", "pattern": "^/reference/" }
61
+ }
62
+ }
63
+ },
64
+ "exactCalls": {
65
+ "type": "array",
66
+ "maxItems": 20,
67
+ "items": { "type": "string", "minLength": 3, "maxLength": 700 }
68
+ },
69
+ "authoring": {
70
+ "type": "object",
71
+ "additionalProperties": false,
72
+ "required": ["imports", "initialize", "prerequisites", "steps"],
73
+ "properties": {
74
+ "imports": {
75
+ "type": "array",
76
+ "minItems": 1,
77
+ "maxItems": 4,
78
+ "uniqueItems": true,
79
+ "items": { "type": "string", "minLength": 30, "maxLength": 90 }
80
+ },
81
+ "initialize": { "const": "let program = chart()" },
82
+ "prerequisites": {
83
+ "type": "array",
84
+ "minItems": 2,
85
+ "maxItems": 2,
86
+ "items": {
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "required": ["id", "signature", "call", "bindings"],
90
+ "properties": {
91
+ "id": { "enum": ["action.createCanvas", "action.createData"] },
92
+ "signature": { "type": "string", "minLength": 8, "maxLength": 180 },
93
+ "call": { "type": "string", "minLength": 12, "maxLength": 180 },
94
+ "bindings": {
95
+ "type": "array",
96
+ "maxItems": 4,
97
+ "uniqueItems": true,
98
+ "items": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9]*$" }
99
+ }
100
+ }
101
+ }
102
+ },
103
+ "steps": {
104
+ "type": "array",
105
+ "maxItems": 20,
106
+ "items": { "type": "string", "minLength": 3, "maxLength": 760 }
107
+ }
108
+ }
109
+ },
110
+ "unsupported": {
111
+ "type": "array",
112
+ "maxItems": 10,
113
+ "items": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["constraint", "reason"],
117
+ "properties": {
118
+ "constraint": { "type": "string", "pattern": "^unsupported\\." },
119
+ "reason": { "type": "string", "minLength": 10, "maxLength": 240 }
120
+ }
121
+ }
122
+ },
123
+ "unresolved": {
124
+ "type": "array",
125
+ "maxItems": 30,
126
+ "items": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "required": ["constraint", "reason", "resources"],
130
+ "properties": {
131
+ "constraint": { "type": "string", "minLength": 3 },
132
+ "reason": { "type": "string", "minLength": 10, "maxLength": 240 },
133
+ "resources": {
134
+ "type": "array",
135
+ "minItems": 1,
136
+ "maxItems": 2,
137
+ "uniqueItems": true,
138
+ "items": { "type": "string", "pattern": "^ggaction://docs/[a-z0-9-]+$" }
139
+ }
140
+ }
141
+ }
142
+ },
143
+ "candidates": {
144
+ "type": "array",
145
+ "maxItems": 3,
146
+ "items": {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": ["id", "kind", "name", "route"],
150
+ "properties": {
151
+ "id": { "type": "string", "minLength": 3 },
152
+ "kind": { "enum": ["action", "runtime"] },
153
+ "name": { "type": "string", "minLength": 2 },
154
+ "route": { "type": "string", "pattern": "^/reference/" }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }