@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,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic non-position color/fill scale helpers + ColorBrewer (#825) +
|
|
3
|
+
* configuredColorScaleType. Palette families live in sibling modules:
|
|
4
|
+
* scale-color-viridis.ts, scale-color-stops.ts (gradient + steps),
|
|
5
|
+
* scale-color-hue-grey.ts. Facade re-exports: scale-helpers.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { SEQUENTIAL_SCHEME_NAMES } from "./schema-names.js";
|
|
8
|
+
const SEQUENTIAL_SCHEMES = new Set(SEQUENTIAL_SCHEME_NAMES);
|
|
9
|
+
/** Resolve family intent encoded by family-specific options before data inference. */
|
|
10
|
+
export function configuredColorScaleType(config) {
|
|
11
|
+
if (config === undefined)
|
|
12
|
+
return undefined;
|
|
13
|
+
if (config.type !== undefined)
|
|
14
|
+
return config.type;
|
|
15
|
+
if (config.scheme !== undefined && config.range === undefined) {
|
|
16
|
+
return SEQUENTIAL_SCHEMES.has(config.scheme) ? "sequential" : "ordinal";
|
|
17
|
+
}
|
|
18
|
+
const sequentialOptions = [
|
|
19
|
+
config.transform,
|
|
20
|
+
config.temporalKind,
|
|
21
|
+
config.parse,
|
|
22
|
+
config.parseFailure,
|
|
23
|
+
config.timezone,
|
|
24
|
+
config.disambiguation,
|
|
25
|
+
config.breaks,
|
|
26
|
+
config.oob,
|
|
27
|
+
config.labels,
|
|
28
|
+
];
|
|
29
|
+
if (sequentialOptions.some((value) => value !== undefined)) {
|
|
30
|
+
return "sequential";
|
|
31
|
+
}
|
|
32
|
+
if (config.domainMode !== undefined || config.onExhaust !== undefined)
|
|
33
|
+
return "ordinal";
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Shared PortableSpec builder for color/fill scale helpers (sibling modules). */
|
|
37
|
+
export function colorScale(aesthetic, type, options = {}, forced = {}) {
|
|
38
|
+
return {
|
|
39
|
+
[aesthetic]: {
|
|
40
|
+
type,
|
|
41
|
+
...options,
|
|
42
|
+
...(forced.transform !== undefined && { transform: forced.transform }),
|
|
43
|
+
...(forced.temporalKind !== undefined && { temporalKind: forced.temporalKind }),
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function manualColorScale(aesthetic, options) {
|
|
48
|
+
const { values, ...rest } = options;
|
|
49
|
+
return colorScale(aesthetic, "manual", { ...rest, range: [...values] });
|
|
50
|
+
}
|
|
51
|
+
// Color/colour helpers share function identity. American camelCase is the
|
|
52
|
+
// TypeScript-primary spelling; British and snake_case names are exact aliases.
|
|
53
|
+
export function scaleColorContinuous(options = {}) {
|
|
54
|
+
return colorScale("color", "sequential", options);
|
|
55
|
+
}
|
|
56
|
+
export function scaleColorDiscrete(options = {}) {
|
|
57
|
+
return colorScale("color", "ordinal", options);
|
|
58
|
+
}
|
|
59
|
+
export function scaleColorBinned(options = {}) {
|
|
60
|
+
return colorScale("color", "binned", options);
|
|
61
|
+
}
|
|
62
|
+
export function scaleColorLog10(options = {}) {
|
|
63
|
+
return colorScale("color", "sequential", options, { transform: "log10" });
|
|
64
|
+
}
|
|
65
|
+
export function scaleColorSqrt(options = {}) {
|
|
66
|
+
return colorScale("color", "sequential", options, { transform: "sqrt" });
|
|
67
|
+
}
|
|
68
|
+
export function scaleColorDate(options = {}) {
|
|
69
|
+
return colorScale("color", "sequential", options, { temporalKind: "date" });
|
|
70
|
+
}
|
|
71
|
+
export function scaleColorDatetime(options = {}) {
|
|
72
|
+
return colorScale("color", "sequential", options, { temporalKind: "datetime" });
|
|
73
|
+
}
|
|
74
|
+
export function scaleColorManual(options) {
|
|
75
|
+
return manualColorScale("color", options);
|
|
76
|
+
}
|
|
77
|
+
export function scaleColorIdentity(options = {}) {
|
|
78
|
+
return colorScale("color", "identity", options);
|
|
79
|
+
}
|
|
80
|
+
function withBrewerPalette(options) {
|
|
81
|
+
const { palette, direction, scheme, reverse, ...rest } = options;
|
|
82
|
+
const resolvedScheme = palette ?? scheme;
|
|
83
|
+
return {
|
|
84
|
+
...rest,
|
|
85
|
+
...(resolvedScheme === undefined ? {} : { scheme: resolvedScheme }),
|
|
86
|
+
...(direction === -1 || reverse === true ? { reverse: true } : {}),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** ggplot2 `scale_color_brewer` — discrete ColorBrewer palette. */
|
|
90
|
+
export function scaleColorBrewer(options = {}) {
|
|
91
|
+
return colorScale("color", "ordinal", withBrewerPalette(options));
|
|
92
|
+
}
|
|
93
|
+
/** ggplot2 `scale_color_distiller` — continuous ColorBrewer ramp. */
|
|
94
|
+
export function scaleColorDistiller(options = {}) {
|
|
95
|
+
return colorScale("color", "sequential", withBrewerPalette(options));
|
|
96
|
+
}
|
|
97
|
+
/** ggplot2 `scale_color_fermenter` — binned ColorBrewer ramp. */
|
|
98
|
+
export function scaleColorFermenter(options = {}) {
|
|
99
|
+
return colorScale("color", "binned", withBrewerPalette(options));
|
|
100
|
+
}
|
|
101
|
+
export const scaleColourContinuous = scaleColorContinuous;
|
|
102
|
+
export const scaleColourDiscrete = scaleColorDiscrete;
|
|
103
|
+
export const scaleColourBinned = scaleColorBinned;
|
|
104
|
+
export const scaleColourLog10 = scaleColorLog10;
|
|
105
|
+
export const scaleColourSqrt = scaleColorSqrt;
|
|
106
|
+
export const scaleColourDate = scaleColorDate;
|
|
107
|
+
export const scaleColourDatetime = scaleColorDatetime;
|
|
108
|
+
export const scaleColourManual = scaleColorManual;
|
|
109
|
+
export const scaleColourIdentity = scaleColorIdentity;
|
|
110
|
+
export const scaleColourBrewer = scaleColorBrewer;
|
|
111
|
+
export const scaleColourDistiller = scaleColorDistiller;
|
|
112
|
+
export const scaleColourFermenter = scaleColorFermenter;
|
|
113
|
+
export const scale_color_continuous = scaleColorContinuous;
|
|
114
|
+
export const scale_color_discrete = scaleColorDiscrete;
|
|
115
|
+
export const scale_color_binned = scaleColorBinned;
|
|
116
|
+
export const scale_color_log10 = scaleColorLog10;
|
|
117
|
+
export const scale_color_sqrt = scaleColorSqrt;
|
|
118
|
+
export const scale_color_date = scaleColorDate;
|
|
119
|
+
export const scale_color_datetime = scaleColorDatetime;
|
|
120
|
+
export const scale_color_manual = scaleColorManual;
|
|
121
|
+
export const scale_color_identity = scaleColorIdentity;
|
|
122
|
+
export const scale_color_brewer = scaleColorBrewer;
|
|
123
|
+
export const scale_color_distiller = scaleColorDistiller;
|
|
124
|
+
export const scale_color_fermenter = scaleColorFermenter;
|
|
125
|
+
export const scale_colour_continuous = scaleColorContinuous;
|
|
126
|
+
export const scale_colour_discrete = scaleColorDiscrete;
|
|
127
|
+
export const scale_colour_binned = scaleColorBinned;
|
|
128
|
+
export const scale_colour_log10 = scaleColorLog10;
|
|
129
|
+
export const scale_colour_sqrt = scaleColorSqrt;
|
|
130
|
+
export const scale_colour_date = scaleColorDate;
|
|
131
|
+
export const scale_colour_datetime = scaleColorDatetime;
|
|
132
|
+
export const scale_colour_manual = scaleColorManual;
|
|
133
|
+
export const scale_colour_identity = scaleColorIdentity;
|
|
134
|
+
export const scale_colour_brewer = scaleColorBrewer;
|
|
135
|
+
export const scale_colour_distiller = scaleColorDistiller;
|
|
136
|
+
export const scale_colour_fermenter = scaleColorFermenter;
|
|
137
|
+
export function scaleFillContinuous(options = {}) {
|
|
138
|
+
return colorScale("fill", "sequential", options);
|
|
139
|
+
}
|
|
140
|
+
export function scaleFillDiscrete(options = {}) {
|
|
141
|
+
return colorScale("fill", "ordinal", options);
|
|
142
|
+
}
|
|
143
|
+
export function scaleFillBinned(options = {}) {
|
|
144
|
+
return colorScale("fill", "binned", options);
|
|
145
|
+
}
|
|
146
|
+
export function scaleFillLog10(options = {}) {
|
|
147
|
+
return colorScale("fill", "sequential", options, { transform: "log10" });
|
|
148
|
+
}
|
|
149
|
+
export function scaleFillSqrt(options = {}) {
|
|
150
|
+
return colorScale("fill", "sequential", options, { transform: "sqrt" });
|
|
151
|
+
}
|
|
152
|
+
export function scaleFillDate(options = {}) {
|
|
153
|
+
return colorScale("fill", "sequential", options, { temporalKind: "date" });
|
|
154
|
+
}
|
|
155
|
+
export function scaleFillDatetime(options = {}) {
|
|
156
|
+
return colorScale("fill", "sequential", options, { temporalKind: "datetime" });
|
|
157
|
+
}
|
|
158
|
+
export function scaleFillManual(options) {
|
|
159
|
+
return manualColorScale("fill", options);
|
|
160
|
+
}
|
|
161
|
+
export function scaleFillIdentity(options = {}) {
|
|
162
|
+
return colorScale("fill", "identity", options);
|
|
163
|
+
}
|
|
164
|
+
/** ggplot2 `scale_fill_brewer`. */
|
|
165
|
+
export function scaleFillBrewer(options = {}) {
|
|
166
|
+
return colorScale("fill", "ordinal", withBrewerPalette(options));
|
|
167
|
+
}
|
|
168
|
+
/** ggplot2 `scale_fill_distiller`. */
|
|
169
|
+
export function scaleFillDistiller(options = {}) {
|
|
170
|
+
return colorScale("fill", "sequential", withBrewerPalette(options));
|
|
171
|
+
}
|
|
172
|
+
/** ggplot2 `scale_fill_fermenter`. */
|
|
173
|
+
export function scaleFillFermenter(options = {}) {
|
|
174
|
+
return colorScale("fill", "binned", withBrewerPalette(options));
|
|
175
|
+
}
|
|
176
|
+
export const scale_fill_continuous = scaleFillContinuous;
|
|
177
|
+
export const scale_fill_discrete = scaleFillDiscrete;
|
|
178
|
+
export const scale_fill_binned = scaleFillBinned;
|
|
179
|
+
export const scale_fill_log10 = scaleFillLog10;
|
|
180
|
+
export const scale_fill_sqrt = scaleFillSqrt;
|
|
181
|
+
export const scale_fill_date = scaleFillDate;
|
|
182
|
+
export const scale_fill_datetime = scaleFillDatetime;
|
|
183
|
+
export const scale_fill_manual = scaleFillManual;
|
|
184
|
+
export const scale_fill_identity = scaleFillIdentity;
|
|
185
|
+
export const scale_fill_brewer = scaleFillBrewer;
|
|
186
|
+
export const scale_fill_distiller = scaleFillDistiller;
|
|
187
|
+
export const scale_fill_fermenter = scaleFillFermenter;
|
|
188
|
+
//# sourceMappingURL=scale-color-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-color-helpers.js","sourceRoot":"","sources":["../src/scale-color-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS,uBAAuB,CAAC,CAAC;AAEpE,sFAAsF;AACtF,MAAM,UAAU,wBAAwB,CACtC,MAAkC;IAElC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,IAAI,MAAM,C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AiB,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hue / grey / ordinal color/fill scale constructors (#829).
|
|
3
|
+
* Ordinal aliases bind to scaleColorDiscrete / scaleFillDiscrete (same identity).
|
|
4
|
+
*/
|
|
5
|
+
import type { Scales } from "./schema.js";
|
|
6
|
+
import { scaleColorDiscrete, scaleFillDiscrete, type DiscreteColorScaleOptions } from "./scale-color-helpers.js";
|
|
7
|
+
/** scale_*_hue options: discrete + optional HSL-ish h/c/l (bake range if set). */
|
|
8
|
+
export type HueScaleOptions = Omit<DiscreteColorScaleOptions, "scheme" | "range"> & {
|
|
9
|
+
/** Hue range in degrees [start, end). Default [15, 375). */
|
|
10
|
+
h?: readonly [number, number];
|
|
11
|
+
/** Chroma proxy 0–100 → HSL saturation. Default 100. */
|
|
12
|
+
c?: number;
|
|
13
|
+
/** Lightness 0–100. Default 65. */
|
|
14
|
+
l?: number;
|
|
15
|
+
};
|
|
16
|
+
/** scale_*_grey / gray options. */
|
|
17
|
+
export type GreyScaleOptions = Omit<DiscreteColorScaleOptions, "scheme" | "range"> & {
|
|
18
|
+
/** Lightness start in [0, 1]. Default 0.2. */
|
|
19
|
+
start?: number;
|
|
20
|
+
/** Lightness end in [0, 1]. Default 0.8. */
|
|
21
|
+
end?: number;
|
|
22
|
+
};
|
|
23
|
+
export type OrdinalColorScaleOptions = DiscreteColorScaleOptions;
|
|
24
|
+
export declare function scaleColorHue(options?: HueScaleOptions): Scales;
|
|
25
|
+
export declare function scaleColorGrey(options?: GreyScaleOptions): Scales;
|
|
26
|
+
/** Binding-identical American spelling of scaleColorGrey. */
|
|
27
|
+
export declare const scaleColorGray: typeof scaleColorGrey;
|
|
28
|
+
/** Binding-identical alias of scaleColorDiscrete (ggplot2 scale_*_ordinal). */
|
|
29
|
+
export declare const scaleColorOrdinal: typeof scaleColorDiscrete;
|
|
30
|
+
export declare function scaleFillHue(options?: HueScaleOptions): Scales;
|
|
31
|
+
export declare function scaleFillGrey(options?: GreyScaleOptions): Scales;
|
|
32
|
+
/** Binding-identical American spelling of scaleFillGrey. */
|
|
33
|
+
export declare const scaleFillGray: typeof scaleFillGrey;
|
|
34
|
+
/** Binding-identical alias of scaleFillDiscrete. */
|
|
35
|
+
export declare const scaleFillOrdinal: typeof scaleFillDiscrete;
|
|
36
|
+
export declare const scaleColourHue: typeof scaleColorHue;
|
|
37
|
+
export declare const scaleColourGrey: typeof scaleColorGrey;
|
|
38
|
+
export declare const scaleColourGray: typeof scaleColorGrey;
|
|
39
|
+
export declare const scaleColourOrdinal: typeof scaleColorDiscrete;
|
|
40
|
+
export declare const scale_color_hue: typeof scaleColorHue;
|
|
41
|
+
export declare const scale_color_grey: typeof scaleColorGrey;
|
|
42
|
+
export declare const scale_color_gray: typeof scaleColorGrey;
|
|
43
|
+
export declare const scale_color_ordinal: typeof scaleColorDiscrete;
|
|
44
|
+
export declare const scale_colour_hue: typeof scaleColorHue;
|
|
45
|
+
export declare const scale_colour_grey: typeof scaleColorGrey;
|
|
46
|
+
export declare const scale_colour_gray: typeof scaleColorGrey;
|
|
47
|
+
export declare const scale_colour_ordinal: typeof scaleColorDiscrete;
|
|
48
|
+
export declare const scale_fill_hue: typeof scaleFillHue;
|
|
49
|
+
export declare const scale_fill_grey: typeof scaleFillGrey;
|
|
50
|
+
export declare const scale_fill_gray: typeof scaleFillGrey;
|
|
51
|
+
export declare const scale_fill_ordinal: typeof scaleFillDiscrete;
|
|
52
|
+
//# sourceMappingURL=scale-color-hue-grey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-color-hue-grey.d.ts","sourceRoot":"","sources":["../src/scale-color-hue-grey.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAEL,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,yBAAyB,EAC/B,MAAM,0BAA0B,CAAC;AAKlC,kFAAkF;AAClF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG;IAClF,4DAA4D;IAC5D,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,wDAAwD;IACxD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,mCAAmC;AACnC,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,yBAAyB,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG;IACnF,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,CAAC;AAuBjE,wBAAgB,aAAa,CAAC,OAAO,GAAE,eAAoB,GAAG,MAAM,CAEnE;AACD,wBAAgB,cAAc,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAErE;AACD,6DAA6D;AAC7D,eAAO,MAAM,cAAc,uBAAiB,CAAC;AAC7C,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,2BAAqB,CAAC;AAEpD,wBAAgB,YAAY,CAAC,OAAO,GAAE,eAAoB,GAAG,MAAM,CAElE;AACD,wBAAgB,aAAa,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAEpE;AACD,4DAA4D;AAC5D,eAAO,MAAM,aAAa,sBAAgB,CAAC;AAC3C,oDAAoD;AACpD,eAAO,MAAM,gBAAgB,0BAAoB,CAAC;AAElD,eAAO,MAAM,cAAc,sBAAgB,CAAC;AAC5C,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,kBAAkB,2BAAoB,CAAC;AACpD,eAAO,MAAM,eAAe,sBAAgB,CAAC;AAC7C,eAAO,MAAM,gBAAgB,uBAAiB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,uBAAiB,CAAC;AAC/C,eAAO,MAAM,mBAAmB,2BAAoB,CAAC;AACrD,eAAO,MAAM,gBAAgB,sBAAgB,CAAC;AAC9C,eAAO,MAAM,iBAAiB,uBAAiB,CAAC;AAChD,eAAO,MAAM,iBAAiB,uBAAiB,CAAC;AAChD,eAAO,MAAM,oBAAoB,2BAAoB,CAAC;AACtD,eAAO,MAAM,cAAc,qBAAe,CAAC;AAC3C,eAAO,MAAM,eAAe,sBAAgB,CAAC;AAC7C,eAAO,MAAM,eAAe,sBAAgB,CAAC;AAC7C,eAAO,MAAM,kBAAkB,0BAAmB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { buildGreyPalette, buildHuePalette } from "./hue-grey-palettes.js";
|
|
2
|
+
import { colorScale, scaleColorDiscrete, scaleFillDiscrete, } from "./scale-color-helpers.js";
|
|
3
|
+
const HUE_STOPS = 10;
|
|
4
|
+
const GREY_STOPS = 10;
|
|
5
|
+
function hueConfig(options) {
|
|
6
|
+
const { h, c, l, ...rest } = options;
|
|
7
|
+
if (h !== undefined || c !== undefined || l !== undefined) {
|
|
8
|
+
return {
|
|
9
|
+
...rest,
|
|
10
|
+
range: buildHuePalette(HUE_STOPS, h ?? [15, 375], c ?? 100, l ?? 65),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return { ...rest, scheme: "hue" };
|
|
14
|
+
}
|
|
15
|
+
function greyConfig(options) {
|
|
16
|
+
const { start, end, ...rest } = options;
|
|
17
|
+
// Always bake a range — there is no registered "grey"/"gray" scheme name.
|
|
18
|
+
// scale_*_grey stays portable via explicit stops (start/end still honored).
|
|
19
|
+
return {
|
|
20
|
+
...rest,
|
|
21
|
+
range: buildGreyPalette(GREY_STOPS, start ?? 0.2, end ?? 0.8),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function scaleColorHue(options = {}) {
|
|
25
|
+
return colorScale("color", "ordinal", hueConfig(options));
|
|
26
|
+
}
|
|
27
|
+
export function scaleColorGrey(options = {}) {
|
|
28
|
+
return colorScale("color", "ordinal", greyConfig(options));
|
|
29
|
+
}
|
|
30
|
+
/** Binding-identical American spelling of scaleColorGrey. */
|
|
31
|
+
export const scaleColorGray = scaleColorGrey;
|
|
32
|
+
/** Binding-identical alias of scaleColorDiscrete (ggplot2 scale_*_ordinal). */
|
|
33
|
+
export const scaleColorOrdinal = scaleColorDiscrete;
|
|
34
|
+
export function scaleFillHue(options = {}) {
|
|
35
|
+
return colorScale("fill", "ordinal", hueConfig(options));
|
|
36
|
+
}
|
|
37
|
+
export function scaleFillGrey(options = {}) {
|
|
38
|
+
return colorScale("fill", "ordinal", greyConfig(options));
|
|
39
|
+
}
|
|
40
|
+
/** Binding-identical American spelling of scaleFillGrey. */
|
|
41
|
+
export const scaleFillGray = scaleFillGrey;
|
|
42
|
+
/** Binding-identical alias of scaleFillDiscrete. */
|
|
43
|
+
export const scaleFillOrdinal = scaleFillDiscrete;
|
|
44
|
+
export const scaleColourHue = scaleColorHue;
|
|
45
|
+
export const scaleColourGrey = scaleColorGrey;
|
|
46
|
+
export const scaleColourGray = scaleColorGray;
|
|
47
|
+
export const scaleColourOrdinal = scaleColorOrdinal;
|
|
48
|
+
export const scale_color_hue = scaleColorHue;
|
|
49
|
+
export const scale_color_grey = scaleColorGrey;
|
|
50
|
+
export const scale_color_gray = scaleColorGray;
|
|
51
|
+
export const scale_color_ordinal = scaleColorOrdinal;
|
|
52
|
+
export const scale_colour_hue = scaleColorHue;
|
|
53
|
+
export const scale_colour_grey = scaleColorGrey;
|
|
54
|
+
export const scale_colour_gray = scaleColorGray;
|
|
55
|
+
export const scale_colour_ordinal = scaleColorOrdinal;
|
|
56
|
+
export const scale_fill_hue = scaleFillHue;
|
|
57
|
+
export const scale_fill_grey = scaleFillGrey;
|
|
58
|
+
export const scale_fill_gray = scaleFillGray;
|
|
59
|
+
export const scale_fill_ordinal = scaleFillOrdinal;
|
|
60
|
+
//# sourceMappingURL=scale-color-hue-grey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-color-hue-grey.js","sourceRoot":"","sources":["../src/scale-color-hue-grey.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;AAElC,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,UAAU,GAAG,EAAE,CAAC;AAsBtB,SAAS,SAAS,CAAC,OAAwB;IACzC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACrC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC1D,OAAO;YACL,GAAG,IAAI;YACP,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE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D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-stop color/fill scale constructors: gradient* (#826 continuous) and
|
|
3
|
+
* steps* (#827 binned). Share default hexes and stop-range resolvers so the
|
|
4
|
+
* two families stay one edit surface.
|
|
5
|
+
*/
|
|
6
|
+
import type { Scales } from "./schema.js";
|
|
7
|
+
import { type BinnedColorScaleOptions, type SequentialColorScaleOptions } from "./scale-color-helpers.js";
|
|
8
|
+
/** ggplot2-shaped two-stop continuous colour (default navy → sky). */
|
|
9
|
+
export type GradientScaleOptions = Omit<SequentialColorScaleOptions, "scheme" | "range"> & {
|
|
10
|
+
low?: string;
|
|
11
|
+
high?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Diverging three-stop continuous colour.
|
|
15
|
+
* v1: mid is the center stop of `range` only — no asymmetric domain remapping
|
|
16
|
+
* (ggplot2 `midpoint` deferred; not accepted so it cannot silently no-op).
|
|
17
|
+
*/
|
|
18
|
+
export type Gradient2ScaleOptions = Omit<SequentialColorScaleOptions, "scheme" | "range"> & {
|
|
19
|
+
low?: string;
|
|
20
|
+
mid?: string;
|
|
21
|
+
high?: string;
|
|
22
|
+
};
|
|
23
|
+
/** N-stop continuous colour; requires ≥2 hex stops via colours/colors/values. */
|
|
24
|
+
export type GradientnScaleOptions = Omit<SequentialColorScaleOptions, "scheme" | "range"> & {
|
|
25
|
+
colours?: readonly string[];
|
|
26
|
+
colors?: readonly string[];
|
|
27
|
+
values?: readonly string[];
|
|
28
|
+
};
|
|
29
|
+
/** Two-stop stepped continuous colour (default navy → sky). */
|
|
30
|
+
export type StepsScaleOptions = Omit<BinnedColorScaleOptions, "scheme" | "range"> & {
|
|
31
|
+
low?: string;
|
|
32
|
+
high?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Three-stop stepped diverging colour.
|
|
36
|
+
* v1: no `midpoint` param (asymmetric domain remapping deferred).
|
|
37
|
+
*/
|
|
38
|
+
export type Steps2ScaleOptions = Omit<BinnedColorScaleOptions, "scheme" | "range"> & {
|
|
39
|
+
low?: string;
|
|
40
|
+
mid?: string;
|
|
41
|
+
high?: string;
|
|
42
|
+
};
|
|
43
|
+
/** N-stop stepped colour; requires ≥2 hex stops via colours/colors/values. */
|
|
44
|
+
export type StepsnScaleOptions = Omit<BinnedColorScaleOptions, "scheme" | "range"> & {
|
|
45
|
+
colours?: readonly string[];
|
|
46
|
+
colors?: readonly string[];
|
|
47
|
+
values?: readonly string[];
|
|
48
|
+
};
|
|
49
|
+
export declare function scaleColorGradient(options?: GradientScaleOptions): Scales;
|
|
50
|
+
export declare function scaleColorGradient2(options?: Gradient2ScaleOptions): Scales;
|
|
51
|
+
export declare function scaleColorGradientn(options?: GradientnScaleOptions): Scales;
|
|
52
|
+
export declare function scaleFillGradient(options?: GradientScaleOptions): Scales;
|
|
53
|
+
export declare function scaleFillGradient2(options?: Gradient2ScaleOptions): Scales;
|
|
54
|
+
export declare function scaleFillGradientn(options?: GradientnScaleOptions): Scales;
|
|
55
|
+
export declare const scaleColourGradient: typeof scaleColorGradient;
|
|
56
|
+
export declare const scaleColourGradient2: typeof scaleColorGradient2;
|
|
57
|
+
export declare const scaleColourGradientn: typeof scaleColorGradientn;
|
|
58
|
+
export declare const scale_color_gradient: typeof scaleColorGradient;
|
|
59
|
+
export declare const scale_color_gradient2: typeof scaleColorGradient2;
|
|
60
|
+
export declare const scale_color_gradientn: typeof scaleColorGradientn;
|
|
61
|
+
export declare const scale_colour_gradient: typeof scaleColorGradient;
|
|
62
|
+
export declare const scale_colour_gradient2: typeof scaleColorGradient2;
|
|
63
|
+
export declare const scale_colour_gradientn: typeof scaleColorGradientn;
|
|
64
|
+
export declare const scale_fill_gradient: typeof scaleFillGradient;
|
|
65
|
+
export declare const scale_fill_gradient2: typeof scaleFillGradient2;
|
|
66
|
+
export declare const scale_fill_gradientn: typeof scaleFillGradientn;
|
|
67
|
+
export declare function scaleColorSteps(options?: StepsScaleOptions): Scales;
|
|
68
|
+
export declare function scaleColorSteps2(options?: Steps2ScaleOptions): Scales;
|
|
69
|
+
export declare function scaleColorStepsn(options?: StepsnScaleOptions): Scales;
|
|
70
|
+
export declare function scaleFillSteps(options?: StepsScaleOptions): Scales;
|
|
71
|
+
export declare function scaleFillSteps2(options?: Steps2ScaleOptions): Scales;
|
|
72
|
+
export declare function scaleFillStepsn(options?: StepsnScaleOptions): Scales;
|
|
73
|
+
export declare const scaleColourSteps: typeof scaleColorSteps;
|
|
74
|
+
export declare const scaleColourSteps2: typeof scaleColorSteps2;
|
|
75
|
+
export declare const scaleColourStepsn: typeof scaleColorStepsn;
|
|
76
|
+
export declare const scale_color_steps: typeof scaleColorSteps;
|
|
77
|
+
export declare const scale_color_steps2: typeof scaleColorSteps2;
|
|
78
|
+
export declare const scale_color_stepsn: typeof scaleColorStepsn;
|
|
79
|
+
export declare const scale_colour_steps: typeof scaleColorSteps;
|
|
80
|
+
export declare const scale_colour_steps2: typeof scaleColorSteps2;
|
|
81
|
+
export declare const scale_colour_stepsn: typeof scaleColorStepsn;
|
|
82
|
+
export declare const scale_fill_steps: typeof scaleFillSteps;
|
|
83
|
+
export declare const scale_fill_steps2: typeof scaleFillSteps2;
|
|
84
|
+
export declare const scale_fill_stepsn: typeof scaleFillStepsn;
|
|
85
|
+
//# sourceMappingURL=scale-color-stops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-color-stops.d.ts","sourceRoot":"","sources":["../src/scale-color-stops.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAC;AAUlC,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,2BAA2B,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG;IACzF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,2BAA2B,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG;IAC1F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,2BAA2B,EAAE,QAAQ,GAAG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mB,CAAC;AACpD,eAAO,MAAM,mBAAmB,yBAAmB,CAAC;AACpD,eAAO,MAAM,gBAAgB,uBAAiB,CAAC;AAC/C,eAAO,MAAM,iBAAiB,wBAAkB,CAAC;AACjD,eAAO,MAAM,iBAAiB,wBAAkB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { colorScale, } from "./scale-color-helpers.js";
|
|
2
|
+
// Shared stop defaults (navy→sky continuous; red–light–blue diverging).
|
|
3
|
+
const STOP_DEFAULT_LOW = "#132B43";
|
|
4
|
+
const STOP_DEFAULT_HIGH = "#56B1F7";
|
|
5
|
+
/** ggts diverging defaults (red–light–blue); not claimed as ggplot2 muted(). */
|
|
6
|
+
const STOP2_DEFAULT_LOW = "#B2182B";
|
|
7
|
+
const STOP2_DEFAULT_MID = "#F7F7F7";
|
|
8
|
+
const STOP2_DEFAULT_HIGH = "#2166AC";
|
|
9
|
+
function twoStopRange(options) {
|
|
10
|
+
const { low = STOP_DEFAULT_LOW, high = STOP_DEFAULT_HIGH, ...rest } = options;
|
|
11
|
+
return { ...rest, range: [low, high] };
|
|
12
|
+
}
|
|
13
|
+
function threeStopRange(options) {
|
|
14
|
+
const { low = STOP2_DEFAULT_LOW, mid = STOP2_DEFAULT_MID, high = STOP2_DEFAULT_HIGH, ...rest } = options;
|
|
15
|
+
return { ...rest, range: [low, mid, high] };
|
|
16
|
+
}
|
|
17
|
+
function nStopRange(options, helperLabel) {
|
|
18
|
+
const { colours, colors, values, ...rest } = options;
|
|
19
|
+
const stops = colours ?? colors ?? values;
|
|
20
|
+
if (stops === undefined || stops.length < 2) {
|
|
21
|
+
throw new Error(`${helperLabel} requires colours/colors/values with at least 2 #rgb/#rrggbb stops.`);
|
|
22
|
+
}
|
|
23
|
+
return { ...rest, range: [...stops] };
|
|
24
|
+
}
|
|
25
|
+
// --- gradient / gradient2 / gradientn (#826) --------------------------------
|
|
26
|
+
export function scaleColorGradient(options = {}) {
|
|
27
|
+
return colorScale("color", "sequential", twoStopRange(options));
|
|
28
|
+
}
|
|
29
|
+
export function scaleColorGradient2(options = {}) {
|
|
30
|
+
return colorScale("color", "sequential", threeStopRange(options));
|
|
31
|
+
}
|
|
32
|
+
export function scaleColorGradientn(options = {}) {
|
|
33
|
+
return colorScale("color", "sequential", nStopRange(options, "scale_*_gradientn"));
|
|
34
|
+
}
|
|
35
|
+
export function scaleFillGradient(options = {}) {
|
|
36
|
+
return colorScale("fill", "sequential", twoStopRange(options));
|
|
37
|
+
}
|
|
38
|
+
export function scaleFillGradient2(options = {}) {
|
|
39
|
+
return colorScale("fill", "sequential", threeStopRange(options));
|
|
40
|
+
}
|
|
41
|
+
export function scaleFillGradientn(options = {}) {
|
|
42
|
+
return colorScale("fill", "sequential", nStopRange(options, "scale_*_gradientn"));
|
|
43
|
+
}
|
|
44
|
+
export const scaleColourGradient = scaleColorGradient;
|
|
45
|
+
export const scaleColourGradient2 = scaleColorGradient2;
|
|
46
|
+
export const scaleColourGradientn = scaleColorGradientn;
|
|
47
|
+
export const scale_color_gradient = scaleColorGradient;
|
|
48
|
+
export const scale_color_gradient2 = scaleColorGradient2;
|
|
49
|
+
export const scale_color_gradientn = scaleColorGradientn;
|
|
50
|
+
export const scale_colour_gradient = scaleColorGradient;
|
|
51
|
+
export const scale_colour_gradient2 = scaleColorGradient2;
|
|
52
|
+
export const scale_colour_gradientn = scaleColorGradientn;
|
|
53
|
+
export const scale_fill_gradient = scaleFillGradient;
|
|
54
|
+
export const scale_fill_gradient2 = scaleFillGradient2;
|
|
55
|
+
export const scale_fill_gradientn = scaleFillGradientn;
|
|
56
|
+
// --- steps / steps2 / stepsn (#827) ----------------------------------------
|
|
57
|
+
export function scaleColorSteps(options = {}) {
|
|
58
|
+
return colorScale("color", "binned", twoStopRange(options));
|
|
59
|
+
}
|
|
60
|
+
export function scaleColorSteps2(options = {}) {
|
|
61
|
+
return colorScale("color", "binned", threeStopRange(options));
|
|
62
|
+
}
|
|
63
|
+
export function scaleColorStepsn(options = {}) {
|
|
64
|
+
return colorScale("color", "binned", nStopRange(options, "scale_*_stepsn"));
|
|
65
|
+
}
|
|
66
|
+
export function scaleFillSteps(options = {}) {
|
|
67
|
+
return colorScale("fill", "binned", twoStopRange(options));
|
|
68
|
+
}
|
|
69
|
+
export function scaleFillSteps2(options = {}) {
|
|
70
|
+
return colorScale("fill", "binned", threeStopRange(options));
|
|
71
|
+
}
|
|
72
|
+
export function scaleFillStepsn(options = {}) {
|
|
73
|
+
return colorScale("fill", "binned", nStopRange(options, "scale_*_stepsn"));
|
|
74
|
+
}
|
|
75
|
+
export const scaleColourSteps = scaleColorSteps;
|
|
76
|
+
export const scaleColourSteps2 = scaleColorSteps2;
|
|
77
|
+
export const scaleColourStepsn = scaleColorStepsn;
|
|
78
|
+
export const scale_color_steps = scaleColorSteps;
|
|
79
|
+
export const scale_color_steps2 = scaleColorSteps2;
|
|
80
|
+
export const scale_color_stepsn = scaleColorStepsn;
|
|
81
|
+
export const scale_colour_steps = scaleColorSteps;
|
|
82
|
+
export const scale_colour_steps2 = scaleColorSteps2;
|
|
83
|
+
export const scale_colour_stepsn = scaleColorStepsn;
|
|
84
|
+
export const scale_fill_steps = scaleFillSteps;
|
|
85
|
+
export const scale_fill_steps2 = scaleFillSteps2;
|
|
86
|
+
export const scale_fill_stepsn = scaleFillStepsn;
|
|
87
|
+
//# sourceMappingURL=scale-color-stops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-color-stops.js","sourceRoot":"","sources":["../src/scale-color-stops.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,UAAU,GAGX,MAAM,0BAA0B,CAAC;AAElC,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,gFAAgF;AAChF,MAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,MAAM,kBAAkB,GAAG,SAAS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AAgB,CAAC;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viridis family color/fill scale constructors (#828).
|
|
3
|
+
* ggplot2 scale_*_viridis_{c,d,b}. Helper-only fields `option` and `direction`
|
|
4
|
+
* are stripped before PortableSpec; `begin`/`end` deferred.
|
|
5
|
+
*/
|
|
6
|
+
import type { Scales } from "./schema.js";
|
|
7
|
+
import { SEQUENTIAL_SCHEME_NAMES } from "./schema-names.js";
|
|
8
|
+
import { type DiscreteColorScaleOptions, type SequentialColorScaleOptions } from "./scale-color-helpers.js";
|
|
9
|
+
type SequentialSchemeName = (typeof SEQUENTIAL_SCHEME_NAMES)[number];
|
|
10
|
+
export type ViridisOptionName = SequentialSchemeName;
|
|
11
|
+
/** Shared option surface for scale_*_viridis_* constructors. */
|
|
12
|
+
export type ViridisScaleOptions = {
|
|
13
|
+
/** Viridis-family map name (default `"viridis"`). Maps to PortableSpec `scheme`. */
|
|
14
|
+
option?: ViridisOptionName;
|
|
15
|
+
/**
|
|
16
|
+
* ggplot2 direction: `1` (default) dark→bright, `-1` reverses the ramp.
|
|
17
|
+
* Emitted as PortableSpec `reverse: true` when `-1`.
|
|
18
|
+
*/
|
|
19
|
+
direction?: 1 | -1;
|
|
20
|
+
reverse?: boolean;
|
|
21
|
+
domain?: SequentialColorScaleOptions["domain"];
|
|
22
|
+
range?: SequentialColorScaleOptions["range"];
|
|
23
|
+
breaks?: SequentialColorScaleOptions["breaks"];
|
|
24
|
+
labels?: SequentialColorScaleOptions["labels"];
|
|
25
|
+
oob?: SequentialColorScaleOptions["oob"];
|
|
26
|
+
naValue?: SequentialColorScaleOptions["naValue"];
|
|
27
|
+
unknownValue?: SequentialColorScaleOptions["unknownValue"];
|
|
28
|
+
guide?: SequentialColorScaleOptions["guide"];
|
|
29
|
+
transform?: SequentialColorScaleOptions["transform"];
|
|
30
|
+
domainMode?: DiscreteColorScaleOptions["domainMode"];
|
|
31
|
+
onExhaust?: DiscreteColorScaleOptions["onExhaust"];
|
|
32
|
+
};
|
|
33
|
+
export declare function scaleColorViridisC(options?: ViridisScaleOptions): Scales;
|
|
34
|
+
export declare function scaleColorViridisD(options?: ViridisScaleOptions): Scales;
|
|
35
|
+
export declare function scaleColorViridisB(options?: ViridisScaleOptions): Scales;
|
|
36
|
+
export declare function scaleFillViridisC(options?: ViridisScaleOptions): Scales;
|
|
37
|
+
export declare function scaleFillViridisD(options?: ViridisScaleOptions): Scales;
|
|
38
|
+
export declare function scaleFillViridisB(options?: ViridisScaleOptions): Scales;
|
|
39
|
+
export declare const scaleColourViridisC: typeof scaleColorViridisC;
|
|
40
|
+
export declare const scaleColourViridisD: typeof scaleColorViridisD;
|
|
41
|
+
export declare const scaleColourViridisB: typeof scaleColorViridisB;
|
|
42
|
+
export declare const scale_color_viridis_c: typeof scaleColorViridisC;
|
|
43
|
+
export declare const scale_color_viridis_d: typeof scaleColorViridisD;
|
|
44
|
+
export declare const scale_color_viridis_b: typeof scaleColorViridisB;
|
|
45
|
+
export declare const scale_colour_viridis_c: typeof scaleColorViridisC;
|
|
46
|
+
export declare const scale_colour_viridis_d: typeof scaleColorViridisD;
|
|
47
|
+
export declare const scale_colour_viridis_b: typeof scaleColorViridisB;
|
|
48
|
+
export declare const scale_fill_viridis_c: typeof scaleFillViridisC;
|
|
49
|
+
export declare const scale_fill_viridis_d: typeof scaleFillViridisD;
|
|
50
|
+
export declare const scale_fill_viridis_b: typeof scaleFillViridisB;
|
|
51
|
+
export {};
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E,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACrD,SAAS,CAAC,EAAE,yBAAyB,CAAC,WAAW,CAAC,CAAC;CACpD,CAAC;AA6BF,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAE5E;AACD,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAE5E;AACD,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAE5E;AACD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAE3E;AACD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAE3E;AACD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAE3E;AAED,eAAO,MAAM,mBAAmB,2BAAqB,CAAC;AACtD,eAAO,MAAM,mBAAmB,2BAAqB,CAAC;AACtD,eAAO,MAAM,mBAAmB,2BAAqB,CAAC;AACtD,eAAO,MAAM,qBAAqB,2BAAqB,CAAC;AACxD,eAAO,MAAM,qBAAqB,2BAAqB,CAAC;AACxD,eAAO,MAAM,qBAAqB,2BAAqB,CAAC;AACxD,eAAO,MAAM,sBAAsB,2BAAqB,CAAC;AACzD,eAAO,MAAM,sBAAsB,2BAAqB,CAAC;AACzD,eAAO,MAAM,sBAAsB,2BAAqB,CAAC;AACzD,eAAO,MAAM,oBAAoB,0BAAoB,CAAC;AACtD,eAAO,MAAM,oBAAoB,0BAAoB,CAAC;AACtD,eAAO,MAAM,oBAAoB,0BAAoB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SEQUENTIAL_SCHEME_NAMES } from "./schema-names.js";
|
|
2
|
+
import { colorScale, } from "./scale-color-helpers.js";
|
|
3
|
+
const VIRIDIS_OPTIONS = new Set(SEQUENTIAL_SCHEME_NAMES);
|
|
4
|
+
function resolveViridisPortable(options) {
|
|
5
|
+
const { option, direction, reverse, ...rest } = options;
|
|
6
|
+
if (option !== undefined && !VIRIDIS_OPTIONS.has(option)) {
|
|
7
|
+
throw new Error(`Unknown viridis option "${option}". Expected one of: ${SEQUENTIAL_SCHEME_NAMES.join(", ")}.`);
|
|
8
|
+
}
|
|
9
|
+
const out = {
|
|
10
|
+
scheme: option ?? "viridis",
|
|
11
|
+
};
|
|
12
|
+
if (rest.domain !== undefined)
|
|
13
|
+
out.domain = rest.domain;
|
|
14
|
+
if (rest.range !== undefined)
|
|
15
|
+
out.range = rest.range;
|
|
16
|
+
if (rest.breaks !== undefined)
|
|
17
|
+
out.breaks = rest.breaks;
|
|
18
|
+
if (rest.labels !== undefined)
|
|
19
|
+
out.labels = rest.labels;
|
|
20
|
+
if (rest.oob !== undefined)
|
|
21
|
+
out.oob = rest.oob;
|
|
22
|
+
if (rest.naValue !== undefined)
|
|
23
|
+
out.naValue = rest.naValue;
|
|
24
|
+
if (rest.unknownValue !== undefined)
|
|
25
|
+
out.unknownValue = rest.unknownValue;
|
|
26
|
+
if (rest.guide !== undefined)
|
|
27
|
+
out.guide = rest.guide;
|
|
28
|
+
if (rest.transform !== undefined)
|
|
29
|
+
out.transform = rest.transform;
|
|
30
|
+
if (rest.domainMode !== undefined)
|
|
31
|
+
out.domainMode = rest.domainMode;
|
|
32
|
+
if (rest.onExhaust !== undefined)
|
|
33
|
+
out.onExhaust = rest.onExhaust;
|
|
34
|
+
if (reverse === true || direction === -1)
|
|
35
|
+
out.reverse = true;
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
export function scaleColorViridisC(options = {}) {
|
|
39
|
+
return colorScale("color", "sequential", resolveViridisPortable(options));
|
|
40
|
+
}
|
|
41
|
+
export function scaleColorViridisD(options = {}) {
|
|
42
|
+
return colorScale("color", "ordinal", resolveViridisPortable(options));
|
|
43
|
+
}
|
|
44
|
+
export function scaleColorViridisB(options = {}) {
|
|
45
|
+
return colorScale("color", "binned", resolveViridisPortable(options));
|
|
46
|
+
}
|
|
47
|
+
export function scaleFillViridisC(options = {}) {
|
|
48
|
+
return colorScale("fill", "sequential", resolveViridisPortable(options));
|
|
49
|
+
}
|
|
50
|
+
export function scaleFillViridisD(options = {}) {
|
|
51
|
+
return colorScale("fill", "ordinal", resolveViridisPortable(options));
|
|
52
|
+
}
|
|
53
|
+
export function scaleFillViridisB(options = {}) {
|
|
54
|
+
return colorScale("fill", "binned", resolveViridisPortable(options));
|
|
55
|
+
}
|
|
56
|
+
export const scaleColourViridisC = scaleColorViridisC;
|
|
57
|
+
export const scaleColourViridisD = scaleColorViridisD;
|
|
58
|
+
export const scaleColourViridisB = scaleColorViridisB;
|
|
59
|
+
export const scale_color_viridis_c = scaleColorViridisC;
|
|
60
|
+
export const scale_color_viridis_d = scaleColorViridisD;
|
|
61
|
+
export const scale_color_viridis_b = scaleColorViridisB;
|
|
62
|
+
export const scale_colour_viridis_c = scaleColorViridisC;
|
|
63
|
+
export const scale_colour_viridis_d = scaleColorViridisD;
|
|
64
|
+
export const scale_colour_viridis_b = scaleColorViridisB;
|
|
65
|
+
export const scale_fill_viridis_c = scaleFillViridisC;
|
|
66
|
+
export const scale_fill_viridis_d = scaleFillViridisD;
|
|
67
|
+
export const scale_fill_viridis_b = scaleFillViridisB;
|
|
68
|
+
//# sourceMappingURL=scale-color-viridis.js.map
|