ggaction 0.0.13 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +146 -0
- package/README.md +41 -12
- package/knowledge/action-cards.json +1 -1
- package/knowledge/intent-taxonomy.json +1 -1
- package/knowledge/mcp-resources.json +1 -1
- package/knowledge/task-packet.schema.json +1 -1
- package/knowledge/task-resolver.js +1 -1
- package/package.json +39 -7
- package/src/BasicChartProgram.js +3 -1
- package/src/ChartProgram.js +2 -0
- package/src/accessibility.js +157 -0
- package/src/actions/basic.js +2 -2
- package/src/actions/boxPlots/components.js +20 -12
- package/src/actions/boxPlots/create.js +4 -5
- package/src/actions/boxPlots/edit.js +34 -9
- package/src/actions/boxPlots/materialize.js +12 -4
- package/src/actions/boxPlots/options.js +48 -16
- package/src/actions/canvas/actions.js +3 -3
- package/src/actions/canvas/fitting.js +1 -1
- package/src/actions/categoryOrder/index.js +21 -12
- package/src/actions/charts/area.js +6 -2
- package/src/actions/charts/bar.js +3 -2
- package/src/actions/charts/beeswarm.js +1 -1
- package/src/actions/charts/density.js +7 -3
- package/src/actions/charts/ecdf.js +6 -3
- package/src/actions/charts/endpoints.js +29 -7
- package/src/actions/charts/heatmap.js +3 -2
- package/src/actions/charts/histogram.js +5 -4
- package/src/actions/charts/horizon.js +4 -2
- package/src/actions/charts/interval-regression.js +7 -4
- package/src/actions/charts/line.js +4 -2
- package/src/actions/charts/parallel.js +9 -3
- package/src/actions/charts/pie.js +11 -3
- package/src/actions/charts/polar.js +17 -6
- package/src/actions/charts/radar.js +9 -3
- package/src/actions/charts/radial.js +12 -4
- package/src/actions/charts/raincloud.js +2 -2
- package/src/actions/charts/rug-strip.js +8 -4
- package/src/actions/charts/scatter.js +4 -2
- package/src/actions/composition/actions.js +29 -24
- package/src/actions/coordinates/actions.js +2 -2
- package/src/actions/coordinates/edit.js +76 -0
- package/src/actions/data/basicBin2d.js +4 -5
- package/src/actions/data/bin.js +3 -3
- package/src/actions/data/bin2d.js +63 -193
- package/src/actions/data/bin2dMaterialize.js +4 -5
- package/src/actions/data/box.js +4 -4
- package/src/actions/data/complete.js +26 -0
- package/src/actions/data/computed.js +4 -4
- package/src/actions/data/create.js +7 -14
- package/src/actions/data/density.js +15 -23
- package/src/actions/data/derived.js +57 -31
- package/src/actions/data/ecdf.js +2 -2
- package/src/actions/data/edit.js +551 -0
- package/src/actions/data/filter.js +28 -22
- package/src/actions/data/fold.js +2 -2
- package/src/actions/data/gradientProfile.js +2 -2
- package/src/actions/data/horizon.js +2 -2
- package/src/actions/data/impute.js +26 -0
- package/src/actions/data/index.js +62 -47
- package/src/actions/data/interval.js +2 -2
- package/src/actions/data/intervalEdit.js +26 -18
- package/src/actions/data/normalize.js +27 -0
- package/src/actions/data/regression.js +21 -27
- package/src/actions/data/revise.js +48 -0
- package/src/actions/data/revisionBindings.js +125 -0
- package/src/actions/data/shared.js +20 -4
- package/src/actions/data/stack.js +2 -2
- package/src/actions/data/summary.js +3 -3
- package/src/actions/data/timeUnit.js +6 -3
- package/src/actions/data/window.js +3 -3
- package/src/actions/encodings/angle.js +1 -1
- package/src/actions/encodings/appearance.js +4 -4
- package/src/actions/encodings/barWidth.js +1 -1
- package/src/actions/encodings/channels.js +415 -0
- package/src/actions/encodings/color/index.js +3 -2
- package/src/actions/encodings/density.js +7 -4
- package/src/actions/encodings/histogram.js +4 -3
- package/src/actions/encodings/horizon.js +6 -8
- package/src/actions/encodings/index.js +4 -0
- package/src/actions/encodings/offset.js +22 -15
- package/src/actions/encodings/parallel.js +4 -5
- package/src/actions/encodings/pathOrder.js +6 -11
- package/src/actions/encodings/position/apply.js +53 -7
- package/src/actions/encodings/position/index.js +14 -6
- package/src/actions/encodings/position/policies/bar.js +9 -0
- package/src/actions/encodings/position/resolve.js +24 -7
- package/src/actions/encodings/ranged.js +5 -5
- package/src/actions/encodings/remove.js +13 -9
- package/src/actions/encodings/ruleAppearance.js +2 -24
- package/src/actions/encodings/seriesLayout.js +2 -1
- package/src/actions/encodings/shared.js +82 -14
- package/src/actions/encodings/stroke.js +226 -0
- package/src/actions/encodings/strokeDash.js +2 -2
- package/src/actions/encodings/text.js +1 -1
- package/src/actions/errorBands/create.js +34 -20
- package/src/actions/errorBands/edit.js +34 -137
- package/src/actions/errorBars/create.js +43 -20
- package/src/actions/errorBars/edit.js +29 -125
- package/src/actions/facets/actions.js +267 -73
- package/src/actions/facets/derive.js +99 -28
- package/src/actions/facets/guides.js +4 -5
- package/src/actions/facets/replay.js +4 -5
- package/src/actions/gradientPlots/components.js +15 -8
- package/src/actions/gradientPlots/create.js +4 -5
- package/src/actions/gradientPlots/edit.js +18 -9
- package/src/actions/gradientPlots/materialize.js +5 -3
- package/src/actions/gradientPlots/options.js +10 -2
- package/src/actions/gradientPlots/rebind.js +4 -5
- package/src/actions/guides/applicability.js +8 -2
- package/src/actions/guides/axes/axes.js +23 -4
- package/src/actions/guides/axes/axis.js +2 -2
- package/src/actions/guides/axes/edit.js +2 -2
- package/src/actions/guides/axes/labels.js +67 -21
- package/src/actions/guides/axes/lines.js +15 -9
- package/src/actions/guides/axes/parallel/lifecycle.js +13 -13
- package/src/actions/guides/axes/parallel/resolve.js +6 -2
- package/src/actions/guides/axes/parallel.js +5 -5
- package/src/actions/guides/axes/remove.js +4 -4
- package/src/actions/guides/axes/tickGroups.js +6 -5
- package/src/actions/guides/axes/ticks.js +19 -6
- package/src/actions/guides/axes/titles.js +21 -13
- package/src/actions/guides/grids/grid.js +18 -29
- package/src/actions/guides/grids/resolve.js +7 -2
- package/src/actions/guides/guides.js +20 -4
- package/src/actions/guides/legends/blocks.js +426 -0
- package/src/actions/guides/legends/categorical/actions.js +138 -52
- package/src/actions/guides/legends/categorical/components.js +55 -45
- package/src/actions/guides/legends/categorical/index.js +37 -33
- package/src/actions/guides/legends/categorical/layout.js +98 -16
- package/src/actions/guides/legends/categorical/options.js +2 -2
- package/src/actions/guides/legends/categorical/recipes.js +111 -20
- package/src/actions/guides/legends/categorical/resolve.js +12 -8
- package/src/actions/guides/legends/categorical/symbols.js +104 -52
- package/src/actions/guides/legends/continuous/common.js +76 -20
- package/src/actions/guides/legends/continuous/gradient.js +95 -158
- package/src/actions/guides/legends/continuous/index.js +2 -0
- package/src/actions/guides/legends/continuous/interval.js +21 -16
- package/src/actions/guides/legends/continuous/opacity.js +37 -83
- package/src/actions/guides/legends/continuous/stroke.js +225 -0
- package/src/actions/guides/legends/creation.js +14 -1
- package/src/actions/guides/legends/edit.js +159 -60
- package/src/actions/guides/legends/focused.js +5 -5
- package/src/actions/guides/legends/index.js +2 -0
- package/src/actions/guides/legends/lane.js +59 -24
- package/src/actions/guides/legends/lifecycle.js +19 -8
- package/src/actions/guides/legends/remove.js +17 -8
- package/src/actions/guides/legends/sampling.js +140 -0
- package/src/actions/guides/legends/size.js +100 -108
- package/src/actions/guides/legends/strokeWidth.js +38 -92
- package/src/actions/guides/legends/target.js +112 -1
- package/src/actions/guides/legends/transition.js +165 -16
- package/src/actions/guides/polar/axes/facade.js +8 -8
- package/src/actions/guides/polar/axes/labels.js +29 -10
- package/src/actions/guides/polar/axes/lines.js +19 -19
- package/src/actions/guides/polar/axes/shared.js +16 -0
- package/src/actions/guides/polar/axes/ticks.js +10 -16
- package/src/actions/guides/polar/axes/titles.js +6 -6
- package/src/actions/guides/polar/grids.js +12 -14
- package/src/actions/guides/polar/resolve.js +12 -8
- package/src/actions/index.js +16 -3
- package/src/actions/intervals/revision.js +126 -0
- package/src/actions/marks/arc/actions.js +80 -22
- package/src/actions/marks/area/actions.js +38 -13
- package/src/actions/marks/area/materialize.js +17 -1
- package/src/actions/marks/bar/create.js +12 -3
- package/src/actions/marks/bar/edit.js +21 -4
- package/src/actions/marks/bar/materialize.js +34 -40
- package/src/actions/marks/index.js +10 -1
- package/src/actions/marks/line/actions.js +40 -17
- package/src/actions/marks/line/materialize.js +29 -10
- package/src/actions/marks/point/create.js +9 -3
- package/src/actions/marks/point/edit.js +19 -7
- package/src/actions/marks/point/jitter.js +6 -8
- package/src/actions/marks/point/materialize.js +48 -22
- package/src/actions/marks/point/packing.js +6 -8
- package/src/actions/marks/rect/actions.js +36 -15
- package/src/actions/marks/references.js +602 -33
- package/src/actions/marks/remove.js +67 -41
- package/src/actions/marks/rule/actions.js +51 -14
- package/src/actions/marks/shared.js +1 -1
- package/src/actions/marks/text/actions.js +79 -14
- package/src/actions/marks/text/index.js +4 -0
- package/src/actions/marks/text/layout.js +157 -17
- package/src/actions/marks/text/removal.js +173 -0
- package/src/actions/marks/text/selection.js +72 -0
- package/src/actions/marks/tick/actions.js +25 -8
- package/src/actions/primitives/createGraphics.js +5 -4
- package/src/actions/primitives/editGraphics.js +31 -4
- package/src/actions/primitives/graphicProperties.js +6 -0
- package/src/actions/primitives/semantic.js +11 -3
- package/src/actions/primitives/semanticAction.js +90 -14
- package/src/actions/primitives/semanticValidation/dataset.js +2 -4
- package/src/actions/primitives/semanticValidation/guide.js +1 -1
- package/src/actions/primitives/semanticValidation/index.js +9 -1
- package/src/actions/primitives/semanticValidation/layer.js +5 -0
- package/src/actions/primitives/semanticValidation/scale.js +28 -7
- package/src/actions/regression/components.js +36 -25
- package/src/actions/regression/create.js +13 -6
- package/src/actions/regression/edit.js +24 -11
- package/src/actions/resources/index.js +7 -0
- package/src/actions/resources/remove.js +173 -0
- package/src/actions/scales/channels.js +212 -0
- package/src/actions/scales/consumers/common.js +1 -1
- package/src/actions/scales/consumers/families.js +3 -2
- package/src/actions/scales/consumers/index.js +19 -2
- package/src/actions/scales/consumers/seriesLayout.js +28 -14
- package/src/actions/scales/create.js +55 -23
- package/src/actions/scales/definitions.js +94 -40
- package/src/actions/scales/edit.js +67 -12
- package/src/actions/scales/editPolicy.js +81 -11
- package/src/actions/scales/index.js +6 -0
- package/src/actions/scales/materialize.js +5 -4
- package/src/actions/scales/offset.js +48 -0
- package/src/actions/scales/parallel.js +71 -0
- package/src/actions/scales/preview.js +111 -10
- package/src/actions/scales/quantitativeColor.js +4 -5
- package/src/actions/selection/actions.js +179 -66
- package/src/actions/selection/index.js +3 -0
- package/src/actions/textMetrics/index.js +56 -0
- package/src/actions/theme/actions.js +70 -15
- package/src/actions/theme/composition.js +238 -0
- package/src/actions/theme/index.js +9 -2
- package/src/actions/theme/reconcile.js +313 -121
- package/src/actions/theme/state.js +160 -0
- package/src/actions/titles/actions.js +8 -8
- package/src/actions/titles/resolve.js +3 -3
- package/src/actions/violinPlots/create.js +6 -3
- package/src/actions/violinPlots/edit.js +2 -1
- package/src/core/action.js +117 -35
- package/src/core/compositionState.js +6 -1
- package/src/core/diagnostics.js +16 -0
- package/src/core/extensionRegistry.js +27 -0
- package/src/core/font.js +18 -0
- package/src/core/identifiers.js +5 -4
- package/src/core/immutable.js +10 -3
- package/src/core/optionRequirements.js +8 -0
- package/src/core/programState.js +21 -1
- package/src/core/resourceReferences.js +341 -0
- package/src/core/textMetricProfile.js +28 -0
- package/src/core/textMetrics.js +24 -3
- package/src/core/validation.js +22 -10
- package/src/core/vocabulary.js +16 -3
- package/src/diagnostics.js +1 -0
- package/src/grammar/bars/aggregate.js +4 -1
- package/src/grammar/bars/geometry.js +44 -0
- package/src/grammar/bin.js +54 -9
- package/src/grammar/complete.js +279 -0
- package/src/grammar/computed.js +265 -64
- package/src/grammar/coordinates.js +37 -0
- package/src/grammar/density.js +239 -37
- package/src/grammar/displayLabels.js +57 -0
- package/src/grammar/facets/dependencies.js +133 -1
- package/src/grammar/facets/guides.js +3 -0
- package/src/grammar/facets/index.js +7 -47
- package/src/grammar/facets/scales.js +15 -18
- package/src/grammar/impute.js +341 -0
- package/src/grammar/markLabelSelection.js +57 -0
- package/src/grammar/markLabels.js +18 -1
- package/src/grammar/normalize.js +366 -0
- package/src/grammar/pathSeries.js +26 -8
- package/src/grammar/pointShapes.js +13 -4
- package/src/grammar/polar.js +90 -8
- package/src/grammar/regression/index.js +1 -0
- package/src/grammar/regression/parameters.js +23 -0
- package/src/grammar/roundedRect.js +180 -0
- package/src/grammar/rules.js +1 -0
- package/src/grammar/scales/colorConsumers.js +20 -1
- package/src/grammar/scales/continuous.js +2 -2
- package/src/grammar/scales/definition.js +27 -4
- package/src/grammar/scales/index.js +1 -0
- package/src/grammar/scales/ordinal.js +12 -3
- package/src/grammar/scales/policies.js +2 -2
- package/src/grammar/scales/size.js +456 -0
- package/src/grammar/scales/types.js +8 -0
- package/src/grammar/schemas/concreteGraphic.js +14 -2
- package/src/grammar/schemas/graphic.js +15 -0
- package/src/grammar/schemas/graphicBounds.js +190 -41
- package/src/grammar/schemas/semanticPath.js +7 -2
- package/src/grammar/statisticalReference.js +103 -0
- package/src/grammar/strokeStyle.js +77 -0
- package/src/grammar/summary.js +78 -16
- package/src/grammar/timeUnit.js +216 -5
- package/src/grammar/transformTopology.js +4 -0
- package/src/grammar/transforms.js +394 -28
- package/src/grammar/weightedStatistics.js +374 -0
- package/src/grammar/window.js +221 -16
- package/src/layout/aspect.js +80 -0
- package/src/layout/facets.js +59 -5
- package/src/layout/labels.js +351 -7
- package/src/layout/legend.js +4 -4
- package/src/layout/legendItems.js +6 -6
- package/src/layout/text.js +10 -9
- package/src/layout/title.js +9 -9
- package/src/materialization/bars/aggregate.js +25 -2
- package/src/materialization/bars/histogram.js +84 -24
- package/src/materialization/bars/ranged.js +19 -3
- package/src/materialization/bars/resolve.js +7 -4
- package/src/materialization/composition.js +3 -1
- package/src/materialization/coordinateBounds.js +204 -0
- package/src/materialization/dependencies.js +36 -0
- package/src/materialization/facetGuides/legacyCategorical.js +3 -0
- package/src/materialization/facetGuides/placement.js +9 -3
- package/src/materialization/facetGuides/preparation.js +13 -8
- package/src/materialization/facetHeaders.js +347 -0
- package/src/materialization/facets.js +15 -65
- package/src/materialization/guides/layout.js +3 -3
- package/src/materialization/guides/resources.js +26 -0
- package/src/materialization/legends.js +1 -1
- package/src/materialization/marks/index.js +11 -5
- package/src/materialization/marks/policies.js +2 -1
- package/src/materialization/rect.js +25 -12
- package/src/materialization/rectConfig.js +5 -1
- package/src/materialization/scaleGuideDependencies.js +10 -0
- package/src/materialization/scales/map.js +5 -3
- package/src/materialization/scales/policies/binnedPosition.js +2 -2
- package/src/materialization/scales/policies/offset.js +50 -8
- package/src/materialization/scales/policies/series.js +4 -1
- package/src/materialization/scales/resolve.js +22 -6
- package/src/materialization/selection/items/arc.js +28 -4
- package/src/materialization/selection/items/bar.js +30 -3
- package/src/materialization/selection/items/common.js +20 -5
- package/src/materialization/selection/items/rect.js +28 -4
- package/src/materialization/selection/path.js +1 -1
- package/src/materialization/selection/point.js +3 -1
- package/src/materialization/text.js +265 -14
- package/src/materialization/typography.js +31 -0
- package/src/mcp/cli.js +5 -3
- package/src/persistence/codec.js +65 -0
- package/src/persistence/validation.js +185 -0
- package/src/persistence.js +74 -0
- package/src/renderers/canvas/circle.js +2 -3
- package/src/renderers/canvas/index.js +5 -4
- package/src/renderers/canvas/line.js +2 -3
- package/src/renderers/canvas/native.js +4 -4
- package/src/renderers/canvas/path.js +2 -3
- package/src/renderers/canvas/rect.js +2 -3
- package/src/renderers/canvas/stroke.js +11 -0
- package/src/renderers/nativeBackend.js +10 -0
- package/src/renderers/options.js +13 -0
- package/src/renderers/pdf.js +25 -54
- package/src/renderers/png.js +22 -17
- package/src/renderers/svg.js +29 -14
- package/src/renderers/text.js +1 -11
- package/src/selectors/coordinates.js +3 -1
- package/src/selectors/datasets.js +38 -5
- package/src/selectors/layers.js +10 -4
- package/src/selectors/markOwners.js +46 -0
- package/src/selectors/scales.js +6 -4
- package/src/theme/defaults.js +103 -1
- package/src/version.js +2 -0
- package/types/accessibility.d.ts +37 -0
- package/types/basic.d.ts +10 -2
- package/types/diagnostics.d.ts +15 -0
- package/types/index.d.ts +90 -0
- package/types/pdf.d.ts +9 -0
- package/types/persistence.d.ts +7 -0
- package/types/png.d.ts +9 -0
- package/types/program.d.ts +944 -118
|
@@ -9,7 +9,7 @@ const OPTIONS = Object.freeze([
|
|
|
9
9
|
"kernel", "normalization", "center", "as"
|
|
10
10
|
]);
|
|
11
11
|
|
|
12
|
-
export const materializeGradientProfileData = derivedMaterializer(
|
|
12
|
+
export const materializeGradientProfileData = /* @__PURE__ */ derivedMaterializer(
|
|
13
13
|
"materializeGradientProfileData",
|
|
14
14
|
"Materialize one categorical density-profile dataset.",
|
|
15
15
|
"gradientProfile",
|
|
@@ -24,7 +24,7 @@ export const materializeGradientProfileData = derivedMaterializer(
|
|
|
24
24
|
}]
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
export const createGradientProfileData = derivedCreator(
|
|
27
|
+
export const createGradientProfileData = /* @__PURE__ */ derivedCreator(
|
|
28
28
|
"createGradientProfileData",
|
|
29
29
|
"Create one immutable categorical density-profile dataset.",
|
|
30
30
|
OPTIONS,
|
|
@@ -26,7 +26,7 @@ function requestedTransform(args) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export const materializeHorizonData = derivedMaterializer(
|
|
29
|
+
export const materializeHorizonData = /* @__PURE__ */ derivedMaterializer(
|
|
30
30
|
"materializeHorizonData",
|
|
31
31
|
"Materialize one immutable Horizon band dataset.",
|
|
32
32
|
"horizon",
|
|
@@ -34,7 +34,7 @@ export const materializeHorizonData = derivedMaterializer(
|
|
|
34
34
|
result => [{ ...result.transform, resolved: result.resolved }]
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
export const createHorizonData = derivedCreator(
|
|
37
|
+
export const createHorizonData = /* @__PURE__ */ derivedCreator(
|
|
38
38
|
"createHorizonData",
|
|
39
39
|
"Create one immutable Horizon band dataset.",
|
|
40
40
|
OPTIONS,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deriveImputedRows,
|
|
3
|
+
normalizeImputeTransform
|
|
4
|
+
} from "../../grammar/impute.js";
|
|
5
|
+
import { derivedCreator, derivedMaterializer } from "./shared.js";
|
|
6
|
+
|
|
7
|
+
const OPTIONS = Object.freeze([
|
|
8
|
+
"id", "source", "fields", "groupBy", "sortBy", "method", "value", "edges", "maxGap"
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
export const materializeImputedData = /* @__PURE__ */ derivedMaterializer(
|
|
12
|
+
"materializeImputedData",
|
|
13
|
+
"Materialize one immutable missing-value dataset.",
|
|
14
|
+
"impute",
|
|
15
|
+
deriveImputedRows
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const createImputedData = /* @__PURE__ */ derivedCreator(
|
|
19
|
+
"createImputedData",
|
|
20
|
+
"Replace explicit missing cells within independent groups.",
|
|
21
|
+
OPTIONS,
|
|
22
|
+
"Imputed dataset id",
|
|
23
|
+
"Imputed source dataset id",
|
|
24
|
+
normalizeImputeTransform,
|
|
25
|
+
"materializeImputedData"
|
|
26
|
+
);
|
|
@@ -35,60 +35,75 @@ import {
|
|
|
35
35
|
materializeBin2DData
|
|
36
36
|
} from "./bin2d.js";
|
|
37
37
|
import { createData } from "./create.js";
|
|
38
|
+
import { reviseData } from "./revise.js";
|
|
38
39
|
import { createWindowData, materializeWindowData } from "./window.js";
|
|
39
40
|
import { createSummaryData, materializeSummaryData } from "./summary.js";
|
|
40
41
|
import { createBinData, materializeBinData } from "./bin.js";
|
|
41
42
|
import { createFoldData, materializeFoldData } from "./fold.js";
|
|
42
43
|
import { createComputedData, materializeComputedData } from "./computed.js";
|
|
44
|
+
import {
|
|
45
|
+
createNormalizedData,
|
|
46
|
+
materializeNormalizedData
|
|
47
|
+
} from "./normalize.js";
|
|
48
|
+
import { createCompleteData, materializeCompleteData } from "./complete.js";
|
|
49
|
+
import { createImputedData, materializeImputedData } from "./impute.js";
|
|
43
50
|
import { createStackData, materializeStackData } from "./stack.js";
|
|
51
|
+
import { EDIT_DERIVED_DATA_ACTIONS } from "./edit.js";
|
|
44
52
|
import { createBoxSummaryData, createBoxOutlierData, materializeBoxSummaryData, materializeBoxOutlierData } from "./box.js";
|
|
45
53
|
|
|
46
54
|
export function registerDataActions(ProgramClass) {
|
|
47
|
-
ProgramClass.prototype
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
materializeGradientProfileData
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
55
|
+
Object.assign(ProgramClass.prototype, EDIT_DERIVED_DATA_ACTIONS, {
|
|
56
|
+
createData,
|
|
57
|
+
reviseData,
|
|
58
|
+
createDerivedData,
|
|
59
|
+
bindMarkData,
|
|
60
|
+
releaseDerivedData,
|
|
61
|
+
rebindLayerData,
|
|
62
|
+
createDensityData,
|
|
63
|
+
createCategoricalDensityData,
|
|
64
|
+
materializeFilteredData,
|
|
65
|
+
materializeMarkFilteredData,
|
|
66
|
+
filterData,
|
|
67
|
+
filterMarks,
|
|
68
|
+
materializeEmptyMark,
|
|
69
|
+
removeMarkFilter,
|
|
70
|
+
materializeRegressionData,
|
|
71
|
+
materializeDensityData,
|
|
72
|
+
createGradientProfileData,
|
|
73
|
+
materializeGradientProfileData,
|
|
74
|
+
createRegressionData,
|
|
75
|
+
materializeIntervalData,
|
|
76
|
+
createIntervalData,
|
|
77
|
+
createECDFData,
|
|
78
|
+
materializeECDFData,
|
|
79
|
+
createHorizonData,
|
|
80
|
+
materializeHorizonData,
|
|
81
|
+
createWindowData,
|
|
82
|
+
materializeWindowData,
|
|
83
|
+
createSummaryData,
|
|
84
|
+
materializeSummaryData,
|
|
85
|
+
createBinData,
|
|
86
|
+
materializeBinData,
|
|
87
|
+
createFoldData,
|
|
88
|
+
materializeFoldData,
|
|
89
|
+
createComputedData,
|
|
90
|
+
materializeComputedData,
|
|
91
|
+
createNormalizedData,
|
|
92
|
+
materializeNormalizedData,
|
|
93
|
+
createCompleteData,
|
|
94
|
+
materializeCompleteData,
|
|
95
|
+
createImputedData,
|
|
96
|
+
materializeImputedData,
|
|
97
|
+
createStackData,
|
|
98
|
+
materializeStackData,
|
|
99
|
+
createTimeUnitData,
|
|
100
|
+
materializeTimeUnitData,
|
|
101
|
+
createBin2DData,
|
|
102
|
+
editBin2DData,
|
|
103
|
+
materializeBin2DData,
|
|
104
|
+
createBoxSummaryData,
|
|
105
|
+
createBoxOutlierData,
|
|
106
|
+
materializeBoxSummaryData,
|
|
107
|
+
materializeBoxOutlierData
|
|
108
|
+
});
|
|
94
109
|
}
|
|
@@ -16,14 +16,14 @@ const OPTIONS = Object.freeze([
|
|
|
16
16
|
"as"
|
|
17
17
|
]);
|
|
18
18
|
|
|
19
|
-
export const materializeIntervalData = derivedMaterializer(
|
|
19
|
+
export const materializeIntervalData = /* @__PURE__ */ derivedMaterializer(
|
|
20
20
|
"materializeIntervalData",
|
|
21
21
|
"Materialize one grouped interval-summary dataset.",
|
|
22
22
|
"interval",
|
|
23
23
|
deriveInterval
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
-
export const createIntervalData = derivedCreator(
|
|
26
|
+
export const createIntervalData = /* @__PURE__ */ derivedCreator(
|
|
27
27
|
"createIntervalData",
|
|
28
28
|
"Create immutable grouped interval-summary values.",
|
|
29
29
|
OPTIONS,
|
|
@@ -138,13 +138,7 @@ export function planIntervalRoleData(program, {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
export function
|
|
142
|
-
owner,
|
|
143
|
-
data,
|
|
144
|
-
consumers,
|
|
145
|
-
statistics,
|
|
146
|
-
operation
|
|
147
|
-
}) {
|
|
141
|
+
export function validateIntervalStatistics(statistics, operation) {
|
|
148
142
|
if (!isPlainObject(statistics)) {
|
|
149
143
|
throw new TypeError(`${operation} statistics must be a plain object.`);
|
|
150
144
|
}
|
|
@@ -154,16 +148,9 @@ export function planIntervalEdit(program, {
|
|
|
154
148
|
`${operation} statistics requires center, extent, method, or level.`
|
|
155
149
|
);
|
|
156
150
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
: undefined;
|
|
161
|
-
if (transform?.type !== "interval") {
|
|
162
|
-
throw new Error(
|
|
163
|
-
`${operation} statistics requires a statistical interval owner; ` +
|
|
164
|
-
"explicit interval fields cannot be converted by edit."
|
|
165
|
-
);
|
|
166
|
-
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function mergeIntervalStatistics(transform, statistics) {
|
|
167
154
|
const center = Object.hasOwn(statistics, "center")
|
|
168
155
|
? statistics.center
|
|
169
156
|
: transform.center;
|
|
@@ -181,7 +168,28 @@ export function planIntervalEdit(program, {
|
|
|
181
168
|
} else if (extent === "ci" && transform.extent === "ci") {
|
|
182
169
|
raw.level = transform.level;
|
|
183
170
|
}
|
|
184
|
-
|
|
171
|
+
return normalizeIntervalParameters(raw);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function planIntervalEdit(program, {
|
|
175
|
+
owner,
|
|
176
|
+
data,
|
|
177
|
+
consumers,
|
|
178
|
+
statistics,
|
|
179
|
+
operation
|
|
180
|
+
}) {
|
|
181
|
+
validateIntervalStatistics(statistics, operation);
|
|
182
|
+
const previous = findDataset(program, data);
|
|
183
|
+
const transform = previous?.transform?.length === 1
|
|
184
|
+
? previous.transform[0]
|
|
185
|
+
: undefined;
|
|
186
|
+
if (transform?.type !== "interval") {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`${operation} statistics requires a statistical interval owner; ` +
|
|
189
|
+
"explicit interval fields cannot be converted by edit."
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
const parameters = mergeIntervalStatistics(transform, statistics);
|
|
185
193
|
const current = {
|
|
186
194
|
center: transform.center,
|
|
187
195
|
extent: transform.extent,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deriveNormalizedRows,
|
|
3
|
+
normalizeNormalizeTransform
|
|
4
|
+
} from "../../grammar/normalize.js";
|
|
5
|
+
import { derivedCreator, derivedMaterializer } from "./shared.js";
|
|
6
|
+
|
|
7
|
+
const OPTIONS = Object.freeze([
|
|
8
|
+
"id", "source", "field", "as", "groupBy", "method",
|
|
9
|
+
"variance", "zeroDenominator", "baseline", "sortBy"
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
export const materializeNormalizedData = /* @__PURE__ */ derivedMaterializer(
|
|
13
|
+
"materializeNormalizedData",
|
|
14
|
+
"Materialize one immutable grouped normalization dataset.",
|
|
15
|
+
"normalize",
|
|
16
|
+
deriveNormalizedRows
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const createNormalizedData = /* @__PURE__ */ derivedCreator(
|
|
20
|
+
"createNormalizedData",
|
|
21
|
+
"Create a row-preserving grouped normalization dataset.",
|
|
22
|
+
OPTIONS,
|
|
23
|
+
"Normalized dataset id",
|
|
24
|
+
"Normalized source dataset id",
|
|
25
|
+
normalizeNormalizeTransform,
|
|
26
|
+
"materializeNormalizedData"
|
|
27
|
+
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { closedAction } from "../../core/action.js";
|
|
2
2
|
import { validateUserId } from "../../core/identifiers.js";
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import {
|
|
5
5
|
deriveRegression,
|
|
6
|
-
|
|
6
|
+
normalizeRegressionTransform
|
|
7
7
|
} from "../../grammar/regression/index.js";
|
|
8
|
+
import { resolveDatasetReference } from "../../selectors/datasets.js";
|
|
8
9
|
import { derivedMaterializer } from "./shared.js";
|
|
9
10
|
|
|
10
11
|
const OPTIONS = Object.freeze([
|
|
@@ -12,7 +13,7 @@ const OPTIONS = Object.freeze([
|
|
|
12
13
|
"confidenceMethod", "level", "confidence", "interval"
|
|
13
14
|
]);
|
|
14
15
|
|
|
15
|
-
export const materializeRegressionData = derivedMaterializer(
|
|
16
|
+
export const materializeRegressionData = /* @__PURE__ */ derivedMaterializer(
|
|
16
17
|
"materializeRegressionData",
|
|
17
18
|
"Materialize one regression derived dataset.",
|
|
18
19
|
"regression",
|
|
@@ -30,35 +31,28 @@ export const materializeRegressionData = derivedMaterializer(
|
|
|
30
31
|
})
|
|
31
32
|
);
|
|
32
33
|
|
|
33
|
-
export const createRegressionData =
|
|
34
|
-
{ op: "createRegressionData", description: "Create grouped regression values and optional interval bounds." },
|
|
34
|
+
export const createRegressionData = /* @__PURE__ */ closedAction(
|
|
35
|
+
{ op: "createRegressionData", description: "Create grouped regression values and optional interval bounds." }, OPTIONS,
|
|
35
36
|
function (args = {}) {
|
|
36
|
-
validateKeys(args, OPTIONS, "createRegressionData");
|
|
37
|
-
const parameters = normalizeRegressionParameters(args);
|
|
38
37
|
const id = validateUserId(args.id, "Regression dataset id");
|
|
39
|
-
const
|
|
38
|
+
const requestedSource = validateUserId(
|
|
40
39
|
args.source ?? this.context.currentData,
|
|
41
40
|
"Source dataset id"
|
|
42
41
|
);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
? { degree: parameters.degree }
|
|
51
|
-
: {}),
|
|
52
|
-
...(parameters.method === "loess"
|
|
53
|
-
? { span: parameters.span }
|
|
54
|
-
: {
|
|
55
|
-
confidenceMethod: parameters.confidenceMethod,
|
|
56
|
-
level: parameters.level,
|
|
57
|
-
interval: parameters.interval
|
|
58
|
-
})
|
|
59
|
-
};
|
|
60
|
-
return this
|
|
42
|
+
const source = resolveDatasetReference(
|
|
43
|
+
this,
|
|
44
|
+
requestedSource,
|
|
45
|
+
"Regression source dataset"
|
|
46
|
+
).id;
|
|
47
|
+
const transform = normalizeRegressionTransform(args);
|
|
48
|
+
const next = this
|
|
61
49
|
.createDerivedData({ id, source, transform: [transform] })
|
|
62
50
|
.materializeRegressionData({ id });
|
|
51
|
+
return this.actionStack.length === 1
|
|
52
|
+
? next._withMaterializationConfig(
|
|
53
|
+
["data", "regression", id],
|
|
54
|
+
{ current: id }
|
|
55
|
+
)
|
|
56
|
+
: next;
|
|
63
57
|
}
|
|
64
58
|
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { closedAction } from "../../core/action.js";
|
|
2
|
+
import { validateUserId } from "../../core/identifiers.js";
|
|
3
|
+
|
|
4
|
+
import { requireDataset } from "../../selectors/datasets.js";
|
|
5
|
+
import { requireLayer } from "../../selectors/layers.js";
|
|
6
|
+
import { applyRevisionPlan, buildSourceRevisionPlan } from "./edit.js";
|
|
7
|
+
import { resolveStoredSelection } from "../../materialization/selection/state.js";
|
|
8
|
+
import { withGuideLayoutTransaction } from "../../materialization/guides/layout.js";
|
|
9
|
+
|
|
10
|
+
let reviseFacet;
|
|
11
|
+
|
|
12
|
+
export function registerFacetDataRevision(handler) {
|
|
13
|
+
reviseFacet = handler;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function reviseUnitData(program, { source, id, values }) {
|
|
17
|
+
const plan = buildSourceRevisionPlan(program, source, id);
|
|
18
|
+
const created = program.createData({ id, values });
|
|
19
|
+
const next = withGuideLayoutTransaction(created, candidate =>
|
|
20
|
+
applyRevisionPlan(candidate, undefined, plan, { retain: new Set([source]) }));
|
|
21
|
+
for (const [selection, config] of Object.entries(next.materializationConfigs.selections ?? {})) {
|
|
22
|
+
if (plan.replacements.has(requireLayer(program, config.target).data)) {
|
|
23
|
+
resolveStoredSelection(next, selection);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { program: next, plan };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const reviseData = /* @__PURE__ */ closedAction(
|
|
30
|
+
{ op: "reviseData", description: "Revise source data and its dependent chart.", scope: "any" }, ["source", "id", "values"],
|
|
31
|
+
function (args = {}) {
|
|
32
|
+
const source = validateUserId(args.source, "Source dataset id");
|
|
33
|
+
const id = validateUserId(args.id, "Revision dataset id");
|
|
34
|
+
if (this.compositionSpec !== undefined && this.compositionSpec.type !== "facet") {
|
|
35
|
+
throw new Error("Revise an explicit child, then use replaceCompositionChild for concat.");
|
|
36
|
+
}
|
|
37
|
+
const original = requireDataset(this, source);
|
|
38
|
+
if (original.source !== undefined || !Array.isArray(original.values)) {
|
|
39
|
+
throw new Error(`Source "${source}" must be a materialized original dataset.`);
|
|
40
|
+
}
|
|
41
|
+
const apply = this.compositionSpec === undefined
|
|
42
|
+
? program => reviseUnitData(program, { source, id, values: args.values }).program
|
|
43
|
+
: program => reviseFacet(program, { source, id, values: args.values });
|
|
44
|
+
// The entire dependent materialization must succeed before returning a revision.
|
|
45
|
+
apply(this);
|
|
46
|
+
return apply(this);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { collectDataOwnerReferences, collectMarkConfigReferences } from "../../core/resourceReferences.js";
|
|
2
|
+
import { datasetTransformOutputRoles } from "../../grammar/transforms.js";
|
|
3
|
+
import { requireLayer } from "../../selectors/layers.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export function outputFieldChanges(previous, next) {
|
|
7
|
+
const before = datasetTransformOutputRoles(previous);
|
|
8
|
+
const after = datasetTransformOutputRoles(next);
|
|
9
|
+
const family = previous.type === "bin2d" ? "2D bin " : "";
|
|
10
|
+
const counts = new Map();
|
|
11
|
+
const retainedFields = new Set(Object.values(after));
|
|
12
|
+
for (const field of Object.values(before)) {
|
|
13
|
+
counts.set(field, (counts.get(field) ?? 0) + 1);
|
|
14
|
+
}
|
|
15
|
+
return new Map(Object.entries(before).flatMap(([role, field]) => {
|
|
16
|
+
if (field === after[role] || retainedFields.has(field)) return [];
|
|
17
|
+
if (counts.get(field) !== 1) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`Cannot rebind ambiguous derived output field "${field}".`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return [[field, { role, next: after[role], family }]];
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function changedConsumerField(field, changes) {
|
|
27
|
+
const change = changes.get(field);
|
|
28
|
+
if (change === undefined) return field;
|
|
29
|
+
if (change.next === undefined) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Cannot remove referenced ${change.family}${change.role} output field "${field}".`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return change.next;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function rebindLayerOutputFields(program, id, changes) {
|
|
38
|
+
const layer = requireLayer(program, id);
|
|
39
|
+
let next = program;
|
|
40
|
+
const changed = field => changedConsumerField(field, changes);
|
|
41
|
+
const editField = (property, field) => {
|
|
42
|
+
if (field === undefined) return;
|
|
43
|
+
const value = changed(field);
|
|
44
|
+
if (value !== field) next = next.editSemantic({ property, value });
|
|
45
|
+
};
|
|
46
|
+
for (const [channel, encoding] of Object.entries(layer.encoding ?? {})) {
|
|
47
|
+
editField(`layer[${id}].encoding.${channel}.field`, encoding?.field);
|
|
48
|
+
const summary = encoding?.categoryOrder?.by;
|
|
49
|
+
if (summary?.field !== undefined) {
|
|
50
|
+
const field = changed(summary.field);
|
|
51
|
+
if (field !== summary.field) {
|
|
52
|
+
next = next.editSemantic({
|
|
53
|
+
property: `layer[${id}].encoding.${channel}.categoryOrder`,
|
|
54
|
+
value: { ...encoding.categoryOrder, by: { ...summary, field } }
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
editField(
|
|
60
|
+
`layer[${id}].encoding.theta.weight`,
|
|
61
|
+
layer.encoding?.theta?.weight
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const parallel = layer.encoding?.parallel;
|
|
65
|
+
if (parallel?.dimensions !== undefined) {
|
|
66
|
+
const dimensions = parallel.dimensions.map(dimension => ({
|
|
67
|
+
...dimension,
|
|
68
|
+
field: changed(dimension.field)
|
|
69
|
+
}));
|
|
70
|
+
if (dimensions.some((dimension, index) =>
|
|
71
|
+
dimension.field !== parallel.dimensions[index].field
|
|
72
|
+
)) {
|
|
73
|
+
next = next.editSemantic({
|
|
74
|
+
property: `layer[${id}].encoding.parallel.dimensions`,
|
|
75
|
+
value: dimensions
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
editField(`layer[${id}].encoding.parallel.key`, parallel?.key);
|
|
80
|
+
|
|
81
|
+
for (const [selectionId, config] of Object.entries(
|
|
82
|
+
program.materializationConfigs.selections ?? {}
|
|
83
|
+
)) {
|
|
84
|
+
if (config.target !== id) continue;
|
|
85
|
+
const selector = { ...config.selector };
|
|
86
|
+
if (selector.field !== undefined) selector.field = changed(selector.field);
|
|
87
|
+
if (selector.groupBy !== undefined) {
|
|
88
|
+
selector.groupBy = selector.groupBy.map(changed);
|
|
89
|
+
}
|
|
90
|
+
if (JSON.stringify(selector) !== JSON.stringify(config.selector)) {
|
|
91
|
+
next = next._withSelectionConfig(selectionId, { ...config, selector });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const jitter = program.materializationConfigs.jitters?.[id];
|
|
96
|
+
const key = jitter?.key === undefined ? undefined : changed(jitter.key);
|
|
97
|
+
if (key !== undefined && key !== jitter.key) {
|
|
98
|
+
next = next._withMaterializationConfig(
|
|
99
|
+
["jitters", id],
|
|
100
|
+
{ ...jitter, key }
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
return next;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function replaceAtPath(value, [key, ...rest], replacement) {
|
|
107
|
+
const result = Array.isArray(value) ? [...value] : { ...value };
|
|
108
|
+
Object.defineProperty(result, key, { value: rest.length === 0
|
|
109
|
+
? replacement : replaceAtPath(value[key], rest, replacement),
|
|
110
|
+
enumerable: true, configurable: true, writable: true });
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function rebindMaterializationDataReferences(program, replacements) {
|
|
115
|
+
if (replacements.size === 0) return program;
|
|
116
|
+
let next = program;
|
|
117
|
+
for (const ref of [...collectMarkConfigReferences(program), ...collectDataOwnerReferences(program)]) {
|
|
118
|
+
if (ref.kind !== "data" || !replacements.has(ref.id)) continue;
|
|
119
|
+
const path = ref.ownerKind === "markConfig" ? ["marks", ref.ownerId, ...ref.path] : ref.path;
|
|
120
|
+
const [root, ...rest] = path;
|
|
121
|
+
next = next._withMaterializationConfig([root],
|
|
122
|
+
replaceAtPath(next.materializationConfigs[root], rest, replacements.get(ref.id)));
|
|
123
|
+
}
|
|
124
|
+
return next;
|
|
125
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { action } from "../../core/action.js";
|
|
2
2
|
import { validateUserId } from "../../core/identifiers.js";
|
|
3
3
|
import { validateKeys } from "../../core/validation.js";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
findDataset,
|
|
6
|
+
resolveDatasetReference
|
|
7
|
+
} from "../../selectors/datasets.js";
|
|
5
8
|
|
|
6
9
|
export const MATERIALIZE_OPTIONS = Object.freeze(["id"]);
|
|
7
10
|
|
|
@@ -61,12 +64,25 @@ export function derivedCreator(
|
|
|
61
64
|
return action({ op, description }, function (args = {}) {
|
|
62
65
|
validateKeys(args, options, op);
|
|
63
66
|
const id = validateUserId(args.id, idLabel);
|
|
64
|
-
const
|
|
67
|
+
const requestedSource = validateUserId(
|
|
65
68
|
requireSource ? args.source : args.source ?? this.context.currentData,
|
|
66
69
|
sourceLabel
|
|
67
70
|
);
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
const source = resolveDatasetReference(
|
|
72
|
+
this,
|
|
73
|
+
requestedSource,
|
|
74
|
+
sourceLabel
|
|
75
|
+
).id;
|
|
76
|
+
const standalone = this.actionStack.length === 1;
|
|
77
|
+
const requestedTransform = transform(args, id);
|
|
78
|
+
const next = this
|
|
79
|
+
.createDerivedData({ id, source, transform: [requestedTransform] })
|
|
70
80
|
[materialize]({ id });
|
|
81
|
+
return standalone
|
|
82
|
+
? next._withMaterializationConfig(
|
|
83
|
+
["data", requestedTransform.type, id],
|
|
84
|
+
{ current: id }
|
|
85
|
+
)
|
|
86
|
+
: next;
|
|
71
87
|
});
|
|
72
88
|
}
|
|
@@ -8,14 +8,14 @@ const OPTIONS = Object.freeze([
|
|
|
8
8
|
"id", "source", "category", "group", "value", "mode", "as"
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
|
-
export const materializeStackData = derivedMaterializer(
|
|
11
|
+
export const materializeStackData = /* @__PURE__ */ derivedMaterializer(
|
|
12
12
|
"materializeStackData",
|
|
13
13
|
"Materialize one immutable category/series stack dataset.",
|
|
14
14
|
"stack",
|
|
15
15
|
deriveStackRows
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
export const createStackData = derivedCreator(
|
|
18
|
+
export const createStackData = /* @__PURE__ */ derivedCreator(
|
|
19
19
|
"createStackData",
|
|
20
20
|
"Create reusable start, end, value, and share stack rows.",
|
|
21
21
|
OPTIONS,
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
import { derivedCreator, derivedMaterializer } from "./shared.js";
|
|
6
6
|
|
|
7
7
|
const OPTIONS = Object.freeze([
|
|
8
|
-
"id", "source", "groupBy", "aggregates", "members"
|
|
8
|
+
"id", "source", "groupBy", "aggregates", "members", "weight"
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
|
-
export const materializeSummaryData = derivedMaterializer(
|
|
11
|
+
export const materializeSummaryData = /* @__PURE__ */ derivedMaterializer(
|
|
12
12
|
"materializeSummaryData",
|
|
13
13
|
"Materialize one immutable grouped summary dataset.",
|
|
14
14
|
"summary",
|
|
15
15
|
deriveSummaryRows
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
export const createSummaryData = derivedCreator(
|
|
18
|
+
export const createSummaryData = /* @__PURE__ */ derivedCreator(
|
|
19
19
|
"createSummaryData",
|
|
20
20
|
"Create reusable grouped aggregate values and provenance.",
|
|
21
21
|
OPTIONS,
|
|
@@ -4,16 +4,19 @@ import {
|
|
|
4
4
|
} from "../../grammar/timeUnit.js";
|
|
5
5
|
import { derivedCreator, derivedMaterializer } from "./shared.js";
|
|
6
6
|
|
|
7
|
-
const OPTIONS = Object.freeze([
|
|
7
|
+
const OPTIONS = Object.freeze([
|
|
8
|
+
"id", "source", "field", "unit", "as", "temporalUnit", "timeZone",
|
|
9
|
+
"weekStartsOn", "weekRule"
|
|
10
|
+
]);
|
|
8
11
|
|
|
9
|
-
export const materializeTimeUnitData = derivedMaterializer(
|
|
12
|
+
export const materializeTimeUnitData = /* @__PURE__ */ derivedMaterializer(
|
|
10
13
|
"materializeTimeUnitData",
|
|
11
14
|
"Materialize one immutable UTC time-unit dataset.",
|
|
12
15
|
"timeUnit",
|
|
13
16
|
deriveTimeUnitRows
|
|
14
17
|
);
|
|
15
18
|
|
|
16
|
-
export const createTimeUnitData = derivedCreator(
|
|
19
|
+
export const createTimeUnitData = /* @__PURE__ */ derivedCreator(
|
|
17
20
|
"createTimeUnitData",
|
|
18
21
|
"Create immutable UTC calendar bucket values.",
|
|
19
22
|
OPTIONS,
|