@sqlrooms/deck 0.29.0-rc.2
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/README.md +357 -0
- package/dist/ColorScaleLegend.d.ts +8 -0
- package/dist/ColorScaleLegend.d.ts.map +1 -0
- package/dist/ColorScaleLegend.js +11 -0
- package/dist/ColorScaleLegend.js.map +1 -0
- package/dist/DeckMap.d.ts +4 -0
- package/dist/DeckMap.d.ts.map +1 -0
- package/dist/DeckMap.js +157 -0
- package/dist/DeckMap.js.map +1 -0
- package/dist/datasets/normalizeDatasets.d.ts +5 -0
- package/dist/datasets/normalizeDatasets.d.ts.map +1 -0
- package/dist/datasets/normalizeDatasets.js +57 -0
- package/dist/datasets/normalizeDatasets.js.map +1 -0
- package/dist/datasets/usePreparedDeckDatasets.d.ts +3 -0
- package/dist/datasets/usePreparedDeckDatasets.d.ts.map +1 -0
- package/dist/datasets/usePreparedDeckDatasets.js +61 -0
- package/dist/datasets/usePreparedDeckDatasets.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/json/compileColorScale.d.ts +35 -0
- package/dist/json/compileColorScale.d.ts.map +1 -0
- package/dist/json/compileColorScale.js +527 -0
- package/dist/json/compileColorScale.js.map +1 -0
- package/dist/json/compileGeoArrowAccessor.d.ts +11 -0
- package/dist/json/compileGeoArrowAccessor.d.ts.map +1 -0
- package/dist/json/compileGeoArrowAccessor.js +74 -0
- package/dist/json/compileGeoArrowAccessor.js.map +1 -0
- package/dist/json/createDeckJsonConfiguration.d.ts +9 -0
- package/dist/json/createDeckJsonConfiguration.d.ts.map +1 -0
- package/dist/json/createDeckJsonConfiguration.js +112 -0
- package/dist/json/createDeckJsonConfiguration.js.map +1 -0
- package/dist/json/defaultClasses.d.ts +24 -0
- package/dist/json/defaultClasses.d.ts.map +1 -0
- package/dist/json/defaultClasses.js +21 -0
- package/dist/json/defaultClasses.js.map +1 -0
- package/dist/json/extractColorScaleLegends.d.ts +8 -0
- package/dist/json/extractColorScaleLegends.d.ts.map +1 -0
- package/dist/json/extractColorScaleLegends.js +48 -0
- package/dist/json/extractColorScaleLegends.js.map +1 -0
- package/dist/json/layerCompatibility.d.ts +15 -0
- package/dist/json/layerCompatibility.d.ts.map +1 -0
- package/dist/json/layerCompatibility.js +38 -0
- package/dist/json/layerCompatibility.js.map +1 -0
- package/dist/json/layerConfig.d.ts +10 -0
- package/dist/json/layerConfig.d.ts.map +1 -0
- package/dist/json/layerConfig.js +43 -0
- package/dist/json/layerConfig.js.map +1 -0
- package/dist/json/rewriteGeoArrowAccessors.d.ts +7 -0
- package/dist/json/rewriteGeoArrowAccessors.d.ts.map +1 -0
- package/dist/json/rewriteGeoArrowAccessors.js +53 -0
- package/dist/json/rewriteGeoArrowAccessors.js.map +1 -0
- package/dist/prepare/detectGeometryColumn.d.ts +10 -0
- package/dist/prepare/detectGeometryColumn.d.ts.map +1 -0
- package/dist/prepare/detectGeometryColumn.js +84 -0
- package/dist/prepare/detectGeometryColumn.js.map +1 -0
- package/dist/prepare/geoarrow.d.ts +18 -0
- package/dist/prepare/geoarrow.d.ts.map +1 -0
- package/dist/prepare/geoarrow.js +114 -0
- package/dist/prepare/geoarrow.js.map +1 -0
- package/dist/prepare/geometryDecoder.d.ts +9 -0
- package/dist/prepare/geometryDecoder.d.ts.map +1 -0
- package/dist/prepare/geometryDecoder.js +2 -0
- package/dist/prepare/geometryDecoder.js.map +1 -0
- package/dist/prepare/prepareDeckDataset.d.ts +11 -0
- package/dist/prepare/prepareDeckDataset.d.ts.map +1 -0
- package/dist/prepare/prepareDeckDataset.js +66 -0
- package/dist/prepare/prepareDeckDataset.js.map +1 -0
- package/dist/prepare/toGeoJsonBinary.d.ts +9 -0
- package/dist/prepare/toGeoJsonBinary.d.ts.map +1 -0
- package/dist/prepare/toGeoJsonBinary.js +25 -0
- package/dist/prepare/toGeoJsonBinary.js.map +1 -0
- package/dist/prepare/types.d.ts +25 -0
- package/dist/prepare/types.d.ts.map +1 -0
- package/dist/prepare/types.js +2 -0
- package/dist/prepare/types.js.map +1 -0
- package/dist/prepare/wkbDecoder.d.ts +3 -0
- package/dist/prepare/wkbDecoder.d.ts.map +1 -0
- package/dist/prepare/wkbDecoder.js +106 -0
- package/dist/prepare/wkbDecoder.js.map +1 -0
- package/dist/types.d.ts +115 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileColorScale.js","sourceRoot":"","sources":["../../src/json/compileColorScale.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAShD,MAAM,kBAAkB,GAAqC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1E,MAAM,qBAAqB,GAAqC;IAC9D,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;CACnB,CAAC;AACF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,6BAA6B,GAG/B;IACF,KAAK,EAAE,SAAS,CAAC,gBAAgB;IACjC,IAAI,EAAE,SAAS,CAAC,eAAe;IAC/B,IAAI,EAAE,SAAS,CAAC,eAAe;IAC/B,OAAO,EAAE,SAAS,CAAC,kBAAkB;IACrC,IAAI,EAAE,SAAS,CAAC,eAAe;IAC/B,gBAAgB,EAAE,SAAS,CAAC,2BAA2B;IACvD,IAAI,EAAE,SAAS,CAAC,eAAe;IAC/B,MAAM,EAAE,SAAS,CAAC,iBAAiB;IACnC,KAAK,EAAE,SAAS,CAAC,gBAAgB;IAC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B,OAAO,EAAE,UAAU,CAAC,OAAO;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,cAAc,EAAkB;SAC3C,MAAM,CAAC,UAAU,CAAC;SAClB,KAAK,CAAC,KAAK,CAAiC,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["import type * as arrow from 'apache-arrow';\nimport {rgb} from 'd3-color';\nimport {\n scaleDiverging,\n scaleOrdinal,\n scaleQuantile,\n scaleQuantize,\n scaleSequential,\n scaleThreshold,\n} from 'd3-scale';\nimport * as chromatic from 'd3-scale-chromatic';\nimport type {\n BinnedNumericScheme,\n CategoricalScheme,\n ContinuousDivergingScheme,\n ContinuousSequentialScheme,\n LayerColorScale,\n} from '../types';\n\nconst DEFAULT_NULL_COLOR: [number, number, number, number] = [0, 0, 0, 0];\nconst DEFAULT_UNKNOWN_COLOR: [number, number, number, number] = [\n 180, 180, 180, 180,\n];\nconst DEFAULT_BIN_COUNT = 5;\n\nconst CONTINUOUS_SEQUENTIAL_SCHEMES: Record<\n ContinuousSequentialScheme,\n (t: number) => string\n> = {\n Blues: chromatic.interpolateBlues,\n BuGn: chromatic.interpolateBuGn,\n BuPu: chromatic.interpolateBuPu,\n Cividis: chromatic.interpolateCividis,\n Cool: chromatic.interpolateCool,\n CubehelixDefault: chromatic.interpolateCubehelixDefault,\n GnBu: chromatic.interpolateGnBu,\n Greens: chromatic.interpolateGreens,\n Greys: chromatic.interpolateGreys,\n Inferno: chromatic.interpolateInferno,\n Magma: chromatic.interpolateMagma,\n OrRd: chromatic.interpolateOrRd,\n Oranges: chromatic.interpolateOranges,\n Plasma: chromatic.interpolatePlasma,\n PuBu: chromatic.interpolatePuBu,\n PuBuGn: chromatic.interpolatePuBuGn,\n PuRd: chromatic.interpolatePuRd,\n Purples: chromatic.interpolatePurples,\n Rainbow: chromatic.interpolateRainbow,\n RdPu: chromatic.interpolateRdPu,\n Reds: chromatic.interpolateReds,\n Sinebow: chromatic.interpolateSinebow,\n Turbo: chromatic.interpolateTurbo,\n Viridis: chromatic.interpolateViridis,\n Warm: chromatic.interpolateWarm,\n YlGn: chromatic.interpolateYlGn,\n YlGnBu: chromatic.interpolateYlGnBu,\n YlOrBr: chromatic.interpolateYlOrBr,\n YlOrRd: chromatic.interpolateYlOrRd,\n};\n\nconst CONTINUOUS_DIVERGING_SCHEMES: Record<\n ContinuousDivergingScheme,\n (t: number) => string\n> = {\n BrBG: chromatic.interpolateBrBG,\n PRGn: chromatic.interpolatePRGn,\n PiYG: chromatic.interpolatePiYG,\n PuOr: chromatic.interpolatePuOr,\n RdBu: chromatic.interpolateRdBu,\n RdGy: chromatic.interpolateRdGy,\n RdYlBu: chromatic.interpolateRdYlBu,\n RdYlGn: chromatic.interpolateRdYlGn,\n Spectral: chromatic.interpolateSpectral,\n};\n\nconst DISCRETE_NUMERIC_SCHEMES: Record<\n BinnedNumericScheme,\n ReadonlyArray<ReadonlyArray<string>>\n> = {\n Blues: chromatic.schemeBlues,\n BuGn: chromatic.schemeBuGn,\n BuPu: chromatic.schemeBuPu,\n GnBu: chromatic.schemeGnBu,\n Greens: chromatic.schemeGreens,\n Greys: chromatic.schemeGreys,\n OrRd: chromatic.schemeOrRd,\n Oranges: chromatic.schemeOranges,\n PuBu: chromatic.schemePuBu,\n PuBuGn: chromatic.schemePuBuGn,\n PuRd: chromatic.schemePuRd,\n Purples: chromatic.schemePurples,\n RdPu: chromatic.schemeRdPu,\n Reds: chromatic.schemeReds,\n YlGn: chromatic.schemeYlGn,\n YlGnBu: chromatic.schemeYlGnBu,\n YlOrBr: chromatic.schemeYlOrBr,\n YlOrRd: chromatic.schemeYlOrRd,\n BrBG: chromatic.schemeBrBG,\n PRGn: chromatic.schemePRGn,\n PiYG: chromatic.schemePiYG,\n PuOr: chromatic.schemePuOr,\n RdBu: chromatic.schemeRdBu,\n RdGy: chromatic.schemeRdGy,\n RdYlBu: chromatic.schemeRdYlBu,\n RdYlGn: chromatic.schemeRdYlGn,\n Spectral: chromatic.schemeSpectral,\n};\n\nconst CATEGORICAL_SCHEMES: Record<CategoricalScheme, ReadonlyArray<string>> = {\n Accent: chromatic.schemeAccent,\n Category10: chromatic.schemeCategory10,\n Dark2: chromatic.schemeDark2,\n Observable10: chromatic.schemeObservable10,\n Paired: chromatic.schemePaired,\n Pastel1: chromatic.schemePastel1,\n Pastel2: chromatic.schemePastel2,\n Set1: chromatic.schemeSet1,\n Set2: chromatic.schemeSet2,\n Set3: chromatic.schemeSet3,\n Tableau10: chromatic.schemeTableau10,\n};\n\ntype DiscreteScaleWithInvertExtent = {\n invertExtent: (value: string) => [unknown, unknown];\n};\ntype NumericColorScale = ((value: number) => string) &\n DiscreteScaleWithInvertExtent;\n\nexport type ResolvedColorLegend =\n | {\n type: 'continuous';\n title: string;\n gradient: string;\n ticks: Array<{label: string; offset: number}>;\n }\n | {\n type: 'stepped';\n title: string;\n items: Array<{label: string; color: [number, number, number, number]}>;\n }\n | {\n type: 'categorical';\n title: string;\n items: Array<{label: string; color: [number, number, number, number]}>;\n };\n\nfunction createNullColorAccessor(nullColor: [number, number, number, number]) {\n return () => nullColor;\n}\n\nfunction normalizeColor(\n color: [number, number, number, number?] | undefined,\n fallback: [number, number, number, number],\n) {\n if (!color) {\n return fallback;\n }\n\n return [color[0], color[1], color[2], color[3] ?? 255] as [\n number,\n number,\n number,\n number,\n ];\n}\n\nfunction parseColorString(value: string, alpha = 255) {\n const parsed = rgb(value);\n return [parsed.r, parsed.g, parsed.b, alpha] as [\n number,\n number,\n number,\n number,\n ];\n}\n\nfunction formatLegendNumber(value: number) {\n return new Intl.NumberFormat('en-US', {\n maximumFractionDigits: Math.abs(value) >= 100 ? 0 : 2,\n }).format(value);\n}\n\nfunction resolveFieldName(\n schemaOwner: arrow.Table | arrow.RecordBatch,\n requestedField: string,\n) {\n const exactMatch = schemaOwner.schema.fields.find(\n (field) => field.name === requestedField,\n )?.name;\n if (exactMatch) {\n return exactMatch;\n }\n\n const caseInsensitiveMatches = schemaOwner.schema.fields\n .map((field) => field.name)\n .filter(\n (fieldName) => fieldName.toLowerCase() === requestedField.toLowerCase(),\n );\n\n if (caseInsensitiveMatches.length === 1) {\n return caseInsensitiveMatches[0]!;\n }\n\n return undefined;\n}\n\nfunction getColumn(table: arrow.Table, field: string) {\n const resolvedFieldName = resolveFieldName(table, field);\n if (!resolvedFieldName) {\n throw new Error(`Unknown colorScale field \"${field}\".`);\n }\n\n const vector = table.getChild(resolvedFieldName);\n if (!vector) {\n throw new Error(`Unable to read colorScale field \"${resolvedFieldName}\".`);\n }\n\n return {\n fieldName: resolvedFieldName,\n vector,\n };\n}\n\nfunction getRowValue(row: unknown, fieldName: string) {\n if (!row || typeof row !== 'object') {\n return undefined;\n }\n\n const object = row as Record<string, unknown>;\n const sources = [\n object,\n object.properties as Record<string, unknown> | undefined,\n ].filter((value): value is Record<string, unknown> =>\n Boolean(value && typeof value === 'object'),\n );\n\n for (const source of sources) {\n if (fieldName in source) {\n return source[fieldName];\n }\n\n const caseInsensitiveMatches = Object.keys(source).filter(\n (key) => key.toLowerCase() === fieldName.toLowerCase(),\n );\n if (caseInsensitiveMatches.length === 1) {\n return source[caseInsensitiveMatches[0]!] as unknown;\n }\n }\n\n return undefined;\n}\n\nfunction toFiniteNumber(value: unknown) {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : undefined;\n }\n\n if (typeof value === 'bigint') {\n return Number(value);\n }\n\n if (typeof value === 'string' && value.trim() !== '') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n }\n\n return undefined;\n}\n\nfunction getNumericValues(vector: arrow.Vector) {\n const values: number[] = [];\n for (let index = 0; index < vector.length; index += 1) {\n const numericValue = toFiniteNumber(vector.get(index));\n if (numericValue !== undefined) {\n values.push(numericValue);\n }\n }\n\n return values;\n}\n\nfunction getSequentialDomain(values: number[]) {\n const min = Math.min(...values);\n const max = Math.max(...values);\n if (min === max) {\n return [min - 1, max + 1] as [number, number];\n }\n\n return [min, max] as [number, number];\n}\n\nfunction getDivergingDomain(values: number[]) {\n const min = Math.min(...values);\n const max = Math.max(...values);\n if (min === max) {\n return [min - 1, min, max + 1] as [number, number, number];\n }\n\n if (min < 0 && max > 0) {\n return [min, 0, max] as [number, number, number];\n }\n\n return [min, (min + max) / 2, max] as [number, number, number];\n}\n\nfunction unique<T>(values: T[]) {\n return [...new Set(values)];\n}\n\nfunction clampBinCount(bins: number) {\n return Math.max(2, Math.round(bins));\n}\n\nfunction sampleInterpolator(interpolator: (t: number) => string, bins: number) {\n if (bins === 1) {\n return [interpolator(0.5)];\n }\n\n return Array.from({length: bins}, (_, index) =>\n interpolator(index / (bins - 1)),\n );\n}\n\nfunction getNumericInterpolator(scheme: BinnedNumericScheme) {\n const sequential =\n CONTINUOUS_SEQUENTIAL_SCHEMES[scheme as ContinuousSequentialScheme];\n if (sequential) {\n return sequential;\n }\n\n return CONTINUOUS_DIVERGING_SCHEMES[scheme as ContinuousDivergingScheme];\n}\n\nfunction getDiscreteNumericColors(options: {\n scheme: BinnedNumericScheme;\n bins: number;\n reverse?: boolean;\n}) {\n const {scheme, reverse} = options;\n const bins = clampBinCount(options.bins);\n const discreteScheme = DISCRETE_NUMERIC_SCHEMES[scheme];\n const directColors = discreteScheme[bins];\n const colors = Array.isArray(directColors)\n ? [...directColors]\n : sampleInterpolator(\n getNumericInterpolator(scheme) ??\n (() => {\n throw new Error(\n `Unsupported numeric colorScale scheme \"${scheme}\".`,\n );\n })(),\n bins,\n );\n\n return reverse ? colors.reverse() : colors;\n}\n\nfunction formatExtentLabel(extent: [unknown, unknown]) {\n const start = toFiniteNumber(extent[0]);\n const end = toFiniteNumber(extent[1]);\n\n if (start === undefined && end === undefined) {\n return 'unknown';\n }\n\n if (start === undefined && end !== undefined) {\n return `< ${formatLegendNumber(end)}`;\n }\n\n if (start !== undefined && end === undefined) {\n return `>= ${formatLegendNumber(start)}`;\n }\n\n return `${formatLegendNumber(start!)} - ${formatLegendNumber(end!)}`;\n}\n\nfunction buildSteppedLegendItems(\n scale: DiscreteScaleWithInvertExtent,\n range: string[],\n) {\n return range.map((color) => ({\n label: formatExtentLabel(scale.invertExtent(color)),\n color: parseColorString(color),\n }));\n}\n\nfunction buildGradient(interpolator: (t: number) => string) {\n return `linear-gradient(to right, ${[0, 0.25, 0.5, 0.75, 1]\n .map((offset) => `${interpolator(offset)} ${offset * 100}%`)\n .join(', ')})`;\n}\n\nfunction getGeoArrowOrRowValue(options: {\n value: unknown;\n fieldName: string;\n vector: arrow.Vector;\n}) {\n const {value, fieldName, vector} = options;\n if (\n value &&\n typeof value === 'object' &&\n 'index' in value &&\n typeof (value as {index?: unknown}).index === 'number'\n ) {\n const objectInfo = value as {\n index: number;\n data?: {data?: arrow.Table | arrow.RecordBatch};\n };\n const batch = objectInfo.data?.data;\n const batchFieldName = batch\n ? resolveFieldName(batch, fieldName)\n : undefined;\n\n if (batch && batchFieldName) {\n return batch.getChild(batchFieldName)?.get(objectInfo.index);\n }\n\n return vector.get(objectInfo.index);\n }\n\n return getRowValue(value, fieldName);\n}\n\nfunction createContinuousAccessor(options: {\n fieldName: string;\n vector: arrow.Vector;\n nullColor: [number, number, number, number];\n colorForValue: (value: number) => string;\n}) {\n const {fieldName, vector, nullColor, colorForValue} = options;\n\n return (value: unknown) => {\n const rawValue = getGeoArrowOrRowValue({value, fieldName, vector});\n const numericValue = toFiniteNumber(rawValue);\n if (numericValue === undefined) {\n return nullColor;\n }\n\n return parseColorString(colorForValue(numericValue));\n };\n}\n\nexport function compileColorScale(options: {\n table: arrow.Table;\n colorScale: LayerColorScale;\n}) {\n const {table, colorScale} = options;\n const {fieldName, vector} = getColumn(table, colorScale.field);\n const nullColor = normalizeColor(colorScale.nullColor, DEFAULT_NULL_COLOR);\n\n if (colorScale.type === 'categorical') {\n const baseRange = CATEGORICAL_SCHEMES[colorScale.scheme];\n if (!baseRange) {\n throw new Error(\n `Unsupported categorical colorScale scheme \"${colorScale.scheme}\".`,\n );\n }\n\n const range = colorScale.reverse\n ? [...baseRange].reverse()\n : [...baseRange];\n const scale = scaleOrdinal<string, string>(range);\n const unknownColor = normalizeColor(\n colorScale.unknownColor,\n DEFAULT_UNKNOWN_COLOR,\n );\n\n return (value: unknown) => {\n const rawValue = getGeoArrowOrRowValue({value, fieldName, vector});\n if (rawValue == null) {\n return nullColor;\n }\n\n if (\n typeof rawValue !== 'string' &&\n typeof rawValue !== 'number' &&\n typeof rawValue !== 'boolean'\n ) {\n return unknownColor;\n }\n\n return parseColorString(scale(String(rawValue)));\n };\n }\n\n const numericValues = getNumericValues(vector);\n if (numericValues.length === 0) {\n return createNullColorAccessor(nullColor);\n }\n\n if (colorScale.type === 'sequential') {\n const interpolator = CONTINUOUS_SEQUENTIAL_SCHEMES[colorScale.scheme];\n const domain =\n colorScale.domain === 'auto'\n ? getSequentialDomain(numericValues)\n : colorScale.domain;\n const colorInterpolator = colorScale.reverse\n ? (t: number) => interpolator(1 - t)\n : interpolator;\n const scale = scaleSequential(colorInterpolator).domain(domain);\n if (colorScale.clamp) {\n scale.clamp(true);\n }\n\n return createContinuousAccessor({\n fieldName,\n vector,\n nullColor,\n colorForValue: (value) => scale(value) as string,\n });\n }\n\n if (colorScale.type === 'diverging') {\n const interpolator = CONTINUOUS_DIVERGING_SCHEMES[colorScale.scheme];\n const domain =\n colorScale.domain === 'auto'\n ? getDivergingDomain(numericValues)\n : colorScale.domain;\n const colorInterpolator = colorScale.reverse\n ? (t: number) => interpolator(1 - t)\n : interpolator;\n const scale = scaleDiverging(colorInterpolator).domain(domain);\n if (colorScale.clamp) {\n scale.clamp(true);\n }\n\n return createContinuousAccessor({\n fieldName,\n vector,\n nullColor,\n colorForValue: (value) => scale(value) as string,\n });\n }\n\n if (colorScale.type === 'quantize') {\n const range = getDiscreteNumericColors({\n scheme: colorScale.scheme,\n bins: colorScale.bins ?? DEFAULT_BIN_COUNT,\n reverse: colorScale.reverse,\n });\n const domain =\n colorScale.domain === 'auto'\n ? getSequentialDomain(numericValues)\n : colorScale.domain;\n const scale = scaleQuantize<number, string>()\n .domain(domain)\n .range(range) as unknown as NumericColorScale;\n\n return createContinuousAccessor({\n fieldName,\n vector,\n nullColor,\n colorForValue: scale,\n });\n }\n\n if (colorScale.type === 'quantile') {\n const range = getDiscreteNumericColors({\n scheme: colorScale.scheme,\n bins: colorScale.bins ?? DEFAULT_BIN_COUNT,\n reverse: colorScale.reverse,\n });\n const scale = scaleQuantile<string>()\n .domain(numericValues)\n .range(range) as unknown as NumericColorScale;\n\n return createContinuousAccessor({\n fieldName,\n vector,\n nullColor,\n colorForValue: scale,\n });\n }\n\n const thresholds = [...colorScale.thresholds].sort(\n (left, right) => left - right,\n );\n if (!thresholds.length) {\n throw new Error('Threshold colorScale requires at least one threshold.');\n }\n\n const range = getDiscreteNumericColors({\n scheme: colorScale.scheme,\n bins: thresholds.length + 1,\n reverse: colorScale.reverse,\n });\n const scale = scaleThreshold<number, string>()\n .domain(thresholds)\n .range(range) as unknown as NumericColorScale;\n\n return createContinuousAccessor({\n fieldName,\n vector,\n nullColor,\n colorForValue: (value) => scale(value) as string,\n });\n}\n\nexport function buildColorScaleLegend(options: {\n table: arrow.Table;\n colorScale: LayerColorScale;\n title?: string;\n}): ResolvedColorLegend | null {\n const {table, colorScale, title} = options;\n const {fieldName, vector} = getColumn(table, colorScale.field);\n const resolvedTitle = title && title.trim() ? title.trim() : fieldName;\n\n if (colorScale.type === 'categorical') {\n const baseRange = CATEGORICAL_SCHEMES[colorScale.scheme];\n const range = colorScale.reverse\n ? [...baseRange].reverse()\n : [...baseRange];\n const values = unique(\n Array.from({length: vector.length}, (_, index) =>\n vector.get(index),\n ).filter(\n (value): value is string | number | boolean =>\n value != null &&\n (typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'),\n ),\n );\n\n if (values.length === 0) {\n return null;\n }\n\n return {\n type: 'categorical',\n title: resolvedTitle,\n items: values.map((value, index) => ({\n label: String(value),\n color: parseColorString(range[index % range.length]!),\n })),\n };\n }\n\n const numericValues = getNumericValues(vector);\n if (numericValues.length === 0) {\n return null;\n }\n\n if (colorScale.type === 'sequential') {\n const interpolator = CONTINUOUS_SEQUENTIAL_SCHEMES[colorScale.scheme];\n const domain =\n colorScale.domain === 'auto'\n ? getSequentialDomain(numericValues)\n : colorScale.domain;\n const colorInterpolator = colorScale.reverse\n ? (t: number) => interpolator(1 - t)\n : interpolator;\n\n return {\n type: 'continuous',\n title: resolvedTitle,\n gradient: buildGradient(colorInterpolator),\n ticks: [\n {label: formatLegendNumber(domain[0]), offset: 0},\n {label: formatLegendNumber((domain[0] + domain[1]) / 2), offset: 50},\n {label: formatLegendNumber(domain[1]), offset: 100},\n ],\n };\n }\n\n if (colorScale.type === 'diverging') {\n const interpolator = CONTINUOUS_DIVERGING_SCHEMES[colorScale.scheme];\n const domain =\n colorScale.domain === 'auto'\n ? getDivergingDomain(numericValues)\n : colorScale.domain;\n const colorInterpolator = colorScale.reverse\n ? (t: number) => interpolator(1 - t)\n : interpolator;\n\n return {\n type: 'continuous',\n title: resolvedTitle,\n gradient: buildGradient(colorInterpolator),\n ticks: [\n {label: formatLegendNumber(domain[0]), offset: 0},\n {label: formatLegendNumber(domain[1]), offset: 50},\n {label: formatLegendNumber(domain[2]), offset: 100},\n ],\n };\n }\n\n if (colorScale.type === 'quantize') {\n const range = getDiscreteNumericColors({\n scheme: colorScale.scheme,\n bins: colorScale.bins ?? DEFAULT_BIN_COUNT,\n reverse: colorScale.reverse,\n });\n const domain =\n colorScale.domain === 'auto'\n ? getSequentialDomain(numericValues)\n : colorScale.domain;\n const scale = scaleQuantize<number, string>()\n .domain(domain)\n .range(range) as unknown as NumericColorScale;\n\n return {\n type: 'stepped',\n title: resolvedTitle,\n items: buildSteppedLegendItems(scale, range),\n };\n }\n\n if (colorScale.type === 'quantile') {\n const range = getDiscreteNumericColors({\n scheme: colorScale.scheme,\n bins: colorScale.bins ?? DEFAULT_BIN_COUNT,\n reverse: colorScale.reverse,\n });\n const scale = scaleQuantile<string>()\n .domain(numericValues)\n .range(range) as unknown as NumericColorScale;\n\n return {\n type: 'stepped',\n title: resolvedTitle,\n items: buildSteppedLegendItems(scale, range),\n };\n }\n\n const thresholds = [...colorScale.thresholds].sort(\n (left, right) => left - right,\n );\n if (!thresholds.length) {\n return null;\n }\n\n const range = getDiscreteNumericColors({\n scheme: colorScale.scheme,\n bins: thresholds.length + 1,\n reverse: colorScale.reverse,\n });\n const scale = scaleThreshold<number, string>()\n .domain(thresholds)\n .range(range) as unknown as NumericColorScale;\n\n return {\n type: 'stepped',\n title: resolvedTitle,\n items: buildSteppedLegendItems(scale, range),\n };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as arrow from 'apache-arrow';
|
|
2
|
+
export declare function compileGeoArrowAccessor(expression: string, table: arrow.Table): ({ index, data, target, }: {
|
|
3
|
+
index: number;
|
|
4
|
+
data: {
|
|
5
|
+
data: {
|
|
6
|
+
get: (i: number) => Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
target: number[];
|
|
10
|
+
}) => unknown;
|
|
11
|
+
//# sourceMappingURL=compileGeoArrowAccessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileGeoArrowAccessor.d.ts","sourceRoot":"","sources":["../../src/json/compileGeoArrowAccessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAwE3C,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,8BA6Bf;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QAAC,IAAI,EAAE;YAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAC,CAAA;KAAC,CAAC;IAC5D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,aAUF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function isValidIdentifier(name) {
|
|
2
|
+
return /^[A-Za-z_$][\w$]*$/.test(name);
|
|
3
|
+
}
|
|
4
|
+
const RESERVED_IDENTIFIERS = new Set([
|
|
5
|
+
'true',
|
|
6
|
+
'false',
|
|
7
|
+
'null',
|
|
8
|
+
'undefined',
|
|
9
|
+
'NaN',
|
|
10
|
+
'Infinity',
|
|
11
|
+
'Math',
|
|
12
|
+
'Number',
|
|
13
|
+
'String',
|
|
14
|
+
'Boolean',
|
|
15
|
+
'Array',
|
|
16
|
+
'Object',
|
|
17
|
+
'Date',
|
|
18
|
+
'target',
|
|
19
|
+
]);
|
|
20
|
+
function unique(values) {
|
|
21
|
+
return [...new Set(values)];
|
|
22
|
+
}
|
|
23
|
+
function resolveColumnBindings(expression, table) {
|
|
24
|
+
const schemaFieldNames = table.schema.fields
|
|
25
|
+
.map((field) => field.name)
|
|
26
|
+
.filter(isValidIdentifier);
|
|
27
|
+
const identifiers = unique(Array.from(expression.matchAll(/\b[A-Za-z_$][\w$]*\b/g))
|
|
28
|
+
.map((match) => match[0])
|
|
29
|
+
.filter((identifier) => !RESERVED_IDENTIFIERS.has(identifier)));
|
|
30
|
+
return identifiers.map((identifier) => {
|
|
31
|
+
const exactMatch = schemaFieldNames.find((fieldName) => fieldName === identifier);
|
|
32
|
+
if (exactMatch) {
|
|
33
|
+
return { identifier, columnName: exactMatch };
|
|
34
|
+
}
|
|
35
|
+
const caseInsensitiveMatches = schemaFieldNames.filter((fieldName) => fieldName.toLowerCase() === identifier.toLowerCase());
|
|
36
|
+
return {
|
|
37
|
+
identifier,
|
|
38
|
+
columnName: caseInsensitiveMatches.length === 1
|
|
39
|
+
? caseInsensitiveMatches[0]
|
|
40
|
+
: undefined,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function copyArrayLikeIntoTarget(result) {
|
|
45
|
+
if (!Array.isArray(result) && !ArrayBuffer.isView(result)) {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
// TODO(geoarrow-upgrade): Keep returning plain JS arrays for 0.3.x. Reusing deck's
|
|
49
|
+
// typed `target` buffer here caused `ScatterplotLayer` binary attribute errors
|
|
50
|
+
// (`Float64Array`) when GeoArrow delegated to deck sublayers. If the next GeoArrow
|
|
51
|
+
// runtime changes the callback contract, re-evaluate whether target reuse is safe.
|
|
52
|
+
return Array.from(result);
|
|
53
|
+
}
|
|
54
|
+
export function compileGeoArrowAccessor(expression, table) {
|
|
55
|
+
const trimmedExpression = expression.trim();
|
|
56
|
+
if (trimmedExpression === '-') {
|
|
57
|
+
return ({ index, data, }) => data.data.get(index);
|
|
58
|
+
}
|
|
59
|
+
const bindings = resolveColumnBindings(trimmedExpression, table);
|
|
60
|
+
const evaluator = new Function(...bindings.map((binding) => binding.identifier), 'target', `return (${trimmedExpression});`);
|
|
61
|
+
// TODO(geoarrow-upgrade): This custom evaluator exists because published 0.3.x
|
|
62
|
+
// GeoArrow callbacks are batch-oriented rather than deck.gl/json row-oriented. If
|
|
63
|
+
// the next version aligns with deck.gl/json accessors, remove this compiler and
|
|
64
|
+
// let the standard JSON conversion pipeline handle expressions.
|
|
65
|
+
return ({ index, data, target, }) => {
|
|
66
|
+
const batch = data.data;
|
|
67
|
+
const args = bindings.map((binding) => binding.columnName
|
|
68
|
+
? batch.getChild(binding.columnName)?.get(index)
|
|
69
|
+
: undefined);
|
|
70
|
+
const result = evaluator(...args, target);
|
|
71
|
+
return copyArrayLikeIntoTarget(result);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=compileGeoArrowAccessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileGeoArrowAccessor.js","sourceRoot":"","sources":["../../src/json/compileGeoArrowAccessor.ts"],"names":[],"mappings":"A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O,CAAC,EACN,KAAK,EACL,IAAI,EACJ,MAAM,GAKP,EAAE,EAAE;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,IAAuC,CAAC;QAC3D,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACpC,OAAO,CAAC,UAAU;YAChB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC;YAChD,CAAC,CAAC,SAAS,CACd,CAAC;QACF,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1C,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type * as arrow from 'apache-arrow';\n\nfunction isValidIdentifier(name: string) {\n return /^[A-Za-z_$][\\w$]*$/.test(name);\n}\n\nconst RESERVED_IDENTIFIERS = new Set([\n 'true',\n 'false',\n 'null',\n 'undefined',\n 'NaN',\n 'Infinity',\n 'Math',\n 'Number',\n 'String',\n 'Boolean',\n 'Array',\n 'Object',\n 'Date',\n 'target',\n]);\n\nfunction unique<T>(values: T[]) {\n return [...new Set(values)];\n}\n\nfunction resolveColumnBindings(expression: string, table: arrow.Table) {\n const schemaFieldNames = table.schema.fields\n .map((field) => field.name)\n .filter(isValidIdentifier);\n\n const identifiers = unique(\n Array.from(expression.matchAll(/\\b[A-Za-z_$][\\w$]*\\b/g))\n .map((match) => match[0])\n .filter((identifier) => !RESERVED_IDENTIFIERS.has(identifier)),\n );\n\n return identifiers.map((identifier) => {\n const exactMatch = schemaFieldNames.find(\n (fieldName) => fieldName === identifier,\n );\n if (exactMatch) {\n return {identifier, columnName: exactMatch};\n }\n\n const caseInsensitiveMatches = schemaFieldNames.filter(\n (fieldName) => fieldName.toLowerCase() === identifier.toLowerCase(),\n );\n\n return {\n identifier,\n columnName:\n caseInsensitiveMatches.length === 1\n ? caseInsensitiveMatches[0]!\n : undefined,\n };\n });\n}\n\nfunction copyArrayLikeIntoTarget(result: unknown) {\n if (!Array.isArray(result) && !ArrayBuffer.isView(result)) {\n return result;\n }\n\n // TODO(geoarrow-upgrade): Keep returning plain JS arrays for 0.3.x. Reusing deck's\n // typed `target` buffer here caused `ScatterplotLayer` binary attribute errors\n // (`Float64Array`) when GeoArrow delegated to deck sublayers. If the next GeoArrow\n // runtime changes the callback contract, re-evaluate whether target reuse is safe.\n return Array.from(result as ArrayLike<number>);\n}\n\nexport function compileGeoArrowAccessor(\n expression: string,\n table: arrow.Table,\n) {\n const trimmedExpression = expression.trim();\n if (trimmedExpression === '-') {\n return ({\n index,\n data,\n }: {\n index: number;\n data: {data: {get: (i: number) => unknown}};\n }) => data.data.get(index);\n }\n\n const bindings = resolveColumnBindings(trimmedExpression, table);\n\n const evaluator = new Function(\n ...bindings.map((binding) => binding.identifier),\n 'target',\n `return (${trimmedExpression});`,\n ) as (...args: unknown[]) => unknown;\n\n // TODO(geoarrow-upgrade): This custom evaluator exists because published 0.3.x\n // GeoArrow callbacks are batch-oriented rather than deck.gl/json row-oriented. If\n // the next version aligns with deck.gl/json accessors, remove this compiler and\n // let the standard JSON conversion pipeline handle expressions.\n return ({\n index,\n data,\n target,\n }: {\n index: number;\n data: {data: {get: (i: number) => Record<string, unknown>}};\n target: number[];\n }) => {\n const batch = data.data as arrow.Table | arrow.RecordBatch;\n const args = bindings.map((binding) =>\n binding.columnName\n ? batch.getChild(binding.columnName)?.get(index)\n : undefined,\n );\n const result = evaluator(...args, target);\n return copyArrayLikeIntoTarget(result);\n };\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JSONConfiguration } from '@deck.gl/json';
|
|
2
|
+
import type { PreparedDeckDatasetState } from '../types';
|
|
3
|
+
type CreateDeckJsonConfigurationOptions = {
|
|
4
|
+
datasetStates: Record<string, PreparedDeckDatasetState>;
|
|
5
|
+
datasetIds: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function createDeckJsonConfiguration(options: CreateDeckJsonConfigurationOptions): JSONConfiguration;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=createDeckJsonConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDeckJsonConfiguration.d.ts","sourceRoot":"","sources":["../../src/json/createDeckJsonConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAsB,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAqB5E,KAAK,kCAAkC,GAAG;IACxC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACxD,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAgCF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,kCAAkC,qBAqH5C"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { JSONConfiguration } from '@deck.gl/json';
|
|
2
|
+
import { DEFAULT_DECK_JSON_CLASSES, DEFAULT_DECK_JSON_CONSTANTS, DEFAULT_DECK_JSON_ENUMERATIONS, } from './defaultClasses';
|
|
3
|
+
import { getLayerCompatibility, isSupportedGeoArrowLayerType, } from './layerCompatibility';
|
|
4
|
+
import { isManagedLayer, resolveColorScale, resolveDatasetId, resolveGeometryColumn, stripLayerExtensionProps, } from './layerConfig';
|
|
5
|
+
import { rewriteGeoArrowAccessors } from './rewriteGeoArrowAccessors';
|
|
6
|
+
import { wkbGeometryDecoder } from '../prepare/wkbDecoder';
|
|
7
|
+
import { compileColorScale } from './compileColorScale';
|
|
8
|
+
function getLayerName(Class) {
|
|
9
|
+
const maybeClass = Class;
|
|
10
|
+
return maybeClass.layerName ?? maybeClass.name ?? 'UnknownLayer';
|
|
11
|
+
}
|
|
12
|
+
function applyColorScale(options) {
|
|
13
|
+
const { props, layerProps, table } = options;
|
|
14
|
+
const colorScale = resolveColorScale(layerProps);
|
|
15
|
+
if (!colorScale) {
|
|
16
|
+
return props;
|
|
17
|
+
}
|
|
18
|
+
const targetProp = colorScale.prop ?? 'getFillColor';
|
|
19
|
+
if (props[targetProp] !== undefined) {
|
|
20
|
+
return props;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
...props,
|
|
24
|
+
[targetProp]: compileColorScale({
|
|
25
|
+
table,
|
|
26
|
+
colorScale,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function createDeckJsonConfiguration(options) {
|
|
31
|
+
const { datasetStates, datasetIds } = options;
|
|
32
|
+
return new JSONConfiguration({
|
|
33
|
+
classes: DEFAULT_DECK_JSON_CLASSES,
|
|
34
|
+
enumerations: DEFAULT_DECK_JSON_ENUMERATIONS,
|
|
35
|
+
constants: DEFAULT_DECK_JSON_CONSTANTS,
|
|
36
|
+
// TODO(geoarrow-upgrade): In 0.3.x we preserve raw `@@=` strings here because
|
|
37
|
+
// `@deck.gl/json` would otherwise eagerly compile them into row-based accessors
|
|
38
|
+
// before `preProcessClassProps` can rewrite them for GeoArrow. If the next
|
|
39
|
+
// GeoArrow version can consume deck.gl/json's converted accessors directly, or
|
|
40
|
+
// exposes a cleaner injection seam, remove this shim.
|
|
41
|
+
convertFunction: (expression) => `@@=${expression}`,
|
|
42
|
+
preProcessClassProps: (Class, props) => {
|
|
43
|
+
const layerName = getLayerName(Class);
|
|
44
|
+
const compatibility = getLayerCompatibility(layerName);
|
|
45
|
+
if (!compatibility) {
|
|
46
|
+
return props;
|
|
47
|
+
}
|
|
48
|
+
const layerProps = props;
|
|
49
|
+
const extensionProps = layerProps;
|
|
50
|
+
const datasetId = resolveDatasetId(extensionProps, datasetIds);
|
|
51
|
+
const managed = isManagedLayer(extensionProps, datasetIds) ||
|
|
52
|
+
(datasetIds.length > 1 && layerProps.data === undefined);
|
|
53
|
+
if (!managed) {
|
|
54
|
+
return props;
|
|
55
|
+
}
|
|
56
|
+
if (!datasetId) {
|
|
57
|
+
throw new Error(`Layer "${layerName}" must declare _sqlrooms.dataset when multiple datasets are available.`);
|
|
58
|
+
}
|
|
59
|
+
const datasetState = datasetStates[datasetId];
|
|
60
|
+
if (!datasetState) {
|
|
61
|
+
throw new Error(`Layer "${layerName}" references unknown dataset "${datasetId}".`);
|
|
62
|
+
}
|
|
63
|
+
if (datasetState.status !== 'ready') {
|
|
64
|
+
return stripLayerExtensionProps(layerProps);
|
|
65
|
+
}
|
|
66
|
+
const prepared = datasetState.prepared;
|
|
67
|
+
const geometryColumn = resolveGeometryColumn(extensionProps);
|
|
68
|
+
const baseProps = applyColorScale({
|
|
69
|
+
props: stripLayerExtensionProps(layerProps),
|
|
70
|
+
layerProps: extensionProps,
|
|
71
|
+
table: prepared.table,
|
|
72
|
+
});
|
|
73
|
+
if (compatibility.representation === 'geojson') {
|
|
74
|
+
return {
|
|
75
|
+
...baseProps,
|
|
76
|
+
data: prepared.getGeoJsonBinaryData(geometryColumn),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const resolvedGeometry = prepared.resolveGeometry(geometryColumn);
|
|
80
|
+
if (!resolvedGeometry.nativeGeoArrow &&
|
|
81
|
+
!(isSupportedGeoArrowLayerType(layerName) &&
|
|
82
|
+
wkbGeometryDecoder.supportsGeoArrowPromotion(layerName, resolvedGeometry.encoding, prepared.table, resolvedGeometry.columnName))) {
|
|
83
|
+
throw new Error(`Layer "${layerName}" cannot render geometry encoding "${resolvedGeometry.encoding}" for dataset "${datasetId}".`);
|
|
84
|
+
}
|
|
85
|
+
const geoArrowLayerData = prepared.getGeoArrowLayerData(geometryColumn);
|
|
86
|
+
const nextProps = {
|
|
87
|
+
...baseProps,
|
|
88
|
+
// TODO(geoarrow-upgrade): 0.3.x expects `data` as an Arrow Table and the
|
|
89
|
+
// geometry accessor as an Arrow Vector. Re-check this payload contract when
|
|
90
|
+
// upgrading; newer GeoArrow code may prefer RecordBatch/Data chunks instead.
|
|
91
|
+
data: geoArrowLayerData.table,
|
|
92
|
+
[compatibility.geometryProp]: baseProps[compatibility.geometryProp] ??
|
|
93
|
+
geoArrowLayerData.geometryColumn,
|
|
94
|
+
};
|
|
95
|
+
return rewriteGeoArrowAccessors({
|
|
96
|
+
props: nextProps,
|
|
97
|
+
table: geoArrowLayerData.table,
|
|
98
|
+
layerName,
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
postProcessConvertedJson: (json) => {
|
|
102
|
+
if (json &&
|
|
103
|
+
typeof json === 'object' &&
|
|
104
|
+
'layers' in json &&
|
|
105
|
+
Array.isArray(json.layers)) {
|
|
106
|
+
json.layers = json.layers.filter(Boolean);
|
|
107
|
+
}
|
|
108
|
+
return json;
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=createDeckJsonConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDeckJsonConfiguration.js","sourceRoot":"","sources":["../../src/json/createDeckJsonConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAOtD,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,UAAU,GAAG,KAA4C,CAAC;IAChE,OAAO,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC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BAChC,CAAC,CACC,4BAA4B,CAAC,SAAS,CAAC;oBACvC,kBAAkB,CAAC,yBAAyB,CAC1C,SAAS,EACT,gBAAgB,CAAC,QAAQ,EACzB,QAAQ,CAAC,KAAK,EACd,gBAAgB,CAAC,UAAU,CAC5B,CACF,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,UAAU,SAAS,sCAAsC,gBAAgB,CAAC,QAAQ,kBAAkB,SAAS,IAAI,CAClH,CAAC;YACJ,CAAC;YAED,MAAM,iBAAiB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACxE,MAAM,SAAS,GAAG;gBAChB,GAAG,SAAS;gBACZ,yEAAyE;gBACzE,4EAA4E;gBAC5E,6EAA6E;gBAC7E,IAAI,EAAE,iBAAiB,CAAC,KAAK;gBAC7B,CAAC,aAAa,CAAC,YAAY,CAAC,EAC1B,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC;oBACrC,iBAAiB,CAAC,cAAc;aACnC,CAAC;YAEF,OAAO,wBAAwB,CAAC;gBAC9B,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,iBAAiB,CAAC,KAAK;gBAC9B,SAAS;aACV,CAAC,CAAC;QACL,CAAC;QACD,wBAAwB,EAAE,CAAC,IAAa,EAAE,EAAE;YAC1C,IACE,IAAI;gBACJ,OAAO,IAAI,KAAK,QAAQ;gBACxB,QAAQ,IAAI,IAAI;gBAChB,KAAK,CAAC,OAAO,CAAE,IAA6B,CAAC,MAAM,CAAC,EACpD,CAAC;gBACA,IAA4B,CAAC,MAAM,GAClC,IACD,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {JSONConfiguration} from '@deck.gl/json';\nimport type {LayerExtensionProps, PreparedDeckDatasetState} from '../types';\nimport {\n DEFAULT_DECK_JSON_CLASSES,\n DEFAULT_DECK_JSON_CONSTANTS,\n DEFAULT_DECK_JSON_ENUMERATIONS,\n} from './defaultClasses';\nimport {\n getLayerCompatibility,\n isSupportedGeoArrowLayerType,\n} from './layerCompatibility';\nimport {\n isManagedLayer,\n resolveColorScale,\n resolveDatasetId,\n resolveGeometryColumn,\n stripLayerExtensionProps,\n} from './layerConfig';\nimport {rewriteGeoArrowAccessors} from './rewriteGeoArrowAccessors';\nimport {wkbGeometryDecoder} from '../prepare/wkbDecoder';\nimport {compileColorScale} from './compileColorScale';\n\ntype CreateDeckJsonConfigurationOptions = {\n datasetStates: Record<string, PreparedDeckDatasetState>;\n datasetIds: string[];\n};\n\nfunction getLayerName(Class: unknown) {\n const maybeClass = Class as {layerName?: string; name?: string};\n return maybeClass.layerName ?? maybeClass.name ?? 'UnknownLayer';\n}\n\nfunction applyColorScale(options: {\n props: Record<string, unknown>;\n layerProps: LayerExtensionProps & Record<string, unknown>;\n table: import('apache-arrow').Table;\n}) {\n const {props, layerProps, table} = options;\n const colorScale = resolveColorScale(layerProps);\n if (!colorScale) {\n return props;\n }\n\n const targetProp = colorScale.prop ?? 'getFillColor';\n if (props[targetProp] !== undefined) {\n return props;\n }\n\n return {\n ...props,\n [targetProp]: compileColorScale({\n table,\n colorScale,\n }),\n };\n}\n\nexport function createDeckJsonConfiguration(\n options: CreateDeckJsonConfigurationOptions,\n) {\n const {datasetStates, datasetIds} = options;\n\n return new JSONConfiguration({\n classes: DEFAULT_DECK_JSON_CLASSES,\n enumerations: DEFAULT_DECK_JSON_ENUMERATIONS,\n constants: DEFAULT_DECK_JSON_CONSTANTS,\n // TODO(geoarrow-upgrade): In 0.3.x we preserve raw `@@=` strings here because\n // `@deck.gl/json` would otherwise eagerly compile them into row-based accessors\n // before `preProcessClassProps` can rewrite them for GeoArrow. If the next\n // GeoArrow version can consume deck.gl/json's converted accessors directly, or\n // exposes a cleaner injection seam, remove this shim.\n convertFunction: (expression: string) => `@@=${expression}`,\n preProcessClassProps: (Class: unknown, props: unknown) => {\n const layerName = getLayerName(Class);\n const compatibility = getLayerCompatibility(layerName);\n\n if (!compatibility) {\n return props;\n }\n\n const layerProps = props as Record<string, unknown>;\n const extensionProps = layerProps as typeof layerProps &\n LayerExtensionProps;\n const datasetId = resolveDatasetId(extensionProps, datasetIds);\n const managed =\n isManagedLayer(extensionProps, datasetIds) ||\n (datasetIds.length > 1 && layerProps.data === undefined);\n\n if (!managed) {\n return props;\n }\n\n if (!datasetId) {\n throw new Error(\n `Layer \"${layerName}\" must declare _sqlrooms.dataset when multiple datasets are available.`,\n );\n }\n\n const datasetState = datasetStates[datasetId];\n if (!datasetState) {\n throw new Error(\n `Layer \"${layerName}\" references unknown dataset \"${datasetId}\".`,\n );\n }\n\n if (datasetState.status !== 'ready') {\n return stripLayerExtensionProps(layerProps);\n }\n\n const prepared = datasetState.prepared;\n const geometryColumn = resolveGeometryColumn(extensionProps);\n const baseProps = applyColorScale({\n props: stripLayerExtensionProps(layerProps),\n layerProps: extensionProps,\n table: prepared.table,\n });\n\n if (compatibility.representation === 'geojson') {\n return {\n ...baseProps,\n data: prepared.getGeoJsonBinaryData(geometryColumn),\n };\n }\n\n const resolvedGeometry = prepared.resolveGeometry(geometryColumn);\n if (\n !resolvedGeometry.nativeGeoArrow &&\n !(\n isSupportedGeoArrowLayerType(layerName) &&\n wkbGeometryDecoder.supportsGeoArrowPromotion(\n layerName,\n resolvedGeometry.encoding,\n prepared.table,\n resolvedGeometry.columnName,\n )\n )\n ) {\n throw new Error(\n `Layer \"${layerName}\" cannot render geometry encoding \"${resolvedGeometry.encoding}\" for dataset \"${datasetId}\".`,\n );\n }\n\n const geoArrowLayerData = prepared.getGeoArrowLayerData(geometryColumn);\n const nextProps = {\n ...baseProps,\n // TODO(geoarrow-upgrade): 0.3.x expects `data` as an Arrow Table and the\n // geometry accessor as an Arrow Vector. Re-check this payload contract when\n // upgrading; newer GeoArrow code may prefer RecordBatch/Data chunks instead.\n data: geoArrowLayerData.table,\n [compatibility.geometryProp]:\n baseProps[compatibility.geometryProp] ??\n geoArrowLayerData.geometryColumn,\n };\n\n return rewriteGeoArrowAccessors({\n props: nextProps,\n table: geoArrowLayerData.table,\n layerName,\n });\n },\n postProcessConvertedJson: (json: unknown) => {\n if (\n json &&\n typeof json === 'object' &&\n 'layers' in json &&\n Array.isArray((json as {layers?: unknown[]}).layers)\n ) {\n (json as {layers: unknown[]}).layers = (\n json as {layers: unknown[]}\n ).layers.filter(Boolean);\n }\n\n return json;\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FirstPersonView, MapView, OrbitView, OrthographicView } from '@deck.gl/core';
|
|
2
|
+
import { GeoJsonLayer } from '@deck.gl/layers';
|
|
3
|
+
import { GeoArrowPathLayer, GeoArrowScatterplotLayer, GeoArrowSolidPolygonLayer } from '@geoarrow/deck.gl-layers';
|
|
4
|
+
export declare const DEFAULT_DECK_JSON_CLASSES: {
|
|
5
|
+
MapView: typeof MapView;
|
|
6
|
+
FirstPersonView: typeof FirstPersonView;
|
|
7
|
+
OrbitView: typeof OrbitView;
|
|
8
|
+
OrthographicView: typeof OrthographicView;
|
|
9
|
+
GeoJsonLayer: typeof GeoJsonLayer;
|
|
10
|
+
GeoArrowScatterplotLayer: typeof GeoArrowScatterplotLayer;
|
|
11
|
+
GeoArrowPathLayer: typeof GeoArrowPathLayer;
|
|
12
|
+
GeoArrowSolidPolygonLayer: typeof GeoArrowSolidPolygonLayer;
|
|
13
|
+
};
|
|
14
|
+
export declare const DEFAULT_DECK_JSON_ENUMERATIONS: {
|
|
15
|
+
COORDINATE_SYSTEM: {
|
|
16
|
+
readonly DEFAULT: -1;
|
|
17
|
+
readonly LNGLAT: 1;
|
|
18
|
+
readonly METER_OFFSETS: 2;
|
|
19
|
+
readonly LNGLAT_OFFSETS: 3;
|
|
20
|
+
readonly CARTESIAN: 0;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const DEFAULT_DECK_JSON_CONSTANTS: {};
|
|
24
|
+
//# sourceMappingURL=defaultClasses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultClasses.d.ts","sourceRoot":"","sources":["../../src/json/defaultClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,OAAO,EACP,SAAS,EACT,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAKlC,eAAO,MAAM,yBAAyB;;;;;;;;;CASrC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;CAE1C,CAAC;AAEF,eAAO,MAAM,2BAA2B,IAAK,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { COORDINATE_SYSTEM, FirstPersonView, MapView, OrbitView, OrthographicView, } from '@deck.gl/core';
|
|
2
|
+
import { GeoJsonLayer } from '@deck.gl/layers';
|
|
3
|
+
import { GeoArrowPathLayer, GeoArrowScatterplotLayer, GeoArrowSolidPolygonLayer, } from '@geoarrow/deck.gl-layers';
|
|
4
|
+
// TODO(geoarrow-upgrade): Revisit this import surface on the next GeoArrow bump.
|
|
5
|
+
// Published 0.3.x uses `@geoarrow/deck.gl-layers`; newer lines may rename the package
|
|
6
|
+
// and/or move the exported layer classes.
|
|
7
|
+
export const DEFAULT_DECK_JSON_CLASSES = {
|
|
8
|
+
MapView,
|
|
9
|
+
FirstPersonView,
|
|
10
|
+
OrbitView,
|
|
11
|
+
OrthographicView,
|
|
12
|
+
GeoJsonLayer,
|
|
13
|
+
GeoArrowScatterplotLayer,
|
|
14
|
+
GeoArrowPathLayer,
|
|
15
|
+
GeoArrowSolidPolygonLayer,
|
|
16
|
+
};
|
|
17
|
+
export const DEFAULT_DECK_JSON_ENUMERATIONS = {
|
|
18
|
+
COORDINATE_SYSTEM,
|
|
19
|
+
};
|
|
20
|
+
export const DEFAULT_DECK_JSON_CONSTANTS = {};
|
|
21
|
+
//# sourceMappingURL=defaultClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultClasses.js","sourceRoot":"","sources":["../../src/json/defaultClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,iFAAiF;AACjF,sFAAsF;AACtF,0CAA0C;AAC1C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO;IACP,eAAe;IACf,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,wBAAwB;IACxB,iBAAiB;IACjB,yBAAyB;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,iBAAiB;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC","sourcesContent":["import {\n COORDINATE_SYSTEM,\n FirstPersonView,\n MapView,\n OrbitView,\n OrthographicView,\n} from '@deck.gl/core';\nimport {GeoJsonLayer} from '@deck.gl/layers';\nimport {\n GeoArrowPathLayer,\n GeoArrowScatterplotLayer,\n GeoArrowSolidPolygonLayer,\n} from '@geoarrow/deck.gl-layers';\n\n// TODO(geoarrow-upgrade): Revisit this import surface on the next GeoArrow bump.\n// Published 0.3.x uses `@geoarrow/deck.gl-layers`; newer lines may rename the package\n// and/or move the exported layer classes.\nexport const DEFAULT_DECK_JSON_CLASSES = {\n MapView,\n FirstPersonView,\n OrbitView,\n OrthographicView,\n GeoJsonLayer,\n GeoArrowScatterplotLayer,\n GeoArrowPathLayer,\n GeoArrowSolidPolygonLayer,\n};\n\nexport const DEFAULT_DECK_JSON_ENUMERATIONS = {\n COORDINATE_SYSTEM,\n};\n\nexport const DEFAULT_DECK_JSON_CONSTANTS = {};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PreparedDeckDatasetState } from '../types';
|
|
2
|
+
import { type ResolvedColorLegend } from './compileColorScale';
|
|
3
|
+
export declare function extractColorScaleLegends(options: {
|
|
4
|
+
spec: Record<string, unknown> | null;
|
|
5
|
+
datasetIds: string[];
|
|
6
|
+
datasetStates: Record<string, PreparedDeckDatasetState>;
|
|
7
|
+
}): ResolvedColorLegend[];
|
|
8
|
+
//# sourceMappingURL=extractColorScaleLegends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractColorScaleLegends.d.ts","sourceRoot":"","sources":["../../src/json/extractColorScaleLegends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAC5E,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAuB7B,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;CACzD,yBA4CA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { buildColorScaleLegend, } from './compileColorScale';
|
|
2
|
+
import { resolveColorLegend, resolveColorScale, resolveDatasetId, } from './layerConfig';
|
|
3
|
+
function resolveLegendTitle(layerProps, fallbackField) {
|
|
4
|
+
const legend = resolveColorLegend(layerProps);
|
|
5
|
+
if (legend &&
|
|
6
|
+
typeof legend === 'object' &&
|
|
7
|
+
typeof legend.title === 'string') {
|
|
8
|
+
return legend.title;
|
|
9
|
+
}
|
|
10
|
+
return fallbackField;
|
|
11
|
+
}
|
|
12
|
+
export function extractColorScaleLegends(options) {
|
|
13
|
+
const { spec, datasetIds, datasetStates } = options;
|
|
14
|
+
if (!spec || !Array.isArray(spec.layers)) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const legends = [];
|
|
18
|
+
for (const layer of spec.layers) {
|
|
19
|
+
if (!layer || typeof layer !== 'object') {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const layerProps = layer;
|
|
23
|
+
const extensionProps = layerProps;
|
|
24
|
+
const colorScale = resolveColorScale(extensionProps);
|
|
25
|
+
const legend = resolveColorLegend(extensionProps);
|
|
26
|
+
if (!colorScale || legend === false) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const datasetId = resolveDatasetId(layerProps, datasetIds);
|
|
30
|
+
if (!datasetId) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const datasetState = datasetStates[datasetId];
|
|
34
|
+
if (!datasetState || datasetState.status !== 'ready') {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const resolvedLegend = buildColorScaleLegend({
|
|
38
|
+
table: datasetState.prepared.table,
|
|
39
|
+
colorScale,
|
|
40
|
+
title: resolveLegendTitle(layerProps, colorScale.field),
|
|
41
|
+
});
|
|
42
|
+
if (resolvedLegend) {
|
|
43
|
+
legends.push(resolvedLegend);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return legends;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=extractColorScaleLegends.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractColorScaleLegends.js","sourceRoot":"","sources":["../../src/json/extractColorScaleLegends.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,GAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,SAAS,kBAAkB,CACzB,UAAmC,EAC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,MAAM,cAAc,GAAG,qBAAqB,CAAC;YAC3C,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK;YAClC,UAAU;YACV,KAAK,EAAE,kBAAkB,CAAC,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC;SACxD,CAAC,CAAC;QAEH,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type {LayerExtensionProps, PreparedDeckDatasetState} from '../types';\nimport {\n buildColorScaleLegend,\n type ResolvedColorLegend,\n} from './compileColorScale';\nimport {\n resolveColorLegend,\n resolveColorScale,\n resolveDatasetId,\n} from './layerConfig';\n\nfunction resolveLegendTitle(\n layerProps: Record<string, unknown>,\n fallbackField: string,\n) {\n const legend = resolveColorLegend(layerProps);\n if (\n legend &&\n typeof legend === 'object' &&\n typeof legend.title === 'string'\n ) {\n return legend.title;\n }\n\n return fallbackField;\n}\n\nexport function extractColorScaleLegends(options: {\n spec: Record<string, unknown> | null;\n datasetIds: string[];\n datasetStates: Record<string, PreparedDeckDatasetState>;\n}) {\n const {spec, datasetIds, datasetStates} = options;\n if (!spec || !Array.isArray(spec.layers)) {\n return [] as ResolvedColorLegend[];\n }\n\n const legends: ResolvedColorLegend[] = [];\n\n for (const layer of spec.layers) {\n if (!layer || typeof layer !== 'object') {\n continue;\n }\n\n const layerProps = layer as Record<string, unknown>;\n const extensionProps = layerProps as LayerExtensionProps &\n Record<string, unknown>;\n const colorScale = resolveColorScale(extensionProps);\n const legend = resolveColorLegend(extensionProps);\n if (!colorScale || legend === false) {\n continue;\n }\n\n const datasetId = resolveDatasetId(layerProps, datasetIds);\n if (!datasetId) {\n continue;\n }\n\n const datasetState = datasetStates[datasetId];\n if (!datasetState || datasetState.status !== 'ready') {\n continue;\n }\n\n const resolvedLegend = buildColorScaleLegend({\n table: datasetState.prepared.table,\n colorScale,\n title: resolveLegendTitle(layerProps, colorScale.field),\n });\n\n if (resolvedLegend) {\n legends.push(resolvedLegend);\n }\n }\n\n return legends;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SupportedGeoArrowLayerType } from '../prepare/geometryDecoder';
|
|
2
|
+
type GeoJsonCompatibility = {
|
|
3
|
+
representation: 'geojson';
|
|
4
|
+
vectorAccessorProps: string[];
|
|
5
|
+
};
|
|
6
|
+
type GeoArrowCompatibility = {
|
|
7
|
+
representation: 'geoarrow';
|
|
8
|
+
geometryProp: string;
|
|
9
|
+
vectorAccessorProps: string[];
|
|
10
|
+
};
|
|
11
|
+
type LayerCompatibility = GeoJsonCompatibility | GeoArrowCompatibility;
|
|
12
|
+
export declare function getLayerCompatibility(layerName: string): LayerCompatibility | undefined;
|
|
13
|
+
export declare function isSupportedGeoArrowLayerType(layerName: string): layerName is SupportedGeoArrowLayerType;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=layerCompatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerCompatibility.d.ts","sourceRoot":"","sources":["../../src/json/layerCompatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,4BAA4B,CAAC;AAE3E,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,SAAS,CAAC;IAC1B,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,cAAc,EAAE,UAAU,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,KAAK,kBAAkB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AA8BvE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,kCAEtD;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,SAAS,IAAI,0BAA0B,CAMzC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const LAYER_COMPATIBILITY = {
|
|
2
|
+
GeoJsonLayer: {
|
|
3
|
+
representation: 'geojson',
|
|
4
|
+
vectorAccessorProps: [],
|
|
5
|
+
},
|
|
6
|
+
GeoArrowScatterplotLayer: {
|
|
7
|
+
representation: 'geoarrow',
|
|
8
|
+
geometryProp: 'getPosition',
|
|
9
|
+
vectorAccessorProps: [
|
|
10
|
+
'getPosition',
|
|
11
|
+
'getRadius',
|
|
12
|
+
'getFillColor',
|
|
13
|
+
'getLineColor',
|
|
14
|
+
'getLineWidth',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
GeoArrowPathLayer: {
|
|
18
|
+
representation: 'geoarrow',
|
|
19
|
+
geometryProp: 'getPath',
|
|
20
|
+
vectorAccessorProps: ['getPath', 'getColor', 'getWidth'],
|
|
21
|
+
},
|
|
22
|
+
GeoArrowSolidPolygonLayer: {
|
|
23
|
+
representation: 'geoarrow',
|
|
24
|
+
geometryProp: 'getPolygon',
|
|
25
|
+
vectorAccessorProps: ['getPolygon', 'getElevation', 'getFillColor', 'getLineColor'],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export function getLayerCompatibility(layerName) {
|
|
29
|
+
return LAYER_COMPATIBILITY[layerName];
|
|
30
|
+
}
|
|
31
|
+
export function isSupportedGeoArrowLayerType(layerName) {
|
|
32
|
+
return [
|
|
33
|
+
'GeoArrowScatterplotLayer',
|
|
34
|
+
'GeoArrowPathLayer',
|
|
35
|
+
'GeoArrowSolidPolygonLayer',
|
|
36
|
+
].includes(layerName);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=layerCompatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerCompatibility.js","sourceRoot":"","sources":["../../src/json/layerCompatibility.ts"],"names":[],"mappings":"AAeA,MAAM,mBAAmB,GAAuC;IAC9D,YAAY,EAAE;QACZ,cAAc,EAAE,SAAS;QACzB,mBAAmB,EAAE,EAAE;KACxB;IACD,wBAAwB,EAAE;QACxB,cAAc,EAAE,UAAU;QAC1B,YAAY,EAAE,aAAa;QAC3B,mBAAmB,EAAE;YACnB,aAAa;YACb,WAAW;YACX,cAAc;YACd,cAAc;YACd,cAAc;SACf;KACF;IACD,iBAAiB,EAAE;QACjB,cAAc,EAAE,UAAU;QAC1B,YAAY,EAAE,SAAS;QACvB,mBAAmB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC;KACzD;IACD,yBAAyB,EAAE;QACzB,cAAc,EAAE,UAAU;QAC1B,YAAY,EAAE,YAAY;QAC1B,mBAAmB,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAC;KACpF;CACF,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACrD,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,SAAiB;IAEjB,OAAO;QACL,0BAA0B;QAC1B,mBAAmB;QACnB,2BAA2B;KAC5B,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACxB,CAAC","sourcesContent":["import type {SupportedGeoArrowLayerType} from '../prepare/geometryDecoder';\n\ntype GeoJsonCompatibility = {\n representation: 'geojson';\n vectorAccessorProps: string[];\n};\n\ntype GeoArrowCompatibility = {\n representation: 'geoarrow';\n geometryProp: string;\n vectorAccessorProps: string[];\n};\n\ntype LayerCompatibility = GeoJsonCompatibility | GeoArrowCompatibility;\n\nconst LAYER_COMPATIBILITY: Record<string, LayerCompatibility> = {\n GeoJsonLayer: {\n representation: 'geojson',\n vectorAccessorProps: [],\n },\n GeoArrowScatterplotLayer: {\n representation: 'geoarrow',\n geometryProp: 'getPosition',\n vectorAccessorProps: [\n 'getPosition',\n 'getRadius',\n 'getFillColor',\n 'getLineColor',\n 'getLineWidth',\n ],\n },\n GeoArrowPathLayer: {\n representation: 'geoarrow',\n geometryProp: 'getPath',\n vectorAccessorProps: ['getPath', 'getColor', 'getWidth'],\n },\n GeoArrowSolidPolygonLayer: {\n representation: 'geoarrow',\n geometryProp: 'getPolygon',\n vectorAccessorProps: ['getPolygon', 'getElevation', 'getFillColor', 'getLineColor'],\n },\n};\n\nexport function getLayerCompatibility(layerName: string) {\n return LAYER_COMPATIBILITY[layerName];\n}\n\nexport function isSupportedGeoArrowLayerType(\n layerName: string,\n): layerName is SupportedGeoArrowLayerType {\n return [\n 'GeoArrowScatterplotLayer',\n 'GeoArrowPathLayer',\n 'GeoArrowSolidPolygonLayer',\n ].includes(layerName);\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LayerColorLegendConfig, LayerColorScale } from '../types';
|
|
2
|
+
export declare function resolveDatasetId(props: Record<string, unknown>, datasetIds: string[]): string | undefined;
|
|
3
|
+
export declare function isManagedLayer(props: Record<string, unknown>, datasetIds: string[]): boolean;
|
|
4
|
+
export declare function stripLayerExtensionProps(props: Record<string, unknown>): {
|
|
5
|
+
[x: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
export declare function resolveGeometryColumn(props: Record<string, unknown>): string | undefined;
|
|
8
|
+
export declare function resolveColorScale(props: Record<string, unknown>): LayerColorScale | undefined;
|
|
9
|
+
export declare function resolveColorLegend(props: Record<string, unknown>): LayerColorLegendConfig | undefined;
|
|
10
|
+
//# sourceMappingURL=layerConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerConfig.d.ts","sourceRoot":"","sources":["../../src/json/layerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EAEhB,MAAM,UAAU,CAAC;AAelB,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,UAAU,EAAE,MAAM,EAAE,sBAarB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,UAAU,EAAE,MAAM,EAAE,WAGrB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;EAItE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,sBAKnE;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,eAAe,GAAG,SAAS,CAG7B;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,sBAAsB,GAAG,SAAS,CAEpC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function hasExtensionKeys(props) {
|
|
2
|
+
return '_sqlrooms' in props;
|
|
3
|
+
}
|
|
4
|
+
function getLayerConfig(props) {
|
|
5
|
+
const layerProps = props;
|
|
6
|
+
if (!layerProps._sqlrooms || typeof layerProps._sqlrooms !== 'object') {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return layerProps._sqlrooms;
|
|
10
|
+
}
|
|
11
|
+
export function resolveDatasetId(props, datasetIds) {
|
|
12
|
+
const layerProps = props;
|
|
13
|
+
const config = getLayerConfig(props);
|
|
14
|
+
if (typeof config?.dataset === 'string' && config.dataset) {
|
|
15
|
+
return config.dataset;
|
|
16
|
+
}
|
|
17
|
+
if (datasetIds.length === 1 && layerProps.data === undefined) {
|
|
18
|
+
return datasetIds[0];
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
export function isManagedLayer(props, datasetIds) {
|
|
23
|
+
return hasExtensionKeys(props) || resolveDatasetId(props, datasetIds) != null;
|
|
24
|
+
}
|
|
25
|
+
export function stripLayerExtensionProps(props) {
|
|
26
|
+
const nextProps = { ...props };
|
|
27
|
+
delete nextProps._sqlrooms;
|
|
28
|
+
return nextProps;
|
|
29
|
+
}
|
|
30
|
+
export function resolveGeometryColumn(props) {
|
|
31
|
+
const config = getLayerConfig(props);
|
|
32
|
+
return typeof config?.geometryColumn === 'string' && config.geometryColumn
|
|
33
|
+
? config.geometryColumn
|
|
34
|
+
: undefined;
|
|
35
|
+
}
|
|
36
|
+
export function resolveColorScale(props) {
|
|
37
|
+
const config = getLayerConfig(props);
|
|
38
|
+
return config?.colorScale;
|
|
39
|
+
}
|
|
40
|
+
export function resolveColorLegend(props) {
|
|
41
|
+
return resolveColorScale(props)?.legend;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=layerConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerConfig.js","sourceRoot":"","sources":["../../src/json/layerConfig.ts"],"names":[],"mappings":"AAMA,SAAS,gBAAgB,CAAC,KAA8B;IACtD,OAAO,WAAW,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED,SAAS,cAAc,CAAC,KAA8B;IACpD,MAAM,UAAU,GAAG,KAA+C,CAAC;IACnE,IAAI,CAAC,UAAU,CAAC,SAAS,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QACtE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,UAAU,CAAC,SAAS,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,KAA8B,EAC9B,UAAoB;IAEpB,MAAM,UAAU,GAAG,KAA+C,CAAC;IACnE,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,OAAO,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QAC1D,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7D,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,KAA8B,EAC9B,UAAoB;IAEpB,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAA8B;IACrE,MAAM,SAAS,GAAG,EAAC,GAAG,KAAK,EAAC,CAAC;IAC7B,OAAO,SAAS,CAAC,SAAS,CAAC;IAC3B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA8B;IAClE,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,OAAO,MAAM,EAAE,cAAc,KAAK,QAAQ,IAAI,MAAM,CAAC,cAAc;QACxE,CAAC,CAAC,MAAM,CAAC,cAAc;QACvB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAA8B;IAE9B,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,MAAM,EAAE,UAAU,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,KAA8B;IAE9B,OAAO,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;AAC1C,CAAC","sourcesContent":["import type {\n LayerColorLegendConfig,\n LayerColorScale,\n LayerExtensionProps,\n} from '../types';\n\nfunction hasExtensionKeys(props: Record<string, unknown>) {\n return '_sqlrooms' in props;\n}\n\nfunction getLayerConfig(props: Record<string, unknown>) {\n const layerProps = props as LayerExtensionProps & {data?: unknown};\n if (!layerProps._sqlrooms || typeof layerProps._sqlrooms !== 'object') {\n return undefined;\n }\n\n return layerProps._sqlrooms;\n}\n\nexport function resolveDatasetId(\n props: Record<string, unknown>,\n datasetIds: string[],\n) {\n const layerProps = props as LayerExtensionProps & {data?: unknown};\n const config = getLayerConfig(props);\n if (typeof config?.dataset === 'string' && config.dataset) {\n return config.dataset;\n }\n\n if (datasetIds.length === 1 && layerProps.data === undefined) {\n return datasetIds[0];\n }\n\n return undefined;\n}\n\nexport function isManagedLayer(\n props: Record<string, unknown>,\n datasetIds: string[],\n) {\n return hasExtensionKeys(props) || resolveDatasetId(props, datasetIds) != null;\n}\n\nexport function stripLayerExtensionProps(props: Record<string, unknown>) {\n const nextProps = {...props};\n delete nextProps._sqlrooms;\n return nextProps;\n}\n\nexport function resolveGeometryColumn(props: Record<string, unknown>) {\n const config = getLayerConfig(props);\n return typeof config?.geometryColumn === 'string' && config.geometryColumn\n ? config.geometryColumn\n : undefined;\n}\n\nexport function resolveColorScale(\n props: Record<string, unknown>,\n): LayerColorScale | undefined {\n const config = getLayerConfig(props);\n return config?.colorScale;\n}\n\nexport function resolveColorLegend(\n props: Record<string, unknown>,\n): LayerColorLegendConfig | undefined {\n return resolveColorScale(props)?.legend;\n}\n"]}
|