ggaction 0.0.4 → 0.0.6
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.
- package/CHANGELOG.md +55 -0
- package/README.md +35 -13
- package/package.json +18 -7
- package/src/actions/boxPlots/create.js +13 -7
- package/src/actions/boxPlots/edit.js +484 -36
- package/src/actions/boxPlots/materialize.js +3 -0
- package/src/actions/boxPlots/options.js +11 -4
- package/src/actions/boxPlots/resolve.js +10 -2
- package/src/actions/charts/bar.js +50 -0
- package/src/actions/charts/heatmap.js +205 -0
- package/src/actions/charts/histogram.js +58 -0
- package/src/actions/charts/index.js +15 -0
- package/src/actions/charts/line.js +69 -0
- package/src/actions/charts/parallel.js +76 -0
- package/src/actions/charts/scatter.js +56 -0
- package/src/actions/charts/shared.js +121 -0
- package/src/actions/composition/actions.js +13 -3
- package/src/actions/coordinates/parallel.js +50 -0
- package/src/actions/data/bin2d.js +260 -0
- package/src/actions/data/density.js +54 -13
- package/src/actions/data/derived.js +22 -0
- package/src/actions/data/filter.js +5 -0
- package/src/actions/data/gradientProfile.js +65 -0
- package/src/actions/data/horizon.js +71 -0
- package/src/actions/data/index.js +34 -2
- package/src/actions/data/intervalEdit.js +76 -0
- package/src/actions/data/window.js +50 -0
- package/src/actions/distributions/revision.js +326 -0
- package/src/actions/encodings/appearance.js +35 -1
- package/src/actions/encodings/color/index.js +17 -1
- package/src/actions/encodings/color/layout.js +8 -0
- package/src/actions/encodings/density/resolve.js +109 -0
- package/src/actions/encodings/density.js +330 -90
- package/src/actions/encodings/horizon/resolve.js +283 -0
- package/src/actions/encodings/horizon.js +364 -0
- package/src/actions/encodings/index.js +8 -0
- package/src/actions/encodings/parallel.js +115 -0
- package/src/actions/encodings/pathOrder.js +131 -0
- package/src/actions/encodings/position/apply.js +73 -4
- package/src/actions/encodings/position/index.js +15 -2
- package/src/actions/encodings/position/policies/arc.js +27 -4
- package/src/actions/encodings/position/policies/area.js +33 -2
- package/src/actions/encodings/position/policies/index.js +7 -2
- package/src/actions/encodings/position/policies/line.js +18 -2
- package/src/actions/encodings/position/resolve.js +24 -2
- package/src/actions/encodings/ranged.js +3 -1
- package/src/actions/encodings/remove.js +268 -0
- package/src/actions/encodings/ruleAppearance.js +88 -10
- package/src/actions/errorBands/edit.js +121 -13
- package/src/actions/errorBars/edit.js +45 -8
- package/src/actions/errorBars/options.js +7 -1
- package/src/actions/facets/actions.js +137 -3
- package/src/actions/facets/derive.js +33 -3
- package/src/actions/facets/replay.js +7 -36
- package/src/actions/gradientPlots/components.js +177 -0
- package/src/actions/gradientPlots/create.js +96 -0
- package/src/actions/gradientPlots/edit.js +501 -0
- package/src/actions/gradientPlots/index.js +24 -0
- package/src/actions/gradientPlots/materialize.js +287 -0
- package/src/actions/gradientPlots/options.js +120 -0
- package/src/actions/gradientPlots/paint.js +107 -0
- package/src/actions/gradientPlots/rebind.js +51 -0
- package/src/actions/gradientPlots/resolve.js +81 -0
- package/src/actions/guides/applicability.js +44 -17
- package/src/actions/guides/axes/axes.js +37 -3
- package/src/actions/guides/axes/edit.js +129 -47
- package/src/actions/guides/axes/index.js +2 -0
- package/src/actions/guides/axes/labels.js +11 -6
- package/src/actions/guides/axes/parallel/resolve.js +86 -0
- package/src/actions/guides/axes/parallel.js +228 -0
- package/src/actions/guides/axes/titles.js +11 -8
- package/src/actions/guides/guides.js +60 -5
- package/src/actions/guides/legends/categorical/actions.js +67 -19
- package/src/actions/guides/legends/continuous/common.js +3 -3
- package/src/actions/guides/legends/edit.js +63 -0
- package/src/actions/guides/legends/index.js +2 -0
- package/src/actions/guides/legends/remove.js +124 -30
- package/src/actions/guides/legends/strokeWidth.js +198 -0
- package/src/actions/index.js +6 -0
- package/src/actions/marks/arc/actions.js +46 -14
- package/src/actions/marks/area/actions.js +60 -136
- package/src/actions/marks/area/materialize.js +163 -0
- package/src/actions/marks/index.js +5 -1
- package/src/actions/marks/line/actions.js +99 -80
- package/src/actions/marks/line/materialize.js +146 -0
- package/src/actions/marks/point/create.js +76 -0
- package/src/actions/marks/point/edit.js +97 -0
- package/src/actions/marks/point/index.js +11 -1
- package/src/actions/marks/point/jitter.js +72 -0
- package/src/actions/marks/point/{actions.js → materialize.js} +183 -172
- package/src/actions/marks/rect/actions.js +3 -0
- package/src/actions/marks/remove.js +13 -2
- package/src/actions/marks/rule/actions.js +29 -4
- package/src/actions/marks/text/actions.js +19 -4
- package/src/actions/marks/text/index.js +7 -1
- package/src/actions/marks/text/layout.js +321 -0
- package/src/actions/primitives/semanticValidation/dataset.js +22 -0
- package/src/actions/primitives/semanticValidation/guide.js +43 -0
- package/src/actions/primitives/semanticValidation/index.js +23 -0
- package/src/actions/primitives/semanticValidation/layer.js +74 -0
- package/src/actions/primitives/semanticValidation/scale.js +74 -0
- package/src/actions/primitives/semanticValidation/shared.js +5 -0
- package/src/actions/primitives/semanticValue.js +1 -204
- package/src/actions/regression/edit.js +247 -88
- package/src/actions/scales/consumers/common.js +18 -0
- package/src/actions/scales/consumers/families.js +14 -3
- package/src/actions/scales/definitions.js +30 -0
- package/src/actions/scales/edit.js +6 -204
- package/src/actions/scales/editPolicy.js +214 -0
- package/src/actions/scales/materialize.js +1 -1
- package/src/actions/scales/patch.js +26 -0
- package/src/actions/selection/actions.js +150 -5
- package/src/actions/selection/index.js +6 -0
- package/src/actions/violinPlots/create.js +198 -0
- package/src/actions/violinPlots/index.js +5 -0
- package/src/core/textMetrics.js +47 -0
- package/src/core/vocabulary.js +14 -2
- package/src/grammar/arcs.js +49 -12
- package/src/grammar/areaSeries.js +41 -5
- package/src/grammar/bin2d.js +333 -0
- package/src/grammar/categoricalDensity.js +192 -0
- package/src/grammar/coordinates.js +1 -1
- package/src/grammar/curveCommands.js +3 -1
- package/src/grammar/density.js +252 -26
- package/src/grammar/facets/dependencies.js +3 -11
- package/src/grammar/facets/index.js +3 -1
- package/src/grammar/gradientProfile.js +213 -0
- package/src/grammar/horizon.js +455 -0
- package/src/grammar/jitter.js +197 -0
- package/src/grammar/lineSeries.js +69 -0
- package/src/grammar/paint.js +88 -0
- package/src/grammar/parallelCoordinates.js +213 -0
- package/src/grammar/pathOrder.js +35 -0
- package/src/grammar/pointShapes.js +24 -0
- package/src/grammar/rules.js +1 -0
- package/src/grammar/scales/appearance.js +21 -0
- package/src/grammar/schemas/concreteGraphic.js +11 -1
- package/src/grammar/schemas/graphicBounds.js +19 -37
- package/src/grammar/schemas/semanticPath.js +17 -2
- package/src/grammar/transforms.js +100 -11
- package/src/grammar/window.js +339 -0
- package/src/layout/labels.js +270 -0
- package/src/layout/text.js +4 -1
- package/src/layout/title.js +10 -20
- package/src/materialization/dataProvenance.js +56 -2
- package/src/materialization/dependencies.js +9 -14
- package/src/materialization/guides/resources.js +74 -24
- package/src/materialization/horizon.js +29 -0
- package/src/materialization/layout.js +15 -0
- package/src/materialization/marks/capabilities.js +21 -1
- package/src/materialization/marks/index.js +3 -0
- package/src/materialization/marks/pathOrder.js +71 -0
- package/src/materialization/marks/policies.js +6 -2
- package/src/materialization/scaleGuideDependencies.js +8 -0
- package/src/materialization/scales/resolve.js +2 -0
- package/src/materialization/selection/items/path.js +27 -1
- package/src/materialization/selection/items/point.js +1 -5
- package/src/materialization/selection/items/rect.js +21 -0
- package/src/materialization/selection/styles.js +20 -9
- package/src/materialization/text.js +12 -4
- package/src/renderers/canvas/fill.js +33 -0
- package/src/renderers/canvas/index.js +7 -0
- package/src/renderers/canvas/path.js +7 -4
- package/src/renderers/canvas/rect.js +9 -3
- package/src/selectors/datasets.js +4 -0
- package/src/theme/defaults.js +4 -0
- package/types/extension.d.ts +6 -0
- package/types/index.d.ts +77 -0
- package/types/program.d.ts +703 -17
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,59 @@ All notable changes to `ggaction` are recorded in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## [0.0.6] - 2026-07-23
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added explicit edit and removal lifecycles for encodings, point appearance, selections, highlights, legends, and
|
|
12
|
+
Cartesian axis components while preserving immutable state and meaningful action traces.
|
|
13
|
+
- Added revision workflows for 2D bins, interval statistics, regression, density, box plots, gradient plots, and facet
|
|
14
|
+
policies, including deterministic rematerialization after data-role and layout changes.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Expanded installed-package, Browser Canvas, Node PNG, TypeScript, action-contract, and cross-capability coverage for
|
|
19
|
+
the complete authoring lifecycle surface.
|
|
20
|
+
- Improved documentation entry points, navigation, chart discovery, gallery filtering, responsive presentation, and
|
|
21
|
+
generated API routing for the completed lifecycle actions.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Preserved unaffected shared-legend channels when selectively removing an encoding, and prevented removed resources
|
|
26
|
+
from returning after later rematerialization or facet replay.
|
|
27
|
+
- Kept documentation search results under the deployed `/ggaction/` base path and improved gallery text contrast.
|
|
28
|
+
- Allowed the approved Polar chart ink bounds to absorb the observed 1.5-pixel platform rasterization variance while
|
|
29
|
+
retaining exact primitive/public pixel comparisons and the existing density, color, and region checks.
|
|
30
|
+
|
|
31
|
+
## [0.0.5] - 2026-07-21
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- Added complete `createScatterPlot`, `createLinePlot`, `createBarPlot`, `createHistogram`, `createHeatmap`, and
|
|
36
|
+
`createParallelCoordinates` facades that reuse ordinary mark, encoding, scale, coordinate, and guide actions.
|
|
37
|
+
- Added deterministic point jitter, ordered line paths, collision-aware text labels, field-driven rule widths, and
|
|
38
|
+
weighted Polar sectors with immutable rematerialization across data, scale, Canvas, selection, and facet changes.
|
|
39
|
+
- Added window and rectangular 2D-bin data actions, binned heatmaps, categorical density and violin plots, Horizon
|
|
40
|
+
charts, Parallel Coordinates, and density-filled gradient plots with Browser Canvas and Node PNG parity.
|
|
41
|
+
- Added backend-neutral item-local gradient paint, expanded public declarations and action contracts, and runnable
|
|
42
|
+
chart examples for every new capability.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- Aligned Box Plot with the shared facade inference, ambiguity, public option-type, and opt-in guide contracts while
|
|
47
|
+
preserving its existing omitted-guide behavior.
|
|
48
|
+
- Reorganized source, test, documentation, and internal architecture ownership around explicit policies and capability
|
|
49
|
+
registries without changing the renderer's concrete `graphicSpec` boundary.
|
|
50
|
+
- Expanded public documentation with task-oriented API routing, generated split action references, improved mobile and
|
|
51
|
+
no-JavaScript navigation, complete facade discovery, and release-scoped deployment checks.
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- Materialized the documented default point radius, made direct quantitative line x/y authoring order-independent, and
|
|
56
|
+
made layered datum rules resolve to the expected full-span geometry instead of an empty result.
|
|
57
|
+
- Kept sticky documentation deep links below the top bar by sharing one computed fragment offset between CSS and the
|
|
58
|
+
page table of contents.
|
|
59
|
+
|
|
7
60
|
## [0.0.4] - 2026-07-19
|
|
8
61
|
|
|
9
62
|
### Changed
|
|
@@ -82,6 +135,8 @@ All notable changes to `ggaction` are recorded in this file.
|
|
|
82
135
|
- Cartesian charts are the complete current path. Polar semantic tokens exist only where explicitly documented and do
|
|
83
136
|
not imply complete polar rendering.
|
|
84
137
|
|
|
138
|
+
[0.0.6]: https://github.com/ggaction/ggaction/releases/tag/v0.0.6
|
|
139
|
+
[0.0.5]: https://github.com/ggaction/ggaction/releases/tag/v0.0.5
|
|
85
140
|
[0.0.4]: https://github.com/ggaction/ggaction/releases/tag/v0.0.4
|
|
86
141
|
[0.0.3]: https://github.com/ggaction/ggaction/releases/tag/v0.0.3
|
|
87
142
|
[0.0.2]: https://github.com/ggaction/ggaction/releases/tag/v0.0.2
|
package/README.md
CHANGED
|
@@ -38,10 +38,13 @@ import { chart } from "ggaction";
|
|
|
38
38
|
const program = chart()
|
|
39
39
|
.createCanvas()
|
|
40
40
|
.createData({ values: cars })
|
|
41
|
-
.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
.createScatterPlot({
|
|
42
|
+
id: "points",
|
|
43
|
+
x: "Displacement",
|
|
44
|
+
y: "Acceleration",
|
|
45
|
+
color: "Origin",
|
|
46
|
+
guides: false
|
|
47
|
+
})
|
|
45
48
|
.createRegression()
|
|
46
49
|
.createGuides();
|
|
47
50
|
```
|
|
@@ -74,22 +77,41 @@ const program = chart()
|
|
|
74
77
|
margin: { top: 30, right: 130, bottom: 60, left: 70 }
|
|
75
78
|
})
|
|
76
79
|
.createData({ values: observations })
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
.createGuides();
|
|
80
|
+
.createScatterPlot({
|
|
81
|
+
x: "displacement",
|
|
82
|
+
y: "acceleration",
|
|
83
|
+
color: "origin"
|
|
84
|
+
});
|
|
83
85
|
|
|
84
86
|
const context = document.querySelector("#chart").getContext("2d");
|
|
85
87
|
render(program, context);
|
|
86
88
|
```
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
Use `createLinePlot`, `createBarPlot`, `createHistogram`, and `createHeatmap` for
|
|
91
|
+
the other basic Cartesian charts. Each facade records the regular mark,
|
|
92
|
+
encoding, and guide actions as trace children, and the same resource-specific
|
|
93
|
+
actions remain available for later edits. See the
|
|
94
|
+
[Basic Charts API](https://ggaction.github.io/ggaction/api/basic-charts/).
|
|
95
|
+
|
|
96
|
+
Use `createParallelCoordinates({ dimensions })` to connect each source row
|
|
97
|
+
across ordered, dimension-local scales and axes. See the
|
|
98
|
+
[Parallel Coordinates API](https://ggaction.github.io/ggaction/api/parallel-coordinates/)
|
|
99
|
+
or the [runnable Cars example](./examples/cars-parallel-coordinates/).
|
|
100
|
+
|
|
101
|
+
For an advanced layered example, follow the [regression recipe](https://ggaction.github.io/ggaction/recipes/regression-scatterplot/)
|
|
102
|
+
or open the [runnable regression example](./examples/cars-regression-scatterplot/).
|
|
103
|
+
To compare category distributions with density-filled strips, read the
|
|
104
|
+
[gradient-plot guide](https://ggaction.github.io/ggaction/api/gradient-plots/)
|
|
105
|
+
or open the [runnable example](./examples/cars-gradient-plot/).
|
|
106
|
+
For symmetric or split density shapes centered on categories, use the
|
|
107
|
+
[violin-plot API](https://ggaction.github.io/ggaction/api/violin-plots/) or the
|
|
108
|
+
[runnable Cars example](./examples/cars-acceleration-violins/).
|
|
109
|
+
For compact signed time-series bands, use `encodeHorizon` on an area mark and
|
|
110
|
+
open the [runnable Gapminder example](./examples/gapminder-horizon/).
|
|
89
111
|
|
|
90
112
|
## What it supports
|
|
91
113
|
|
|
92
|
-
- Cartesian and
|
|
114
|
+
- Cartesian, Polar, and Parallel-coordinate charts
|
|
93
115
|
- Statistical layers and intervals
|
|
94
116
|
- Faceting and program composition
|
|
95
117
|
- Mark selection and coordinated highlighting
|
|
@@ -120,7 +142,7 @@ All entries include TypeScript declarations. The default entry is browser-safe;
|
|
|
120
142
|
|
|
121
143
|
## Status and development
|
|
122
144
|
|
|
123
|
-
> **Status:** `0.0.
|
|
145
|
+
> **Status:** `0.0.6` is the current experimental public release. APIs may change before `1.0.0`; changes are recorded in the [changelog](./CHANGELOG.md).
|
|
124
146
|
|
|
125
147
|
```bash
|
|
126
148
|
npm install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggaction",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Build charts through immutable, traceable graphical actions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hyeon Jeon",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"files": [
|
|
24
24
|
"src/",
|
|
25
|
-
"!src
|
|
25
|
+
"!src/**/AGENTS.md",
|
|
26
26
|
"types/",
|
|
27
27
|
"README.md",
|
|
28
28
|
"CHANGELOG.md",
|
|
@@ -54,19 +54,29 @@
|
|
|
54
54
|
"test:docs:built": "node scripts/check-built-docs.js _site",
|
|
55
55
|
"test:docs:browser": "node scripts/test-built-docs.js _site",
|
|
56
56
|
"test:coverage": "node scripts/run-tests.js coverage",
|
|
57
|
-
"test:render": "node
|
|
57
|
+
"test:render": "node scripts/run-render-tests.js",
|
|
58
58
|
"assets:readme": "node scripts/generate-readme-demo.js",
|
|
59
|
-
"artifacts:
|
|
60
|
-
"artifacts:gallery
|
|
59
|
+
"artifacts:clean": "node test/support/artifacts.js",
|
|
60
|
+
"artifacts:gallery": "node scripts/generate-artifact-gallery.js",
|
|
61
|
+
"artifacts:gallery:test": "node scripts/test-artifact-gallery.js",
|
|
61
62
|
"docs:images": "node scripts/generate-doc-images.js",
|
|
62
63
|
"docs:llms": "node scripts/generate-llm-docs.js",
|
|
63
64
|
"docs:capabilities": "node scripts/generate-doc-capabilities.js",
|
|
64
65
|
"docs:capabilities:check": "node scripts/generate-doc-capabilities.js --check",
|
|
66
|
+
"docs:actions": "node scripts/generate-doc-action-metadata.js",
|
|
67
|
+
"docs:actions:check": "node scripts/generate-doc-action-metadata.js --check",
|
|
68
|
+
"docs:search": "node scripts/generate-doc-search-index.js",
|
|
69
|
+
"docs:search:check": "node scripts/generate-doc-search-index.js --check",
|
|
70
|
+
"docs:reference": "node scripts/generate-doc-action-reference.js",
|
|
71
|
+
"docs:reference:check": "node scripts/generate-doc-action-reference.js --check",
|
|
72
|
+
"docs:metadata": "node scripts/generate-doc-page-metadata.js",
|
|
73
|
+
"docs:metadata:check": "node scripts/generate-doc-page-metadata.js --check",
|
|
74
|
+
"docs:preflight": "node scripts/check-docs-environment.js",
|
|
65
75
|
"docs:signatures": "node scripts/generate-doc-signatures.js",
|
|
66
76
|
"docs:signatures:check": "node scripts/generate-doc-signatures.js --check",
|
|
67
|
-
"docs:generate": "npm run docs:signatures && npm run docs:capabilities && npm run docs:images && npm run docs:llms",
|
|
77
|
+
"docs:generate": "npm run docs:signatures && npm run docs:capabilities && npm run docs:actions && npm run docs:reference && npm run docs:metadata && npm run docs:search && npm run docs:images && npm run docs:llms",
|
|
68
78
|
"docs:build": "bundle exec jekyll build --source docs --destination _site --baseurl /ggaction",
|
|
69
|
-
"docs:verify": "npm run docs:generate && npm run test:docs && npm run docs:build && npm run test:docs:built && npm run test:docs:browser",
|
|
79
|
+
"docs:verify": "npm run docs:preflight && npm run docs:generate && npm run test:docs && npm run docs:build && npm run test:docs:built && npm run test:docs:browser",
|
|
70
80
|
"contracts:catalog": "node scripts/generate-action-catalog.js",
|
|
71
81
|
"contracts:catalog:check": "node scripts/generate-action-catalog.js --check",
|
|
72
82
|
"package:check": "node scripts/package-artifact.js --check",
|
|
@@ -86,6 +96,7 @@
|
|
|
86
96
|
"@napi-rs/canvas": "^1.0.2"
|
|
87
97
|
},
|
|
88
98
|
"devDependencies": {
|
|
99
|
+
"@axe-core/playwright": "^4.12.1",
|
|
89
100
|
"es-module-lexer": "^1.7.0",
|
|
90
101
|
"gifenc": "^1.0.3",
|
|
91
102
|
"playwright": "^1.61.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { action } from "../../core/action.js";
|
|
2
2
|
import { validateKeys } from "../../core/validation.js";
|
|
3
|
-
import { findDataset } from "../../selectors/datasets.js";
|
|
4
3
|
import { findSemanticScale } from "../../selectors/scales.js";
|
|
4
|
+
import { resolveFacadeData } from "../charts/shared.js";
|
|
5
5
|
import {
|
|
6
6
|
BOX_PLOT_OPTIONS,
|
|
7
7
|
boxEncodingArgs,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
resolveBoxMedianAppearance,
|
|
10
10
|
resolveBoxOutlierAppearance,
|
|
11
11
|
resolveBoxPosition,
|
|
12
|
+
resolveBoxGuides,
|
|
12
13
|
resolveBoxWhisker,
|
|
13
14
|
resolveBoxWidth
|
|
14
15
|
} from "./options.js";
|
|
@@ -26,11 +27,14 @@ export const createBoxPlot = action(
|
|
|
26
27
|
function (args = {}) {
|
|
27
28
|
validateKeys(args, BOX_PLOT_OPTIONS, "createBoxPlot");
|
|
28
29
|
const id = resolveBoxPlotId(this, args.id);
|
|
29
|
-
const source = resolveBoxSourceLayer(this, args.target
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
const source = resolveBoxSourceLayer(this, args.target, {
|
|
31
|
+
requiresInference: args.x === undefined || args.y === undefined
|
|
32
|
+
});
|
|
33
|
+
const data = resolveFacadeData(
|
|
34
|
+
this,
|
|
35
|
+
args.data ?? source?.data,
|
|
36
|
+
"createBoxPlot"
|
|
37
|
+
);
|
|
34
38
|
const x = resolveBoxPosition(args.x, "x") ?? source?.encoding?.x;
|
|
35
39
|
const y = resolveBoxPosition(args.y, "y") ?? source?.encoding?.y;
|
|
36
40
|
const whisker = resolveBoxWhisker(args.whisker);
|
|
@@ -41,6 +45,7 @@ export const createBoxPlot = action(
|
|
|
41
45
|
const box = resolveBoxAppearance(args.box);
|
|
42
46
|
const median = resolveBoxMedianAppearance(args.median);
|
|
43
47
|
const outlier = resolveBoxOutlierAppearance(args.outlier);
|
|
48
|
+
const guides = resolveBoxGuides(args.guides);
|
|
44
49
|
if (x !== undefined && y !== undefined && resolveBoxOrientation(x, y) === undefined) {
|
|
45
50
|
throw new Error(
|
|
46
51
|
"createBoxPlot requires one categorical axis and one quantitative axis."
|
|
@@ -62,7 +67,8 @@ export const createBoxPlot = action(
|
|
|
62
67
|
outliers: args.outliers ?? true,
|
|
63
68
|
box,
|
|
64
69
|
median,
|
|
65
|
-
outlier
|
|
70
|
+
outlier,
|
|
71
|
+
guides
|
|
66
72
|
}
|
|
67
73
|
});
|
|
68
74
|
if (x !== undefined) {
|