@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,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCALE_REFERENCE builder (SpecDeclarations + capabilities). Gen-only:
|
|
3
|
+
* `scripts/gen-reference-catalogs.ts`. Runtime uses generated/scale-reference-data.ts.
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
SCALE_CAPABILITIES,
|
|
7
|
+
STYLE_ORDINAL_SCALE_HELPERS,
|
|
8
|
+
scaleCapabilityCamelHelpers,
|
|
9
|
+
} from "./capabilities.js";
|
|
10
|
+
import { classifyColorFillHelper } from "./scale-reference-classify-color.js";
|
|
11
|
+
import { classifyPositionHelper } from "./scale-reference-classify-position.js";
|
|
12
|
+
import { classifyStyleHelper } from "./scale-reference-classify-style.js";
|
|
13
|
+
import {
|
|
14
|
+
aestheticFromHelper,
|
|
15
|
+
type HelperMeta,
|
|
16
|
+
type ScaleAesthetic,
|
|
17
|
+
type ScaleFamily,
|
|
18
|
+
type ScaleParamDoc,
|
|
19
|
+
} from "./scale-reference-classify-support.js";
|
|
20
|
+
|
|
21
|
+
export type {
|
|
22
|
+
ScaleAesthetic,
|
|
23
|
+
ScaleFamily,
|
|
24
|
+
ScaleParamDoc,
|
|
25
|
+
} from "./scale-reference-classify-support.js";
|
|
26
|
+
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Public types
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
export interface ScaleReferenceEntry {
|
|
32
|
+
/** Helper name, e.g. scaleXContinuous (Colour aliases use Colour spelling). */
|
|
33
|
+
readonly helper: string;
|
|
34
|
+
/** Route slug — snake_case stem without the scale prefix (e.g. x_continuous). */
|
|
35
|
+
readonly slug: string;
|
|
36
|
+
/** Svelte component export, e.g. ScaleXContinuous. */
|
|
37
|
+
readonly component: string;
|
|
38
|
+
readonly family: ScaleFamily;
|
|
39
|
+
/** Aesthetic channels written by this helper (usually one). */
|
|
40
|
+
readonly aesthetics: readonly ScaleAesthetic[];
|
|
41
|
+
/** Canonical post-normalize scale type(s) this helper authors. */
|
|
42
|
+
readonly scaleType: string;
|
|
43
|
+
/** Forced transform when the helper pins one (log10/sqrt); else undefined. */
|
|
44
|
+
readonly transform?: "log10" | "sqrt";
|
|
45
|
+
/** Forced temporalKind when the helper pins one. */
|
|
46
|
+
readonly temporalKind?: string;
|
|
47
|
+
/** Short purpose text for index + detail lede. */
|
|
48
|
+
readonly summary: string;
|
|
49
|
+
/** TypeScript options type name (or Omit expression) for the shell props. */
|
|
50
|
+
readonly optionsType: string;
|
|
51
|
+
/** Authoring props (schema-derived + helper sugar). */
|
|
52
|
+
readonly params: readonly ScaleParamDoc[];
|
|
53
|
+
/**
|
|
54
|
+
* How this scale interacts with guides: axis for position; legend/colorbar/
|
|
55
|
+
* colorsteps for style; "none" when guide: "none" is typical.
|
|
56
|
+
*/
|
|
57
|
+
readonly guide: string;
|
|
58
|
+
/**
|
|
59
|
+
* When set, this component is a binding-identical re-export of another
|
|
60
|
+
* (British Colour spelling or *Ordinal → *Discrete).
|
|
61
|
+
*/
|
|
62
|
+
readonly aliasOf?: string;
|
|
63
|
+
/** Alternate component names that re-export this shell. */
|
|
64
|
+
readonly alsoExportedAs: readonly string[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Naming
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
/** scaleXContinuous → ScaleXContinuous */
|
|
72
|
+
export function componentNameForScaleHelper(helper: string): string {
|
|
73
|
+
if (!helper.startsWith("scale")) {
|
|
74
|
+
throw new Error(`SCALE_REFERENCE: expected scale* helper, got "${helper}"`);
|
|
75
|
+
}
|
|
76
|
+
return "S" + helper.slice(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** scaleXContinuous → x_continuous; scaleColorViridisC → color_viridis_c */
|
|
80
|
+
export function slugForScaleHelper(helper: string): string {
|
|
81
|
+
const stem = helper.startsWith("scale") ? helper.slice(5) : helper;
|
|
82
|
+
return stem
|
|
83
|
+
.replaceAll(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
84
|
+
.replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1_$2")
|
|
85
|
+
.toLowerCase();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// Per-helper classification dispatch
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
function classifyHelper(helper: string, family: ScaleFamily): HelperMeta {
|
|
93
|
+
if (
|
|
94
|
+
family === "position-continuous" ||
|
|
95
|
+
family === "position-binned" ||
|
|
96
|
+
family === "position-temporal" ||
|
|
97
|
+
family === "position-discrete"
|
|
98
|
+
) {
|
|
99
|
+
return classifyPositionHelper(helper, family);
|
|
100
|
+
}
|
|
101
|
+
if (family === "color-fill") return classifyColorFillHelper(helper, family);
|
|
102
|
+
return classifyStyleHelper(helper, family);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Build catalog
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
|
|
109
|
+
function familyForHelper(helper: string): ScaleFamily {
|
|
110
|
+
for (const cap of SCALE_CAPABILITIES) {
|
|
111
|
+
if ((cap.helpers as readonly string[]).includes(helper)) {
|
|
112
|
+
return cap.family;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Ordinal style aliases live outside the main ledger helper arrays.
|
|
116
|
+
if ((STYLE_ORDINAL_SCALE_HELPERS as readonly string[]).includes(helper)) {
|
|
117
|
+
if (helper.includes("Shape") || helper.includes("Linetype")) return "finite-style";
|
|
118
|
+
return "numeric-style";
|
|
119
|
+
}
|
|
120
|
+
// Colour spelling is on the ledger under color-fill.
|
|
121
|
+
if (helper.includes("Colour")) {
|
|
122
|
+
return "color-fill";
|
|
123
|
+
}
|
|
124
|
+
throw new Error(`SCALE_REFERENCE: helper "${helper}" not in SCALE_CAPABILITIES`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function primaryHelperForAlias(helper: string): string | undefined {
|
|
128
|
+
if (helper.includes("Colour")) {
|
|
129
|
+
return helper.replace("Colour", "Color");
|
|
130
|
+
}
|
|
131
|
+
// Style-channel *Ordinal shells re-export *Discrete (#830/#832). Color/fill
|
|
132
|
+
// scaleColorOrdinal / scaleFillOrdinal are distinct primary helpers.
|
|
133
|
+
if ((STYLE_ORDINAL_SCALE_HELPERS as readonly string[]).includes(helper)) {
|
|
134
|
+
return helper.replace(/Ordinal$/, "Discrete");
|
|
135
|
+
}
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function buildAlsoExportedAs(primaryHelper: string): readonly string[] {
|
|
140
|
+
const aliases: string[] = [];
|
|
141
|
+
// Colour re-exports for color channel only
|
|
142
|
+
if (primaryHelper.startsWith("scaleColor")) {
|
|
143
|
+
aliases.push(componentNameForScaleHelper(primaryHelper.replace("Color", "Colour")));
|
|
144
|
+
}
|
|
145
|
+
// Ordinal re-exports for discrete style shells
|
|
146
|
+
if (
|
|
147
|
+
primaryHelper.endsWith("Discrete") &&
|
|
148
|
+
(primaryHelper.startsWith("scaleSize") ||
|
|
149
|
+
primaryHelper.startsWith("scaleLinewidth") ||
|
|
150
|
+
primaryHelper.startsWith("scaleAlpha") ||
|
|
151
|
+
primaryHelper.startsWith("scaleShape"))
|
|
152
|
+
) {
|
|
153
|
+
aliases.push(componentNameForScaleHelper(primaryHelper.replace(/Discrete$/, "Ordinal")));
|
|
154
|
+
}
|
|
155
|
+
return Object.freeze(aliases);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function buildEntry(helper: string): ScaleReferenceEntry {
|
|
159
|
+
const family = familyForHelper(helper);
|
|
160
|
+
const aliasOfHelper = primaryHelperForAlias(helper);
|
|
161
|
+
const aes = aestheticFromHelper(helper);
|
|
162
|
+
const meta =
|
|
163
|
+
aliasOfHelper === undefined
|
|
164
|
+
? classifyHelper(helper, family)
|
|
165
|
+
: classifyHelper(aliasOfHelper, familyForHelper(aliasOfHelper));
|
|
166
|
+
|
|
167
|
+
const aesthetics: readonly ScaleAesthetic[] = Object.freeze([aes]);
|
|
168
|
+
const alsoExportedAs: readonly string[] =
|
|
169
|
+
aliasOfHelper === undefined ? buildAlsoExportedAs(helper) : Object.freeze([]);
|
|
170
|
+
const summary =
|
|
171
|
+
aliasOfHelper === undefined
|
|
172
|
+
? meta.summary
|
|
173
|
+
: helper.includes("Colour")
|
|
174
|
+
? `${meta.summary} British Colour spelling — same binding as ${componentNameForScaleHelper(aliasOfHelper)}.`
|
|
175
|
+
: `${meta.summary} ggplot2 *Ordinal alias — same binding as ${componentNameForScaleHelper(aliasOfHelper)}.`;
|
|
176
|
+
|
|
177
|
+
return Object.freeze({
|
|
178
|
+
helper,
|
|
179
|
+
slug: slugForScaleHelper(helper),
|
|
180
|
+
component: componentNameForScaleHelper(helper),
|
|
181
|
+
family,
|
|
182
|
+
aesthetics,
|
|
183
|
+
scaleType: meta.scaleType,
|
|
184
|
+
...(meta.transform === undefined ? {} : { transform: meta.transform }),
|
|
185
|
+
...(meta.temporalKind === undefined ? {} : { temporalKind: meta.temporalKind }),
|
|
186
|
+
summary,
|
|
187
|
+
optionsType: meta.optionsType,
|
|
188
|
+
params: Object.freeze([...meta.params]),
|
|
189
|
+
guide: meta.guide,
|
|
190
|
+
...(aliasOfHelper === undefined ? {} : { aliasOf: slugForScaleHelper(aliasOfHelper) }),
|
|
191
|
+
alsoExportedAs,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** Primary Scale* helpers (no Colour / Ordinal-only aliases). */
|
|
196
|
+
export function primaryScaleHelpers(): readonly string[] {
|
|
197
|
+
return scaleCapabilityCamelHelpers();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Every public Scale* surface: primary shells + Colour aliases + Ordinal
|
|
202
|
+
* style aliases (binding-identical re-exports).
|
|
203
|
+
*/
|
|
204
|
+
export function allScaleHelpers(): readonly string[] {
|
|
205
|
+
const primary = scaleCapabilityCamelHelpers();
|
|
206
|
+
const colour = primary
|
|
207
|
+
.filter((h) => h.startsWith("scaleColor"))
|
|
208
|
+
.map((h) => h.replace("Color", "Colour"));
|
|
209
|
+
return [...new Set([...primary, ...colour, ...STYLE_ORDINAL_SCALE_HELPERS])].toSorted();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function buildScaleReference(): Readonly<Record<string, ScaleReferenceEntry>> {
|
|
213
|
+
const out: Record<string, ScaleReferenceEntry> = {};
|
|
214
|
+
for (const helper of allScaleHelpers()) {
|
|
215
|
+
const entry = buildEntry(helper);
|
|
216
|
+
if (out[entry.slug] !== undefined) {
|
|
217
|
+
throw new Error(`SCALE_REFERENCE: duplicate slug "${entry.slug}"`);
|
|
218
|
+
}
|
|
219
|
+
out[entry.slug] = entry;
|
|
220
|
+
}
|
|
221
|
+
return Object.freeze(out);
|
|
222
|
+
}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color/fill-family classification for the SCALE_REFERENCE builder
|
|
3
|
+
* (gen-only): continuous, binned, ordinal, manual, identity, transformed,
|
|
4
|
+
* temporal, and gradient/brewer/distiller/fermenter/viridis/hue/grey
|
|
5
|
+
* variants.
|
|
6
|
+
*/
|
|
7
|
+
import {
|
|
8
|
+
aestheticFromHelper,
|
|
9
|
+
guideFor,
|
|
10
|
+
paramDocsFromSchema,
|
|
11
|
+
withGradientStops,
|
|
12
|
+
withHueGrey,
|
|
13
|
+
withPaletteDirection,
|
|
14
|
+
withValues,
|
|
15
|
+
withViridisOption,
|
|
16
|
+
type HelperMeta,
|
|
17
|
+
} from "./scale-reference-classify-support.js";
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Param key sets per options family (mirrors helper option Pick/Omit types)
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
const COLOR_SEQUENTIAL_KEYS = [
|
|
24
|
+
"domain",
|
|
25
|
+
"breaks",
|
|
26
|
+
"range",
|
|
27
|
+
"scheme",
|
|
28
|
+
"reverse",
|
|
29
|
+
"transform",
|
|
30
|
+
"oob",
|
|
31
|
+
"naValue",
|
|
32
|
+
"unknownValue",
|
|
33
|
+
"labels",
|
|
34
|
+
"guide",
|
|
35
|
+
] as const;
|
|
36
|
+
|
|
37
|
+
const COLOR_TRANSFORMED_KEYS = [
|
|
38
|
+
"domain",
|
|
39
|
+
"breaks",
|
|
40
|
+
"range",
|
|
41
|
+
"scheme",
|
|
42
|
+
"reverse",
|
|
43
|
+
"oob",
|
|
44
|
+
"naValue",
|
|
45
|
+
"unknownValue",
|
|
46
|
+
"labels",
|
|
47
|
+
"guide",
|
|
48
|
+
] as const;
|
|
49
|
+
|
|
50
|
+
const COLOR_DISCRETE_KEYS = [
|
|
51
|
+
"domain",
|
|
52
|
+
"domainMode",
|
|
53
|
+
"range",
|
|
54
|
+
"scheme",
|
|
55
|
+
"reverse",
|
|
56
|
+
"naValue",
|
|
57
|
+
"unknownValue",
|
|
58
|
+
"onExhaust",
|
|
59
|
+
"guide",
|
|
60
|
+
] as const;
|
|
61
|
+
|
|
62
|
+
const COLOR_MANUAL_KEYS = ["domain", "naValue", "unknownValue", "guide"] as const;
|
|
63
|
+
const COLOR_IDENTITY_KEYS = ["naValue", "unknownValue", "guide"] as const;
|
|
64
|
+
const COLOR_TEMPORAL_KEYS = [
|
|
65
|
+
"domain",
|
|
66
|
+
"breaks",
|
|
67
|
+
"range",
|
|
68
|
+
"scheme",
|
|
69
|
+
"reverse",
|
|
70
|
+
"oob",
|
|
71
|
+
"naValue",
|
|
72
|
+
"unknownValue",
|
|
73
|
+
"labels",
|
|
74
|
+
"guide",
|
|
75
|
+
"parse",
|
|
76
|
+
"parseFailure",
|
|
77
|
+
"timezone",
|
|
78
|
+
"disambiguation",
|
|
79
|
+
] as const;
|
|
80
|
+
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Per-helper classification: color / fill
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
type ColorFillFamily = "color-fill";
|
|
86
|
+
|
|
87
|
+
const colorParams = (keys: readonly string[]) => paramDocsFromSchema("ColorScaleSpec", keys);
|
|
88
|
+
|
|
89
|
+
type ColorHandler = (helper: string) => HelperMeta | undefined;
|
|
90
|
+
|
|
91
|
+
function classifyPalette(helper: string): HelperMeta | undefined {
|
|
92
|
+
const aes = aestheticFromHelper(helper);
|
|
93
|
+
|
|
94
|
+
if (helper.includes("Viridis")) {
|
|
95
|
+
const kind = helper.endsWith("D") ? "ordinal" : helper.endsWith("B") ? "binned" : "sequential";
|
|
96
|
+
const label =
|
|
97
|
+
kind === "ordinal"
|
|
98
|
+
? "discrete (viridis_d)"
|
|
99
|
+
: kind === "binned"
|
|
100
|
+
? "binned (viridis_b)"
|
|
101
|
+
: "continuous (viridis_c)";
|
|
102
|
+
return {
|
|
103
|
+
optionsType: "ViridisScaleOptions",
|
|
104
|
+
scaleType: kind,
|
|
105
|
+
params: withViridisOption(colorParams(COLOR_SEQUENTIAL_KEYS.filter((k) => k !== "scheme"))),
|
|
106
|
+
guide: guideFor(aes, kind),
|
|
107
|
+
summary: `Viridis-family ${aes} scale — ${label}.`,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (helper.includes("Brewer")) {
|
|
111
|
+
return {
|
|
112
|
+
optionsType: "ColorBrewerScaleOptions",
|
|
113
|
+
scaleType: "ordinal",
|
|
114
|
+
params: withPaletteDirection(colorParams(COLOR_DISCRETE_KEYS)),
|
|
115
|
+
guide: guideFor(aes, "ordinal"),
|
|
116
|
+
summary: `ColorBrewer qualitative ${aes} scale (discrete categories).`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (helper.includes("Distiller")) {
|
|
120
|
+
return {
|
|
121
|
+
optionsType: "ColorDistillerScaleOptions",
|
|
122
|
+
scaleType: "sequential",
|
|
123
|
+
params: withPaletteDirection(colorParams(COLOR_SEQUENTIAL_KEYS)),
|
|
124
|
+
guide: guideFor(aes, "sequential"),
|
|
125
|
+
summary: `ColorBrewer sequential/diverging ${aes} ramp (distiller).`,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if (helper.includes("Fermenter")) {
|
|
129
|
+
return {
|
|
130
|
+
optionsType: "ColorFermenterScaleOptions",
|
|
131
|
+
scaleType: "binned",
|
|
132
|
+
params: withPaletteDirection(colorParams(COLOR_SEQUENTIAL_KEYS)),
|
|
133
|
+
guide: guideFor(aes, "binned"),
|
|
134
|
+
summary: `ColorBrewer binned ${aes} steps (fermenter).`,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function classifyGradient2(helper: string): HelperMeta | undefined {
|
|
141
|
+
const aes = aestheticFromHelper(helper);
|
|
142
|
+
|
|
143
|
+
if (helper.includes("Gradient2") || helper.includes("Steps2")) {
|
|
144
|
+
const binned = helper.includes("Steps");
|
|
145
|
+
return {
|
|
146
|
+
optionsType: binned ? "Steps2ScaleOptions" : "Gradient2ScaleOptions",
|
|
147
|
+
scaleType: binned ? "binned" : "sequential",
|
|
148
|
+
params: withGradientStops(colorParams(COLOR_SEQUENTIAL_KEYS), binned ? "steps2" : "2"),
|
|
149
|
+
guide: guideFor(aes, binned ? "binned" : "sequential"),
|
|
150
|
+
summary: binned
|
|
151
|
+
? `Three-stop diverging binned ${aes} steps (low/mid/high).`
|
|
152
|
+
: `Three-stop diverging continuous ${aes} gradient (low/mid/high).`,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function classifyGradient(helper: string): HelperMeta | undefined {
|
|
159
|
+
const aes = aestheticFromHelper(helper);
|
|
160
|
+
|
|
161
|
+
if (helper.includes("Gradientn") || helper.includes("Stepsn")) {
|
|
162
|
+
const binned = helper.includes("Steps");
|
|
163
|
+
return {
|
|
164
|
+
optionsType: binned ? "StepsnScaleOptions" : "GradientnScaleOptions",
|
|
165
|
+
scaleType: binned ? "binned" : "sequential",
|
|
166
|
+
params: withGradientStops(colorParams(COLOR_SEQUENTIAL_KEYS), binned ? "stepsn" : "n"),
|
|
167
|
+
guide: guideFor(aes, binned ? "binned" : "sequential"),
|
|
168
|
+
summary: binned
|
|
169
|
+
? `N-stop binned ${aes} steps from an ordered color list.`
|
|
170
|
+
: `N-stop continuous ${aes} gradient from an ordered color list.`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
if (helper.includes("Gradient") || helper.endsWith("Steps")) {
|
|
174
|
+
const binned = helper.endsWith("Steps");
|
|
175
|
+
return {
|
|
176
|
+
optionsType: binned ? "StepsScaleOptions" : "GradientScaleOptions",
|
|
177
|
+
scaleType: binned ? "binned" : "sequential",
|
|
178
|
+
params: withGradientStops(colorParams(COLOR_SEQUENTIAL_KEYS), binned ? "steps" : "steps"),
|
|
179
|
+
guide: guideFor(aes, binned ? "binned" : "sequential"),
|
|
180
|
+
summary: binned
|
|
181
|
+
? `Two-stop binned ${aes} steps (low/high).`
|
|
182
|
+
: `Two-stop continuous ${aes} gradient (low/high).`,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function classifyNamedPalette(helper: string): HelperMeta | undefined {
|
|
189
|
+
const aes = aestheticFromHelper(helper);
|
|
190
|
+
|
|
191
|
+
if (helper.includes("Hue")) {
|
|
192
|
+
return {
|
|
193
|
+
optionsType: "HueScaleOptions",
|
|
194
|
+
scaleType: "ordinal",
|
|
195
|
+
params: withHueGrey(colorParams(COLOR_DISCRETE_KEYS), "hue"),
|
|
196
|
+
guide: guideFor(aes, "ordinal"),
|
|
197
|
+
summary: `Evenly spaced hue ${aes} palette for discrete categories.`,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (helper.includes("Grey") || helper.includes("Gray")) {
|
|
201
|
+
return {
|
|
202
|
+
optionsType: "GreyScaleOptions",
|
|
203
|
+
scaleType: "ordinal",
|
|
204
|
+
params: withHueGrey(colorParams(COLOR_DISCRETE_KEYS), "grey"),
|
|
205
|
+
guide: guideFor(aes, "ordinal"),
|
|
206
|
+
summary: `Grey ramp ${aes} palette for discrete categories.`,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (helper.includes("Ordinal")) {
|
|
210
|
+
return {
|
|
211
|
+
optionsType: "OrdinalColorScaleOptions",
|
|
212
|
+
scaleType: "ordinal",
|
|
213
|
+
params: colorParams(COLOR_DISCRETE_KEYS),
|
|
214
|
+
guide: guideFor(aes, "ordinal"),
|
|
215
|
+
summary: `Explicit ordinal ${aes} scale (categories → colors).`,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function classifyBaseColor(helper: string): HelperMeta | undefined {
|
|
222
|
+
const aes = aestheticFromHelper(helper);
|
|
223
|
+
|
|
224
|
+
if (helper.includes("Log10")) {
|
|
225
|
+
return {
|
|
226
|
+
optionsType: "TransformedColorScaleOptions",
|
|
227
|
+
scaleType: "sequential",
|
|
228
|
+
transform: "log10",
|
|
229
|
+
params: colorParams(COLOR_TRANSFORMED_KEYS),
|
|
230
|
+
guide: guideFor(aes, "sequential"),
|
|
231
|
+
summary: `Sequential ${aes} scale with log10 pre-training transform.`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
if (helper.includes("Sqrt")) {
|
|
235
|
+
return {
|
|
236
|
+
optionsType: "TransformedColorScaleOptions",
|
|
237
|
+
scaleType: "sequential",
|
|
238
|
+
transform: "sqrt",
|
|
239
|
+
params: colorParams(COLOR_TRANSFORMED_KEYS),
|
|
240
|
+
guide: guideFor(aes, "sequential"),
|
|
241
|
+
summary: `Sequential ${aes} scale with sqrt pre-training transform.`,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (helper.includes("Datetime")) {
|
|
245
|
+
return {
|
|
246
|
+
optionsType: "TemporalColorScaleOptions",
|
|
247
|
+
scaleType: "sequential",
|
|
248
|
+
temporalKind: "datetime",
|
|
249
|
+
params: colorParams(COLOR_TEMPORAL_KEYS),
|
|
250
|
+
guide: guideFor(aes, "sequential"),
|
|
251
|
+
summary: `Sequential ${aes} scale trained on datetime values.`,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
if (helper.includes("Date")) {
|
|
255
|
+
return {
|
|
256
|
+
optionsType: "TemporalColorScaleOptions",
|
|
257
|
+
scaleType: "sequential",
|
|
258
|
+
temporalKind: "date",
|
|
259
|
+
params: colorParams(COLOR_TEMPORAL_KEYS),
|
|
260
|
+
guide: guideFor(aes, "sequential"),
|
|
261
|
+
summary: `Sequential ${aes} scale trained on calendar dates.`,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
if (helper.includes("Manual")) {
|
|
265
|
+
return {
|
|
266
|
+
optionsType: "ManualColorScaleOptions",
|
|
267
|
+
scaleType: "manual",
|
|
268
|
+
params: withValues(
|
|
269
|
+
colorParams(COLOR_MANUAL_KEYS),
|
|
270
|
+
"string[]",
|
|
271
|
+
"Colors paired positionally with the explicit or trained domain (required).",
|
|
272
|
+
),
|
|
273
|
+
guide: guideFor(aes, "manual"),
|
|
274
|
+
summary: `Manual ${aes} mapping: domain values paired with explicit colors.`,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
if (helper.includes("Identity")) {
|
|
278
|
+
return {
|
|
279
|
+
optionsType: "IdentityColorScaleOptions",
|
|
280
|
+
scaleType: "identity",
|
|
281
|
+
params: colorParams(COLOR_IDENTITY_KEYS),
|
|
282
|
+
guide: guideFor(aes, "identity"),
|
|
283
|
+
summary: `Identity ${aes} scale: source values are validated #rgb/#rrggbb colors used as-is.`,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
if (helper.includes("Binned")) {
|
|
287
|
+
return {
|
|
288
|
+
optionsType: "BinnedColorScaleOptions",
|
|
289
|
+
scaleType: "binned",
|
|
290
|
+
params: colorParams(COLOR_SEQUENTIAL_KEYS),
|
|
291
|
+
guide: guideFor(aes, "binned"),
|
|
292
|
+
summary: `Binned ${aes} scale: continuous values → ordered color steps.`,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (helper.includes("Discrete")) {
|
|
296
|
+
return {
|
|
297
|
+
optionsType: "DiscreteColorScaleOptions",
|
|
298
|
+
scaleType: "ordinal",
|
|
299
|
+
params: colorParams(COLOR_DISCRETE_KEYS),
|
|
300
|
+
guide: guideFor(aes, "ordinal"),
|
|
301
|
+
summary: `Discrete ${aes} scale for categorical data (default ordinal family).`,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
if (helper.includes("Continuous")) {
|
|
305
|
+
return {
|
|
306
|
+
optionsType: "SequentialColorScaleOptions",
|
|
307
|
+
scaleType: "sequential",
|
|
308
|
+
params: colorParams(COLOR_SEQUENTIAL_KEYS),
|
|
309
|
+
guide: guideFor(aes, "sequential"),
|
|
310
|
+
summary: `Continuous sequential ${aes} scale (default continuous color family).`,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
return undefined;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const COLOR_HANDLERS: ColorHandler[] = [
|
|
317
|
+
classifyPalette,
|
|
318
|
+
classifyGradient2,
|
|
319
|
+
classifyGradient,
|
|
320
|
+
classifyNamedPalette,
|
|
321
|
+
classifyBaseColor,
|
|
322
|
+
];
|
|
323
|
+
|
|
324
|
+
export function classifyColorFillHelper(helper: string, _family: ColorFillFamily): HelperMeta {
|
|
325
|
+
for (const handler of COLOR_HANDLERS) {
|
|
326
|
+
const meta = handler(helper);
|
|
327
|
+
if (meta !== undefined) return meta;
|
|
328
|
+
}
|
|
329
|
+
const stem = helper.replace(
|
|
330
|
+
/^scale(Colour|Color|Fill|X|Y|Size|Linewidth|Alpha|Shape|Linetype|Radius)/,
|
|
331
|
+
"",
|
|
332
|
+
);
|
|
333
|
+
throw new Error(`SCALE_REFERENCE: unhandled color/fill helper "${helper}" (stem ${stem})`);
|
|
334
|
+
}
|