@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,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GUIDE_REFERENCE builder. Gen-only: `scripts/gen-reference-catalogs.ts`.
|
|
3
|
+
* Runtime uses generated/guide-reference-data.ts.
|
|
4
|
+
*/
|
|
5
|
+
import { SpecDeclarations } from "./schema-declarations.js";
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Public types
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
/** Portable guide type literals (GuideSpec discriminators). */
|
|
12
|
+
export const KNOWN_GUIDE_TYPES = ["legend", "colorbar", "colorsteps", "axis", "none"] as const;
|
|
13
|
+
|
|
14
|
+
export type GuideTypeName = (typeof KNOWN_GUIDE_TYPES)[number];
|
|
15
|
+
|
|
16
|
+
/** Every aesthetic a guide can be keyed by (GuidesSpec keys). */
|
|
17
|
+
export const GUIDE_CHANNELS = [
|
|
18
|
+
"x",
|
|
19
|
+
"y",
|
|
20
|
+
"color",
|
|
21
|
+
"fill",
|
|
22
|
+
"size",
|
|
23
|
+
"linewidth",
|
|
24
|
+
"alpha",
|
|
25
|
+
"shape",
|
|
26
|
+
"linetype",
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
29
|
+
export type GuideChannelName = (typeof GUIDE_CHANNELS)[number];
|
|
30
|
+
|
|
31
|
+
export interface GuideParamDoc {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly typeSummary: string;
|
|
35
|
+
readonly required: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GuideReferenceEntry {
|
|
39
|
+
readonly name: GuideTypeName;
|
|
40
|
+
/** Route slug — same as the portable type literal. */
|
|
41
|
+
readonly slug: string;
|
|
42
|
+
/** Svelte component export, e.g. GuideLegend. */
|
|
43
|
+
readonly component: string;
|
|
44
|
+
/** Portable `type` discriminant (same as name). */
|
|
45
|
+
readonly typeLiteral: GuideTypeName;
|
|
46
|
+
/** SpecDeclarations key for the guide options object. */
|
|
47
|
+
readonly schemaType: string;
|
|
48
|
+
/** Fluent helper, e.g. guideLegend. */
|
|
49
|
+
readonly helper: string;
|
|
50
|
+
/** ggplot2-style snake_case alias, e.g. guide_legend. */
|
|
51
|
+
readonly helperAlias: string;
|
|
52
|
+
/** Short purpose text for the guide variant. */
|
|
53
|
+
readonly summary: string;
|
|
54
|
+
/**
|
|
55
|
+
* Aesthetics this guide type may key. Subset of GUIDE_CHANNELS; scale family
|
|
56
|
+
* constraints (sequential → colorbar, binned → colorsteps) are prose on the
|
|
57
|
+
* page, not a separate field.
|
|
58
|
+
*/
|
|
59
|
+
readonly channels: readonly GuideChannelName[];
|
|
60
|
+
/**
|
|
61
|
+
* Options on the Svelte shell / JSON guide object, excluding the fixed
|
|
62
|
+
* `type` discriminant. The shell also takes `channel` (not part of *GuideSpec).
|
|
63
|
+
*/
|
|
64
|
+
readonly params: readonly GuideParamDoc[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Static catalog metadata
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
const GUIDE_SUMMARIES: Readonly<Record<GuideTypeName, string>> = Object.freeze({
|
|
72
|
+
legend:
|
|
73
|
+
"Discrete legend for one non-position aesthetic: title, placement rank, position, direction, key size, and collision. Default guide for categorical color, fill, size, shape, and other style channels.",
|
|
74
|
+
colorbar:
|
|
75
|
+
"Continuous color ramp for sequential color or fill scales. Shows ticks and labels along a vertical or horizontal bar; incompatible with discrete legends and binned colorsteps.",
|
|
76
|
+
colorsteps:
|
|
77
|
+
"Binned color legend for binned color or fill scales. Step blocks with optional labels; use instead of legend or colorbar when the scale type is binned.",
|
|
78
|
+
axis: "Axis guide for positional aesthetics x and y: title, tick marks, labels, and collision. Not valid on color, fill, or other style channels.",
|
|
79
|
+
none: "Suppress the guide for one aesthetic entirely. Valid on every channel; useful to hide size or shape legends while keeping the mapping.",
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const GUIDE_COMPONENTS: Readonly<Record<GuideTypeName, string>> = Object.freeze({
|
|
83
|
+
legend: "GuideLegend",
|
|
84
|
+
colorbar: "GuideColorbar",
|
|
85
|
+
colorsteps: "GuideColorsteps",
|
|
86
|
+
axis: "GuideAxis",
|
|
87
|
+
none: "GuideNone",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const GUIDE_SCHEMA_TYPES: Readonly<Record<GuideTypeName, string>> = Object.freeze({
|
|
91
|
+
legend: "LegendGuideSpec",
|
|
92
|
+
colorbar: "ColorbarGuideSpec",
|
|
93
|
+
colorsteps: "ColorstepsGuideSpec",
|
|
94
|
+
axis: "AxisGuideSpec",
|
|
95
|
+
none: "NoneGuideSpec",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const GUIDE_HELPERS: Readonly<Record<GuideTypeName, { camel: string; snake: string }>> =
|
|
99
|
+
Object.freeze({
|
|
100
|
+
legend: { camel: "guideLegend", snake: "guide_legend" },
|
|
101
|
+
colorbar: { camel: "guideColorbar", snake: "guide_colorbar" },
|
|
102
|
+
colorsteps: { camel: "guideColorsteps", snake: "guide_colorsteps" },
|
|
103
|
+
axis: { camel: "guideAxis", snake: "guide_axis" },
|
|
104
|
+
none: { camel: "guideNone", snake: "guide_none" },
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
/** Aesthetic keys each guide type may bind (matches guideStructuralErrors). */
|
|
108
|
+
const GUIDE_CHANNELS_FOR_TYPE: Readonly<Record<GuideTypeName, readonly GuideChannelName[]>> =
|
|
109
|
+
Object.freeze({
|
|
110
|
+
axis: ["x", "y"],
|
|
111
|
+
legend: ["color", "fill", "size", "linewidth", "alpha", "shape", "linetype"],
|
|
112
|
+
colorbar: ["color", "fill"],
|
|
113
|
+
colorsteps: ["color", "fill"],
|
|
114
|
+
none: [...GUIDE_CHANNELS],
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Schema props often omit descriptions. Prefer SpecDeclarations text when
|
|
119
|
+
* present; fall back to these authoring notes so every param has prose.
|
|
120
|
+
*/
|
|
121
|
+
const PARAM_DESCRIPTION_FALLBACKS: Readonly<Record<string, string>> = Object.freeze({
|
|
122
|
+
title: "Optional guide title string (max 256 characters). Omit to use the scale or labs title.",
|
|
123
|
+
order:
|
|
124
|
+
"Integer placement rank among sibling guides (−1024…1024). Lower values sort earlier. Not the plot-wide Legend entry-sort enum.",
|
|
125
|
+
position:
|
|
126
|
+
'Guide placement relative to the panel: "auto", "right", or "bottom". Auto picks a side from available space.',
|
|
127
|
+
direction:
|
|
128
|
+
'Layout of keys or the color ramp: "auto", "vertical", or "horizontal". Bottom placement usually forces horizontal.',
|
|
129
|
+
keySize: "Legend key glyph size in pixels (4…48).",
|
|
130
|
+
collision:
|
|
131
|
+
"How long labels behave when they do not fit: ellipsis, wrap (legend only), preserve (axis), auto (axis), or error.",
|
|
132
|
+
force:
|
|
133
|
+
"When true, keep this guide even if the scale would normally suppress it (for example a single-level discrete scale).",
|
|
134
|
+
showTicks: "When false, hide tick marks on the axis or colorbar.",
|
|
135
|
+
showLabels: "When false, hide tick or step labels on the axis, colorbar, or colorsteps guide.",
|
|
136
|
+
theme:
|
|
137
|
+
"Bounded presentation overrides for this guide block (title/label size, gaps, colorbar size).",
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// Schema walkers
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
|
|
144
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
145
|
+
return typeof value === "object" && value !== null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function refName(node: Record<string, unknown>): string | undefined {
|
|
149
|
+
const ref = node["$ref"];
|
|
150
|
+
return typeof ref === "string" ? ref : undefined;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function typeSummaryOf(node: unknown, depth = 0): string {
|
|
154
|
+
if (!isRecord(node) || depth > 8) return "unknown";
|
|
155
|
+
const ref = refName(node);
|
|
156
|
+
if (ref !== undefined) return ref;
|
|
157
|
+
if (typeof node["const"] === "string" || typeof node["const"] === "number") {
|
|
158
|
+
return JSON.stringify(node["const"]);
|
|
159
|
+
}
|
|
160
|
+
const anyOf = node["anyOf"];
|
|
161
|
+
if (Array.isArray(anyOf)) {
|
|
162
|
+
const parts = anyOf.map((branch) => typeSummaryOf(branch, depth + 1));
|
|
163
|
+
if (parts.every((p) => p.startsWith('"') || p.startsWith("'") || /^-?\d/.test(p))) {
|
|
164
|
+
return [...new Set(parts)].join(" | ");
|
|
165
|
+
}
|
|
166
|
+
return parts.join(" | ");
|
|
167
|
+
}
|
|
168
|
+
const type = node["type"];
|
|
169
|
+
if (type === "number" || type === "integer") return type === "integer" ? "integer" : "number";
|
|
170
|
+
if (type === "string") return "string";
|
|
171
|
+
if (type === "boolean") return "boolean";
|
|
172
|
+
if (type === "object") return "object";
|
|
173
|
+
if (Array.isArray(type)) {
|
|
174
|
+
return type.filter((t) => t !== "null").join(" | ") || "unknown";
|
|
175
|
+
}
|
|
176
|
+
return "unknown";
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function descriptionOf(node: unknown, name: string): string {
|
|
180
|
+
if (
|
|
181
|
+
isRecord(node) &&
|
|
182
|
+
typeof node["description"] === "string" &&
|
|
183
|
+
node["description"].trim() !== ""
|
|
184
|
+
) {
|
|
185
|
+
return node["description"];
|
|
186
|
+
}
|
|
187
|
+
return PARAM_DESCRIPTION_FALLBACKS[name] ?? "";
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function guideParamsDocs(schemaType: string): readonly GuideParamDoc[] {
|
|
191
|
+
if (!(schemaType in SpecDeclarations)) {
|
|
192
|
+
throw new Error(`GUIDE_REFERENCE: SpecDeclarations has no entry "${schemaType}"`);
|
|
193
|
+
}
|
|
194
|
+
const schema = SpecDeclarations[schemaType as keyof typeof SpecDeclarations] as {
|
|
195
|
+
properties?: Record<string, unknown>;
|
|
196
|
+
required?: readonly string[];
|
|
197
|
+
};
|
|
198
|
+
const props = schema.properties;
|
|
199
|
+
if (props === undefined) {
|
|
200
|
+
// NoneGuideSpec is `{ type: "none" }` only — no option props.
|
|
201
|
+
return Object.freeze([]);
|
|
202
|
+
}
|
|
203
|
+
const required = new Set(schema.required ?? []);
|
|
204
|
+
const docs: GuideParamDoc[] = [];
|
|
205
|
+
for (const [name, propSchema] of Object.entries(props)) {
|
|
206
|
+
if (name === "type") continue; // discriminant is fixed by the shell / helper
|
|
207
|
+
const description = descriptionOf(propSchema, name);
|
|
208
|
+
if (description.trim() === "") {
|
|
209
|
+
throw new Error(
|
|
210
|
+
`GUIDE_REFERENCE: ${schemaType}.${name} has no schema description and no fallback`,
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
docs.push({
|
|
214
|
+
name,
|
|
215
|
+
description,
|
|
216
|
+
typeSummary: typeSummaryOf(propSchema),
|
|
217
|
+
required: required.has(name),
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return Object.freeze(docs);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ---------------------------------------------------------------------------
|
|
224
|
+
// Build
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
|
|
227
|
+
function buildEntry(name: GuideTypeName): GuideReferenceEntry {
|
|
228
|
+
const helpers = GUIDE_HELPERS[name];
|
|
229
|
+
return Object.freeze({
|
|
230
|
+
name,
|
|
231
|
+
slug: name,
|
|
232
|
+
component: GUIDE_COMPONENTS[name],
|
|
233
|
+
typeLiteral: name,
|
|
234
|
+
schemaType: GUIDE_SCHEMA_TYPES[name],
|
|
235
|
+
helper: helpers.camel,
|
|
236
|
+
helperAlias: helpers.snake,
|
|
237
|
+
summary: GUIDE_SUMMARIES[name],
|
|
238
|
+
channels: GUIDE_CHANNELS_FOR_TYPE[name],
|
|
239
|
+
params: guideParamsDocs(GUIDE_SCHEMA_TYPES[name]),
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function buildGuideReference(): Readonly<Record<GuideTypeName, GuideReferenceEntry>> {
|
|
244
|
+
const out = {} as Record<GuideTypeName, GuideReferenceEntry>;
|
|
245
|
+
for (const name of KNOWN_GUIDE_TYPES) {
|
|
246
|
+
out[name] = buildEntry(name);
|
|
247
|
+
}
|
|
248
|
+
return Object.freeze(out);
|
|
249
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GUIDE_REFERENCE — per-guide API docs for the docs site.
|
|
3
|
+
*
|
|
4
|
+
* Catalog data is precomputed from SpecDeclarations
|
|
5
|
+
* (`scripts/gen-reference-catalogs.ts`) so reference pages never load TypeBox.
|
|
6
|
+
* Guides are declaration-only Svelte shells keyed by aesthetic channel.
|
|
7
|
+
*/
|
|
8
|
+
import { GUIDE_REFERENCE_DATA } from "./generated/guide-reference-data.js";
|
|
9
|
+
|
|
10
|
+
/** Portable guide type literals (GuideSpec discriminators). */
|
|
11
|
+
export const KNOWN_GUIDE_TYPES = ["legend", "colorbar", "colorsteps", "axis", "none"] as const;
|
|
12
|
+
|
|
13
|
+
export type GuideTypeName = (typeof KNOWN_GUIDE_TYPES)[number];
|
|
14
|
+
|
|
15
|
+
/** Every aesthetic a guide can be keyed by (GuidesSpec keys). */
|
|
16
|
+
export const GUIDE_CHANNELS = [
|
|
17
|
+
"x",
|
|
18
|
+
"y",
|
|
19
|
+
"color",
|
|
20
|
+
"fill",
|
|
21
|
+
"size",
|
|
22
|
+
"linewidth",
|
|
23
|
+
"alpha",
|
|
24
|
+
"shape",
|
|
25
|
+
"linetype",
|
|
26
|
+
] as const;
|
|
27
|
+
|
|
28
|
+
export type GuideChannelName = (typeof GUIDE_CHANNELS)[number];
|
|
29
|
+
|
|
30
|
+
export interface GuideParamDoc {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly description: string;
|
|
33
|
+
readonly typeSummary: string;
|
|
34
|
+
readonly required: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GuideReferenceEntry {
|
|
38
|
+
readonly name: GuideTypeName;
|
|
39
|
+
/** Route slug — same as the portable type literal. */
|
|
40
|
+
readonly slug: string;
|
|
41
|
+
/** Svelte component export, e.g. GuideLegend. */
|
|
42
|
+
readonly component: string;
|
|
43
|
+
/** Portable `type` discriminant (same as name). */
|
|
44
|
+
readonly typeLiteral: GuideTypeName;
|
|
45
|
+
/** SpecDeclarations key for the guide options object. */
|
|
46
|
+
readonly schemaType: string;
|
|
47
|
+
/** Fluent helper, e.g. guideLegend. */
|
|
48
|
+
readonly helper: string;
|
|
49
|
+
/** ggplot2-style snake_case alias, e.g. guide_legend. */
|
|
50
|
+
readonly helperAlias: string;
|
|
51
|
+
/** Short purpose text for the guide variant. */
|
|
52
|
+
readonly summary: string;
|
|
53
|
+
/**
|
|
54
|
+
* Aesthetics this guide type may key. Subset of GUIDE_CHANNELS; scale family
|
|
55
|
+
* constraints (sequential → colorbar, binned → colorsteps) are prose on the
|
|
56
|
+
* page, not a separate field.
|
|
57
|
+
*/
|
|
58
|
+
readonly channels: readonly GuideChannelName[];
|
|
59
|
+
/**
|
|
60
|
+
* Options on the Svelte shell / JSON guide object, excluding the fixed
|
|
61
|
+
* `type` discriminant. The shell also takes `channel` (not part of *GuideSpec).
|
|
62
|
+
*/
|
|
63
|
+
readonly params: readonly GuideParamDoc[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Complete per-guide API reference. Keys are exactly KNOWN_GUIDE_TYPES.
|
|
68
|
+
* Precomputed at gen time.
|
|
69
|
+
*/
|
|
70
|
+
export const GUIDE_REFERENCE: Readonly<Record<GuideTypeName, GuideReferenceEntry>> =
|
|
71
|
+
GUIDE_REFERENCE_DATA;
|
|
72
|
+
|
|
73
|
+
/** Stable list order matching KNOWN_GUIDE_TYPES (docs index, search, inventory). */
|
|
74
|
+
export function guideReferenceList(): readonly GuideReferenceEntry[] {
|
|
75
|
+
return KNOWN_GUIDE_TYPES.map((name) => GUIDE_REFERENCE[name]);
|
|
76
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hue / grey discrete palettes for scale_*_hue and scale_*_grey (#829).
|
|
3
|
+
* Clean-room HSL greys and even-hue stops (not ggplot2 R source).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** HSL → #rrggbb (s,l in 0–1; h in degrees). */
|
|
7
|
+
export function hslToHex(h: number, s: number, l: number): string {
|
|
8
|
+
const hh = ((h % 360) + 360) % 360;
|
|
9
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
10
|
+
const x = c * (1 - Math.abs(((hh / 60) % 2) - 1));
|
|
11
|
+
const m = l - c / 2;
|
|
12
|
+
let r = 0;
|
|
13
|
+
let g = 0;
|
|
14
|
+
let b = 0;
|
|
15
|
+
if (hh < 60) {
|
|
16
|
+
r = c;
|
|
17
|
+
g = x;
|
|
18
|
+
} else if (hh < 120) {
|
|
19
|
+
r = x;
|
|
20
|
+
g = c;
|
|
21
|
+
} else if (hh < 180) {
|
|
22
|
+
g = c;
|
|
23
|
+
b = x;
|
|
24
|
+
} else if (hh < 240) {
|
|
25
|
+
g = x;
|
|
26
|
+
b = c;
|
|
27
|
+
} else if (hh < 300) {
|
|
28
|
+
r = x;
|
|
29
|
+
b = c;
|
|
30
|
+
} else {
|
|
31
|
+
r = c;
|
|
32
|
+
b = x;
|
|
33
|
+
}
|
|
34
|
+
const to2 = (n: number) =>
|
|
35
|
+
Math.round((n + m) * 255)
|
|
36
|
+
.toString(16)
|
|
37
|
+
.padStart(2, "0");
|
|
38
|
+
return `#${to2(r)}${to2(g)}${to2(b)}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** n even hues over [h0, h1); c/l are ggplot2-like 0–100 scales. */
|
|
42
|
+
export function buildHuePalette(
|
|
43
|
+
n: number,
|
|
44
|
+
h: readonly [number, number] = [15, 375],
|
|
45
|
+
c = 100,
|
|
46
|
+
l = 65,
|
|
47
|
+
): string[] {
|
|
48
|
+
const count = Math.max(1, Math.floor(n));
|
|
49
|
+
const s = Math.min(1, Math.max(0, c / 100));
|
|
50
|
+
const light = Math.min(1, Math.max(0, l / 100));
|
|
51
|
+
const [h0, h1] = h;
|
|
52
|
+
const span = h1 - h0;
|
|
53
|
+
const out: string[] = [];
|
|
54
|
+
for (let i = 0; i < count; i++) {
|
|
55
|
+
const t = count === 1 ? 0 : i / count;
|
|
56
|
+
out.push(hslToHex(h0 + span * t, s, light));
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** n greys from start→end in [0, 1]. */
|
|
62
|
+
export function buildGreyPalette(n: number, start = 0.2, end = 0.8): string[] {
|
|
63
|
+
const count = Math.max(1, Math.floor(n));
|
|
64
|
+
const s0 = Math.min(1, Math.max(0, start));
|
|
65
|
+
const s1 = Math.min(1, Math.max(0, end));
|
|
66
|
+
const out: string[] = [];
|
|
67
|
+
for (let i = 0; i < count; i++) {
|
|
68
|
+
const t = count === 1 ? 0 : i / (count - 1);
|
|
69
|
+
const g = s0 + (s1 - s0) * t;
|
|
70
|
+
const ch = Math.round(g * 255)
|
|
71
|
+
.toString(16)
|
|
72
|
+
.padStart(2, "0");
|
|
73
|
+
out.push(`#${ch}${ch}${ch}`);
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Default 10-stop hue scheme (matches scale_*_hue with no overrides). */
|
|
79
|
+
export const HUE_PALETTE_10: readonly string[] = Object.freeze(buildHuePalette(10));
|
|
80
|
+
|
|
81
|
+
/** Default 10-stop grey scheme (start 0.2, end 0.8). */
|
|
82
|
+
export const GREY_PALETTE_10: readonly string[] = Object.freeze(buildGreyPalette(10));
|