@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,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Position-family classification for the SCALE_REFERENCE builder (gen-only):
|
|
3
|
+
* continuous/binned linear, transformed, temporal, and discrete (band) x/y
|
|
4
|
+
* position scales.
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
aestheticFromHelper,
|
|
8
|
+
guideFor,
|
|
9
|
+
paramDocsFromSchema,
|
|
10
|
+
withLimits,
|
|
11
|
+
type HelperMeta,
|
|
12
|
+
} from "./scale-reference-classify-support.js";
|
|
13
|
+
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Param key sets per options family (mirrors helper option Pick/Omit types)
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
const POSITION_CONTINUOUS_KEYS = [
|
|
19
|
+
"domain",
|
|
20
|
+
"nice",
|
|
21
|
+
"zero",
|
|
22
|
+
"reverse",
|
|
23
|
+
"breaks",
|
|
24
|
+
"labels",
|
|
25
|
+
"expand",
|
|
26
|
+
"oob",
|
|
27
|
+
"naValue",
|
|
28
|
+
"minorBreaks",
|
|
29
|
+
"transform",
|
|
30
|
+
"guide",
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
const POSITION_TRANSFORMED_KEYS = POSITION_CONTINUOUS_KEYS.filter((k) => k !== "transform");
|
|
34
|
+
|
|
35
|
+
const POSITION_DISCRETE_KEYS = [
|
|
36
|
+
"domain",
|
|
37
|
+
"reverse",
|
|
38
|
+
"breaks",
|
|
39
|
+
"labels",
|
|
40
|
+
"expand",
|
|
41
|
+
"naValue",
|
|
42
|
+
"guide",
|
|
43
|
+
] as const;
|
|
44
|
+
|
|
45
|
+
const POSITION_TEMPORAL_KEYS = [
|
|
46
|
+
"domain",
|
|
47
|
+
"nice",
|
|
48
|
+
"reverse",
|
|
49
|
+
"breaks",
|
|
50
|
+
"labels",
|
|
51
|
+
"expand",
|
|
52
|
+
"oob",
|
|
53
|
+
"naValue",
|
|
54
|
+
"minorBreaks",
|
|
55
|
+
"parse",
|
|
56
|
+
"parseFailure",
|
|
57
|
+
"timezone",
|
|
58
|
+
"disambiguation",
|
|
59
|
+
"dateBreaks",
|
|
60
|
+
"dateMinorBreaks",
|
|
61
|
+
"dateLabels",
|
|
62
|
+
"locale",
|
|
63
|
+
"weekStart",
|
|
64
|
+
"guide",
|
|
65
|
+
] as const;
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Per-helper classification: position families
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
type PositionFamily =
|
|
72
|
+
| "position-continuous"
|
|
73
|
+
| "position-binned"
|
|
74
|
+
| "position-temporal"
|
|
75
|
+
| "position-discrete";
|
|
76
|
+
|
|
77
|
+
export function classifyPositionHelper(helper: string, family: PositionFamily): HelperMeta {
|
|
78
|
+
const aes = aestheticFromHelper(helper);
|
|
79
|
+
|
|
80
|
+
// --- position -----------------------------------------------------------
|
|
81
|
+
if (family === "position-continuous" || family === "position-binned") {
|
|
82
|
+
const posParams = paramDocsFromSchema("PositionScaleSpec", POSITION_CONTINUOUS_KEYS);
|
|
83
|
+
if (helper.includes("Log10")) {
|
|
84
|
+
return {
|
|
85
|
+
optionsType: "TransformedPositionScaleOptions",
|
|
86
|
+
scaleType: "linear",
|
|
87
|
+
transform: "log10",
|
|
88
|
+
params: withLimits(paramDocsFromSchema("PositionScaleSpec", POSITION_TRANSFORMED_KEYS)),
|
|
89
|
+
guide: guideFor(aes, "linear"),
|
|
90
|
+
summary: `Base-10 log ${aes} position scale (pre-stat log10 transform on a linear scale).`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (helper.includes("Sqrt")) {
|
|
94
|
+
return {
|
|
95
|
+
optionsType: "TransformedPositionScaleOptions",
|
|
96
|
+
scaleType: "linear",
|
|
97
|
+
transform: "sqrt",
|
|
98
|
+
params: withLimits(paramDocsFromSchema("PositionScaleSpec", POSITION_TRANSFORMED_KEYS)),
|
|
99
|
+
guide: guideFor(aes, "linear"),
|
|
100
|
+
summary: `Square-root ${aes} position scale (pre-stat sqrt transform on a linear scale).`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (helper.includes("Reverse")) {
|
|
104
|
+
return {
|
|
105
|
+
optionsType: 'Omit<ContinuousPositionScaleOptions, "transform" | "reverse">',
|
|
106
|
+
scaleType: "linear",
|
|
107
|
+
params: withLimits(
|
|
108
|
+
paramDocsFromSchema(
|
|
109
|
+
"PositionScaleSpec",
|
|
110
|
+
POSITION_CONTINUOUS_KEYS.filter((k) => k !== "transform" && k !== "reverse"),
|
|
111
|
+
),
|
|
112
|
+
),
|
|
113
|
+
guide: guideFor(aes, "linear"),
|
|
114
|
+
summary: `Continuous ${aes} position scale with reverse: true (output direction flipped).`,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (family === "position-binned" || helper.includes("Binned")) {
|
|
118
|
+
return {
|
|
119
|
+
optionsType: "ContinuousPositionScaleOptions",
|
|
120
|
+
scaleType: "binned",
|
|
121
|
+
params: withLimits(posParams),
|
|
122
|
+
guide: guideFor(aes, "binned"),
|
|
123
|
+
summary: `Binned ${aes} position scale: quantitative values map to ordered bins (breaks are bin boundaries).`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
optionsType: "ContinuousPositionScaleOptions",
|
|
128
|
+
scaleType: "linear",
|
|
129
|
+
params: withLimits(posParams),
|
|
130
|
+
guide: guideFor(aes, "linear"),
|
|
131
|
+
summary: `Continuous linear ${aes} position scale (default numeric family).`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (family === "position-temporal") {
|
|
136
|
+
let temporalKind = "date";
|
|
137
|
+
if (helper.includes("Datetime")) temporalKind = "datetime";
|
|
138
|
+
else if (helper.includes("Time") && !helper.includes("Date")) temporalKind = "time";
|
|
139
|
+
else if (helper.includes("MonthDay")) temporalKind = "monthDay";
|
|
140
|
+
const label =
|
|
141
|
+
temporalKind === "monthDay"
|
|
142
|
+
? "month-day (year collapsed)"
|
|
143
|
+
: temporalKind === "time"
|
|
144
|
+
? "time-of-day"
|
|
145
|
+
: temporalKind;
|
|
146
|
+
return {
|
|
147
|
+
optionsType: "TemporalScaleOptions",
|
|
148
|
+
scaleType: "time",
|
|
149
|
+
temporalKind,
|
|
150
|
+
params: paramDocsFromSchema("PositionScaleSpec", POSITION_TEMPORAL_KEYS),
|
|
151
|
+
guide: guideFor(aes, "time"),
|
|
152
|
+
summary: `Temporal ${aes} position scale (${label}).`,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Remaining position family: discrete (band).
|
|
157
|
+
return {
|
|
158
|
+
optionsType: "DiscretePositionScaleOptions",
|
|
159
|
+
scaleType: "band",
|
|
160
|
+
params: paramDocsFromSchema("PositionScaleSpec", POSITION_DISCRETE_KEYS),
|
|
161
|
+
guide: guideFor(aes, "band"),
|
|
162
|
+
summary: `Discrete (band) ${aes} position scale for categories.`,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style-family classification for the SCALE_REFERENCE builder (gen-only):
|
|
3
|
+
* numeric style channels (size/linewidth/alpha) and finite style channels
|
|
4
|
+
* (shape/linetype).
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
aestheticFromHelper,
|
|
8
|
+
guideFor,
|
|
9
|
+
paramDocsFromSchema,
|
|
10
|
+
styleSchemaFor,
|
|
11
|
+
sugarParam,
|
|
12
|
+
withValues,
|
|
13
|
+
type HelperMeta,
|
|
14
|
+
} from "./scale-reference-classify-support.js";
|
|
15
|
+
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Param key sets per options family (mirrors helper option Pick/Omit types)
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
const STYLE_SEQUENTIAL_KEYS = [
|
|
21
|
+
"domain",
|
|
22
|
+
"breaks",
|
|
23
|
+
"range",
|
|
24
|
+
"reverse",
|
|
25
|
+
"oob",
|
|
26
|
+
"naValue",
|
|
27
|
+
"unknownValue",
|
|
28
|
+
"labels",
|
|
29
|
+
"guide",
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
const STYLE_DISCRETE_KEYS = [
|
|
33
|
+
"domain",
|
|
34
|
+
"domainMode",
|
|
35
|
+
"range",
|
|
36
|
+
"reverse",
|
|
37
|
+
"naValue",
|
|
38
|
+
"unknownValue",
|
|
39
|
+
"onExhaust",
|
|
40
|
+
"guide",
|
|
41
|
+
] as const;
|
|
42
|
+
|
|
43
|
+
const STYLE_MANUAL_KEYS = ["domain", "naValue", "unknownValue", "guide"] as const;
|
|
44
|
+
const STYLE_IDENTITY_KEYS = ["naValue", "unknownValue", "guide"] as const;
|
|
45
|
+
|
|
46
|
+
const FINITE_DISCRETE_KEYS = [
|
|
47
|
+
"domain",
|
|
48
|
+
"domainMode",
|
|
49
|
+
"range",
|
|
50
|
+
"reverse",
|
|
51
|
+
"naValue",
|
|
52
|
+
"unknownValue",
|
|
53
|
+
"onExhaust",
|
|
54
|
+
"guide",
|
|
55
|
+
] as const;
|
|
56
|
+
|
|
57
|
+
const FINITE_BINNED_KEYS = [
|
|
58
|
+
"domain",
|
|
59
|
+
"breaks",
|
|
60
|
+
"range",
|
|
61
|
+
"reverse",
|
|
62
|
+
"naValue",
|
|
63
|
+
"unknownValue",
|
|
64
|
+
"labels",
|
|
65
|
+
"guide",
|
|
66
|
+
] as const;
|
|
67
|
+
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// Per-helper classification: numeric style / finite style
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
|
|
72
|
+
type StyleFamily = "numeric-style" | "finite-style";
|
|
73
|
+
|
|
74
|
+
export function classifyStyleHelper(helper: string, family: StyleFamily): HelperMeta {
|
|
75
|
+
return family === "numeric-style"
|
|
76
|
+
? classifyNumericStyleHelper(helper)
|
|
77
|
+
: classifyFiniteStyleHelper(helper);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function classifyNumericStyleHelper(helper: string): HelperMeta {
|
|
81
|
+
const aes = aestheticFromHelper(helper);
|
|
82
|
+
const decl = styleSchemaFor(aes);
|
|
83
|
+
if (helper === "scaleSizeArea" || helper === "scaleSizeBinnedArea") {
|
|
84
|
+
const binned = helper.includes("Binned");
|
|
85
|
+
return {
|
|
86
|
+
optionsType: "SizeAreaScaleOptions",
|
|
87
|
+
scaleType: binned ? "binned" : "sequential",
|
|
88
|
+
params: [
|
|
89
|
+
...paramDocsFromSchema(decl, STYLE_SEQUENTIAL_KEYS),
|
|
90
|
+
sugarParam(
|
|
91
|
+
"maxSize",
|
|
92
|
+
"number",
|
|
93
|
+
"Maximum area-mapped size (ggplot2 scale_size_area max_size).",
|
|
94
|
+
),
|
|
95
|
+
],
|
|
96
|
+
guide: guideFor(aes, binned ? "binned" : "sequential"),
|
|
97
|
+
summary: binned
|
|
98
|
+
? "Binned size scale with area mapping (zero maps to zero area)."
|
|
99
|
+
: "Continuous size scale with area mapping (zero maps to zero area).",
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (helper === "scaleRadius") {
|
|
103
|
+
return {
|
|
104
|
+
optionsType: "SequentialStyleScaleOptions",
|
|
105
|
+
scaleType: "sequential",
|
|
106
|
+
params: paramDocsFromSchema(decl, STYLE_SEQUENTIAL_KEYS),
|
|
107
|
+
guide: guideFor("size", "sequential"),
|
|
108
|
+
summary: "Continuous size scale with radius (linear) mapping instead of area.",
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (helper.includes("Discrete") || helper.includes("Ordinal")) {
|
|
112
|
+
return {
|
|
113
|
+
optionsType: "DiscreteNumericStyleScaleOptions",
|
|
114
|
+
scaleType: "ordinal",
|
|
115
|
+
params: paramDocsFromSchema(decl, STYLE_DISCRETE_KEYS),
|
|
116
|
+
guide: guideFor(aes, "ordinal"),
|
|
117
|
+
summary: `Discrete ${aes} scale for categories (ordinal).`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (helper.includes("Manual")) {
|
|
121
|
+
return {
|
|
122
|
+
optionsType: "ManualNumericStyleScaleOptions",
|
|
123
|
+
scaleType: "manual",
|
|
124
|
+
params: withValues(
|
|
125
|
+
paramDocsFromSchema(decl, STYLE_MANUAL_KEYS),
|
|
126
|
+
"number[]",
|
|
127
|
+
"Numeric range values paired with domain (required).",
|
|
128
|
+
),
|
|
129
|
+
guide: guideFor(aes, "manual"),
|
|
130
|
+
summary: `Manual ${aes} mapping: domain values paired with explicit numbers.`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (helper.includes("Identity")) {
|
|
134
|
+
return {
|
|
135
|
+
optionsType: "IdentityNumericStyleScaleOptions",
|
|
136
|
+
scaleType: "identity",
|
|
137
|
+
params: paramDocsFromSchema(decl, STYLE_IDENTITY_KEYS),
|
|
138
|
+
guide: guideFor(aes, "identity"),
|
|
139
|
+
summary: `Identity ${aes} scale: source numbers used as mapped style values.`,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (helper.includes("Datetime")) {
|
|
143
|
+
return {
|
|
144
|
+
optionsType: "TemporalNumericStyleScaleOptions",
|
|
145
|
+
scaleType: "sequential",
|
|
146
|
+
temporalKind: "datetime",
|
|
147
|
+
params: paramDocsFromSchema(decl, STYLE_SEQUENTIAL_KEYS),
|
|
148
|
+
guide: guideFor(aes, "sequential"),
|
|
149
|
+
summary: `Sequential ${aes} scale trained on datetime values.`,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (helper.includes("Date")) {
|
|
153
|
+
return {
|
|
154
|
+
optionsType: "TemporalNumericStyleScaleOptions",
|
|
155
|
+
scaleType: "sequential",
|
|
156
|
+
temporalKind: "date",
|
|
157
|
+
params: paramDocsFromSchema(decl, STYLE_SEQUENTIAL_KEYS),
|
|
158
|
+
guide: guideFor(aes, "sequential"),
|
|
159
|
+
summary: `Sequential ${aes} scale trained on calendar dates.`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (helper.includes("Binned")) {
|
|
163
|
+
return {
|
|
164
|
+
optionsType: "SequentialStyleScaleOptions",
|
|
165
|
+
scaleType: "binned",
|
|
166
|
+
params: paramDocsFromSchema(decl, STYLE_SEQUENTIAL_KEYS),
|
|
167
|
+
guide: guideFor(aes, "binned"),
|
|
168
|
+
summary: `Binned ${aes} scale: continuous values → stepped numeric style.`,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (helper.includes("Continuous")) {
|
|
172
|
+
return {
|
|
173
|
+
optionsType: "SequentialStyleScaleOptions",
|
|
174
|
+
scaleType: "sequential",
|
|
175
|
+
params: paramDocsFromSchema(decl, STYLE_SEQUENTIAL_KEYS),
|
|
176
|
+
guide: guideFor(aes, "sequential"),
|
|
177
|
+
summary: `Continuous sequential ${aes} scale.`,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
throw new Error(`SCALE_REFERENCE: unhandled numeric-style helper "${helper}"`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function classifyFiniteStyleHelper(helper: string): HelperMeta {
|
|
184
|
+
const aes = aestheticFromHelper(helper);
|
|
185
|
+
const decl = styleSchemaFor(aes);
|
|
186
|
+
const output =
|
|
187
|
+
aes === "shape" ? "PointShapeName" : aes === "linetype" ? "LinetypeName" : "string";
|
|
188
|
+
if (helper.includes("Discrete") || helper.includes("Ordinal")) {
|
|
189
|
+
return {
|
|
190
|
+
optionsType: `DiscreteFiniteStyleScaleOptions<${output}>`,
|
|
191
|
+
scaleType: "ordinal",
|
|
192
|
+
params: paramDocsFromSchema(decl, FINITE_DISCRETE_KEYS),
|
|
193
|
+
guide: guideFor(aes, "ordinal"),
|
|
194
|
+
summary: `Discrete ${aes} scale for categories (named symbols).`,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
if (helper.includes("Binned")) {
|
|
198
|
+
return {
|
|
199
|
+
optionsType: `BinnedFiniteStyleScaleOptions<${output}>`,
|
|
200
|
+
scaleType: "binned",
|
|
201
|
+
params: paramDocsFromSchema(decl, FINITE_BINNED_KEYS),
|
|
202
|
+
guide: guideFor(aes, "binned"),
|
|
203
|
+
summary: `Binned ${aes} scale: continuous values → finite named symbols.`,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
if (helper.includes("Manual")) {
|
|
207
|
+
return {
|
|
208
|
+
optionsType: `ManualFiniteStyleScaleOptions<${output}>`,
|
|
209
|
+
scaleType: "manual",
|
|
210
|
+
params: withValues(
|
|
211
|
+
paramDocsFromSchema(decl, STYLE_MANUAL_KEYS),
|
|
212
|
+
`${output}[]`,
|
|
213
|
+
"Named symbols paired with domain (required).",
|
|
214
|
+
),
|
|
215
|
+
guide: guideFor(aes, "manual"),
|
|
216
|
+
summary: `Manual ${aes} mapping: domain values paired with named symbols.`,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
if (helper.includes("Identity")) {
|
|
220
|
+
return {
|
|
221
|
+
optionsType: `IdentityFiniteStyleScaleOptions<${output}>`,
|
|
222
|
+
scaleType: "identity",
|
|
223
|
+
params: paramDocsFromSchema(decl, STYLE_IDENTITY_KEYS),
|
|
224
|
+
guide: guideFor(aes, "identity"),
|
|
225
|
+
summary: `Identity ${aes} scale: source names used as mapped symbols.`,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
throw new Error(`SCALE_REFERENCE: unhandled finite-style helper "${helper}"`);
|
|
229
|
+
}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared classification machinery for the SCALE_REFERENCE builder (gen-only):
|
|
3
|
+
* public scale types, schema walkers, param-doc sugar, and per-helper
|
|
4
|
+
* lookups. Family classifiers live in scale-reference-classify-*.ts.
|
|
5
|
+
*/
|
|
6
|
+
import type { ScaleCapability } from "./capabilities.js";
|
|
7
|
+
import { SpecDeclarations } from "./schema-declarations.js";
|
|
8
|
+
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Public types
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
export interface ScaleParamDoc {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly typeSummary: string;
|
|
17
|
+
readonly required: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ScaleFamily = ScaleCapability["family"];
|
|
21
|
+
|
|
22
|
+
/** Canonical aesthetic channel(s) this Scale* component configures. */
|
|
23
|
+
export type ScaleAesthetic =
|
|
24
|
+
| "x"
|
|
25
|
+
| "y"
|
|
26
|
+
| "color"
|
|
27
|
+
| "fill"
|
|
28
|
+
| "size"
|
|
29
|
+
| "linewidth"
|
|
30
|
+
| "alpha"
|
|
31
|
+
| "shape"
|
|
32
|
+
| "linetype";
|
|
33
|
+
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Schema walkers (param docs)
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
39
|
+
return typeof value === "object" && value !== null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function descriptionOf(node: unknown): string {
|
|
43
|
+
if (!isRecord(node)) return "";
|
|
44
|
+
const d = node["description"];
|
|
45
|
+
return typeof d === "string" ? d : "";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function typeSummaryOf(node: unknown, depth = 0): string {
|
|
49
|
+
if (!isRecord(node) || depth > 8) return "unknown";
|
|
50
|
+
const ref = node["$ref"];
|
|
51
|
+
if (typeof ref === "string") return ref;
|
|
52
|
+
if (typeof node["const"] === "string" || typeof node["const"] === "number") {
|
|
53
|
+
return JSON.stringify(node["const"]);
|
|
54
|
+
}
|
|
55
|
+
const anyOf = node["anyOf"];
|
|
56
|
+
if (Array.isArray(anyOf)) {
|
|
57
|
+
const parts = anyOf.map((branch) => typeSummaryOf(branch, depth + 1));
|
|
58
|
+
if (parts.every((p) => p.startsWith('"') || p.startsWith("'") || /^-?\d/.test(p))) {
|
|
59
|
+
return [...new Set(parts)].join(" | ");
|
|
60
|
+
}
|
|
61
|
+
return parts.join(" | ");
|
|
62
|
+
}
|
|
63
|
+
const type = node["type"];
|
|
64
|
+
if (type === "number" || type === "integer") return type === "integer" ? "integer" : "number";
|
|
65
|
+
if (type === "string") return "string";
|
|
66
|
+
if (type === "boolean") return "boolean";
|
|
67
|
+
if (type === "array") {
|
|
68
|
+
const items = node["items"];
|
|
69
|
+
return `Array<${typeSummaryOf(items, depth + 1)}>`;
|
|
70
|
+
}
|
|
71
|
+
if (type === "object") return "object";
|
|
72
|
+
if (Array.isArray(type)) {
|
|
73
|
+
return type.filter((t) => t !== "null").join(" | ") || "unknown";
|
|
74
|
+
}
|
|
75
|
+
return "unknown";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function propertiesOf(declName: keyof typeof SpecDeclarations): Record<string, unknown> {
|
|
79
|
+
const schema: unknown = SpecDeclarations[declName];
|
|
80
|
+
if (!isRecord(schema)) {
|
|
81
|
+
throw new Error(`SCALE_REFERENCE: SpecDeclarations.${declName} is not an object`);
|
|
82
|
+
}
|
|
83
|
+
// Intersect schemas put properties on allOf[0].properties
|
|
84
|
+
const direct = schema["properties"];
|
|
85
|
+
if (isRecord(direct)) return direct;
|
|
86
|
+
const allOf = schema["allOf"];
|
|
87
|
+
if (Array.isArray(allOf)) {
|
|
88
|
+
for (const branch of allOf) {
|
|
89
|
+
if (isRecord(branch) && isRecord(branch["properties"])) {
|
|
90
|
+
return branch["properties"];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`SCALE_REFERENCE: SpecDeclarations.${declName} has no properties`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Fallback prose when a schema node has no description (shared style fields). */
|
|
98
|
+
const PARAM_DESCRIPTION_FALLBACKS: Readonly<Record<string, string>> = Object.freeze({
|
|
99
|
+
domain:
|
|
100
|
+
"Explicit semantic domain. Continuous scales use [min, max]; ordinal uses ordered values.",
|
|
101
|
+
domainMode:
|
|
102
|
+
'Ordinal domain stability: "grow" (default) preserves assignments across filters; "data" rebuilds from current data.',
|
|
103
|
+
breaks: "Explicit reference ticks or bin boundaries in data units.",
|
|
104
|
+
range: "Explicit output range for the mapped aesthetic.",
|
|
105
|
+
reverse: "Reverse the scale's output direction. Default false.",
|
|
106
|
+
oob: 'Out-of-bounds policy for values outside an explicit domain: "censor" (default) or "squish".',
|
|
107
|
+
naValue: "Replacement for missing/null source values.",
|
|
108
|
+
unknownValue: "Replacement for invalid, out-of-domain, or unmapped values.",
|
|
109
|
+
onExhaust: 'Ordinal palette exhaustion policy: "cycle" (default) with a warning, or "error".',
|
|
110
|
+
labels: "Guide label format string (numeric or temporal).",
|
|
111
|
+
guide: "Guide presentation override (legend, colorbar, colorsteps, or none).",
|
|
112
|
+
transform: 'Pre-training quantitative transform: "identity" (default), "log10", or "sqrt".',
|
|
113
|
+
scheme: "Named color scheme (categorical or sequential family).",
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export function paramDocsFromSchema(
|
|
117
|
+
declName: keyof typeof SpecDeclarations,
|
|
118
|
+
keys: readonly string[],
|
|
119
|
+
): ScaleParamDoc[] {
|
|
120
|
+
const props = propertiesOf(declName);
|
|
121
|
+
const docs: ScaleParamDoc[] = [];
|
|
122
|
+
for (const name of keys) {
|
|
123
|
+
const prop = props[name];
|
|
124
|
+
if (prop === undefined) {
|
|
125
|
+
throw new Error(`SCALE_REFERENCE: ${declName} missing property "${name}"`);
|
|
126
|
+
}
|
|
127
|
+
const fromSchema = descriptionOf(prop).trim();
|
|
128
|
+
const description =
|
|
129
|
+
fromSchema === ""
|
|
130
|
+
? (PARAM_DESCRIPTION_FALLBACKS[name] ?? `Authoring option \`${name}\` for this scale.`)
|
|
131
|
+
: fromSchema;
|
|
132
|
+
docs.push({
|
|
133
|
+
name,
|
|
134
|
+
description,
|
|
135
|
+
typeSummary: typeSummaryOf(prop),
|
|
136
|
+
required: false,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return docs;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function sugarParam(
|
|
143
|
+
name: string,
|
|
144
|
+
typeSummary: string,
|
|
145
|
+
description: string,
|
|
146
|
+
required = false,
|
|
147
|
+
): ScaleParamDoc {
|
|
148
|
+
return { name, typeSummary, description, required };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// Per-helper classification lookups
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
export interface HelperMeta {
|
|
156
|
+
optionsType: string;
|
|
157
|
+
scaleType: string;
|
|
158
|
+
transform?: "log10" | "sqrt";
|
|
159
|
+
temporalKind?: string;
|
|
160
|
+
params: readonly ScaleParamDoc[];
|
|
161
|
+
guide: string;
|
|
162
|
+
summary: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function aestheticFromHelper(helper: string): ScaleAesthetic {
|
|
166
|
+
if (helper.startsWith("scaleX")) return "x";
|
|
167
|
+
if (helper.startsWith("scaleY")) return "y";
|
|
168
|
+
if (helper.startsWith("scaleColor") || helper.startsWith("scaleColour")) return "color";
|
|
169
|
+
if (helper.startsWith("scaleFill")) return "fill";
|
|
170
|
+
if (helper.startsWith("scaleSize") || helper === "scaleRadius") return "size";
|
|
171
|
+
if (helper.startsWith("scaleLinewidth")) return "linewidth";
|
|
172
|
+
if (helper.startsWith("scaleAlpha")) return "alpha";
|
|
173
|
+
if (helper.startsWith("scaleShape")) return "shape";
|
|
174
|
+
if (helper.startsWith("scaleLinetype")) return "linetype";
|
|
175
|
+
throw new Error(`SCALE_REFERENCE: cannot derive aesthetic from "${helper}"`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function styleSchemaFor(aes: ScaleAesthetic): keyof typeof SpecDeclarations {
|
|
179
|
+
if (aes === "alpha") return "AlphaScaleSpec";
|
|
180
|
+
if (aes === "shape") return "ShapeScaleSpec";
|
|
181
|
+
if (aes === "linetype") return "LinetypeScaleSpec";
|
|
182
|
+
if (aes === "size" || aes === "linewidth") return "PositiveStyleScaleSpec";
|
|
183
|
+
throw new Error(`SCALE_REFERENCE: no style schema for aesthetic ${aes}`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function guideFor(aes: ScaleAesthetic, scaleType: string): string {
|
|
187
|
+
if (aes === "x" || aes === "y") {
|
|
188
|
+
return 'Axis guide on the position channel (band axis guide when type is band). Set guide to customize ticks/labels or guide: "none" to hide.';
|
|
189
|
+
}
|
|
190
|
+
if (aes === "color" || aes === "fill") {
|
|
191
|
+
if (scaleType === "sequential") {
|
|
192
|
+
return 'Colorbar guide by default for continuous ramps. Use guide helpers or guide: "none" to suppress.';
|
|
193
|
+
}
|
|
194
|
+
if (scaleType === "binned") {
|
|
195
|
+
return 'Colorsteps guide by default for binned color. Use guide helpers or guide: "none" to suppress.';
|
|
196
|
+
}
|
|
197
|
+
return 'Legend guide for discrete/manual/identity color. Set guide: "none" to hide.';
|
|
198
|
+
}
|
|
199
|
+
return 'Legend guide for the mapped style channel. Set guide: "none" to hide.';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function withLimits(base: ScaleParamDoc[]): ScaleParamDoc[] {
|
|
203
|
+
return [
|
|
204
|
+
sugarParam(
|
|
205
|
+
"limits",
|
|
206
|
+
"DomainValue[]",
|
|
207
|
+
"Pin the scale to [min, max] in source units (authoring sugar for domain). Supplying both limits and domain throws.",
|
|
208
|
+
),
|
|
209
|
+
...base,
|
|
210
|
+
];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export function withValues(
|
|
214
|
+
base: ScaleParamDoc[],
|
|
215
|
+
typeSummary: string,
|
|
216
|
+
description: string,
|
|
217
|
+
): ScaleParamDoc[] {
|
|
218
|
+
return [...base, sugarParam("values", typeSummary, description, true)];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function withPaletteDirection(base: ScaleParamDoc[]): ScaleParamDoc[] {
|
|
222
|
+
return [
|
|
223
|
+
...base,
|
|
224
|
+
sugarParam(
|
|
225
|
+
"palette",
|
|
226
|
+
"string",
|
|
227
|
+
"Named palette (ColorBrewer / distiller / fermenter family). Maps onto scheme.",
|
|
228
|
+
),
|
|
229
|
+
sugarParam("direction", "1 | -1", "Palette direction: 1 (default) or -1 (reverse)."),
|
|
230
|
+
];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function withGradientStops(
|
|
234
|
+
base: ScaleParamDoc[],
|
|
235
|
+
kind: "2" | "n" | "steps" | "steps2" | "stepsn",
|
|
236
|
+
): ScaleParamDoc[] {
|
|
237
|
+
const extra: ScaleParamDoc[] = [];
|
|
238
|
+
if (kind === "2" || kind === "steps2") {
|
|
239
|
+
extra.push(
|
|
240
|
+
sugarParam("low", "string", "Low-end #rgb/#rrggbb color."),
|
|
241
|
+
sugarParam("mid", "string", "Midpoint #rgb/#rrggbb color."),
|
|
242
|
+
sugarParam("high", "string", "High-end #rgb/#rrggbb color."),
|
|
243
|
+
sugarParam(
|
|
244
|
+
"midpoint",
|
|
245
|
+
"number",
|
|
246
|
+
"Data value mapped to mid (default 0 for diverging helpers).",
|
|
247
|
+
),
|
|
248
|
+
);
|
|
249
|
+
} else if (kind === "n" || kind === "stepsn") {
|
|
250
|
+
extra.push(
|
|
251
|
+
sugarParam(
|
|
252
|
+
"colours",
|
|
253
|
+
"string[]",
|
|
254
|
+
"Ordered #rgb/#rrggbb stops (British spelling alias of colors).",
|
|
255
|
+
),
|
|
256
|
+
sugarParam("colors", "string[]", "Ordered #rgb/#rrggbb stops."),
|
|
257
|
+
sugarParam(
|
|
258
|
+
"values",
|
|
259
|
+
"number[]",
|
|
260
|
+
"Optional stop positions in [0, 1] (or data units for some helpers).",
|
|
261
|
+
),
|
|
262
|
+
);
|
|
263
|
+
} else {
|
|
264
|
+
extra.push(
|
|
265
|
+
sugarParam("low", "string", "Low-end #rgb/#rrggbb color."),
|
|
266
|
+
sugarParam("high", "string", "High-end #rgb/#rrggbb color."),
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
return [...base.filter((p) => p.name !== "scheme" && p.name !== "range"), ...extra];
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function withViridisOption(base: ScaleParamDoc[]): ScaleParamDoc[] {
|
|
273
|
+
return [
|
|
274
|
+
sugarParam(
|
|
275
|
+
"option",
|
|
276
|
+
'"viridis" | "magma" | "plasma" | "inferno" | "cividis" | "turbo"',
|
|
277
|
+
"Viridis family option (default viridis).",
|
|
278
|
+
),
|
|
279
|
+
...base.filter((p) => p.name !== "scheme"),
|
|
280
|
+
];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function withHueGrey(base: ScaleParamDoc[], kind: "hue" | "grey"): ScaleParamDoc[] {
|
|
284
|
+
if (kind === "hue") {
|
|
285
|
+
return [
|
|
286
|
+
...base.filter((p) => p.name !== "scheme" && p.name !== "range"),
|
|
287
|
+
sugarParam("h", "[number, number]", "Hue range in degrees (ggplot2 scale_colour_hue)."),
|
|
288
|
+
sugarParam("c", "number", "Chroma."),
|
|
289
|
+
sugarParam("l", "number", "Luminance."),
|
|
290
|
+
sugarParam("direction", "1 | -1", "Wheel direction."),
|
|
291
|
+
];
|
|
292
|
+
}
|
|
293
|
+
return [
|
|
294
|
+
...base.filter((p) => p.name !== "scheme" && p.name !== "range"),
|
|
295
|
+
sugarParam("start", "number", "Grey start (0–1)."),
|
|
296
|
+
sugarParam("end", "number", "Grey end (0–1)."),
|
|
297
|
+
];
|
|
298
|
+
}
|