@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,432 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `$defs` partial — scale base schemas (DomainValue…ColorScaleSpec).
|
|
3
|
+
* Composed by schema-declarations.ts via spread; key insertion order is load-bearing.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Type from "typebox";
|
|
7
|
+
import { COLOR_SCHEME_NAME_SCHEMAS } from "./schema-name-schemas.js";
|
|
8
|
+
import { MAX_BINNED_BREAKS } from "./schema-names.js";
|
|
9
|
+
import {
|
|
10
|
+
TemporalIntervalSpecSchema,
|
|
11
|
+
TemporalLabelSpecSchema,
|
|
12
|
+
TemporalWeekStartSchema,
|
|
13
|
+
} from "./temporal-interval-schema.js";
|
|
14
|
+
import { TemporalParserSpecSchema } from "./temporal-parse-schema.js";
|
|
15
|
+
|
|
16
|
+
const forbiddenColorOption = () => Type.Optional(Type.Never());
|
|
17
|
+
|
|
18
|
+
export const ScaleDecls = {
|
|
19
|
+
DomainValue: Type.Union([Type.String(), Type.Number(), Type.Boolean(), Type.Null()], {
|
|
20
|
+
description:
|
|
21
|
+
"One domain entry: a number (linear/log), an ISO 8601 date string (time), or a category value (band/ordinal).",
|
|
22
|
+
}),
|
|
23
|
+
|
|
24
|
+
TemporalParserSpec: TemporalParserSpecSchema,
|
|
25
|
+
|
|
26
|
+
ScaleExpansion: Type.Object(
|
|
27
|
+
{
|
|
28
|
+
mult: Type.Optional(
|
|
29
|
+
Type.Union(
|
|
30
|
+
[
|
|
31
|
+
Type.Number({ minimum: 0 }),
|
|
32
|
+
Type.Array(Type.Number({ minimum: 0 }), { minItems: 2, maxItems: 2 }),
|
|
33
|
+
],
|
|
34
|
+
{
|
|
35
|
+
description:
|
|
36
|
+
"Multiplicative display padding as a fraction of the (transformed) domain span. A scalar pads both ends; a [lower, upper] tuple pads each end. Non-negative and finite.",
|
|
37
|
+
},
|
|
38
|
+
),
|
|
39
|
+
),
|
|
40
|
+
add: Type.Optional(
|
|
41
|
+
Type.Union(
|
|
42
|
+
[
|
|
43
|
+
Type.Number({ minimum: 0 }),
|
|
44
|
+
Type.Array(Type.Number({ minimum: 0 }), { minItems: 2, maxItems: 2 }),
|
|
45
|
+
],
|
|
46
|
+
{
|
|
47
|
+
description:
|
|
48
|
+
"Additive display padding in (transformed) scale units. A scalar pads both ends; a [lower, upper] tuple pads each end. Non-negative and finite.",
|
|
49
|
+
},
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
description:
|
|
56
|
+
"Display-domain expansion. Padding is applied after nice in transformed space and never widens the OOB limits. `{ mult: 0, add: 0 }` disables padding.",
|
|
57
|
+
},
|
|
58
|
+
),
|
|
59
|
+
|
|
60
|
+
PositionScaleSpec: Type.Intersect([
|
|
61
|
+
Type.Object(
|
|
62
|
+
{
|
|
63
|
+
type: Type.Optional(
|
|
64
|
+
Type.Union(
|
|
65
|
+
[
|
|
66
|
+
Type.Literal("linear"),
|
|
67
|
+
Type.Literal("log"),
|
|
68
|
+
Type.Literal("time"),
|
|
69
|
+
Type.Literal("band"),
|
|
70
|
+
Type.Literal("binned"),
|
|
71
|
+
],
|
|
72
|
+
{
|
|
73
|
+
description:
|
|
74
|
+
'Scale type: "linear" (default for numbers), "time" (temporal fields; ISO strings or Date values), "band" (discrete categories), "binned" (quantitative values assigned to ordered bins). "log" is an accepted authored alias that canonicalizes to { type: "linear", transform: "log10" }. Omit to infer from the field type.',
|
|
75
|
+
},
|
|
76
|
+
),
|
|
77
|
+
),
|
|
78
|
+
transform: Type.Optional(
|
|
79
|
+
Type.Union([Type.Literal("identity"), Type.Literal("log10"), Type.Literal("sqrt")], {
|
|
80
|
+
description:
|
|
81
|
+
'Pre-stat position transform applied after parsing and before grouping-sensitive stats/positions. "identity" (default), "log10" (base-10; source values must be > 0), "sqrt" (source values must be >= 0). Only "identity" is permitted on time scales.',
|
|
82
|
+
}),
|
|
83
|
+
),
|
|
84
|
+
temporalKind: Type.Optional(
|
|
85
|
+
Type.Union(
|
|
86
|
+
[
|
|
87
|
+
Type.Literal("date"),
|
|
88
|
+
Type.Literal("datetime"),
|
|
89
|
+
Type.Literal("time"),
|
|
90
|
+
Type.Literal("monthDay"),
|
|
91
|
+
],
|
|
92
|
+
{
|
|
93
|
+
description:
|
|
94
|
+
'Temporal precision intent. "date" uses calendar dates; "datetime" uses instants; "time" is time-of-day (portable numbers are seconds since midnight); "monthDay" collapses the year, so the same calendar day from any year shares one position — values parse with the "md" parser and resolve into a fixed leap reference year, and year, clock, weekday and zone label tokens are rejected. A month-day window cannot cross the year boundary. Supplying this option requests a time scale.',
|
|
95
|
+
},
|
|
96
|
+
),
|
|
97
|
+
),
|
|
98
|
+
parse: Type.Optional(
|
|
99
|
+
Type.Ref("TemporalParserSpec", {
|
|
100
|
+
description:
|
|
101
|
+
"Explicit deterministic parser for temporal source values. Omit for value-driven inference.",
|
|
102
|
+
}),
|
|
103
|
+
),
|
|
104
|
+
parseFailure: Type.Optional(
|
|
105
|
+
Type.Union([Type.Literal("error"), Type.Literal("censor")], {
|
|
106
|
+
description:
|
|
107
|
+
'Explicit parser failure policy: "error" (default) stops with bounded evidence; "censor" converts invalid values to missing and emits a warning.',
|
|
108
|
+
}),
|
|
109
|
+
),
|
|
110
|
+
timezone: Type.Optional(
|
|
111
|
+
Type.String({
|
|
112
|
+
minLength: 1,
|
|
113
|
+
maxLength: 128,
|
|
114
|
+
description:
|
|
115
|
+
'IANA timezone used for timezone-less temporal input. Default "UTC". Invalid zones fail with an actionable diagnostic.',
|
|
116
|
+
}),
|
|
117
|
+
),
|
|
118
|
+
disambiguation: Type.Optional(
|
|
119
|
+
Type.Union(
|
|
120
|
+
[
|
|
121
|
+
Type.Literal("compatible"),
|
|
122
|
+
Type.Literal("earlier"),
|
|
123
|
+
Type.Literal("later"),
|
|
124
|
+
Type.Literal("reject"),
|
|
125
|
+
],
|
|
126
|
+
{
|
|
127
|
+
description:
|
|
128
|
+
'DST gap/fold policy for IANA local times. Default "reject"; choose "earlier", "later", or Temporal-compatible behavior explicitly.',
|
|
129
|
+
},
|
|
130
|
+
),
|
|
131
|
+
),
|
|
132
|
+
dateBreaks: Type.Optional(TemporalIntervalSpecSchema),
|
|
133
|
+
dateMinorBreaks: Type.Optional(TemporalIntervalSpecSchema),
|
|
134
|
+
dateLabels: Type.Optional(TemporalLabelSpecSchema),
|
|
135
|
+
locale: Type.Optional(
|
|
136
|
+
Type.String({
|
|
137
|
+
minLength: 1,
|
|
138
|
+
maxLength: 128,
|
|
139
|
+
description:
|
|
140
|
+
'BCP 47 locale for temporal labels. Default "en-US". JSON Schema bounds the portable string shape; runtime validation canonicalizes the tag and verifies Intl support before rendering.',
|
|
141
|
+
}),
|
|
142
|
+
),
|
|
143
|
+
weekStart: Type.Optional(TemporalWeekStartSchema),
|
|
144
|
+
domain: Type.Optional(
|
|
145
|
+
Type.Array(Type.Ref("DomainValue"), {
|
|
146
|
+
minItems: 1,
|
|
147
|
+
description:
|
|
148
|
+
"Explicit domain, PINNING the scale: [min, max] for continuous scales (numbers, or temporal strings for time); the full category list for band scales. Data outside the domain is dropped with a warning.",
|
|
149
|
+
}),
|
|
150
|
+
),
|
|
151
|
+
nice: Type.Optional(
|
|
152
|
+
Type.Boolean({
|
|
153
|
+
description:
|
|
154
|
+
"Round the inferred domain to tick-friendly bounds. Default true. Ignored when `domain` is set.",
|
|
155
|
+
}),
|
|
156
|
+
),
|
|
157
|
+
zero: Type.Optional(
|
|
158
|
+
Type.Boolean({
|
|
159
|
+
description:
|
|
160
|
+
"Force the domain to include zero. Bars, columns, and areas force this to true on the measure axis; set false explicitly to override. Ignored when `domain` is set.",
|
|
161
|
+
}),
|
|
162
|
+
),
|
|
163
|
+
reverse: Type.Optional(
|
|
164
|
+
Type.Boolean({ description: "Reverse the scale's output direction. Default false." }),
|
|
165
|
+
),
|
|
166
|
+
breaks: Type.Optional(
|
|
167
|
+
Type.Array(Type.Union([Type.Number(), Type.String()]), {
|
|
168
|
+
minItems: 1,
|
|
169
|
+
description:
|
|
170
|
+
"Explicit tick positions in data units (numbers, or ISO date strings for time scales); for binned scales these are the bin boundaries. Omit for automatic ticks. Binned scales allow at most 65 boundaries (64 bins); non-binned explicit ticks are not capped.",
|
|
171
|
+
}),
|
|
172
|
+
),
|
|
173
|
+
labels: Type.Optional(
|
|
174
|
+
Type.String({
|
|
175
|
+
description:
|
|
176
|
+
'Tick label format string. Time scales: strftime-style ("%Y-%m", "%b %d", "%H:%M"). Numeric scales: ",d" (grouped integer), ".1f" (fixed decimals), ".0%" (percent), "~s" (SI prefix). Omit for automatic formatting.',
|
|
177
|
+
}),
|
|
178
|
+
),
|
|
179
|
+
expand: Type.Optional(
|
|
180
|
+
Type.Ref("ScaleExpansion", {
|
|
181
|
+
description:
|
|
182
|
+
"Display-domain padding. Non-temporal continuous/binned axes default to { mult: 0.05, add: 0 }; time axes default to zero. Pinned domains still receive display expansion.",
|
|
183
|
+
}),
|
|
184
|
+
),
|
|
185
|
+
oob: Type.Optional(
|
|
186
|
+
Type.Union([Type.Literal("censor"), Type.Literal("squish")], {
|
|
187
|
+
description:
|
|
188
|
+
'Out-of-bounds policy for values outside explicit source limits, applied before stats. "censor" (default) drops them to missing; "squish" clamps them to the nearest source limit before transform.',
|
|
189
|
+
}),
|
|
190
|
+
),
|
|
191
|
+
naValue: Type.Optional(
|
|
192
|
+
Type.Union([Type.Number(), Type.Null()], {
|
|
193
|
+
description:
|
|
194
|
+
"Replacement for missing/censored positional values, resolved after OOB and before transform. A finite number substitutes; null (default) keeps them missing. The replacement is itself checked against the transform/domain rules.",
|
|
195
|
+
}),
|
|
196
|
+
),
|
|
197
|
+
minorBreaks: Type.Optional(
|
|
198
|
+
Type.Array(Type.Number(), {
|
|
199
|
+
minItems: 1,
|
|
200
|
+
description:
|
|
201
|
+
"Explicit minor gridline positions in semantic source units. Coincident major/minor values render only the major tick. Time scales use dateMinorBreaks instead.",
|
|
202
|
+
}),
|
|
203
|
+
),
|
|
204
|
+
guide: Type.Optional(Type.Union([Type.Ref("GuideSpec"), Type.Ref("BandAxisGuideSpec")])),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
additionalProperties: false,
|
|
208
|
+
description: "Configuration for a positional (x or y) scale.",
|
|
209
|
+
},
|
|
210
|
+
),
|
|
211
|
+
Type.Union([
|
|
212
|
+
Type.Object({
|
|
213
|
+
type: Type.Literal("binned"),
|
|
214
|
+
breaks: Type.Optional(
|
|
215
|
+
Type.Array(Type.Union([Type.Number(), Type.String()]), {
|
|
216
|
+
maxItems: MAX_BINNED_BREAKS + 1,
|
|
217
|
+
}),
|
|
218
|
+
),
|
|
219
|
+
}),
|
|
220
|
+
Type.Object({
|
|
221
|
+
type: Type.Optional(
|
|
222
|
+
Type.Union([
|
|
223
|
+
Type.Literal("linear"),
|
|
224
|
+
Type.Literal("log"),
|
|
225
|
+
Type.Literal("time"),
|
|
226
|
+
Type.Literal("band"),
|
|
227
|
+
]),
|
|
228
|
+
),
|
|
229
|
+
}),
|
|
230
|
+
]),
|
|
231
|
+
]),
|
|
232
|
+
|
|
233
|
+
ColorScaleSpec: Type.Intersect([
|
|
234
|
+
Type.Object(
|
|
235
|
+
{
|
|
236
|
+
type: Type.Optional(
|
|
237
|
+
Type.Union(
|
|
238
|
+
[
|
|
239
|
+
Type.Literal("ordinal"),
|
|
240
|
+
Type.Literal("sequential"),
|
|
241
|
+
Type.Literal("binned"),
|
|
242
|
+
Type.Literal("manual"),
|
|
243
|
+
Type.Literal("identity"),
|
|
244
|
+
],
|
|
245
|
+
{
|
|
246
|
+
description:
|
|
247
|
+
'Color scale family: "ordinal" for categories, "sequential" for a continuous ramp, "binned" for color steps, "manual" for an explicit domain/range mapping, or "identity" for validated source colors.',
|
|
248
|
+
},
|
|
249
|
+
),
|
|
250
|
+
),
|
|
251
|
+
transform: Type.Optional(
|
|
252
|
+
Type.Union([Type.Literal("identity"), Type.Literal("log10"), Type.Literal("sqrt")], {
|
|
253
|
+
description:
|
|
254
|
+
"Pre-training quantitative transform for sequential/binned color values. log10/sqrt require non-temporal values; ordinal, manual, and identity families do not accept a transform.",
|
|
255
|
+
}),
|
|
256
|
+
),
|
|
257
|
+
temporalKind: Type.Optional(
|
|
258
|
+
Type.Union([Type.Literal("date"), Type.Literal("datetime")], {
|
|
259
|
+
description:
|
|
260
|
+
'Temporal precision intent for sequential/binned colors. "date" uses calendar labels; "datetime" uses instant labels.',
|
|
261
|
+
}),
|
|
262
|
+
),
|
|
263
|
+
parse: Type.Optional(
|
|
264
|
+
Type.Ref("TemporalParserSpec", {
|
|
265
|
+
description:
|
|
266
|
+
"Explicit deterministic parser for temporal color/fill source values. Omit for value-driven inference.",
|
|
267
|
+
}),
|
|
268
|
+
),
|
|
269
|
+
parseFailure: Type.Optional(
|
|
270
|
+
Type.Union([Type.Literal("error"), Type.Literal("censor")], {
|
|
271
|
+
description:
|
|
272
|
+
'Explicit temporal parser failure policy: "error" (default) or "censor" with a bounded warning.',
|
|
273
|
+
}),
|
|
274
|
+
),
|
|
275
|
+
timezone: Type.Optional(
|
|
276
|
+
Type.String({
|
|
277
|
+
minLength: 1,
|
|
278
|
+
maxLength: 128,
|
|
279
|
+
description: 'IANA timezone for temporal color/fill input. Default "UTC".',
|
|
280
|
+
}),
|
|
281
|
+
),
|
|
282
|
+
disambiguation: Type.Optional(
|
|
283
|
+
Type.Union([
|
|
284
|
+
Type.Literal("compatible"),
|
|
285
|
+
Type.Literal("earlier"),
|
|
286
|
+
Type.Literal("later"),
|
|
287
|
+
Type.Literal("reject"),
|
|
288
|
+
]),
|
|
289
|
+
),
|
|
290
|
+
domain: Type.Optional(
|
|
291
|
+
Type.Array(Type.Ref("DomainValue"), {
|
|
292
|
+
minItems: 1,
|
|
293
|
+
description:
|
|
294
|
+
"Explicit semantic domain. Manual/ordinal scales use ordered values; sequential/binned scales use [min, max].",
|
|
295
|
+
}),
|
|
296
|
+
),
|
|
297
|
+
domainMode: Type.Optional(
|
|
298
|
+
Type.Union([Type.Literal("grow"), Type.Literal("data")], {
|
|
299
|
+
description:
|
|
300
|
+
'Ordinal domain stability: "grow" (default) preserves assignments across filters; "data" rebuilds from current data.',
|
|
301
|
+
}),
|
|
302
|
+
),
|
|
303
|
+
breaks: Type.Optional(
|
|
304
|
+
Type.Array(Type.Union([Type.Number(), Type.String()]), {
|
|
305
|
+
minItems: 2,
|
|
306
|
+
description:
|
|
307
|
+
"Explicit semantic reference ticks for sequential colorbars or ordered boundaries for binned colorsteps.",
|
|
308
|
+
}),
|
|
309
|
+
),
|
|
310
|
+
range: Type.Optional(
|
|
311
|
+
Type.Array(Type.String({ pattern: "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" }), {
|
|
312
|
+
minItems: 1,
|
|
313
|
+
description:
|
|
314
|
+
"Explicit #rgb/#rrggbb colors. Manual pairs them with domain values; sequential/binned interpolate or sample them.",
|
|
315
|
+
}),
|
|
316
|
+
),
|
|
317
|
+
scheme: Type.Optional(
|
|
318
|
+
Type.Union(COLOR_SCHEME_NAME_SCHEMAS, {
|
|
319
|
+
description:
|
|
320
|
+
'Named color scheme: categorical "observable10" (default), "ipsum", "flexoki", "colorblind", "hue", and ColorBrewer qualitative (Dark2); or sequential family "viridis" (default), "magma", "plasma", "inferno", "cividis", "turbo", plus ColorBrewer sequential/diverging (Blues, RdYlBu, …). Sequential-family names may also be used with ordinal scales (discrete sampling). When type is omitted, the named scheme selects its ordinal or sequential scale family.',
|
|
321
|
+
}),
|
|
322
|
+
),
|
|
323
|
+
reverse: Type.Optional(
|
|
324
|
+
Type.Boolean({ description: "Reverse the output color range. Default false." }),
|
|
325
|
+
),
|
|
326
|
+
oob: Type.Optional(
|
|
327
|
+
Type.Union([Type.Literal("censor"), Type.Literal("squish"), Type.Literal("wrap")], {
|
|
328
|
+
description:
|
|
329
|
+
'Out-of-bounds policy for an explicit continuous domain: "censor" (default), "squish", or "wrap" (periodic; required for cyclic *O schemes). Not valid on binned color scales.',
|
|
330
|
+
}),
|
|
331
|
+
),
|
|
332
|
+
naValue: Type.Optional(
|
|
333
|
+
Type.String({
|
|
334
|
+
pattern: "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
335
|
+
description: "Color for null/missing values. Default9.",
|
|
336
|
+
}),
|
|
337
|
+
),
|
|
338
|
+
unknownValue: Type.Optional(
|
|
339
|
+
Type.String({
|
|
340
|
+
pattern: "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
341
|
+
description: "Color for invalid, out-of-domain, or unmapped values. Default9.",
|
|
342
|
+
}),
|
|
343
|
+
),
|
|
344
|
+
onExhaust: Type.Optional(
|
|
345
|
+
Type.Union([Type.Literal("cycle"), Type.Literal("error")], {
|
|
346
|
+
description:
|
|
347
|
+
'Ordinal palette exhaustion policy: "cycle" (default) with a warning, or "error".',
|
|
348
|
+
}),
|
|
349
|
+
),
|
|
350
|
+
labels: Type.Optional(
|
|
351
|
+
Type.String({
|
|
352
|
+
description:
|
|
353
|
+
'Guide label format: numeric (".1f", ",d", ".0%") or temporal strftime-style text.',
|
|
354
|
+
}),
|
|
355
|
+
),
|
|
356
|
+
guide: Type.Optional(Type.Ref("GuideSpec")),
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
additionalProperties: false,
|
|
360
|
+
description: "Configuration for a color or fill scale.",
|
|
361
|
+
},
|
|
362
|
+
),
|
|
363
|
+
Type.Union([
|
|
364
|
+
Type.Object({
|
|
365
|
+
type: Type.Literal("binned"),
|
|
366
|
+
breaks: Type.Optional(
|
|
367
|
+
Type.Array(Type.Union([Type.Number(), Type.String()]), {
|
|
368
|
+
minItems: 2,
|
|
369
|
+
maxItems: MAX_BINNED_BREAKS + 1,
|
|
370
|
+
}),
|
|
371
|
+
),
|
|
372
|
+
domainMode: forbiddenColorOption(),
|
|
373
|
+
onExhaust: forbiddenColorOption(),
|
|
374
|
+
}),
|
|
375
|
+
Type.Object({
|
|
376
|
+
type: Type.Literal("manual"),
|
|
377
|
+
range: Type.Array(Type.String({ pattern: "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" }), {
|
|
378
|
+
minItems: 1,
|
|
379
|
+
}),
|
|
380
|
+
transform: forbiddenColorOption(),
|
|
381
|
+
temporalKind: forbiddenColorOption(),
|
|
382
|
+
parse: forbiddenColorOption(),
|
|
383
|
+
parseFailure: forbiddenColorOption(),
|
|
384
|
+
timezone: forbiddenColorOption(),
|
|
385
|
+
disambiguation: forbiddenColorOption(),
|
|
386
|
+
domainMode: forbiddenColorOption(),
|
|
387
|
+
breaks: forbiddenColorOption(),
|
|
388
|
+
scheme: forbiddenColorOption(),
|
|
389
|
+
reverse: forbiddenColorOption(),
|
|
390
|
+
oob: forbiddenColorOption(),
|
|
391
|
+
onExhaust: forbiddenColorOption(),
|
|
392
|
+
labels: forbiddenColorOption(),
|
|
393
|
+
}),
|
|
394
|
+
Type.Object({
|
|
395
|
+
type: Type.Literal("identity"),
|
|
396
|
+
transform: forbiddenColorOption(),
|
|
397
|
+
temporalKind: forbiddenColorOption(),
|
|
398
|
+
parse: forbiddenColorOption(),
|
|
399
|
+
parseFailure: forbiddenColorOption(),
|
|
400
|
+
timezone: forbiddenColorOption(),
|
|
401
|
+
disambiguation: forbiddenColorOption(),
|
|
402
|
+
domain: forbiddenColorOption(),
|
|
403
|
+
domainMode: forbiddenColorOption(),
|
|
404
|
+
breaks: forbiddenColorOption(),
|
|
405
|
+
range: forbiddenColorOption(),
|
|
406
|
+
scheme: forbiddenColorOption(),
|
|
407
|
+
reverse: forbiddenColorOption(),
|
|
408
|
+
oob: forbiddenColorOption(),
|
|
409
|
+
onExhaust: forbiddenColorOption(),
|
|
410
|
+
labels: forbiddenColorOption(),
|
|
411
|
+
}),
|
|
412
|
+
Type.Object({
|
|
413
|
+
type: Type.Literal("ordinal"),
|
|
414
|
+
transform: forbiddenColorOption(),
|
|
415
|
+
temporalKind: forbiddenColorOption(),
|
|
416
|
+
parse: forbiddenColorOption(),
|
|
417
|
+
parseFailure: forbiddenColorOption(),
|
|
418
|
+
timezone: forbiddenColorOption(),
|
|
419
|
+
disambiguation: forbiddenColorOption(),
|
|
420
|
+
breaks: forbiddenColorOption(),
|
|
421
|
+
oob: forbiddenColorOption(),
|
|
422
|
+
labels: forbiddenColorOption(),
|
|
423
|
+
}),
|
|
424
|
+
Type.Object({
|
|
425
|
+
type: Type.Literal("sequential"),
|
|
426
|
+
domainMode: forbiddenColorOption(),
|
|
427
|
+
onExhaust: forbiddenColorOption(),
|
|
428
|
+
}),
|
|
429
|
+
Type.Object({ type: forbiddenColorOption() }),
|
|
430
|
+
]),
|
|
431
|
+
]),
|
|
432
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named-defs module surface (public).
|
|
3
|
+
* `.Import(key)` returns a Cyclic schema rooted at `key` (`$defs` + `$ref`),
|
|
4
|
+
* matching the TypeBox 0.x Module.Import JSON shape used by the artifact
|
|
5
|
+
* emitter and by Value.Check / Value.Errors.
|
|
6
|
+
*
|
|
7
|
+
* Type inference uses `Static<>` on `SpecDeclarations` (not Cyclic Import):
|
|
8
|
+
* Cyclic's Static<> collapses large graphs to `never` under TypeScript 6.
|
|
9
|
+
* We avoid `Type.Module(SpecDeclarations)` for Static extraction — the Module
|
|
10
|
+
* surface hits TS7056 on composite .d.ts emit once geom unions grow large.
|
|
11
|
+
*
|
|
12
|
+
* Build the `$defs` graph once (rooted at PlotSpec) and re-root by swapping
|
|
13
|
+
* `$ref` — Type.Cyclic(decls, key) per import would rebuild the full graph
|
|
14
|
+
* ~20× at module load. The re-root trick is load-bearing as a unit: the root
|
|
15
|
+
* graph, the re-root helper, `SpecModule`, and every `SpecModule.Import`
|
|
16
|
+
* constant share one `$defs` bag and stay together here (`schema-types.ts`
|
|
17
|
+
* is type-level only).
|
|
18
|
+
*/
|
|
19
|
+
import Type, { type TSchema } from "typebox";
|
|
20
|
+
|
|
21
|
+
import { SpecDeclarations } from "./schema-declarations.js";
|
|
22
|
+
|
|
23
|
+
const SpecDefsRoot = Type.Cyclic(SpecDeclarations, "PlotSpec");
|
|
24
|
+
|
|
25
|
+
/** Cyclic schema: shared `$defs` bag + root `$ref` (TypeBox 0.x Import shape). */
|
|
26
|
+
export type SpecImportSchema = {
|
|
27
|
+
$defs: (typeof SpecDefsRoot)["$defs"];
|
|
28
|
+
$ref: string;
|
|
29
|
+
} & TSchema;
|
|
30
|
+
|
|
31
|
+
function reRootSpec(key: keyof typeof SpecDeclarations): SpecImportSchema {
|
|
32
|
+
// One shared `$defs` graph; only the root `$ref` changes per import.
|
|
33
|
+
const schema: SpecImportSchema = {
|
|
34
|
+
$defs: SpecDefsRoot.$defs,
|
|
35
|
+
$ref: key,
|
|
36
|
+
};
|
|
37
|
+
return schema;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const SpecModule = {
|
|
41
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- preserves TypeBox 0.x instantiation-expression compatibility
|
|
42
|
+
Import<Key extends keyof typeof SpecDeclarations>(key: Key): SpecImportSchema {
|
|
43
|
+
return reRootSpec(key);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// Imported (validatable) schemas — Cyclic `$defs`+`$ref` for runtime/artifact
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
|
|
51
|
+
export const PlotSpecSchema = SpecModule.Import("PlotSpec");
|
|
52
|
+
export const LayerSpecSchema = SpecModule.Import("LayerSpec");
|
|
53
|
+
export const PointLayerSchema = SpecModule.Import("PointLayer");
|
|
54
|
+
export const LineLayerSchema = SpecModule.Import("LineLayer");
|
|
55
|
+
export const PathLayerSchema = SpecModule.Import("PathLayer");
|
|
56
|
+
export const ColLayerSchema = SpecModule.Import("ColLayer");
|
|
57
|
+
export const BarLayerSchema = SpecModule.Import("BarLayer");
|
|
58
|
+
export const HistogramLayerSchema = SpecModule.Import("HistogramLayer");
|
|
59
|
+
export const FreqpolyLayerSchema = SpecModule.Import("FreqpolyLayer");
|
|
60
|
+
export const AreaLayerSchema = SpecModule.Import("AreaLayer");
|
|
61
|
+
export const RibbonLayerSchema = SpecModule.Import("RibbonLayer");
|
|
62
|
+
export const SegmentLayerSchema = SpecModule.Import("SegmentLayer");
|
|
63
|
+
export const CountLayerSchema = SpecModule.Import("CountLayer");
|
|
64
|
+
export const ViolinLayerSchema = SpecModule.Import("ViolinLayer");
|
|
65
|
+
export const FunctionLayerSchema = SpecModule.Import("FunctionLayer");
|
|
66
|
+
export const PolygonLayerSchema = SpecModule.Import("PolygonLayer");
|
|
67
|
+
export const AblineLayerSchema = SpecModule.Import("AblineLayer");
|
|
68
|
+
export const CurveLayerSchema = SpecModule.Import("CurveLayer");
|
|
69
|
+
export const MapLayerSchema = SpecModule.Import("MapLayer");
|
|
70
|
+
export const BlankLayerSchema = SpecModule.Import("BlankLayer");
|
|
71
|
+
export const SfLayerSchema = SpecModule.Import("SfLayer");
|
|
72
|
+
export const SfTextLayerSchema = SpecModule.Import("SfTextLayer");
|
|
73
|
+
export const SfLabelLayerSchema = SpecModule.Import("SfLabelLayer");
|
|
74
|
+
|
|
75
|
+
export const SpokeLayerSchema = SpecModule.Import("SpokeLayer");
|
|
76
|
+
export const RugLayerSchema = SpecModule.Import("RugLayer");
|
|
77
|
+
export const StepLayerSchema = SpecModule.Import("StepLayer");
|
|
78
|
+
export const QqLayerSchema = SpecModule.Import("QqLayer");
|
|
79
|
+
export const QqLineLayerSchema = SpecModule.Import("QqLineLayer");
|
|
80
|
+
export const RuleLayerSchema = SpecModule.Import("RuleLayer");
|
|
81
|
+
export const HlineLayerSchema = SpecModule.Import("HlineLayer");
|
|
82
|
+
export const VlineLayerSchema = SpecModule.Import("VlineLayer");
|
|
83
|
+
export const JitterLayerSchema = SpecModule.Import("JitterLayer");
|
|
84
|
+
export const TextLayerSchema = SpecModule.Import("TextLayer");
|
|
85
|
+
export const LabelLayerSchema = SpecModule.Import("LabelLayer");
|
|
86
|
+
export const SmoothLayerSchema = SpecModule.Import("SmoothLayer");
|
|
87
|
+
export const QuantileLayerSchema = SpecModule.Import("QuantileLayer");
|
|
88
|
+
export const ContourLayerSchema = SpecModule.Import("ContourLayer");
|
|
89
|
+
export const BoxplotLayerSchema = SpecModule.Import("BoxplotLayer");
|
|
90
|
+
export const DensityLayerSchema = SpecModule.Import("DensityLayer");
|
|
91
|
+
export const Density2dLayerSchema = SpecModule.Import("Density2dLayer");
|
|
92
|
+
export const Density2dFilledLayerSchema = SpecModule.Import("Density2dFilledLayer");
|
|
93
|
+
export const DotplotLayerSchema = SpecModule.Import("DotplotLayer");
|
|
94
|
+
export const ErrorbarLayerSchema = SpecModule.Import("ErrorbarLayer");
|
|
95
|
+
export const LinerangeLayerSchema = SpecModule.Import("LinerangeLayer");
|
|
96
|
+
export const PointrangeLayerSchema = SpecModule.Import("PointrangeLayer");
|
|
97
|
+
export const CrossbarLayerSchema = SpecModule.Import("CrossbarLayer");
|
|
98
|
+
export const RectLayerSchema = SpecModule.Import("RectLayer");
|
|
99
|
+
export const TileLayerSchema = SpecModule.Import("TileLayer");
|
|
100
|
+
export const Bin2dLayerSchema = SpecModule.Import("Bin2dLayer");
|
|
101
|
+
export const RasterLayerSchema = SpecModule.Import("RasterLayer");
|
|
102
|
+
export const HexLayerSchema = SpecModule.Import("HexLayer");
|
|
103
|
+
export const AesSchema = SpecModule.Import("Aes");
|
|
104
|
+
export const ChannelValueSchema = SpecModule.Import("ChannelValue");
|
|
105
|
+
export const DataRefSchema = SpecModule.Import("DataRef");
|
|
106
|
+
export const ScalesSchema = SpecModule.Import("Scales");
|
|
107
|
+
export const TemporalParserSpecSchemaRef = SpecModule.Import("TemporalParserSpec");
|
|
108
|
+
export const FacetFieldRefSchema = SpecModule.Import("FacetFieldRef");
|
|
109
|
+
export const FacetStripSpecSchema = SpecModule.Import("FacetStripSpec");
|
|
110
|
+
export const FacetSpecSchema = SpecModule.Import("FacetSpec");
|
|
111
|
+
export const CoordTransformAxisSpecSchema = SpecModule.Import("CoordTransformAxisSpec");
|
|
112
|
+
export const CoordTransformSpecSchema = SpecModule.Import("CoordTransformSpec");
|
|
113
|
+
export const CoordFixedSpecSchema = SpecModule.Import("CoordFixedSpec");
|
|
114
|
+
export const CoordSfSpecSchema = SpecModule.Import("CoordSfSpec");
|
|
115
|
+
export const CoordRadialSpecSchema = SpecModule.Import("CoordRadialSpec");
|
|
116
|
+
export const CoordSpecSchema = SpecModule.Import("CoordSpec");
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeBox literals for closed name registries (schema graph only).
|
|
3
|
+
* Runtime name arrays live in schema-names.ts without a typebox import.
|
|
4
|
+
*/
|
|
5
|
+
import Type, { type TLiteral } from "typebox";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
COLOR_SCHEME_NAMES,
|
|
9
|
+
LINETYPE_NAMES,
|
|
10
|
+
POINT_SHAPE_NAMES,
|
|
11
|
+
THEME_NAMES,
|
|
12
|
+
type LinetypeName,
|
|
13
|
+
type PointShapeName,
|
|
14
|
+
} from "./schema-names.js";
|
|
15
|
+
|
|
16
|
+
type ColorSchemeNameValue = (typeof COLOR_SCHEME_NAMES)[number];
|
|
17
|
+
/** TypeBox literals for color scheme names (used by ColorScaleSpec). */
|
|
18
|
+
export const COLOR_SCHEME_NAME_SCHEMAS = COLOR_SCHEME_NAMES.map((name) =>
|
|
19
|
+
Type.Literal(name),
|
|
20
|
+
) as unknown as [TLiteral<ColorSchemeNameValue>, ...TLiteral<ColorSchemeNameValue>[]];
|
|
21
|
+
|
|
22
|
+
type PointShapeNameValue = PointShapeName;
|
|
23
|
+
export const POINT_SHAPE_NAME_SCHEMAS = POINT_SHAPE_NAMES.map((name) =>
|
|
24
|
+
Type.Literal(name),
|
|
25
|
+
) as unknown as [TLiteral<PointShapeNameValue>, ...TLiteral<PointShapeNameValue>[]];
|
|
26
|
+
|
|
27
|
+
type LinetypeNameValue = LinetypeName;
|
|
28
|
+
export const LINETYPE_NAME_SCHEMAS = LINETYPE_NAMES.map((name) =>
|
|
29
|
+
Type.Literal(name),
|
|
30
|
+
) as unknown as [TLiteral<LinetypeNameValue>, ...TLiteral<LinetypeNameValue>[]];
|
|
31
|
+
|
|
32
|
+
type ThemeNameValue = (typeof THEME_NAMES)[number];
|
|
33
|
+
/** TypeBox literals for theme names (used by ThemeName def). */
|
|
34
|
+
export const THEME_NAME_SCHEMAS = THEME_NAMES.map((name) => Type.Literal(name)) as unknown as [
|
|
35
|
+
TLiteral<ThemeNameValue>,
|
|
36
|
+
...TLiteral<ThemeNameValue>[],
|
|
37
|
+
];
|