@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,204 @@
|
|
|
1
|
+
import { temporalParserConfigurationError } from "./temporal-parse.js";
|
|
2
|
+
import { parseTemporalInterval, temporalLabelConfigurationError, temporalLocaleConfigurationError, } from "./temporal-interval.js";
|
|
3
|
+
import { appendTemporalKindMismatch, temporalDecisionForField, } from "./validate-data-checks-temporal.js";
|
|
4
|
+
const AXIS_CHANNELS = ["x", "y"];
|
|
5
|
+
const NON_TIME_TYPES_WITH_TEMPORAL_GUIDES = new Set(["band", "linear", "log"]);
|
|
6
|
+
/**
|
|
7
|
+
* Temporal break/label options on an explicit non-time scale.
|
|
8
|
+
* Shared by agent `validate()` and the TypeBox-free render gate.
|
|
9
|
+
*/
|
|
10
|
+
export function temporalGuideTypeMismatchError(scales, axis) {
|
|
11
|
+
const config = scales?.[axis];
|
|
12
|
+
const hasGuideTemporalOption = config?.dateBreaks !== undefined ||
|
|
13
|
+
config?.dateMinorBreaks !== undefined ||
|
|
14
|
+
config?.dateLabels !== undefined ||
|
|
15
|
+
config?.locale !== undefined ||
|
|
16
|
+
config?.weekStart !== undefined;
|
|
17
|
+
if (!hasGuideTemporalOption ||
|
|
18
|
+
config?.type === undefined ||
|
|
19
|
+
!NON_TIME_TYPES_WITH_TEMPORAL_GUIDES.has(config.type)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
code: "scale-type-mismatch",
|
|
24
|
+
path: `/scales/${axis}`,
|
|
25
|
+
message: `scales.${axis} uses temporal break or label options with explicit type "${config.type}".`,
|
|
26
|
+
fix: {
|
|
27
|
+
description: 'Use type "time", a date/datetime scale helper, or remove the temporal option.',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** True when the axis scale config requests temporal semantics (not band). */
|
|
32
|
+
export function scaleRequestsTime(scales, axis) {
|
|
33
|
+
const config = scales?.[axis];
|
|
34
|
+
if (config?.type === "band")
|
|
35
|
+
return false;
|
|
36
|
+
if (config?.type === "time")
|
|
37
|
+
return true;
|
|
38
|
+
return [
|
|
39
|
+
config?.parse,
|
|
40
|
+
config?.temporalKind,
|
|
41
|
+
config?.timezone,
|
|
42
|
+
config?.disambiguation,
|
|
43
|
+
config?.parseFailure,
|
|
44
|
+
config?.dateBreaks,
|
|
45
|
+
config?.dateMinorBreaks,
|
|
46
|
+
config?.dateLabels,
|
|
47
|
+
config?.locale,
|
|
48
|
+
config?.weekStart,
|
|
49
|
+
].some((value) => value !== undefined);
|
|
50
|
+
}
|
|
51
|
+
function temporalAxisConfigurationError(config) {
|
|
52
|
+
const effectiveParser = config?.parse ?? (config?.temporalKind === "monthDay" ? "md" : "auto");
|
|
53
|
+
const parserError = temporalParserConfigurationError(effectiveParser, {
|
|
54
|
+
...(config?.timezone !== undefined && { timezone: config.timezone }),
|
|
55
|
+
...(config?.disambiguation !== undefined && { disambiguation: config.disambiguation }),
|
|
56
|
+
});
|
|
57
|
+
if (parserError !== null)
|
|
58
|
+
return parserError;
|
|
59
|
+
const intervalError = temporalIntervalConfigurationError(config);
|
|
60
|
+
if (intervalError !== null)
|
|
61
|
+
return intervalError;
|
|
62
|
+
const labelError = config?.dateLabels === undefined
|
|
63
|
+
? null
|
|
64
|
+
: temporalLabelConfigurationError(config.dateLabels, config.temporalKind);
|
|
65
|
+
if (labelError !== null)
|
|
66
|
+
return labelError;
|
|
67
|
+
return config?.locale === undefined ? null : temporalLocaleConfigurationError(config.locale);
|
|
68
|
+
}
|
|
69
|
+
function temporalIntervalConfigurationError(config) {
|
|
70
|
+
for (const interval of [config?.dateBreaks, config?.dateMinorBreaks]) {
|
|
71
|
+
if (interval === undefined)
|
|
72
|
+
continue;
|
|
73
|
+
try {
|
|
74
|
+
parseTemporalInterval(interval);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return error instanceof Error ? error.message : "invalid temporal interval";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Validate temporal axis configuration before field evidence is resolved.
|
|
84
|
+
* Errors here are included even when data/profile is missing or invalid.
|
|
85
|
+
* Returns invalidTemporalAxes so post-layer position checks skip broken axes.
|
|
86
|
+
*/
|
|
87
|
+
export function validateTemporalAxisConfiguration(scales) {
|
|
88
|
+
const errors = [];
|
|
89
|
+
const invalidTemporalAxes = new Set();
|
|
90
|
+
for (const axis of AXIS_CHANNELS) {
|
|
91
|
+
const config = scales?.[axis];
|
|
92
|
+
const mismatch = temporalGuideTypeMismatchError(scales, axis);
|
|
93
|
+
if (mismatch !== null) {
|
|
94
|
+
invalidTemporalAxes.add(axis);
|
|
95
|
+
errors.push(mismatch);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (config?.type === "band" || !scaleRequestsTime(scales, axis))
|
|
99
|
+
continue;
|
|
100
|
+
const configurationError = temporalAxisConfigurationError(config);
|
|
101
|
+
if (configurationError === null)
|
|
102
|
+
continue;
|
|
103
|
+
invalidTemporalAxes.add(axis);
|
|
104
|
+
errors.push({
|
|
105
|
+
code: "scale-type-mismatch",
|
|
106
|
+
path: `/scales/${axis}`,
|
|
107
|
+
message: `scales.${axis} has invalid temporal configuration: ${configurationError}.`,
|
|
108
|
+
fix: {
|
|
109
|
+
description: "Correct the parser, interval, label, locale, or timezone configuration.",
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return { errors, invalidTemporalAxes };
|
|
114
|
+
}
|
|
115
|
+
/** Post-layer x/y scale type compatibility against collected field uses. */
|
|
116
|
+
export function checkPositionScaleDataCompatibility(input) {
|
|
117
|
+
const { scales, fields, axisFields, invalidTemporalAxes, temporalDecisionCache } = input;
|
|
118
|
+
const errors = [];
|
|
119
|
+
const evidenceOf = (use) => input.evidenceForUse?.(use) ?? fields.get(use.field);
|
|
120
|
+
for (const axis of AXIS_CHANNELS) {
|
|
121
|
+
const config = scales?.[axis];
|
|
122
|
+
const declared = config?.type === "band" ? "band" : scaleRequestsTime(scales, axis) ? "time" : config?.type;
|
|
123
|
+
if (declared === undefined || declared === "band" || invalidTemporalAxes.has(axis))
|
|
124
|
+
continue;
|
|
125
|
+
for (const use of axisFields[axis]) {
|
|
126
|
+
const info = evidenceOf(use);
|
|
127
|
+
if (info === undefined || info.type === null)
|
|
128
|
+
continue;
|
|
129
|
+
const type = info.type;
|
|
130
|
+
if (declared === "time") {
|
|
131
|
+
errors.push(...timePositionErrors(axis, use, info, config, temporalDecisionCache));
|
|
132
|
+
}
|
|
133
|
+
else if ((declared === "log" || declared === "linear") &&
|
|
134
|
+
(type === "nominal" || type === "ordinal")) {
|
|
135
|
+
errors.push(linearPositionError(axis, declared, use, type));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return errors;
|
|
140
|
+
}
|
|
141
|
+
function timePositionErrors(axis, use, info, config, cache) {
|
|
142
|
+
const effectiveParser = config?.parse ?? (config?.temporalKind === "monthDay" ? "md" : "auto");
|
|
143
|
+
const options = temporalPositionOptions(config);
|
|
144
|
+
const decision = temporalDecisionForField(cache, use.field, info, effectiveParser, options);
|
|
145
|
+
const profileTemporal = info.values === null && info.type === "temporal";
|
|
146
|
+
if (timePositionResolves(config, decision, profileTemporal)) {
|
|
147
|
+
const errors = [];
|
|
148
|
+
appendTemporalKindMismatch(errors, {
|
|
149
|
+
axis,
|
|
150
|
+
path: use.path,
|
|
151
|
+
field: use.field,
|
|
152
|
+
expected: config?.temporalKind,
|
|
153
|
+
actual: decision?.kind ?? null,
|
|
154
|
+
});
|
|
155
|
+
return errors;
|
|
156
|
+
}
|
|
157
|
+
const firstFailure = decision?.failures?.[0];
|
|
158
|
+
const detail = firstFailure === undefined
|
|
159
|
+
? temporalDecisionDetail(decision)
|
|
160
|
+
: ` Parser ${JSON.stringify(effectiveParser)} rejected ${decision?.failedCount ?? 0} value(s), including row ${firstFailure.index}: ${JSON.stringify(firstFailure.value)}.`;
|
|
161
|
+
return [
|
|
162
|
+
{
|
|
163
|
+
code: "scale-type-mismatch",
|
|
164
|
+
path: use.path,
|
|
165
|
+
message: `scales.${axis} requests time but field "${use.field}" is ${info.type}.${detail}`,
|
|
166
|
+
fix: {
|
|
167
|
+
description: config?.parse === undefined
|
|
168
|
+
? `Set scales.${axis}.parse to an explicit temporal order, or set scales.${axis}.type to "band" to keep categories.`
|
|
169
|
+
: `Correct the rejected values, choose the matching scales.${axis}.parse value, or use parseFailure: "censor" explicitly.`,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
function temporalPositionOptions(config) {
|
|
175
|
+
return {
|
|
176
|
+
...(config?.timezone !== undefined && { timezone: config.timezone }),
|
|
177
|
+
...(config?.disambiguation !== undefined && { disambiguation: config.disambiguation }),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function timePositionResolves(config, decision, profileTemporal) {
|
|
181
|
+
return (decision?.status === "temporal" ||
|
|
182
|
+
profileTemporal ||
|
|
183
|
+
(config?.parse !== undefined &&
|
|
184
|
+
config.parseFailure === "censor" &&
|
|
185
|
+
decision?.status === "invalid"));
|
|
186
|
+
}
|
|
187
|
+
function temporalDecisionDetail(decision) {
|
|
188
|
+
if (decision?.status === "ambiguous") {
|
|
189
|
+
return ` Automatic temporal inference was ambiguous between: ${decision.candidates.join(", ")}.`;
|
|
190
|
+
}
|
|
191
|
+
if (decision?.status === "invalid") {
|
|
192
|
+
return ` Automatic temporal inference failed whole-column validation for ${decision.failedCount} value(s).`;
|
|
193
|
+
}
|
|
194
|
+
return "";
|
|
195
|
+
}
|
|
196
|
+
function linearPositionError(axis, declared, use, type) {
|
|
197
|
+
return {
|
|
198
|
+
code: "scale-type-mismatch",
|
|
199
|
+
path: use.path,
|
|
200
|
+
message: `scales.${axis}.type is "${declared}" but field "${use.field}" is ${type}; use a band scale (or a quantitative field).`,
|
|
201
|
+
fix: { description: `Set scales.${axis}.type to "band".` },
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=validate-data-checks-position.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-data-checks-position.js","sourceRoot":"","sources":["../src/validate-data-checks-position.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,0BAA0B,EA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AAED,SAAS,oBAAoB,CAC3B,MAAqC,EACrC,QAAqD,EACrD,eAAwB;IAExB,OAAO,CACL,QAAQ,EAAE,MAAM,KAAK,UAAU;QAC/B,eAAe;QACf,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS;YAC1B,MAAM,CAAC,YAAY,KAAK,QAAQ;YAChC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,QAAqD;IACnF,IAAI,QAAQ,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;QACrC,OAAO,wDAAwD,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACnG,CAAC;IACD,IAAI,QAAQ,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO,oEAAoE,QAAQ,CAAC,WAAW,YAAY,CAAC;IAC9G,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAAe,EACf,QAA0B,EAC1B,GAAoB,EACpB,IAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,UAAU,IAAI,aAAa,QAAQ,gBAAgB,GAAG,CAAC,KAAK,QAAQ,IAAI,+CAA+C;QAChI,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,IAAI,kBAAkB,EAAE;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape/linetype finite-style data-aware scale checks.
|
|
3
|
+
* Barrel: validate-data-checks-style.ts. Orchestrator: validate-data-checks.ts.
|
|
4
|
+
*/
|
|
5
|
+
import type { SpecError } from "./errors.js";
|
|
6
|
+
import type { FieldEvidenceEntry, FieldEvidenceMap } from "./validate-data-evidence.js";
|
|
7
|
+
import type { ChannelFieldUse } from "./validate-data-checks-temporal.js";
|
|
8
|
+
/**
|
|
9
|
+
* Shape/linetype: continuous fields need an explicit finite-style scale type.
|
|
10
|
+
* Order: runs before numeric style / position / color so diagnostic order is stable.
|
|
11
|
+
* Uses evidenceForUse when provided so multi-table same-name fields stay independent (#844).
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkFiniteStyleScaleDataCompatibility(input: {
|
|
14
|
+
scales: Record<string, unknown> | undefined;
|
|
15
|
+
fields: FieldEvidenceMap;
|
|
16
|
+
/**
|
|
17
|
+
* Optional per-use evidence lookup. When provided, prefer it over the
|
|
18
|
+
* last-wins `fields` union so multi-table layers with the same field name
|
|
19
|
+
* keep their own type evidence (#609 / #844).
|
|
20
|
+
*/
|
|
21
|
+
evidenceForUse?: (use: ChannelFieldUse) => FieldEvidenceEntry | undefined;
|
|
22
|
+
finiteStyleFields: Record<"shape" | "linetype", ChannelFieldUse[]>;
|
|
23
|
+
}): SpecError[];
|
|
24
|
+
//# sourceMappingURL=validate-data-checks-style-finite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-data-checks-style-finite.d.ts","sourceRoot":"","sources":["../src/validate-data-checks-style-finite.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC1E,iBAAiB,EAAE,MAAM,CAAC,OAAO,GAAG,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;CACpE,GAAG,SAAS,EAAE,CA+Bd"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape/linetype: continuous fields need an explicit finite-style scale type.
|
|
3
|
+
* Order: runs before numeric style / position / color so diagnostic order is stable.
|
|
4
|
+
* Uses evidenceForUse when provided so multi-table same-name fields stay independent (#844).
|
|
5
|
+
*/
|
|
6
|
+
export function checkFiniteStyleScaleDataCompatibility(input) {
|
|
7
|
+
const { scales, fields, finiteStyleFields } = input;
|
|
8
|
+
const errors = [];
|
|
9
|
+
const evidenceOf = (use) => input.evidenceForUse?.(use) ?? fields.get(use.field);
|
|
10
|
+
const typeOf = (use) => evidenceOf(use)?.type ?? null;
|
|
11
|
+
for (const aesthetic of ["shape", "linetype"]) {
|
|
12
|
+
const config = scales?.[aesthetic];
|
|
13
|
+
if (config?.type !== undefined)
|
|
14
|
+
continue;
|
|
15
|
+
for (const use of finiteStyleFields[aesthetic]) {
|
|
16
|
+
const type = typeOf(use);
|
|
17
|
+
if (type !== "quantitative" && type !== "temporal")
|
|
18
|
+
continue;
|
|
19
|
+
// A binned finite style requires numeric values: the runtime rejects
|
|
20
|
+
// temporal (date/datetime) values with `unsupported-aesthetic-scale`
|
|
21
|
+
// ("cannot be mapped to named symbols", scale-style.ts). So only
|
|
22
|
+
// quantitative fields may be directed to "binned"; temporal fields must
|
|
23
|
+
// use "ordinal", which keys arbitrary values (Dates included) to symbols.
|
|
24
|
+
const isTemporal = type === "temporal";
|
|
25
|
+
errors.push({
|
|
26
|
+
code: "scale-type-mismatch",
|
|
27
|
+
path: `/scales/${aesthetic}`,
|
|
28
|
+
message: `Field "${use.field}" is ${type}, but ${aesthetic} has finite symbols and cannot infer continuous interpolation.`,
|
|
29
|
+
fix: {
|
|
30
|
+
description: isTemporal
|
|
31
|
+
? `Set scales.${aesthetic}.type to "ordinal"; temporal (date/datetime) values cannot be binned onto named symbols.`
|
|
32
|
+
: `Set scales.${aesthetic}.type to "binned", or explicitly choose "ordinal" for identifier-like values.`,
|
|
33
|
+
example: { type: isTemporal ? "ordinal" : "binned" },
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return errors;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=validate-data-checks-style-finite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-data-checks-style-finite.js","sourceRoot":"","sources":["../src/validate-data-checks-style-finite.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,UAAU,sCAAsC,CAAC,KAUtD;IACC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IACpD,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,CAAC,GAAoB,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,CAAC,GAAoB,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,IAAI,CAAC;IACvE,KAAK,MAAM,SAAS,IAAI,CAAC,OAAO,EAAE,UAAU,CAAU,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,CAAkC,CAAC;QACpE,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS;YAAE,SAAS;QACzC,KAAK,MAAM,GAAG,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,IAAI,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,UAAU;gBAAE,SAAS;YAC7D,qEAAqE;YACrE,qEAAqE;YACrE,iEAAiE;YACjE,wEAAwE;YACxE,0EAA0E;YAC1E,MAAM,UAAU,GAAG,IAAI,KAAK,UAAU,CAAC;YACvC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,WAAW,SAAS,EAAE;gBAC5B,OAAO,EAAE,UAAU,GAAG,CAAC,KAAK,QAAQ,IAAI,SAAS,SAAS,gEAAgE;gBAC1H,GAAG,EAAE;oBACH,WAAW,EAAE,UAAU;wBACrB,CAAC,CAAC,cAAc,SAAS,0FAA0F;wBACnH,CAAC,CAAC,cAAc,SAAS,+EAA+E;oBAC1G,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;iBACrD;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size/linewidth/alpha sequential/binned data-aware scale checks (incl. temporal).
|
|
3
|
+
* Barrel: validate-data-checks-style.ts. Orchestrator: validate-data-checks.ts.
|
|
4
|
+
*/
|
|
5
|
+
import type { SpecError } from "./errors.js";
|
|
6
|
+
import type { FieldEvidenceEntry, FieldEvidenceMap } from "./validate-data-evidence.js";
|
|
7
|
+
import { type ChannelFieldUse, type TemporalDecisionCache } from "./validate-data-checks-temporal.js";
|
|
8
|
+
/**
|
|
9
|
+
* Size/linewidth/alpha sequential/binned scale vs field/constant types (incl. temporal).
|
|
10
|
+
* Prefers per-use evidenceForUse over the last-wins union so multi-table same-name
|
|
11
|
+
* fields keep independent types (#609 / #844).
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkNumericStyleScaleDataCompatibility(input: {
|
|
14
|
+
scales: Record<string, unknown> | undefined;
|
|
15
|
+
fields: FieldEvidenceMap;
|
|
16
|
+
/**
|
|
17
|
+
* Optional per-use evidence lookup. When provided, prefer it over the
|
|
18
|
+
* last-wins `fields` union so multi-table layers with the same field name
|
|
19
|
+
* keep their own type evidence (#609 / #844).
|
|
20
|
+
*/
|
|
21
|
+
evidenceForUse?: (use: ChannelFieldUse) => FieldEvidenceEntry | undefined;
|
|
22
|
+
numericStyleFields: Record<"size" | "linewidth" | "alpha", ChannelFieldUse[]>;
|
|
23
|
+
numericStyleScaledConstants: Record<"size" | "linewidth" | "alpha", unknown[]>;
|
|
24
|
+
temporalDecisionCache: TemporalDecisionCache;
|
|
25
|
+
}): SpecError[];
|
|
26
|
+
//# sourceMappingURL=validate-data-checks-style-numeric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-data-checks-style-numeric.d.ts","sourceRoot":"","sources":["../src/validate-data-checks-style-numeric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,oCAAoC,CAAC;AA6O5C;;;;GAIG;AACH,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC1E,kBAAkB,EAAE,MAAM,CAAC,MAAM,GAAG,WAAW,GAAG,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;IAC9E,2BAA2B,EAAE,MAAM,CAAC,MAAM,GAAG,WAAW,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,qBAAqB,EAAE,qBAAqB,CAAC;CAC9C,GAAG,SAAS,EAAE,CA+Fd"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { parseTemporalColumn } from "./temporal-column.js";
|
|
2
|
+
import { parseTemporal } from "./temporal-parse.js";
|
|
3
|
+
import { temporalDecisionForField, temporalParserUsable, } from "./validate-data-checks-temporal.js";
|
|
4
|
+
/** True when a scaled constant is what the core `cellToNumber()` coerces to a
|
|
5
|
+
* finite number, mirroring the non-temporal numeric-style path
|
|
6
|
+
* (scale-style-values.ts). Booleans, numeric strings and ISO date strings all
|
|
7
|
+
* train and render at runtime, so validation must accept them too. Core's
|
|
8
|
+
* cellToNumber cannot be imported here (core depends on spec, not vice versa),
|
|
9
|
+
* so the predicate is replicated. */
|
|
10
|
+
function scaledConstantCoercesToFinite(value) {
|
|
11
|
+
if (typeof value === "number")
|
|
12
|
+
return Number.isFinite(value);
|
|
13
|
+
if (value instanceof Date)
|
|
14
|
+
return Number.isFinite(value.getTime());
|
|
15
|
+
if (typeof value === "boolean")
|
|
16
|
+
return true;
|
|
17
|
+
if (typeof value === "string") {
|
|
18
|
+
if (parseTemporal(value, "iso").ok)
|
|
19
|
+
return true;
|
|
20
|
+
return value.trim() !== "" && Number.isFinite(Number(value));
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
/** Format an arbitrary value for a diagnostic message without ever throwing.
|
|
25
|
+
* Tier-2 runs after schema errors, so a schema-invalid JS constant (BigInt,
|
|
26
|
+
* Symbol, circular object) can reach a message; JSON.stringify throws on BigInt
|
|
27
|
+
* and String() throws on Symbol, so fall back through both to the type name. */
|
|
28
|
+
function safeFormatConstant(value) {
|
|
29
|
+
try {
|
|
30
|
+
const json = JSON.stringify(value);
|
|
31
|
+
if (json !== undefined)
|
|
32
|
+
return json;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
/* BigInt / circular — fall through */
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
return String(value);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return typeof value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** A quantitative field carrying temporal options resolves at runtime only when a
|
|
45
|
+
* working parser (or censor recovery) yields temporal values. Returns a mismatch
|
|
46
|
+
* error or null. Extracted to keep the field loop within the max-depth limit. */
|
|
47
|
+
function quantitativeTemporalFieldError(input) {
|
|
48
|
+
const { decision, aesthetic, field, temporalKind, parse, parseFailure, hasEpochParser, hasExplicitDomain, hasBinnedBreaks, channelTrains, } = input;
|
|
49
|
+
const mismatch = {
|
|
50
|
+
code: "scale-type-mismatch",
|
|
51
|
+
path: `/scales/${aesthetic}`,
|
|
52
|
+
message: `scales.${aesthetic} requests temporal values but field "${field}" is quantitative (numbers are not treated as temporal without a successful epoch parse).`,
|
|
53
|
+
fix: {
|
|
54
|
+
description: `Map a temporal field, use a working parse: { epoch: "ms" | "s" }, or remove temporal ${aesthetic} options.`,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const censorRecovers = parseFailure === "censor" && (hasExplicitDomain || hasBinnedBreaks || channelTrains);
|
|
58
|
+
if (decision === null || decision === undefined) {
|
|
59
|
+
return profileQuantitativeTemporalError({
|
|
60
|
+
aesthetic,
|
|
61
|
+
temporalKind,
|
|
62
|
+
hasEpochParser,
|
|
63
|
+
censorRecovers,
|
|
64
|
+
mismatch,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const censoredInvalid = parse !== undefined &&
|
|
68
|
+
parseFailure === "censor" &&
|
|
69
|
+
decision.status === "invalid" &&
|
|
70
|
+
((decision.validatedCount ?? 0) > 0 || hasExplicitDomain || hasBinnedBreaks || channelTrains);
|
|
71
|
+
if (decision.status !== "temporal" && !censoredInvalid)
|
|
72
|
+
return mismatch;
|
|
73
|
+
// temporalKind may be a schema-invalid non-string (e.g. a Symbol) reaching tier-2;
|
|
74
|
+
// only compare/stringify when it is a valid string, else defer to the schema diagnostic.
|
|
75
|
+
if (typeof temporalKind === "string" &&
|
|
76
|
+
decision.kind !== null &&
|
|
77
|
+
decision.kind !== undefined &&
|
|
78
|
+
decision.kind !== temporalKind) {
|
|
79
|
+
return {
|
|
80
|
+
code: "scale-type-mismatch",
|
|
81
|
+
path: `/scales/${aesthetic}`,
|
|
82
|
+
message: `scales.${aesthetic} requests temporal kind "${temporalKind}" but field "${field}" parses as "${decision.kind}".`,
|
|
83
|
+
fix: {
|
|
84
|
+
description: `Use the ${decision.kind ?? "matching"} ${aesthetic} helper or correct the source precision.`,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function profileQuantitativeTemporalError(input) {
|
|
91
|
+
const { aesthetic, temporalKind, hasEpochParser, censorRecovers, mismatch } = input;
|
|
92
|
+
if (hasEpochParser && typeof temporalKind === "string" && temporalKind !== "datetime") {
|
|
93
|
+
return {
|
|
94
|
+
code: "scale-type-mismatch",
|
|
95
|
+
path: `/scales/${aesthetic}`,
|
|
96
|
+
message: `scales.${aesthetic} requests temporal kind "${temporalKind}" but an epoch parser yields "datetime".`,
|
|
97
|
+
fix: {
|
|
98
|
+
description: `Set scales.${aesthetic}.temporalKind to "datetime", or use a parser that yields ${temporalKind} values.`,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return hasEpochParser || censorRecovers ? null : mismatch;
|
|
103
|
+
}
|
|
104
|
+
/** A scaled numeric-style constant is checked against the same resolution path the
|
|
105
|
+
* runtime uses (resolveNumericStyleValueView). Returns a mismatch error, or null when
|
|
106
|
+
* the constant resolves. Extracted so the per-constant branching does not nest under
|
|
107
|
+
* the aesthetic/constant loops (max-depth). */
|
|
108
|
+
function numericStyleConstantError(input) {
|
|
109
|
+
const { value, aesthetic, configType, requestsTemporal, temporalKind, parseUsable, parser, options, censorRecovers, } = input;
|
|
110
|
+
if (!requestsTemporal) {
|
|
111
|
+
// Non-temporal: accept exactly what cellToNumber() coerces to a finite number
|
|
112
|
+
// (numbers, Dates, booleans, numeric strings, ISO strings); reject "large", "", null.
|
|
113
|
+
if (scaledConstantCoercesToFinite(value))
|
|
114
|
+
return null;
|
|
115
|
+
return {
|
|
116
|
+
code: "scale-type-mismatch",
|
|
117
|
+
path: `/scales/${aesthetic}`,
|
|
118
|
+
message: `scales.${aesthetic}.type is "${configType}" but the scaled constant ${safeFormatConstant(value)} is not numeric; ${configType} ${aesthetic} scales need quantitative or temporal values.`,
|
|
119
|
+
fix: {
|
|
120
|
+
description: `Use a numeric scaled constant, or set scales.${aesthetic}.type to "ordinal".`,
|
|
121
|
+
example: { type: "ordinal" },
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// Temporal: a schema-invalid parser defers to the schema error; otherwise the constant
|
|
126
|
+
// must resolve temporal (a Date is datetime), or be covered by censor recovery.
|
|
127
|
+
if (!parseUsable)
|
|
128
|
+
return null;
|
|
129
|
+
let constantKind;
|
|
130
|
+
if (value instanceof Date) {
|
|
131
|
+
constantKind = "datetime";
|
|
132
|
+
}
|
|
133
|
+
else if (typeof value === "string" || typeof value === "number") {
|
|
134
|
+
const decision = parseTemporalColumn([value], parser, options).decision;
|
|
135
|
+
constantKind = decision.status === "temporal" ? (decision.kind ?? null) : undefined;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
// boolean, bigint, symbol, object, null: not a temporal constant, and must not be
|
|
139
|
+
// handed to parseTemporalColumn — its evidence formatting (JSON.stringify) throws on
|
|
140
|
+
// BigInt / unserializable objects. safeFormatConstant handles the message safely.
|
|
141
|
+
constantKind = undefined;
|
|
142
|
+
}
|
|
143
|
+
if (constantKind === undefined) {
|
|
144
|
+
if (censorRecovers)
|
|
145
|
+
return null;
|
|
146
|
+
return {
|
|
147
|
+
code: "scale-type-mismatch",
|
|
148
|
+
path: `/scales/${aesthetic}`,
|
|
149
|
+
message: `scales.${aesthetic} requests temporal values but the scaled constant ${safeFormatConstant(value)} is not temporal; use a temporal constant or a working parse.`,
|
|
150
|
+
fix: {
|
|
151
|
+
description: `Use a temporal scaled constant, add a working parse: { epoch: "ms" | "s" }, or remove temporal ${aesthetic} options.`,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
// The constant parses temporal; enforce the requested kind — the runtime throws
|
|
156
|
+
// style-temporal-kind when a datetime constant is fed to a `date` scale (or vice versa).
|
|
157
|
+
if (typeof temporalKind === "string" && constantKind !== null && constantKind !== temporalKind) {
|
|
158
|
+
return {
|
|
159
|
+
code: "scale-type-mismatch",
|
|
160
|
+
path: `/scales/${aesthetic}`,
|
|
161
|
+
message: `scales.${aesthetic} requests temporal kind "${temporalKind}" but the scaled constant ${safeFormatConstant(value)} parses as "${constantKind}".`,
|
|
162
|
+
fix: {
|
|
163
|
+
description: `Use a ${temporalKind} constant, or set scales.${aesthetic}.temporalKind to "${constantKind}".`,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Size/linewidth/alpha sequential/binned scale vs field/constant types (incl. temporal).
|
|
171
|
+
* Prefers per-use evidenceForUse over the last-wins union so multi-table same-name
|
|
172
|
+
* fields keep independent types (#609 / #844).
|
|
173
|
+
*/
|
|
174
|
+
export function checkNumericStyleScaleDataCompatibility(input) {
|
|
175
|
+
const { scales, fields, numericStyleFields, numericStyleScaledConstants, temporalDecisionCache } = input;
|
|
176
|
+
const errors = [];
|
|
177
|
+
const evidenceOf = (use) => input.evidenceForUse?.(use) ?? fields.get(use.field);
|
|
178
|
+
const typeOf = (use) => evidenceOf(use)?.type ?? null;
|
|
179
|
+
// color check: a continuous ramp needs quantitative or temporal values, so a
|
|
180
|
+
// nominal/ordinal field trains no finite domain and the runtime throws
|
|
181
|
+
// `style-domain-empty` (scale-style.ts). Reject it at validation time with the
|
|
182
|
+
// same "use ordinal" guidance color scales give. Fields without an explicit
|
|
183
|
+
// sequential/binned type default to an ordinal numeric style and are fine.
|
|
184
|
+
for (const aesthetic of ["size", "linewidth", "alpha"]) {
|
|
185
|
+
const config = scales?.[aesthetic];
|
|
186
|
+
if (config?.type !== "sequential" && config?.type !== "binned")
|
|
187
|
+
continue;
|
|
188
|
+
const facts = numericStyleFacts(config);
|
|
189
|
+
// Pass 1: channel-wide training sources (sibling fields + scaled constants).
|
|
190
|
+
// Runtime trains sequential/binned style scales from the full channel value
|
|
191
|
+
// list, so an all-invalid field/constant is censored when any sibling trains.
|
|
192
|
+
const channelTrains = numericStyleChannelTrains({
|
|
193
|
+
uses: numericStyleFields[aesthetic],
|
|
194
|
+
constants: numericStyleScaledConstants[aesthetic],
|
|
195
|
+
evidenceOf,
|
|
196
|
+
typeOf,
|
|
197
|
+
cache: temporalDecisionCache,
|
|
198
|
+
facts,
|
|
199
|
+
});
|
|
200
|
+
// Pass 2: field diagnostics (use channel-wide censor recovery).
|
|
201
|
+
for (const use of numericStyleFields[aesthetic]) {
|
|
202
|
+
const type = typeOf(use);
|
|
203
|
+
// A quantitative field carrying temporal options fails at resolve time
|
|
204
|
+
// unless a working parser (or censor recovery) yields temporal values —
|
|
205
|
+
// mirror the color checker rather than deferring unconditionally.
|
|
206
|
+
if (type === "quantitative" && facts.requestsTemporal) {
|
|
207
|
+
// Defer to the schema diagnostic when the parser/options are schema-invalid.
|
|
208
|
+
if (!facts.temporalInputsUsable)
|
|
209
|
+
continue;
|
|
210
|
+
const decision = temporalDecisionForField(temporalDecisionCache, use.field, evidenceOf(use), facts.parser, facts.temporalOptions);
|
|
211
|
+
const error = quantitativeTemporalFieldError({
|
|
212
|
+
decision,
|
|
213
|
+
aesthetic,
|
|
214
|
+
field: use.field,
|
|
215
|
+
temporalKind: config.temporalKind,
|
|
216
|
+
parse: config.parse,
|
|
217
|
+
parseFailure: config.parseFailure,
|
|
218
|
+
hasEpochParser: facts.hasEpochParser,
|
|
219
|
+
hasExplicitDomain: facts.hasExplicitDomain,
|
|
220
|
+
hasBinnedBreaks: facts.hasBinnedBreaks,
|
|
221
|
+
channelTrains,
|
|
222
|
+
});
|
|
223
|
+
if (error !== null)
|
|
224
|
+
errors.push(error);
|
|
225
|
+
}
|
|
226
|
+
// A nominal/ordinal field trains no finite domain and the runtime throws
|
|
227
|
+
// `style-domain-empty`; reject it with the same "use ordinal" guidance color
|
|
228
|
+
// scales give. A nominal field carrying temporal options may still resolve
|
|
229
|
+
// to temporal at runtime, so defer (mirror the color checker).
|
|
230
|
+
if (type !== "nominal" && type !== "ordinal")
|
|
231
|
+
continue;
|
|
232
|
+
if (facts.requestsTemporal)
|
|
233
|
+
continue;
|
|
234
|
+
errors.push({
|
|
235
|
+
code: "scale-type-mismatch",
|
|
236
|
+
path: `/scales/${aesthetic}`,
|
|
237
|
+
message: `scales.${aesthetic}.type is "${config.type}" but field "${use.field}" is ${type}; ${config.type} ${aesthetic} scales need quantitative or temporal values.`,
|
|
238
|
+
fix: {
|
|
239
|
+
description: `Set scales.${aesthetic}.type to "ordinal", or map a quantitative field.`,
|
|
240
|
+
example: { type: "ordinal" },
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
// Scaled constants train the same numeric scale, so a constant the scale can't
|
|
245
|
+
// resolve throws at runtime (style-domain-empty / style-temporal-parse). Reject
|
|
246
|
+
// it here too, mirroring the field checks above for both resolution paths.
|
|
247
|
+
const censorRecovers = config.parseFailure === "censor" &&
|
|
248
|
+
(facts.hasExplicitDomain || facts.hasBinnedBreaks || channelTrains);
|
|
249
|
+
for (const value of numericStyleScaledConstants[aesthetic]) {
|
|
250
|
+
const error = numericStyleConstantError({
|
|
251
|
+
value,
|
|
252
|
+
aesthetic,
|
|
253
|
+
configType: config.type,
|
|
254
|
+
requestsTemporal: facts.requestsTemporal,
|
|
255
|
+
temporalKind: config.temporalKind,
|
|
256
|
+
parseUsable: facts.temporalInputsUsable,
|
|
257
|
+
parser: facts.parser,
|
|
258
|
+
options: facts.temporalOptions,
|
|
259
|
+
censorRecovers,
|
|
260
|
+
});
|
|
261
|
+
if (error !== null)
|
|
262
|
+
errors.push(error);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return errors;
|
|
266
|
+
}
|
|
267
|
+
function numericStyleFacts(config) {
|
|
268
|
+
const requestsTemporal = [
|
|
269
|
+
config.temporalKind,
|
|
270
|
+
config.parse,
|
|
271
|
+
config.timezone,
|
|
272
|
+
config.disambiguation,
|
|
273
|
+
].some((value) => value !== undefined);
|
|
274
|
+
const temporalInputsUsable = temporalParserUsable(config.parse) &&
|
|
275
|
+
(config.timezone === undefined || typeof config.timezone === "string") &&
|
|
276
|
+
(config.disambiguation === undefined || typeof config.disambiguation === "string");
|
|
277
|
+
const parser = (config.parse ?? "auto");
|
|
278
|
+
const temporalOptions = {
|
|
279
|
+
...(config.timezone !== undefined && { timezone: config.timezone }),
|
|
280
|
+
...(config.disambiguation !== undefined && { disambiguation: config.disambiguation }),
|
|
281
|
+
};
|
|
282
|
+
const parseableBound = (value) => temporalInputsUsable &&
|
|
283
|
+
config.parse !== undefined &&
|
|
284
|
+
parseTemporal(value, config.parse, temporalOptions).ok;
|
|
285
|
+
const domainValues = Array.isArray(config.domain) ? config.domain.filter(nonNull) : [];
|
|
286
|
+
const binnedBreaks = config.type === "binned" && Array.isArray(config.breaks) ? config.breaks.filter(nonNull) : [];
|
|
287
|
+
return {
|
|
288
|
+
requestsTemporal,
|
|
289
|
+
temporalInputsUsable,
|
|
290
|
+
parser,
|
|
291
|
+
temporalOptions,
|
|
292
|
+
hasEpochParser: typeof config.parse === "object" && config.parse !== null && "epoch" in config.parse,
|
|
293
|
+
hasExplicitDomain: domainValues.length === 2 && domainValues.every((value) => parseableBound(value)),
|
|
294
|
+
hasBinnedBreaks: binnedBreaks.length >= 2 && binnedBreaks.every((value) => parseableBound(value)),
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function nonNull(value) {
|
|
298
|
+
return value !== null;
|
|
299
|
+
}
|
|
300
|
+
function numericStyleChannelTrains(input) {
|
|
301
|
+
const { uses, constants, evidenceOf, typeOf, cache, facts } = input;
|
|
302
|
+
if (uses.some((use) => fieldTrainsNumericStyle(use, evidenceOf, typeOf, cache, facts)))
|
|
303
|
+
return true;
|
|
304
|
+
if (!facts.requestsTemporal || !facts.temporalInputsUsable)
|
|
305
|
+
return false;
|
|
306
|
+
return constants.some((value) => constantTrainsNumericStyle(value, facts));
|
|
307
|
+
}
|
|
308
|
+
function fieldTrainsNumericStyle(use, evidenceOf, typeOf, cache, facts) {
|
|
309
|
+
const type = typeOf(use);
|
|
310
|
+
if (type === "temporal")
|
|
311
|
+
return true;
|
|
312
|
+
if (type !== "quantitative" || !facts.requestsTemporal || !facts.temporalInputsUsable)
|
|
313
|
+
return false;
|
|
314
|
+
const decision = temporalDecisionForField(cache, use.field, evidenceOf(use), facts.parser, facts.temporalOptions);
|
|
315
|
+
return (decision !== null &&
|
|
316
|
+
decision !== undefined &&
|
|
317
|
+
(decision.status === "temporal" || (decision.validatedCount ?? 0) > 0));
|
|
318
|
+
}
|
|
319
|
+
function constantTrainsNumericStyle(value, facts) {
|
|
320
|
+
if (value instanceof Date)
|
|
321
|
+
return true;
|
|
322
|
+
if (typeof value !== "string" && typeof value !== "number")
|
|
323
|
+
return false;
|
|
324
|
+
const decision = parseTemporalColumn([value], facts.parser, facts.temporalOptions).decision;
|
|
325
|
+
return decision.status === "temporal" || (decision.validatedCount ?? 0) > 0;
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=validate-data-checks-style-numeric.js.map
|