@ggts-sh/spec 0.43.0
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/LICENSE +21 -0
- package/README.md +75 -0
- package/dist/artifact.d.ts +11 -0
- package/dist/artifact.d.ts.map +1 -0
- package/dist/artifact.js +71 -0
- package/dist/artifact.js.map +1 -0
- package/dist/builder-core.d.ts +100 -0
- package/dist/builder-core.d.ts.map +1 -0
- package/dist/builder-core.js +176 -0
- package/dist/builder-core.js.map +1 -0
- package/dist/builder-data.d.ts +36 -0
- package/dist/builder-data.d.ts.map +1 -0
- package/dist/builder-data.js +123 -0
- package/dist/builder-data.js.map +1 -0
- package/dist/builder-geoms.d.ts +128 -0
- package/dist/builder-geoms.d.ts.map +1 -0
- package/dist/builder-geoms.js +221 -0
- package/dist/builder-geoms.js.map +1 -0
- package/dist/builder-options.d.ts +323 -0
- package/dist/builder-options.d.ts.map +1 -0
- package/dist/builder-options.js +2 -0
- package/dist/builder-options.js.map +1 -0
- package/dist/builder-scales.d.ts +160 -0
- package/dist/builder-scales.d.ts.map +1 -0
- package/dist/builder-scales.js +322 -0
- package/dist/builder-scales.js.map +1 -0
- package/dist/builder.d.ts +242 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/builder.js +42 -0
- package/dist/builder.js.map +1 -0
- package/dist/capabilities-data.d.ts +72 -0
- package/dist/capabilities-data.d.ts.map +1 -0
- package/dist/capabilities-data.js +337 -0
- package/dist/capabilities-data.js.map +1 -0
- package/dist/capabilities-helpers.d.ts +31 -0
- package/dist/capabilities-helpers.d.ts.map +1 -0
- package/dist/capabilities-helpers.js +41 -0
- package/dist/capabilities-helpers.js.map +1 -0
- package/dist/capabilities.d.ts +22 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +154 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/coord-helpers.d.ts +102 -0
- package/dist/coord-helpers.d.ts.map +1 -0
- package/dist/coord-helpers.js +90 -0
- package/dist/coord-helpers.js.map +1 -0
- package/dist/coord-reference-build.d.ts +50 -0
- package/dist/coord-reference-build.d.ts.map +1 -0
- package/dist/coord-reference-build.js +211 -0
- package/dist/coord-reference-build.js.map +1 -0
- package/dist/coord-reference.d.ts +52 -0
- package/dist/coord-reference.d.ts.map +1 -0
- package/dist/coord-reference.js +27 -0
- package/dist/coord-reference.js.map +1 -0
- package/dist/error-catalog.d.ts +258 -0
- package/dist/error-catalog.d.ts.map +1 -0
- package/dist/error-catalog.js +235 -0
- package/dist/error-catalog.js.map +1 -0
- package/dist/error-prose-shared.d.ts +100 -0
- package/dist/error-prose-shared.d.ts.map +1 -0
- package/dist/error-prose-shared.js +95 -0
- package/dist/error-prose-shared.js.map +1 -0
- package/dist/errors.d.ts +39 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +52 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/coord-reference-data.d.ts +189 -0
- package/dist/generated/coord-reference-data.d.ts.map +1 -0
- package/dist/generated/coord-reference-data.js +212 -0
- package/dist/generated/coord-reference-data.js.map +1 -0
- package/dist/generated/geom-param-keys.d.ts +58 -0
- package/dist/generated/geom-param-keys.d.ts.map +1 -0
- package/dist/generated/geom-param-keys.js +223 -0
- package/dist/generated/geom-param-keys.js.map +1 -0
- package/dist/generated/geom-reference-data.d.ts +2377 -0
- package/dist/generated/geom-reference-data.d.ts.map +1 -0
- package/dist/generated/geom-reference-data.js +2790 -0
- package/dist/generated/geom-reference-data.js.map +1 -0
- package/dist/generated/guide-reference-data.d.ts +219 -0
- package/dist/generated/guide-reference-data.d.ts.map +1 -0
- package/dist/generated/guide-reference-data.js +253 -0
- package/dist/generated/guide-reference-data.js.map +1 -0
- package/dist/generated/plot-spec-validator.d.ts +2 -0
- package/dist/generated/plot-spec-validator.d.ts.map +1 -0
- package/dist/generated/plot-spec-validator.js +6274 -0
- package/dist/generated/plot-spec-validator.js.map +1 -0
- package/dist/generated/position-reference-data.d.ts +82 -0
- package/dist/generated/position-reference-data.d.ts.map +1 -0
- package/dist/generated/position-reference-data.js +181 -0
- package/dist/generated/position-reference-data.js.map +1 -0
- package/dist/generated/scale-reference-data.d.ts +8366 -0
- package/dist/generated/scale-reference-data.d.ts.map +1 -0
- package/dist/generated/scale-reference-data.js +9821 -0
- package/dist/generated/scale-reference-data.js.map +1 -0
- package/dist/generated/stat-reference-data.d.ts +241 -0
- package/dist/generated/stat-reference-data.d.ts.map +1 -0
- package/dist/generated/stat-reference-data.js +311 -0
- package/dist/generated/stat-reference-data.js.map +1 -0
- package/dist/geom-params-build.d.ts +3 -0
- package/dist/geom-params-build.d.ts.map +1 -0
- package/dist/geom-params-build.js +80 -0
- package/dist/geom-params-build.js.map +1 -0
- package/dist/geom-params.d.ts +13 -0
- package/dist/geom-params.d.ts.map +1 -0
- package/dist/geom-params.js +7 -0
- package/dist/geom-params.js.map +1 -0
- package/dist/geom-reference-build.d.ts +29 -0
- package/dist/geom-reference-build.d.ts.map +1 -0
- package/dist/geom-reference-build.js +221 -0
- package/dist/geom-reference-build.js.map +1 -0
- package/dist/geom-reference.d.ts +52 -0
- package/dist/geom-reference.d.ts.map +1 -0
- package/dist/geom-reference.js +72 -0
- package/dist/geom-reference.js.map +1 -0
- package/dist/guide-helpers.d.ts +20 -0
- package/dist/guide-helpers.d.ts.map +1 -0
- package/dist/guide-helpers.js +25 -0
- package/dist/guide-helpers.js.map +1 -0
- package/dist/guide-reference-build.d.ts +42 -0
- package/dist/guide-reference-build.d.ts.map +1 -0
- package/dist/guide-reference-build.js +180 -0
- package/dist/guide-reference-build.js.map +1 -0
- package/dist/guide-reference.d.ts +48 -0
- package/dist/guide-reference.d.ts.map +1 -0
- package/dist/guide-reference.js +32 -0
- package/dist/guide-reference.js.map +1 -0
- package/dist/hue-grey-palettes.d.ts +15 -0
- package/dist/hue-grey-palettes.d.ts.map +1 -0
- package/dist/hue-grey-palettes.js +77 -0
- package/dist/hue-grey-palettes.js.map +1 -0
- package/dist/index.d.ts +364 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +225 -0
- package/dist/index.js.map +1 -0
- package/dist/lint-catalog.d.ts +47 -0
- package/dist/lint-catalog.d.ts.map +1 -0
- package/dist/lint-catalog.js +39 -0
- package/dist/lint-catalog.js.map +1 -0
- package/dist/lint-layer-rules.d.ts +18 -0
- package/dist/lint-layer-rules.d.ts.map +1 -0
- package/dist/lint-layer-rules.js +145 -0
- package/dist/lint-layer-rules.js.map +1 -0
- package/dist/lint-scale-rules.d.ts +8 -0
- package/dist/lint-scale-rules.d.ts.map +1 -0
- package/dist/lint-scale-rules.js +254 -0
- package/dist/lint-scale-rules.js.map +1 -0
- package/dist/lint.d.ts +62 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +57 -0
- package/dist/lint.js.map +1 -0
- package/dist/normalize-coord.d.ts +8 -0
- package/dist/normalize-coord.d.ts.map +1 -0
- package/dist/normalize-coord.js +123 -0
- package/dist/normalize-coord.js.map +1 -0
- package/dist/normalize-input-layers-marks.d.ts +208 -0
- package/dist/normalize-input-layers-marks.d.ts.map +1 -0
- package/dist/normalize-input-layers-marks.js +2 -0
- package/dist/normalize-input-layers-marks.js.map +1 -0
- package/dist/normalize-input-layers-special.d.ts +131 -0
- package/dist/normalize-input-layers-special.d.ts.map +1 -0
- package/dist/normalize-input-layers-special.js +2 -0
- package/dist/normalize-input-layers-special.js.map +1 -0
- package/dist/normalize-input.d.ts +81 -0
- package/dist/normalize-input.d.ts.map +1 -0
- package/dist/normalize-input.js +2 -0
- package/dist/normalize-input.js.map +1 -0
- package/dist/normalize-paint.d.ts +8 -0
- package/dist/normalize-paint.d.ts.map +1 -0
- package/dist/normalize-paint.js +83 -0
- package/dist/normalize-paint.js.map +1 -0
- package/dist/normalize-scales.d.ts +7 -0
- package/dist/normalize-scales.d.ts.map +1 -0
- package/dist/normalize-scales.js +90 -0
- package/dist/normalize-scales.js.map +1 -0
- package/dist/normalize.d.ts +46 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +279 -0
- package/dist/normalize.js.map +1 -0
- package/dist/paint-helpers.d.ts +45 -0
- package/dist/paint-helpers.d.ts.map +1 -0
- package/dist/paint-helpers.js +48 -0
- package/dist/paint-helpers.js.map +1 -0
- package/dist/pipeline-error-catalog.d.ts +319 -0
- package/dist/pipeline-error-catalog.d.ts.map +1 -0
- package/dist/pipeline-error-catalog.js +260 -0
- package/dist/pipeline-error-catalog.js.map +1 -0
- package/dist/portability-check.d.ts +35 -0
- package/dist/portability-check.d.ts.map +1 -0
- package/dist/portability-check.js +121 -0
- package/dist/portability-check.js.map +1 -0
- package/dist/portability-lossy.d.ts +19 -0
- package/dist/portability-lossy.d.ts.map +1 -0
- package/dist/portability-lossy.js +65 -0
- package/dist/portability-lossy.js.map +1 -0
- package/dist/portability.d.ts +23 -0
- package/dist/portability.d.ts.map +1 -0
- package/dist/portability.js +23 -0
- package/dist/portability.js.map +1 -0
- package/dist/portable-builder.d.ts +215 -0
- package/dist/portable-builder.d.ts.map +1 -0
- package/dist/portable-builder.js +27 -0
- package/dist/portable-builder.js.map +1 -0
- package/dist/portable-entry.d.ts +16 -0
- package/dist/portable-entry.d.ts.map +1 -0
- package/dist/portable-entry.js +14 -0
- package/dist/portable-entry.js.map +1 -0
- package/dist/position-reference-build.d.ts +29 -0
- package/dist/position-reference-build.d.ts.map +1 -0
- package/dist/position-reference-build.js +115 -0
- package/dist/position-reference-build.js.map +1 -0
- package/dist/position-reference.d.ts +34 -0
- package/dist/position-reference.d.ts.map +1 -0
- package/dist/position-reference.js +19 -0
- package/dist/position-reference.js.map +1 -0
- package/dist/runtime.d.ts +139 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +2 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scale-color-helpers.d.ts +121 -0
- package/dist/scale-color-helpers.d.ts.map +1 -0
- package/dist/scale-color-helpers.js +188 -0
- package/dist/scale-color-helpers.js.map +1 -0
- package/dist/scale-color-hue-grey.d.ts +52 -0
- package/dist/scale-color-hue-grey.d.ts.map +1 -0
- package/dist/scale-color-hue-grey.js +60 -0
- package/dist/scale-color-hue-grey.js.map +1 -0
- package/dist/scale-color-stops.d.ts +85 -0
- package/dist/scale-color-stops.d.ts.map +1 -0
- package/dist/scale-color-stops.js +87 -0
- package/dist/scale-color-stops.js.map +1 -0
- package/dist/scale-color-viridis.d.ts +52 -0
- package/dist/scale-color-viridis.d.ts.map +1 -0
- package/dist/scale-color-viridis.js +68 -0
- package/dist/scale-color-viridis.js.map +1 -0
- package/dist/scale-helpers.d.ts +20 -0
- package/dist/scale-helpers.d.ts.map +1 -0
- package/dist/scale-helpers.js +20 -0
- package/dist/scale-helpers.js.map +1 -0
- package/dist/scale-multi-helpers.d.ts +61 -0
- package/dist/scale-multi-helpers.d.ts.map +1 -0
- package/dist/scale-multi-helpers.js +147 -0
- package/dist/scale-multi-helpers.js.map +1 -0
- package/dist/scale-position-helpers.d.ts +81 -0
- package/dist/scale-position-helpers.d.ts.map +1 -0
- package/dist/scale-position-helpers.js +133 -0
- package/dist/scale-position-helpers.js.map +1 -0
- package/dist/scale-reference-build.d.ts +50 -0
- package/dist/scale-reference-build.d.ts.map +1 -0
- package/dist/scale-reference-build.js +147 -0
- package/dist/scale-reference-build.js.map +1 -0
- package/dist/scale-reference-classify-color.d.ts +11 -0
- package/dist/scale-reference-classify-color.d.ts.map +1 -0
- package/dist/scale-reference-classify-color.js +292 -0
- package/dist/scale-reference-classify-color.js.map +1 -0
- package/dist/scale-reference-classify-position.d.ts +10 -0
- package/dist/scale-reference-classify-position.d.ts.map +1 -0
- package/dist/scale-reference-classify-position.js +137 -0
- package/dist/scale-reference-classify-position.js.map +1 -0
- package/dist/scale-reference-classify-style.d.ts +10 -0
- package/dist/scale-reference-classify-style.d.ts.map +1 -0
- package/dist/scale-reference-classify-style.js +194 -0
- package/dist/scale-reference-classify-style.js.map +1 -0
- package/dist/scale-reference-classify-support.d.ts +37 -0
- package/dist/scale-reference-classify-support.d.ts.map +1 -0
- package/dist/scale-reference-classify-support.js +206 -0
- package/dist/scale-reference-classify-support.js.map +1 -0
- package/dist/scale-reference.d.ts +80 -0
- package/dist/scale-reference.d.ts.map +1 -0
- package/dist/scale-reference.js +85 -0
- package/dist/scale-reference.js.map +1 -0
- package/dist/scale-style-helpers.d.ts +158 -0
- package/dist/scale-style-helpers.d.ts.map +1 -0
- package/dist/scale-style-helpers.js +197 -0
- package/dist/scale-style-helpers.js.map +1 -0
- package/dist/schema-catalog.d.ts +62 -0
- package/dist/schema-catalog.d.ts.map +1 -0
- package/dist/schema-catalog.js +208 -0
- package/dist/schema-catalog.js.map +1 -0
- package/dist/schema-declarations.d.ts +1585 -0
- package/dist/schema-declarations.d.ts.map +1 -0
- package/dist/schema-declarations.js +51 -0
- package/dist/schema-declarations.js.map +1 -0
- package/dist/schema-decls-data.d.ts +58 -0
- package/dist/schema-decls-data.d.ts.map +1 -0
- package/dist/schema-decls-data.js +151 -0
- package/dist/schema-decls-data.js.map +1 -0
- package/dist/schema-decls-guides-theme.d.ts +166 -0
- package/dist/schema-decls-guides-theme.d.ts.map +1 -0
- package/dist/schema-decls-guides-theme.js +251 -0
- package/dist/schema-decls-guides-theme.js.map +1 -0
- package/dist/schema-decls-layers-col-boxplot.d.ts +118 -0
- package/dist/schema-decls-layers-col-boxplot.d.ts.map +1 -0
- package/dist/schema-decls-layers-col-boxplot.js +239 -0
- package/dist/schema-decls-layers-col-boxplot.js.map +1 -0
- package/dist/schema-decls-layers-count-pointrange.d.ts +89 -0
- package/dist/schema-decls-layers-count-pointrange.d.ts.map +1 -0
- package/dist/schema-decls-layers-count-pointrange.js +190 -0
- package/dist/schema-decls-layers-count-pointrange.js.map +1 -0
- package/dist/schema-decls-layers-crossbar-jitter.d.ts +129 -0
- package/dist/schema-decls-layers-crossbar-jitter.d.ts.map +1 -0
- package/dist/schema-decls-layers-crossbar-jitter.js +255 -0
- package/dist/schema-decls-layers-crossbar-jitter.js.map +1 -0
- package/dist/schema-decls-layers-point-path.d.ts +49 -0
- package/dist/schema-decls-layers-point-path.d.ts.map +1 -0
- package/dist/schema-decls-layers-point-path.js +156 -0
- package/dist/schema-decls-layers-point-path.js.map +1 -0
- package/dist/schema-decls-layers-sf-blank.d.ts +89 -0
- package/dist/schema-decls-layers-sf-blank.d.ts.map +1 -0
- package/dist/schema-decls-layers-sf-blank.js +254 -0
- package/dist/schema-decls-layers-sf-blank.js.map +1 -0
- package/dist/schema-decls-layers-text-map.d.ts +80 -0
- package/dist/schema-decls-layers-text-map.d.ts.map +1 -0
- package/dist/schema-decls-layers-text-map.js +151 -0
- package/dist/schema-decls-layers-text-map.js.map +1 -0
- package/dist/schema-decls-paint.d.ts +39 -0
- package/dist/schema-decls-paint.d.ts.map +1 -0
- package/dist/schema-decls-paint.js +95 -0
- package/dist/schema-decls-paint.js.map +1 -0
- package/dist/schema-decls-params-area-abline.d.ts +85 -0
- package/dist/schema-decls-params-area-abline.d.ts.map +1 -0
- package/dist/schema-decls-params-area-abline.js +259 -0
- package/dist/schema-decls-params-area-abline.js.map +1 -0
- package/dist/schema-decls-params-col-contour.d.ts +61 -0
- package/dist/schema-decls-params-col-contour.d.ts.map +1 -0
- package/dist/schema-decls-params-col-contour.js +202 -0
- package/dist/schema-decls-params-col-contour.js.map +1 -0
- package/dist/schema-decls-params-curve-label.d.ts +64 -0
- package/dist/schema-decls-params-curve-label.d.ts.map +1 -0
- package/dist/schema-decls-params-curve-label.js +204 -0
- package/dist/schema-decls-params-curve-label.js.map +1 -0
- package/dist/schema-decls-params-errorbar-position.d.ts +83 -0
- package/dist/schema-decls-params-errorbar-position.d.ts.map +1 -0
- package/dist/schema-decls-params-errorbar-position.js +264 -0
- package/dist/schema-decls-params-errorbar-position.js.map +1 -0
- package/dist/schema-decls-params-point-path.d.ts +61 -0
- package/dist/schema-decls-params-point-path.d.ts.map +1 -0
- package/dist/schema-decls-params-point-path.js +240 -0
- package/dist/schema-decls-params-point-path.js.map +1 -0
- package/dist/schema-decls-params-violin-summary.d.ts +78 -0
- package/dist/schema-decls-params-violin-summary.d.ts.map +1 -0
- package/dist/schema-decls-params-violin-summary.js +272 -0
- package/dist/schema-decls-params-violin-summary.js.map +1 -0
- package/dist/schema-decls-plot.d.ts +80 -0
- package/dist/schema-decls-plot.d.ts.map +1 -0
- package/dist/schema-decls-plot.js +222 -0
- package/dist/schema-decls-plot.js.map +1 -0
- package/dist/schema-decls-scales-guides.d.ts +291 -0
- package/dist/schema-decls-scales-guides.d.ts.map +1 -0
- package/dist/schema-decls-scales-guides.js +189 -0
- package/dist/schema-decls-scales-guides.js.map +1 -0
- package/dist/schema-decls-scales.d.ts +124 -0
- package/dist/schema-decls-scales.d.ts.map +1 -0
- package/dist/schema-decls-scales.js +279 -0
- package/dist/schema-decls-scales.js.map +1 -0
- package/dist/schema-imports.d.ts +1679 -0
- package/dist/schema-imports.d.ts.map +1 -0
- package/dist/schema-imports.js +104 -0
- package/dist/schema-imports.js.map +1 -0
- package/dist/schema-name-schemas.d.ts +18 -0
- package/dist/schema-name-schemas.d.ts.map +1 -0
- package/dist/schema-name-schemas.js +13 -0
- package/dist/schema-name-schemas.js.map +1 -0
- package/dist/schema-names.d.ts +53 -0
- package/dist/schema-names.d.ts.map +1 -0
- package/dist/schema-names.js +229 -0
- package/dist/schema-names.js.map +1 -0
- package/dist/schema-types.d.ts +336 -0
- package/dist/schema-types.d.ts.map +1 -0
- package/dist/schema-types.js +10 -0
- package/dist/schema-types.js.map +1 -0
- package/dist/schema.d.ts +38 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +34 -0
- package/dist/schema.js.map +1 -0
- package/dist/stat-reference-build.d.ts +24 -0
- package/dist/stat-reference-build.d.ts.map +1 -0
- package/dist/stat-reference-build.js +86 -0
- package/dist/stat-reference-build.js.map +1 -0
- package/dist/stat-reference.d.ts +33 -0
- package/dist/stat-reference.d.ts.map +1 -0
- package/dist/stat-reference.js +19 -0
- package/dist/stat-reference.js.map +1 -0
- package/dist/structural-gate.d.ts +15 -0
- package/dist/structural-gate.d.ts.map +1 -0
- package/dist/structural-gate.js +34 -0
- package/dist/structural-gate.js.map +1 -0
- package/dist/temporal-column.d.ts +33 -0
- package/dist/temporal-column.d.ts.map +1 -0
- package/dist/temporal-column.js +247 -0
- package/dist/temporal-column.js.map +1 -0
- package/dist/temporal-guides.d.ts +11 -0
- package/dist/temporal-guides.d.ts.map +1 -0
- package/dist/temporal-guides.js +11 -0
- package/dist/temporal-guides.js.map +1 -0
- package/dist/temporal-interval-schema.d.ts +9 -0
- package/dist/temporal-interval-schema.d.ts.map +1 -0
- package/dist/temporal-interval-schema.js +25 -0
- package/dist/temporal-interval-schema.js.map +1 -0
- package/dist/temporal-interval.d.ts +29 -0
- package/dist/temporal-interval.d.ts.map +1 -0
- package/dist/temporal-interval.js +122 -0
- package/dist/temporal-interval.js.map +1 -0
- package/dist/temporal-parse-core.d.ts +96 -0
- package/dist/temporal-parse-core.d.ts.map +1 -0
- package/dist/temporal-parse-core.js +235 -0
- package/dist/temporal-parse-core.js.map +1 -0
- package/dist/temporal-parse-format.d.ts +13 -0
- package/dist/temporal-parse-format.d.ts.map +1 -0
- package/dist/temporal-parse-format.js +180 -0
- package/dist/temporal-parse-format.js.map +1 -0
- package/dist/temporal-parse-schema.d.ts +11 -0
- package/dist/temporal-parse-schema.d.ts.map +1 -0
- package/dist/temporal-parse-schema.js +23 -0
- package/dist/temporal-parse-schema.js.map +1 -0
- package/dist/temporal-parse.d.ts +18 -0
- package/dist/temporal-parse.d.ts.map +1 -0
- package/dist/temporal-parse.js +183 -0
- package/dist/temporal-parse.js.map +1 -0
- package/dist/temporal-polyfill.d.ts +3 -0
- package/dist/temporal-polyfill.d.ts.map +1 -0
- package/dist/temporal-polyfill.js +25 -0
- package/dist/temporal-polyfill.js.map +1 -0
- package/dist/temporal-ticks.d.ts +20 -0
- package/dist/temporal-ticks.d.ts.map +1 -0
- package/dist/temporal-ticks.js +246 -0
- package/dist/temporal-ticks.js.map +1 -0
- package/dist/temporal.d.ts +109 -0
- package/dist/temporal.d.ts.map +1 -0
- package/dist/temporal.js +73 -0
- package/dist/temporal.js.map +1 -0
- package/dist/validate-data-checks-color-temporal.d.ts +58 -0
- package/dist/validate-data-checks-color-temporal.d.ts.map +1 -0
- package/dist/validate-data-checks-color-temporal.js +168 -0
- package/dist/validate-data-checks-color-temporal.js.map +1 -0
- package/dist/validate-data-checks-color.d.ts +28 -0
- package/dist/validate-data-checks-color.d.ts.map +1 -0
- package/dist/validate-data-checks-color.js +296 -0
- package/dist/validate-data-checks-color.js.map +1 -0
- package/dist/validate-data-checks-layer.d.ts +37 -0
- package/dist/validate-data-checks-layer.d.ts.map +1 -0
- package/dist/validate-data-checks-layer.js +343 -0
- package/dist/validate-data-checks-layer.js.map +1 -0
- package/dist/validate-data-checks-position.d.ts +45 -0
- package/dist/validate-data-checks-position.d.ts.map +1 -0
- package/dist/validate-data-checks-position.js +204 -0
- package/dist/validate-data-checks-position.js.map +1 -0
- package/dist/validate-data-checks-style-finite.d.ts +24 -0
- package/dist/validate-data-checks-style-finite.d.ts.map +1 -0
- package/dist/validate-data-checks-style-finite.js +40 -0
- package/dist/validate-data-checks-style-finite.js.map +1 -0
- package/dist/validate-data-checks-style-numeric.d.ts +26 -0
- package/dist/validate-data-checks-style-numeric.d.ts.map +1 -0
- package/dist/validate-data-checks-style-numeric.js +327 -0
- package/dist/validate-data-checks-style-numeric.js.map +1 -0
- package/dist/validate-data-checks-style.d.ts +14 -0
- package/dist/validate-data-checks-style.d.ts.map +1 -0
- package/dist/validate-data-checks-style.js +14 -0
- package/dist/validate-data-checks-style.js.map +1 -0
- package/dist/validate-data-checks-temporal.d.ts +57 -0
- package/dist/validate-data-checks-temporal.d.ts.map +1 -0
- package/dist/validate-data-checks-temporal.js +83 -0
- package/dist/validate-data-checks-temporal.js.map +1 -0
- package/dist/validate-data-checks.d.ts +31 -0
- package/dist/validate-data-checks.d.ts.map +1 -0
- package/dist/validate-data-checks.js +110 -0
- package/dist/validate-data-checks.js.map +1 -0
- package/dist/validate-data-evidence.d.ts +69 -0
- package/dist/validate-data-evidence.d.ts.map +1 -0
- package/dist/validate-data-evidence.js +329 -0
- package/dist/validate-data-evidence.js.map +1 -0
- package/dist/validate-data.d.ts +73 -0
- package/dist/validate-data.d.ts.map +1 -0
- package/dist/validate-data.js +30 -0
- package/dist/validate-data.js.map +1 -0
- package/dist/validate-map-errors.d.ts +32 -0
- package/dist/validate-map-errors.d.ts.map +1 -0
- package/dist/validate-map-errors.js +76 -0
- package/dist/validate-map-errors.js.map +1 -0
- package/dist/validate-map-forms.d.ts +43 -0
- package/dist/validate-map-forms.d.ts.map +1 -0
- package/dist/validate-map-forms.js +125 -0
- package/dist/validate-map-forms.js.map +1 -0
- package/dist/validate-map-path-keywords.d.ts +11 -0
- package/dist/validate-map-path-keywords.d.ts.map +1 -0
- package/dist/validate-map-path-keywords.js +95 -0
- package/dist/validate-map-path-keywords.js.map +1 -0
- package/dist/validate-map-path-unions.d.ts +27 -0
- package/dist/validate-map-path-unions.d.ts.map +1 -0
- package/dist/validate-map-path-unions.js +200 -0
- package/dist/validate-map-path-unions.js.map +1 -0
- package/dist/validate-schema-shape.d.ts +69 -0
- package/dist/validate-schema-shape.d.ts.map +1 -0
- package/dist/validate-schema-shape.js +156 -0
- package/dist/validate-schema-shape.js.map +1 -0
- package/dist/validate-schema-walk.d.ts +34 -0
- package/dist/validate-schema-walk.d.ts.map +1 -0
- package/dist/validate-schema-walk.js +216 -0
- package/dist/validate-schema-walk.js.map +1 -0
- package/dist/validate-structure-facet.d.ts +8 -0
- package/dist/validate-structure-facet.d.ts.map +1 -0
- package/dist/validate-structure-facet.js +67 -0
- package/dist/validate-structure-facet.js.map +1 -0
- package/dist/validate-structure-layer-computed-y.d.ts +14 -0
- package/dist/validate-structure-layer-computed-y.d.ts.map +1 -0
- package/dist/validate-structure-layer-computed-y.js +70 -0
- package/dist/validate-structure-layer-computed-y.js.map +1 -0
- package/dist/validate-structure-layer-ribbon.d.ts +8 -0
- package/dist/validate-structure-layer-ribbon.d.ts.map +1 -0
- package/dist/validate-structure-layer-ribbon.js +36 -0
- package/dist/validate-structure-layer-ribbon.js.map +1 -0
- package/dist/validate-structure-layer-rule.d.ts +14 -0
- package/dist/validate-structure-layer-rule.d.ts.map +1 -0
- package/dist/validate-structure-layer-rule.js +90 -0
- package/dist/validate-structure-layer-rule.js.map +1 -0
- package/dist/validate-structure-layer-shared.d.ts +12 -0
- package/dist/validate-structure-layer-shared.d.ts.map +1 -0
- package/dist/validate-structure-layer-shared.js +17 -0
- package/dist/validate-structure-layer-shared.js.map +1 -0
- package/dist/validate-structure-layers.d.ts +12 -0
- package/dist/validate-structure-layers.d.ts.map +1 -0
- package/dist/validate-structure-layers.js +292 -0
- package/dist/validate-structure-layers.js.map +1 -0
- package/dist/validate-structure-paint.d.ts +12 -0
- package/dist/validate-structure-paint.d.ts.map +1 -0
- package/dist/validate-structure-paint.js +87 -0
- package/dist/validate-structure-paint.js.map +1 -0
- package/dist/validate-structure-scales.d.ts +10 -0
- package/dist/validate-structure-scales.d.ts.map +1 -0
- package/dist/validate-structure-scales.js +242 -0
- package/dist/validate-structure-scales.js.map +1 -0
- package/dist/validate-structure-style-bins.d.ts +17 -0
- package/dist/validate-structure-style-bins.d.ts.map +1 -0
- package/dist/validate-structure-style-bins.js +150 -0
- package/dist/validate-structure-style-bins.js.map +1 -0
- package/dist/validate-structure.d.ts +16 -0
- package/dist/validate-structure.d.ts.map +1 -0
- package/dist/validate-structure.js +16 -0
- package/dist/validate-structure.js.map +1 -0
- package/dist/validate.d.ts +24 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +178 -0
- package/dist/validate.js.map +1 -0
- package/package.json +59 -0
- package/schema/v0.json +9618 -0
- package/src/artifact.ts +81 -0
- package/src/builder-core.ts +276 -0
- package/src/builder-data.ts +156 -0
- package/src/builder-geoms.ts +290 -0
- package/src/builder-options.ts +428 -0
- package/src/builder-scales.ts +443 -0
- package/src/builder.ts +125 -0
- package/src/capabilities-data.ts +336 -0
- package/src/capabilities-helpers.ts +54 -0
- package/src/capabilities.ts +159 -0
- package/src/coord-helpers.ts +177 -0
- package/src/coord-reference-build.ts +283 -0
- package/src/coord-reference.ts +75 -0
- package/src/error-catalog.ts +253 -0
- package/src/error-prose-shared.ts +106 -0
- package/src/errors.ts +87 -0
- package/src/generated/coord-reference-data.ts +235 -0
- package/src/generated/geom-param-keys.ts +222 -0
- package/src/generated/geom-reference-data.ts +3024 -0
- package/src/generated/guide-reference-data.ts +284 -0
- package/src/generated/plot-spec-validator.ts +7335 -0
- package/src/generated/position-reference-data.ts +191 -0
- package/src/generated/scale-reference-data.ts +10665 -0
- package/src/generated/stat-reference-data.ts +339 -0
- package/src/geom-params-build.ts +92 -0
- package/src/geom-params.ts +14 -0
- package/src/geom-reference-build.ts +292 -0
- package/src/geom-reference.ts +127 -0
- package/src/guide-helpers.ts +44 -0
- package/src/guide-reference-build.ts +249 -0
- package/src/guide-reference.ts +76 -0
- package/src/hue-grey-palettes.ts +82 -0
- package/src/index.ts +400 -0
- package/src/lint-catalog.ts +57 -0
- package/src/lint-layer-rules.ts +175 -0
- package/src/lint-scale-rules.ts +285 -0
- package/src/lint.ts +126 -0
- package/src/normalize-coord.ts +126 -0
- package/src/normalize-input-layers-marks.ts +276 -0
- package/src/normalize-input-layers-special.ts +252 -0
- package/src/normalize-input.ts +154 -0
- package/src/normalize-paint.ts +98 -0
- package/src/normalize-scales.ts +108 -0
- package/src/normalize.ts +403 -0
- package/src/paint-helpers.ts +98 -0
- package/src/pipeline-error-catalog.ts +278 -0
- package/src/portability-check.ts +155 -0
- package/src/portability-lossy.ts +81 -0
- package/src/portability.ts +31 -0
- package/src/portable-builder.ts +35 -0
- package/src/portable-entry.ts +37 -0
- package/src/position-reference-build.ts +164 -0
- package/src/position-reference.ts +41 -0
- package/src/runtime.ts +198 -0
- package/src/scale-color-helpers.ts +263 -0
- package/src/scale-color-hue-grey.ts +95 -0
- package/src/scale-color-stops.ts +177 -0
- package/src/scale-color-viridis.ts +99 -0
- package/src/scale-helpers.ts +264 -0
- package/src/scale-multi-helpers.ts +220 -0
- package/src/scale-position-helpers.ts +231 -0
- package/src/scale-reference-build.ts +222 -0
- package/src/scale-reference-classify-color.ts +334 -0
- package/src/scale-reference-classify-position.ts +164 -0
- package/src/scale-reference-classify-style.ts +229 -0
- package/src/scale-reference-classify-support.ts +298 -0
- package/src/scale-reference.ts +165 -0
- package/src/scale-style-helpers.ts +316 -0
- package/src/schema-catalog.ts +222 -0
- package/src/schema-declarations.ts +51 -0
- package/src/schema-decls-data.ts +272 -0
- package/src/schema-decls-guides-theme.ts +395 -0
- package/src/schema-decls-layers-col-boxplot.ts +410 -0
- package/src/schema-decls-layers-count-pointrange.ts +321 -0
- package/src/schema-decls-layers-crossbar-jitter.ts +443 -0
- package/src/schema-decls-layers-point-path.ts +246 -0
- package/src/schema-decls-layers-sf-blank.ts +408 -0
- package/src/schema-decls-layers-text-map.ts +259 -0
- package/src/schema-decls-paint.ts +124 -0
- package/src/schema-decls-params-area-abline.ts +440 -0
- package/src/schema-decls-params-col-contour.ts +333 -0
- package/src/schema-decls-params-curve-label.ts +343 -0
- package/src/schema-decls-params-errorbar-position.ts +446 -0
- package/src/schema-decls-params-point-path.ts +394 -0
- package/src/schema-decls-params-violin-summary.ts +447 -0
- package/src/schema-decls-plot.ts +385 -0
- package/src/schema-decls-scales-guides.ts +233 -0
- package/src/schema-decls-scales.ts +432 -0
- package/src/schema-imports.ts +116 -0
- package/src/schema-name-schemas.ts +37 -0
- package/src/schema-names.ts +243 -0
- package/src/schema-types.ts +400 -0
- package/src/schema.ts +287 -0
- package/src/stat-reference-build.ts +145 -0
- package/src/stat-reference.ts +38 -0
- package/src/structural-gate.ts +42 -0
- package/src/temporal-column.ts +323 -0
- package/src/temporal-guides.ts +32 -0
- package/src/temporal-interval-schema.ts +40 -0
- package/src/temporal-interval.ts +151 -0
- package/src/temporal-parse-core.ts +331 -0
- package/src/temporal-parse-format.ts +222 -0
- package/src/temporal-parse-schema.ts +38 -0
- package/src/temporal-parse.ts +259 -0
- package/src/temporal-polyfill.ts +27 -0
- package/src/temporal-ticks.ts +312 -0
- package/src/temporal.ts +112 -0
- package/src/validate-data-checks-color-temporal.ts +261 -0
- package/src/validate-data-checks-color.ts +395 -0
- package/src/validate-data-checks-layer.ts +492 -0
- package/src/validate-data-checks-position.ts +275 -0
- package/src/validate-data-checks-style-finite.ts +55 -0
- package/src/validate-data-checks-style-numeric.ts +455 -0
- package/src/validate-data-checks-style.ts +13 -0
- package/src/validate-data-checks-temporal.ts +129 -0
- package/src/validate-data-checks.ts +157 -0
- package/src/validate-data-evidence.ts +419 -0
- package/src/validate-data.ts +114 -0
- package/src/validate-map-errors.ts +126 -0
- package/src/validate-map-forms.ts +148 -0
- package/src/validate-map-path-keywords.ts +129 -0
- package/src/validate-map-path-unions.ts +281 -0
- package/src/validate-schema-shape.ts +232 -0
- package/src/validate-schema-walk.ts +219 -0
- package/src/validate-structure-facet.ts +76 -0
- package/src/validate-structure-layer-computed-y.ts +94 -0
- package/src/validate-structure-layer-ribbon.ts +61 -0
- package/src/validate-structure-layer-rule.ts +98 -0
- package/src/validate-structure-layer-shared.ts +29 -0
- package/src/validate-structure-layers.ts +395 -0
- package/src/validate-structure-paint.ts +101 -0
- package/src/validate-structure-scales.ts +278 -0
- package/src/validate-structure-style-bins.ts +167 -0
- package/src/validate-structure.ts +16 -0
- package/src/validate.ts +212 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer walk for tier-2 data checks: geom/stat field-type rules, field existence,
|
|
3
|
+
* all-null columns, {stat} columns, and channel collection for scale checkers.
|
|
4
|
+
*
|
|
5
|
+
* Orchestrator: validate-data-checks.ts (evidence resolve → walk → style/position/color).
|
|
6
|
+
* Scale checkers: validate-data-checks-{style,position,color}.ts.
|
|
7
|
+
*/
|
|
8
|
+
import type { SpecError } from "./errors.js";
|
|
9
|
+
import { didYouMean } from "./errors.js";
|
|
10
|
+
import type { Aes, ChannelName } from "./schema.js";
|
|
11
|
+
import { CHANNELS, GEOM_DEFAULTS } from "./schema-catalog.js";
|
|
12
|
+
import type { ProfileFieldType } from "./validate-data.js";
|
|
13
|
+
import { effectiveChannel, type FieldEvidenceMap } from "./validate-data-evidence.js";
|
|
14
|
+
import type { ChannelFieldUse } from "./validate-data-checks-temporal.js";
|
|
15
|
+
|
|
16
|
+
/** Columns generated by each stat ({ stat } channel resolution contract).
|
|
17
|
+
* Documented per stat in its @ggts-sh/core module header. */
|
|
18
|
+
export const STAT_COLUMNS: Record<string, readonly string[]> = {
|
|
19
|
+
identity: [],
|
|
20
|
+
count: ["count"],
|
|
21
|
+
bin: ["count", "density", "ncount", "ndensity"],
|
|
22
|
+
bin_hex: ["count", "density", "ncount", "ndensity"],
|
|
23
|
+
bin_2d: ["count", "density", "ncount", "ndensity"],
|
|
24
|
+
density: ["density", "count", "scaled", "ndensity"],
|
|
25
|
+
ydensity: ["density", "count", "scaled", "violinwidth", "y"],
|
|
26
|
+
bindot: ["stackpos"],
|
|
27
|
+
smooth: ["y", "ymin", "ymax", "se"],
|
|
28
|
+
boxplot: ["ymin", "lower", "middle", "upper", "ymax"],
|
|
29
|
+
summary: ["y", "ymin", "ymax"],
|
|
30
|
+
/** after_stat n / prop for geom_count; not published on y (y is position input). */
|
|
31
|
+
sum: ["n", "prop"],
|
|
32
|
+
function: ["y"],
|
|
33
|
+
/** ggplot2 after_stat(ecdf); y channel defaults to this column. */
|
|
34
|
+
ecdf: ["ecdf"],
|
|
35
|
+
summary_bin: ["y", "ymin", "ymax"],
|
|
36
|
+
/** Centered rolling-window summary; one row per (group, unique x). */
|
|
37
|
+
summary_rolling: ["y"],
|
|
38
|
+
contour: ["level"],
|
|
39
|
+
quantile: ["y"],
|
|
40
|
+
density_2d: ["level", "density"],
|
|
41
|
+
density_2d_filled: ["level", "density"],
|
|
42
|
+
qq: ["sample", "theoretical"],
|
|
43
|
+
qq_line: ["sample", "theoretical"],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* y-channel {stat} columns, mirroring core's STAT_Y_COLUMNS
|
|
48
|
+
* (packages/core/src/pipeline/bind-layer-stat-columns.ts — keep in sync). The
|
|
49
|
+
* generic STAT_COLUMNS table covers style channels; the y channel is stricter
|
|
50
|
+
* because summary-family stats write y as a frame coordinate (a measure
|
|
51
|
+
* output) and publish no y-mappable column. Validating against STAT_COLUMNS
|
|
52
|
+
* here let specs through that the renderer rejects with unknown-stat-column.
|
|
53
|
+
*/
|
|
54
|
+
const STAT_Y_CHANNEL_COLUMNS: Record<string, readonly string[]> = {
|
|
55
|
+
identity: [],
|
|
56
|
+
unique: [],
|
|
57
|
+
manual: [],
|
|
58
|
+
count: ["count"],
|
|
59
|
+
bin: ["count", "density", "ncount", "ndensity"],
|
|
60
|
+
density: ["density", "count", "scaled", "ndensity"],
|
|
61
|
+
ydensity: ["density", "count", "scaled", "violinwidth"],
|
|
62
|
+
density_2d: [],
|
|
63
|
+
density_2d_filled: [],
|
|
64
|
+
bindot: ["stackpos"],
|
|
65
|
+
smooth: [],
|
|
66
|
+
boxplot: [],
|
|
67
|
+
summary: [],
|
|
68
|
+
sum: [],
|
|
69
|
+
function: ["y"],
|
|
70
|
+
ecdf: ["ecdf"],
|
|
71
|
+
summary_bin: [],
|
|
72
|
+
summary_rolling: [],
|
|
73
|
+
contour: [],
|
|
74
|
+
connect: [],
|
|
75
|
+
align: [],
|
|
76
|
+
ellipse: [],
|
|
77
|
+
bin_hex: [],
|
|
78
|
+
bin_2d: [],
|
|
79
|
+
quantile: [],
|
|
80
|
+
sf: [],
|
|
81
|
+
sf_coordinates: [],
|
|
82
|
+
qq: [],
|
|
83
|
+
qq_line: [],
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
function isRecord(v: unknown): v is Record<string, unknown> {
|
|
87
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Channel maps + scaled constants collected while walking layers. */
|
|
91
|
+
export interface LayerWalkCollections {
|
|
92
|
+
errors: SpecError[];
|
|
93
|
+
axisFields: Record<"x" | "y", ChannelFieldUse[]>;
|
|
94
|
+
colorFields: Record<"color" | "fill", ChannelFieldUse[]>;
|
|
95
|
+
colorScaledConstants: Record<"color" | "fill", unknown[]>;
|
|
96
|
+
finiteStyleFields: Record<"shape" | "linetype", ChannelFieldUse[]>;
|
|
97
|
+
numericStyleFields: Record<"size" | "linewidth" | "alpha", ChannelFieldUse[]>;
|
|
98
|
+
numericStyleScaledConstants: Record<"size" | "linewidth" | "alpha", unknown[]>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Walk layers once: geom/stat type contracts, field existence / all-null / {stat}
|
|
103
|
+
* columns, then collect aesthetic uses for scale checkers.
|
|
104
|
+
*/
|
|
105
|
+
export function collectLayerDataChecks(input: {
|
|
106
|
+
layers: readonly unknown[];
|
|
107
|
+
plotAes: Aes | undefined;
|
|
108
|
+
plotFields: FieldEvidenceMap | null;
|
|
109
|
+
/** Per-layer evidence when resolveLayerFieldEvidence succeeded; else null. */
|
|
110
|
+
layerMaps: readonly (FieldEvidenceMap | null)[] | null;
|
|
111
|
+
scaleRequestsTime: (channel: ChannelName) => boolean;
|
|
112
|
+
}): LayerWalkCollections {
|
|
113
|
+
const collections = emptyLayerWalkCollections();
|
|
114
|
+
for (let index = 0; index < input.layers.length; index++) {
|
|
115
|
+
collectLayerDataChecksForLayer(input, index, collections);
|
|
116
|
+
}
|
|
117
|
+
return collections;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
type LayerWalkInput = Parameters<typeof collectLayerDataChecks>[0];
|
|
121
|
+
type FieldTypeOf = (channel: ChannelName) => [string, ProfileFieldType] | null;
|
|
122
|
+
type LayerTypeContext = {
|
|
123
|
+
geom: string;
|
|
124
|
+
stat: string;
|
|
125
|
+
index: number;
|
|
126
|
+
fieldTypeOf: FieldTypeOf;
|
|
127
|
+
scaleRequestsTime: (channel: ChannelName) => boolean;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
function emptyLayerWalkCollections(): LayerWalkCollections {
|
|
131
|
+
return {
|
|
132
|
+
errors: [],
|
|
133
|
+
axisFields: { x: [], y: [] },
|
|
134
|
+
colorFields: { color: [], fill: [] },
|
|
135
|
+
colorScaledConstants: { color: [], fill: [] },
|
|
136
|
+
finiteStyleFields: { shape: [], linetype: [] },
|
|
137
|
+
numericStyleFields: { size: [], linewidth: [], alpha: [] },
|
|
138
|
+
numericStyleScaledConstants: { size: [], linewidth: [], alpha: [] },
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function collectLayerDataChecksForLayer(
|
|
143
|
+
input: LayerWalkInput,
|
|
144
|
+
index: number,
|
|
145
|
+
collections: LayerWalkCollections,
|
|
146
|
+
): void {
|
|
147
|
+
const layer = input.layers[index];
|
|
148
|
+
if (!isRecord(layer)) return;
|
|
149
|
+
const geom = typeof layer["geom"] === "string" ? layer["geom"] : "";
|
|
150
|
+
const layerAes = isRecord(layer["aes"]) ? (layer["aes"] as Aes) : undefined;
|
|
151
|
+
const defaultStat = GEOM_DEFAULTS[geom as keyof typeof GEOM_DEFAULTS]?.stat ?? "identity";
|
|
152
|
+
const stat = typeof layer["stat"] === "string" ? layer["stat"] : defaultStat;
|
|
153
|
+
const fields =
|
|
154
|
+
input.layerMaps === null ? input.plotFields : (input.layerMaps[index] ?? input.plotFields);
|
|
155
|
+
if (fields === null) return;
|
|
156
|
+
const fieldTypeOf = layerFieldTypeLookup(
|
|
157
|
+
input.plotAes,
|
|
158
|
+
layerAes,
|
|
159
|
+
fields,
|
|
160
|
+
input.scaleRequestsTime,
|
|
161
|
+
);
|
|
162
|
+
collections.errors.push(
|
|
163
|
+
...geomFieldTypeErrors({
|
|
164
|
+
geom,
|
|
165
|
+
stat,
|
|
166
|
+
index,
|
|
167
|
+
fieldTypeOf,
|
|
168
|
+
scaleRequestsTime: input.scaleRequestsTime,
|
|
169
|
+
}),
|
|
170
|
+
);
|
|
171
|
+
collectLayerChannels({
|
|
172
|
+
plotAes: input.plotAes,
|
|
173
|
+
layerAes,
|
|
174
|
+
fields,
|
|
175
|
+
stat,
|
|
176
|
+
index,
|
|
177
|
+
collections,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function layerFieldTypeLookup(
|
|
182
|
+
plotAes: Aes | undefined,
|
|
183
|
+
layerAes: Aes | undefined,
|
|
184
|
+
fields: FieldEvidenceMap,
|
|
185
|
+
scaleRequestsTime: (channel: ChannelName) => boolean,
|
|
186
|
+
): FieldTypeOf {
|
|
187
|
+
return (channel) => {
|
|
188
|
+
const mapped = effectiveChannel(plotAes, layerAes, channel);
|
|
189
|
+
if (mapped === undefined || !("field" in mapped)) return null;
|
|
190
|
+
const type = fields.get(mapped.field)?.type;
|
|
191
|
+
if (type === undefined || type === null) return null;
|
|
192
|
+
return [mapped.field, scaleRequestsTime(channel) ? "temporal" : type];
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function geomFieldTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
197
|
+
return [
|
|
198
|
+
...smoothTypeErrors(context),
|
|
199
|
+
...boxplotTypeErrors(context),
|
|
200
|
+
...continuousStatTypeErrors(context),
|
|
201
|
+
...intervalTypeErrors(context),
|
|
202
|
+
...rectTypeErrors(context),
|
|
203
|
+
...rasterTypeErrors(context),
|
|
204
|
+
...tileTypeErrors(context),
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function channelTypeError(
|
|
209
|
+
index: number,
|
|
210
|
+
channel: ChannelName,
|
|
211
|
+
message: string,
|
|
212
|
+
description: string,
|
|
213
|
+
): SpecError {
|
|
214
|
+
return {
|
|
215
|
+
code: "channel-type-mismatch",
|
|
216
|
+
path: `/layers/${index}/aes/${channel}`,
|
|
217
|
+
message,
|
|
218
|
+
fix: { description },
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function isDiscreteType(type: ProfileFieldType): boolean {
|
|
223
|
+
return type === "nominal" || type === "ordinal";
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function smoothTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
227
|
+
if (context.geom !== "smooth") return [];
|
|
228
|
+
const errors: SpecError[] = [];
|
|
229
|
+
for (const channel of ["x", "y"] as const) {
|
|
230
|
+
const info = context.fieldTypeOf(channel);
|
|
231
|
+
if (info === null || !isDiscreteType(info[1])) continue;
|
|
232
|
+
errors.push(
|
|
233
|
+
channelTypeError(
|
|
234
|
+
context.index,
|
|
235
|
+
channel,
|
|
236
|
+
`The smooth stat needs quantitative x and y, but field "${info[0]}" (${channel}) is ${info[1]}.`,
|
|
237
|
+
"Map the channel to a numeric field, or use a boxplot for discrete x.",
|
|
238
|
+
),
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
return errors;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function boxplotTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
245
|
+
if (context.geom !== "boxplot") return [];
|
|
246
|
+
const errors: SpecError[] = [];
|
|
247
|
+
const x = context.fieldTypeOf("x");
|
|
248
|
+
if (x !== null && (x[1] === "quantitative" || x[1] === "temporal")) {
|
|
249
|
+
errors.push(
|
|
250
|
+
channelTypeError(
|
|
251
|
+
context.index,
|
|
252
|
+
"x",
|
|
253
|
+
`The boxplot geom needs a DISCRETE x this milestone, but field "${x[0]}" is ${x[1]}.`,
|
|
254
|
+
"Map x to a categorical field (strings), or bin the values into labeled categories first.",
|
|
255
|
+
),
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
const y = context.fieldTypeOf("y");
|
|
259
|
+
if (y !== null && isDiscreteType(y[1])) {
|
|
260
|
+
errors.push(
|
|
261
|
+
channelTypeError(
|
|
262
|
+
context.index,
|
|
263
|
+
"y",
|
|
264
|
+
`The boxplot stat needs a quantitative y, but field "${y[0]}" is ${y[1]}.`,
|
|
265
|
+
"Map y to a numeric field.",
|
|
266
|
+
),
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
return errors;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function continuousStatTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
273
|
+
const { geom, stat } = context;
|
|
274
|
+
const continuous =
|
|
275
|
+
["histogram", "freqpoly", "density"].includes(geom) ||
|
|
276
|
+
((geom === "bar" || geom === "line") && stat === "bin");
|
|
277
|
+
if (!continuous) return [];
|
|
278
|
+
const x = context.fieldTypeOf("x");
|
|
279
|
+
if (x === null || !isDiscreteType(x[1])) return [];
|
|
280
|
+
return [
|
|
281
|
+
channelTypeError(
|
|
282
|
+
context.index,
|
|
283
|
+
"x",
|
|
284
|
+
`The ${geom === "density" ? "density" : "bin"} stat needs a continuous x, but field "${x[0]}" is ${x[1]}.`,
|
|
285
|
+
'Use geom "bar" (the count stat) to count categories instead.',
|
|
286
|
+
),
|
|
287
|
+
];
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function intervalTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
291
|
+
if (!["errorbar", "linerange", "pointrange", "crossbar"].includes(context.geom)) return [];
|
|
292
|
+
if (context.scaleRequestsTime("y")) return [];
|
|
293
|
+
const errors: SpecError[] = [];
|
|
294
|
+
for (const channel of ["ymin", "ymax"] as const) {
|
|
295
|
+
const info = context.fieldTypeOf(channel);
|
|
296
|
+
if (info === null || !isDiscreteType(info[1])) continue;
|
|
297
|
+
errors.push(
|
|
298
|
+
channelTypeError(
|
|
299
|
+
context.index,
|
|
300
|
+
channel,
|
|
301
|
+
`The ${context.geom} geom needs quantitative bounds, but field "${info[0]}" (${channel}) is ${info[1]}.`,
|
|
302
|
+
"Map the channel to a numeric field.",
|
|
303
|
+
),
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
return errors;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function rectTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
310
|
+
if (context.geom !== "rect") return [];
|
|
311
|
+
return [
|
|
312
|
+
...rectAxisTypeErrors(context, "x", ["xmin", "xmax"]),
|
|
313
|
+
...rectAxisTypeErrors(context, "y", ["ymin", "ymax"]),
|
|
314
|
+
];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function rectAxisTypeErrors(
|
|
318
|
+
context: LayerTypeContext,
|
|
319
|
+
axis: "x" | "y",
|
|
320
|
+
channels: readonly ChannelName[],
|
|
321
|
+
): SpecError[] {
|
|
322
|
+
if (context.scaleRequestsTime(axis)) return [];
|
|
323
|
+
const errors: SpecError[] = [];
|
|
324
|
+
for (const channel of channels) {
|
|
325
|
+
const info = context.fieldTypeOf(channel);
|
|
326
|
+
if (info === null || !isDiscreteType(info[1])) continue;
|
|
327
|
+
errors.push(
|
|
328
|
+
channelTypeError(
|
|
329
|
+
context.index,
|
|
330
|
+
channel,
|
|
331
|
+
`The rect geom needs quantitative edges, but field "${info[0]}" (${channel}) is ${info[1]}.`,
|
|
332
|
+
"Map the channel to a numeric field.",
|
|
333
|
+
),
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
return errors;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function rasterTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
340
|
+
if (context.geom !== "raster") return [];
|
|
341
|
+
const errors: SpecError[] = [];
|
|
342
|
+
for (const channel of ["x", "y"] as const) {
|
|
343
|
+
const info = context.fieldTypeOf(channel);
|
|
344
|
+
if (info === null || !isDiscreteType(info[1])) continue;
|
|
345
|
+
errors.push(
|
|
346
|
+
channelTypeError(
|
|
347
|
+
context.index,
|
|
348
|
+
channel,
|
|
349
|
+
`The raster geom needs continuous ${channel}, but field "${info[0]}" is ${info[1]}.`,
|
|
350
|
+
'Use geom "tile" for discrete axes.',
|
|
351
|
+
),
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
return errors;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function tileTypeErrors(context: LayerTypeContext): SpecError[] {
|
|
358
|
+
if (context.geom !== "tile") return [];
|
|
359
|
+
const errors: SpecError[] = [];
|
|
360
|
+
for (const channel of ["width", "height"] as const) {
|
|
361
|
+
const info = context.fieldTypeOf(channel);
|
|
362
|
+
if (info === null || info[1] === "quantitative") continue;
|
|
363
|
+
errors.push(
|
|
364
|
+
channelTypeError(
|
|
365
|
+
context.index,
|
|
366
|
+
channel,
|
|
367
|
+
`The tile geom needs quantitative ${channel}, but field "${info[0]}" is ${info[1]}.`,
|
|
368
|
+
`Map ${channel} to a positive numeric field, or use params.${channel}.`,
|
|
369
|
+
),
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
return errors;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function collectLayerChannels(input: {
|
|
376
|
+
plotAes: Aes | undefined;
|
|
377
|
+
layerAes: Aes | undefined;
|
|
378
|
+
fields: FieldEvidenceMap;
|
|
379
|
+
stat: string;
|
|
380
|
+
index: number;
|
|
381
|
+
collections: LayerWalkCollections;
|
|
382
|
+
}): void {
|
|
383
|
+
const available = [...input.fields.keys()];
|
|
384
|
+
for (const channel of CHANNELS) {
|
|
385
|
+
const mapped = effectiveChannel(input.plotAes, input.layerAes, channel);
|
|
386
|
+
if (mapped === undefined) continue;
|
|
387
|
+
const path = `/layers/${input.index}/aes/${channel}`;
|
|
388
|
+
if ("stat" in mapped) {
|
|
389
|
+
const error = statColumnError(channel, mapped.stat, input.stat, path);
|
|
390
|
+
if (error !== null) input.collections.errors.push(error);
|
|
391
|
+
} else if ("value" in mapped) {
|
|
392
|
+
collectScaledConstant(input.collections, channel, mapped);
|
|
393
|
+
} else if ("field" in mapped) {
|
|
394
|
+
collectFieldChannel(input.collections, channel, mapped.field, path, input.fields, available);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function statColumnError(
|
|
400
|
+
channel: ChannelName,
|
|
401
|
+
statColumn: string,
|
|
402
|
+
stat: string,
|
|
403
|
+
path: string,
|
|
404
|
+
): SpecError | null {
|
|
405
|
+
const generated = (channel === "y" ? STAT_Y_CHANNEL_COLUMNS[stat] : STAT_COLUMNS[stat]) ?? [];
|
|
406
|
+
if (generated.includes(statColumn)) return null;
|
|
407
|
+
return {
|
|
408
|
+
code: "unknown-stat-column",
|
|
409
|
+
path,
|
|
410
|
+
message:
|
|
411
|
+
generated.length === 0
|
|
412
|
+
? `Channel "${channel}" maps stat column "${statColumn}", but this layer's stat ("${stat}") generates no columns.`
|
|
413
|
+
: `Channel "${channel}" maps stat column "${statColumn}", but this layer's stat ("${stat}") generates: ${generated.join(", ")}.`,
|
|
414
|
+
...(generated.length > 0 && { allowed: [...generated] }),
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function collectScaledConstant(
|
|
419
|
+
collections: LayerWalkCollections,
|
|
420
|
+
channel: ChannelName,
|
|
421
|
+
mapped: { value: unknown; scale?: boolean },
|
|
422
|
+
): void {
|
|
423
|
+
if (mapped.scale !== true || mapped.value === null) return;
|
|
424
|
+
if (channel === "color" || channel === "fill") {
|
|
425
|
+
collections.colorScaledConstants[channel].push(mapped.value);
|
|
426
|
+
}
|
|
427
|
+
if (channel === "size" || channel === "linewidth" || channel === "alpha") {
|
|
428
|
+
collections.numericStyleScaledConstants[channel].push(mapped.value);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function collectFieldChannel(
|
|
433
|
+
collections: LayerWalkCollections,
|
|
434
|
+
channel: ChannelName,
|
|
435
|
+
field: string,
|
|
436
|
+
path: string,
|
|
437
|
+
fields: FieldEvidenceMap,
|
|
438
|
+
available: string[],
|
|
439
|
+
): void {
|
|
440
|
+
const info = fields.get(field);
|
|
441
|
+
if (info === undefined) {
|
|
442
|
+
collections.errors.push(unknownFieldError(channel, field, path, available));
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
if (info.allNull) {
|
|
446
|
+
collections.errors.push({
|
|
447
|
+
code: "all-null-column",
|
|
448
|
+
path,
|
|
449
|
+
message: `Field "${field}" contains only null values; the "${channel}" channel cannot be drawn from it.`,
|
|
450
|
+
});
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
collectFieldUse(collections, channel, { field, path });
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function unknownFieldError(
|
|
457
|
+
channel: ChannelName,
|
|
458
|
+
field: string,
|
|
459
|
+
path: string,
|
|
460
|
+
available: string[],
|
|
461
|
+
): SpecError {
|
|
462
|
+
const suggestion = didYouMean(field, available);
|
|
463
|
+
return {
|
|
464
|
+
code: "unknown-field",
|
|
465
|
+
path,
|
|
466
|
+
message:
|
|
467
|
+
`Unknown field "${field}" (available: ${available.join(", ") || "none"}).` +
|
|
468
|
+
(suggestion === undefined ? "" : ` Did you mean "${suggestion}"?`),
|
|
469
|
+
allowed: available,
|
|
470
|
+
...(suggestion !== undefined && {
|
|
471
|
+
fix: {
|
|
472
|
+
description: `Map "${channel}" to "${suggestion}".`,
|
|
473
|
+
example: { field: suggestion },
|
|
474
|
+
},
|
|
475
|
+
}),
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function collectFieldUse(
|
|
480
|
+
collections: LayerWalkCollections,
|
|
481
|
+
channel: ChannelName,
|
|
482
|
+
use: ChannelFieldUse,
|
|
483
|
+
): void {
|
|
484
|
+
if (["x", "xmin", "xmax", "xend"].includes(channel)) collections.axisFields.x.push(use);
|
|
485
|
+
if (["y", "ymin", "ymax", "yend"].includes(channel)) collections.axisFields.y.push(use);
|
|
486
|
+
if (channel === "color" || channel === "fill") collections.colorFields[channel].push(use);
|
|
487
|
+
if (channel === "shape" || channel === "linetype")
|
|
488
|
+
collections.finiteStyleFields[channel].push(use);
|
|
489
|
+
if (channel === "size" || channel === "linewidth" || channel === "alpha") {
|
|
490
|
+
collections.numericStyleFields[channel].push(use);
|
|
491
|
+
}
|
|
492
|
+
}
|