@sqlrooms/deck 0.29.0-rc.10 → 0.29.0-rc.12

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.
Files changed (173) hide show
  1. package/README.md +88 -16
  2. package/dist/BlockMapSettings.d.ts.map +1 -1
  3. package/dist/BlockMapSettings.js +4 -16
  4. package/dist/BlockMapSettings.js.map +1 -1
  5. package/dist/DashboardMapSettings.d.ts.map +1 -1
  6. package/dist/DashboardMapSettings.js +7 -10
  7. package/dist/DashboardMapSettings.js.map +1 -1
  8. package/dist/DeckJsonMap.d.ts.map +1 -1
  9. package/dist/DeckJsonMap.js +20 -18
  10. package/dist/DeckJsonMap.js.map +1 -1
  11. package/dist/DeckJsonMapSpec.d.ts +916 -53
  12. package/dist/DeckJsonMapSpec.d.ts.map +1 -1
  13. package/dist/DeckJsonMapSpec.js +9 -0
  14. package/dist/DeckJsonMapSpec.js.map +1 -1
  15. package/dist/DeckMapDefaultStylesProvider.d.ts +3 -4
  16. package/dist/DeckMapDefaultStylesProvider.d.ts.map +1 -1
  17. package/dist/DeckMapDefaultStylesProvider.js +13 -7
  18. package/dist/DeckMapDefaultStylesProvider.js.map +1 -1
  19. package/dist/DeckMapSurface.d.ts +1 -1
  20. package/dist/DeckMapSurface.js +1 -1
  21. package/dist/DeckMapSurface.js.map +1 -1
  22. package/dist/MapSettings.d.ts +14 -0
  23. package/dist/MapSettings.d.ts.map +1 -1
  24. package/dist/MapSettings.js +555 -186
  25. package/dist/MapSettings.js.map +1 -1
  26. package/dist/MapSettingsControls.d.ts +8 -1
  27. package/dist/MapSettingsControls.d.ts.map +1 -1
  28. package/dist/MapSettingsControls.js +24 -2
  29. package/dist/MapSettingsControls.js.map +1 -1
  30. package/dist/ai.d.ts +19 -5
  31. package/dist/ai.d.ts.map +1 -1
  32. package/dist/ai.js +63 -112
  33. package/dist/ai.js.map +1 -1
  34. package/dist/aiNormalize.d.ts +31 -0
  35. package/dist/aiNormalize.d.ts.map +1 -0
  36. package/dist/aiNormalize.js +630 -0
  37. package/dist/aiNormalize.js.map +1 -0
  38. package/dist/block.d.ts +1 -1
  39. package/dist/block.d.ts.map +1 -1
  40. package/dist/block.js +1 -1
  41. package/dist/block.js.map +1 -1
  42. package/dist/createOrUpdateDeckMapResource.d.ts +6 -2
  43. package/dist/createOrUpdateDeckMapResource.d.ts.map +1 -1
  44. package/dist/createOrUpdateDeckMapResource.js +57 -4
  45. package/dist/createOrUpdateDeckMapResource.js.map +1 -1
  46. package/dist/dashboard.d.ts.map +1 -1
  47. package/dist/dashboard.js +72 -8
  48. package/dist/dashboard.js.map +1 -1
  49. package/dist/dashboardConfig.d.ts +10 -1
  50. package/dist/dashboardConfig.d.ts.map +1 -1
  51. package/dist/dashboardConfig.js +55 -22
  52. package/dist/dashboardConfig.js.map +1 -1
  53. package/dist/datasets/PreparedDatasetStore.d.ts +3 -4
  54. package/dist/datasets/PreparedDatasetStore.d.ts.map +1 -1
  55. package/dist/datasets/PreparedDatasetStore.js +35 -10
  56. package/dist/datasets/PreparedDatasetStore.js.map +1 -1
  57. package/dist/datasets/helpers.d.ts +39 -2
  58. package/dist/datasets/helpers.d.ts.map +1 -1
  59. package/dist/datasets/helpers.js +86 -3
  60. package/dist/datasets/helpers.js.map +1 -1
  61. package/dist/datasets/usePreparedDatasetStates.d.ts.map +1 -1
  62. package/dist/datasets/usePreparedDatasetStates.js +12 -8
  63. package/dist/datasets/usePreparedDatasetStates.js.map +1 -1
  64. package/dist/datasets/wrapGeometryAsWkb.d.ts +20 -0
  65. package/dist/datasets/wrapGeometryAsWkb.d.ts.map +1 -0
  66. package/dist/datasets/wrapGeometryAsWkb.js +65 -0
  67. package/dist/datasets/wrapGeometryAsWkb.js.map +1 -0
  68. package/dist/index.d.ts +3 -2
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +2 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/json/colorScaleFunction.d.ts +12 -4
  73. package/dist/json/colorScaleFunction.d.ts.map +1 -1
  74. package/dist/json/colorScaleFunction.js.map +1 -1
  75. package/dist/json/compileColorScale.d.ts +3 -2
  76. package/dist/json/compileColorScale.d.ts.map +1 -1
  77. package/dist/json/compileColorScale.js +16 -1
  78. package/dist/json/compileColorScale.js.map +1 -1
  79. package/dist/json/compileGeoArrowAccessor.d.ts +5 -0
  80. package/dist/json/compileGeoArrowAccessor.d.ts.map +1 -1
  81. package/dist/json/compileGeoArrowAccessor.js +17 -3
  82. package/dist/json/compileGeoArrowAccessor.js.map +1 -1
  83. package/dist/json/createDeckJsonConfiguration.d.ts.map +1 -1
  84. package/dist/json/createDeckJsonConfiguration.js +278 -151
  85. package/dist/json/createDeckJsonConfiguration.js.map +1 -1
  86. package/dist/json/defaultClasses.d.ts.map +1 -1
  87. package/dist/json/defaultClasses.js +3 -3
  88. package/dist/json/defaultClasses.js.map +1 -1
  89. package/dist/json/extractColorScaleLegends.d.ts.map +1 -1
  90. package/dist/json/extractColorScaleLegends.js +43 -14
  91. package/dist/json/extractColorScaleLegends.js.map +1 -1
  92. package/dist/json/heatmapDefaults.d.ts +17 -7
  93. package/dist/json/heatmapDefaults.d.ts.map +1 -1
  94. package/dist/json/heatmapDefaults.js +54 -12
  95. package/dist/json/heatmapDefaults.js.map +1 -1
  96. package/dist/json/layers/DeckH3HexagonLayer.d.ts.map +1 -1
  97. package/dist/json/layers/DeckH3HexagonLayer.js +9 -14
  98. package/dist/json/layers/DeckH3HexagonLayer.js.map +1 -1
  99. package/dist/json/layers/DeckHeatmapLayer.d.ts +32 -0
  100. package/dist/json/layers/DeckHeatmapLayer.d.ts.map +1 -0
  101. package/dist/json/layers/DeckHeatmapLayer.js +69 -0
  102. package/dist/json/layers/DeckHeatmapLayer.js.map +1 -0
  103. package/dist/json/layers/h3IndexFormat.d.ts +6 -0
  104. package/dist/json/layers/h3IndexFormat.d.ts.map +1 -0
  105. package/dist/json/layers/h3IndexFormat.js +17 -0
  106. package/dist/json/layers/h3IndexFormat.js.map +1 -0
  107. package/dist/json/layers/index.d.ts +2 -0
  108. package/dist/json/layers/index.d.ts.map +1 -1
  109. package/dist/json/layers/index.js +2 -0
  110. package/dist/json/layers/index.js.map +1 -1
  111. package/dist/json/rewriteGeoArrowAccessors.d.ts.map +1 -1
  112. package/dist/json/rewriteGeoArrowAccessors.js +22 -5
  113. package/dist/json/rewriteGeoArrowAccessors.js.map +1 -1
  114. package/dist/json/scaleFunction.d.ts +27 -0
  115. package/dist/json/scaleFunction.d.ts.map +1 -0
  116. package/dist/json/scaleFunction.js +151 -0
  117. package/dist/json/scaleFunction.js.map +1 -0
  118. package/dist/mapAiConfig.d.ts +8 -0
  119. package/dist/mapAiConfig.d.ts.map +1 -1
  120. package/dist/mapAiConfig.js +9 -1
  121. package/dist/mapAiConfig.js.map +1 -1
  122. package/dist/mapAiSharedInstructions.d.ts +3 -0
  123. package/dist/mapAiSharedInstructions.d.ts.map +1 -0
  124. package/dist/mapAiSharedInstructions.js +16 -0
  125. package/dist/mapAiSharedInstructions.js.map +1 -0
  126. package/dist/mapConfig.d.ts +7 -1
  127. package/dist/mapConfig.d.ts.map +1 -1
  128. package/dist/mapConfig.js.map +1 -1
  129. package/dist/mapConfigUtils.d.ts +22 -0
  130. package/dist/mapConfigUtils.d.ts.map +1 -1
  131. package/dist/mapConfigUtils.js +147 -3
  132. package/dist/mapConfigUtils.js.map +1 -1
  133. package/dist/mapFit.d.ts +16 -0
  134. package/dist/mapFit.d.ts.map +1 -1
  135. package/dist/mapFit.js +208 -30
  136. package/dist/mapFit.js.map +1 -1
  137. package/dist/mapLayerConfigUtils.d.ts +64 -1
  138. package/dist/mapLayerConfigUtils.d.ts.map +1 -1
  139. package/dist/mapLayerConfigUtils.js +277 -16
  140. package/dist/mapLayerConfigUtils.js.map +1 -1
  141. package/dist/mapResourceAuthoring.d.ts +3 -1
  142. package/dist/mapResourceAuthoring.d.ts.map +1 -1
  143. package/dist/mapResourceAuthoring.js +413 -20
  144. package/dist/mapResourceAuthoring.js.map +1 -1
  145. package/dist/mosaic.d.ts +1 -1
  146. package/dist/mosaic.d.ts.map +1 -1
  147. package/dist/mosaic.js.map +1 -1
  148. package/dist/prepare/geoarrow.js.map +1 -1
  149. package/dist/prepare/prepareDeckDataset.d.ts.map +1 -1
  150. package/dist/prepare/prepareDeckDataset.js +1 -0
  151. package/dist/prepare/prepareDeckDataset.js.map +1 -1
  152. package/dist/prepare/types.d.ts +3 -0
  153. package/dist/prepare/types.d.ts.map +1 -1
  154. package/dist/prepare/types.js.map +1 -1
  155. package/dist/prepare/wkbDecoder.d.ts +10 -0
  156. package/dist/prepare/wkbDecoder.d.ts.map +1 -1
  157. package/dist/prepare/wkbDecoder.js +141 -20
  158. package/dist/prepare/wkbDecoder.js.map +1 -1
  159. package/dist/prepare/wkbParser.d.ts +9 -0
  160. package/dist/prepare/wkbParser.d.ts.map +1 -1
  161. package/dist/prepare/wkbParser.js +22 -0
  162. package/dist/prepare/wkbParser.js.map +1 -1
  163. package/dist/selectStarAsWkbCollision.d.ts +3 -0
  164. package/dist/selectStarAsWkbCollision.d.ts.map +1 -0
  165. package/dist/selectStarAsWkbCollision.js +78 -0
  166. package/dist/selectStarAsWkbCollision.js.map +1 -0
  167. package/dist/types.d.ts +1 -1
  168. package/dist/types.d.ts.map +1 -1
  169. package/dist/types.js.map +1 -1
  170. package/dist/useDeckMapFitToBounds.d.ts.map +1 -1
  171. package/dist/useDeckMapFitToBounds.js +1 -1
  172. package/dist/useDeckMapFitToBounds.js.map +1 -1
  173. package/package.json +15 -15
@@ -0,0 +1,69 @@
1
+ import { GeoArrowHeatmapLayer } from '@geoarrow/deck.gl-geoarrow';
2
+ import { DEFAULT_HEATMAP_WEIGHTS_TEXTURE_SIZE } from '../heatmapDefaults';
3
+ /**
4
+ * GeoArrow heatmap that reuses the inner binary `data` wrapper when only style
5
+ * props change. JSONConverter builds a new layer each time; a new wrapper looks
6
+ * like a data change and rebuilds aggregation.
7
+ */
8
+ export class DeckHeatmapLayer extends GeoArrowHeatmapLayer {
9
+ static layerName = 'GeoArrowHeatmapLayer';
10
+ static defaultProps = {
11
+ weightsTextureSize: {
12
+ type: 'number',
13
+ min: 128,
14
+ max: 2048,
15
+ value: DEFAULT_HEATMAP_WEIGHTS_TEXTURE_SIZE,
16
+ },
17
+ };
18
+ renderLayers() {
19
+ const rendered = super.renderLayers();
20
+ const heatmap = unwrapSingleLayer(rendered);
21
+ if (!heatmap)
22
+ return rendered;
23
+ const cache = reuseCachedHeatmapData(this.state?.heatmapDataCache, this.props, heatmap.props.data);
24
+ if (this.state) {
25
+ this.state.heatmapDataCache = cache;
26
+ }
27
+ if (cache.data === heatmap.props.data) {
28
+ return heatmap;
29
+ }
30
+ const HeatmapClass = heatmap.constructor;
31
+ return new HeatmapClass({
32
+ ...heatmap.props,
33
+ data: cache.data,
34
+ });
35
+ }
36
+ }
37
+ /** Return the previous inner heatmap `data` object when Arrow inputs match. */
38
+ export function reuseCachedHeatmapData(cache, props, nextData) {
39
+ const sourceData = props.data;
40
+ const sourcePosition = props.getPosition;
41
+ const weightKey = getHeatmapWeightKey(props);
42
+ if (cache &&
43
+ cache.sourceData === sourceData &&
44
+ cache.sourcePosition === sourcePosition &&
45
+ cache.weightKey === weightKey) {
46
+ return cache;
47
+ }
48
+ return { sourceData, sourcePosition, weightKey, data: nextData };
49
+ }
50
+ function getHeatmapWeightKey(props) {
51
+ const getWeight = props.getWeight;
52
+ const triggers = props.updateTriggers;
53
+ if (triggers && typeof triggers === 'object' && 'getWeight' in triggers) {
54
+ return triggers.getWeight;
55
+ }
56
+ if (typeof getWeight === 'number' || getWeight == null) {
57
+ return getWeight ?? 1;
58
+ }
59
+ return getWeight;
60
+ }
61
+ function unwrapSingleLayer(rendered) {
62
+ const layers = Array.isArray(rendered) ? rendered : [rendered];
63
+ const layer = layers[0];
64
+ if (layer && typeof layer === 'object' && 'props' in layer) {
65
+ return layer;
66
+ }
67
+ return null;
68
+ }
69
+ //# sourceMappingURL=DeckHeatmapLayer.js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AC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type {Layer, LayersList} from '@deck.gl/core';\nimport {GeoArrowHeatmapLayer} from '@geoarrow/deck.gl-geoarrow';\nimport {DEFAULT_HEATMAP_WEIGHTS_TEXTURE_SIZE} from '../heatmapDefaults';\n\ntype HeatmapDataCache = {\n sourceData: unknown;\n sourcePosition: unknown;\n weightKey: unknown;\n data: unknown;\n};\n\ntype LayerWithData = Layer & {props: {data?: unknown}};\n\n/**\n * GeoArrow heatmap that reuses the inner binary `data` wrapper when only style\n * props change. JSONConverter builds a new layer each time; a new wrapper looks\n * like a data change and rebuilds aggregation.\n */\nexport class DeckHeatmapLayer extends GeoArrowHeatmapLayer {\n static layerName = 'GeoArrowHeatmapLayer';\n static defaultProps = {\n weightsTextureSize: {\n type: 'number' as const,\n min: 128,\n max: 2048,\n value: DEFAULT_HEATMAP_WEIGHTS_TEXTURE_SIZE,\n },\n };\n\n declare state: {heatmapDataCache?: HeatmapDataCache};\n\n renderLayers(): Layer | LayersList | null {\n const rendered = super.renderLayers();\n const heatmap = unwrapSingleLayer(rendered);\n if (!heatmap) return rendered;\n\n const cache = reuseCachedHeatmapData(\n this.state?.heatmapDataCache,\n this.props as Record<string, unknown>,\n heatmap.props.data,\n );\n if (this.state) {\n this.state.heatmapDataCache = cache;\n }\n if (cache.data === heatmap.props.data) {\n return heatmap;\n }\n\n const HeatmapClass = heatmap.constructor as new (\n props: Record<string, unknown>,\n ) => Layer;\n return new HeatmapClass({\n ...heatmap.props,\n data: cache.data,\n });\n }\n}\n\n/** Return the previous inner heatmap `data` object when Arrow inputs match. */\nexport function reuseCachedHeatmapData(\n cache: HeatmapDataCache | undefined,\n props: Record<string, unknown>,\n nextData: unknown,\n): HeatmapDataCache {\n const sourceData = props.data;\n const sourcePosition = props.getPosition;\n const weightKey = getHeatmapWeightKey(props);\n if (\n cache &&\n cache.sourceData === sourceData &&\n cache.sourcePosition === sourcePosition &&\n cache.weightKey === weightKey\n ) {\n return cache;\n }\n return {sourceData, sourcePosition, weightKey, data: nextData};\n}\n\nfunction getHeatmapWeightKey(props: Record<string, unknown>): unknown {\n const getWeight = props.getWeight;\n const triggers = props.updateTriggers;\n if (triggers && typeof triggers === 'object' && 'getWeight' in triggers) {\n return (triggers as Record<string, unknown>).getWeight;\n }\n if (typeof getWeight === 'number' || getWeight == null) {\n return getWeight ?? 1;\n }\n return getWeight;\n}\n\nfunction unwrapSingleLayer(rendered: unknown): LayerWithData | null {\n const layers = Array.isArray(rendered) ? rendered : [rendered];\n const layer = layers[0];\n if (layer && typeof layer === 'object' && 'props' in layer) {\n return layer as LayerWithData;\n }\n return null;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert Arrow/DuckDB H3 cell ids to hex strings for H3HexagonLayer.
3
+ * Bigint must use base-16 — `String(bigint)` is decimal and invalid for deck.gl.
4
+ */
5
+ export declare function formatH3IndexForDeck(value: unknown): string;
6
+ //# sourceMappingURL=h3IndexFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"h3IndexFormat.d.ts","sourceRoot":"","sources":["../../../src/json/layers/h3IndexFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAU3D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Convert Arrow/DuckDB H3 cell ids to hex strings for H3HexagonLayer.
3
+ * Bigint must use base-16 — `String(bigint)` is decimal and invalid for deck.gl.
4
+ */
5
+ export function formatH3IndexForDeck(value) {
6
+ if (value == null)
7
+ return '';
8
+ if (typeof value === 'bigint') {
9
+ return BigInt.asUintN(64, value).toString(16);
10
+ }
11
+ if (typeof value === 'number' && Number.isFinite(value)) {
12
+ // Narrow ints only; unsafe for full H3 range.
13
+ return BigInt.asUintN(64, BigInt(Math.trunc(value))).toString(16);
14
+ }
15
+ return String(value);
16
+ }
17
+ //# sourceMappingURL=h3IndexFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"h3IndexFormat.js","sourceRoot":"","sources":["../../../src/json/layers/h3IndexFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,8CAA8C;QAC9C,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["/**\n * Convert Arrow/DuckDB H3 cell ids to hex strings for H3HexagonLayer.\n * Bigint must use base-16 — `String(bigint)` is decimal and invalid for deck.gl.\n */\nexport function formatH3IndexForDeck(value: unknown): string {\n if (value == null) return '';\n if (typeof value === 'bigint') {\n return BigInt.asUintN(64, value).toString(16);\n }\n if (typeof value === 'number' && Number.isFinite(value)) {\n // Narrow ints only; unsafe for full H3 range.\n return BigInt.asUintN(64, BigInt(Math.trunc(value))).toString(16);\n }\n return String(value);\n}\n"]}
@@ -1,5 +1,7 @@
1
1
  export { createTableToRecordBatchAdapter } from './createTableToRecordBatchAdapter';
2
2
  export { DeckColumnLayer } from './DeckColumnLayer';
3
3
  export { DeckH3HexagonLayer } from './DeckH3HexagonLayer';
4
+ export { DeckHeatmapLayer } from './DeckHeatmapLayer';
5
+ export { formatH3IndexForDeck } from './h3IndexFormat';
4
6
  export { DeckTripsLayer } from './DeckTripsLayer';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/json/layers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,+BAA+B,EAAC,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/json/layers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,+BAA+B,EAAC,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export { createTableToRecordBatchAdapter } from './createTableToRecordBatchAdapter';
2
2
  export { DeckColumnLayer } from './DeckColumnLayer';
3
3
  export { DeckH3HexagonLayer } from './DeckH3HexagonLayer';
4
+ export { DeckHeatmapLayer } from './DeckHeatmapLayer';
5
+ export { formatH3IndexForDeck } from './h3IndexFormat';
4
6
  export { DeckTripsLayer } from './DeckTripsLayer';
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/json/layers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,+BAA+B,EAAC,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC","sourcesContent":["export {createTableToRecordBatchAdapter} from './createTableToRecordBatchAdapter';\nexport {DeckColumnLayer} from './DeckColumnLayer';\nexport {DeckH3HexagonLayer} from './DeckH3HexagonLayer';\nexport {DeckTripsLayer} from './DeckTripsLayer';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/json/layers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,+BAA+B,EAAC,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC","sourcesContent":["export {createTableToRecordBatchAdapter} from './createTableToRecordBatchAdapter';\nexport {DeckColumnLayer} from './DeckColumnLayer';\nexport {DeckH3HexagonLayer} from './DeckH3HexagonLayer';\nexport {DeckHeatmapLayer} from './DeckHeatmapLayer';\nexport {formatH3IndexForDeck} from './h3IndexFormat';\nexport {DeckTripsLayer} from './DeckTripsLayer';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rewriteGeoArrowAccessors.d.ts","sourceRoot":"","sources":["../../src/json/rewriteGeoArrowAccessors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAyBtC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,2BA4CA"}
1
+ {"version":3,"file":"rewriteGeoArrowAccessors.d.ts","sourceRoot":"","sources":["../../src/json/rewriteGeoArrowAccessors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AA8CtC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,2BA4CA"}
@@ -5,6 +5,27 @@ function isSimpleColumnReference(expression) {
5
5
  return /^[A-Za-z_$][\w$]*$/.test(expression.trim());
6
6
  }
7
7
  function canUseDirectVectorAccessor(propName, vector) {
8
+ // H3 index columns are safe as Vectors — DeckH3HexagonLayer reads them
9
+ // directly and converts BigInt → hex string when needed.
10
+ if (propName === 'getHexagon') {
11
+ const type = vector.type;
12
+ return (arrow.DataType.isUtf8(type) ||
13
+ arrow.DataType.isLargeUtf8(type) ||
14
+ // DuckDB UBIGINT often arrives as Int(true, 64), not instanceof Int64.
15
+ (arrow.DataType.isInt(type) && type.bitWidth === 64));
16
+ }
17
+ const firstChunk = vector.data[0];
18
+ if (!firstChunk) {
19
+ return false;
20
+ }
21
+ // Heatmap weights are a scalar column. Passing a float Vector through lets
22
+ // GeoArrow put them in binary attributes instead of a new function on every
23
+ // JSON convert (which would look like a data change). Integer columns stay
24
+ // on the function accessor: GeoArrow only uploads float weights, and Int64
25
+ // values are bigint / BigInt64Array which deck.gl cannot use as GPU data.
26
+ if (propName === 'getWeight') {
27
+ return arrow.DataType.isFloat(firstChunk.type);
28
+ }
8
29
  // Direct numeric vectors (for example `getRadius`) currently end up in deck's
9
30
  // binary attribute path and trigger `Float64Array` initialization failures in the
10
31
  // GeoArrow scatterplot wrapper. Re-test which direct vector accessors are safe
@@ -12,11 +33,7 @@ function canUseDirectVectorAccessor(propName, vector) {
12
33
  if (!propName.endsWith('Color')) {
13
34
  return false;
14
35
  }
15
- const firstChunk = vector.data[0];
16
- if (!firstChunk || !arrow.DataType.isFixedSizeList(firstChunk.type)) {
17
- return false;
18
- }
19
- return true;
36
+ return arrow.DataType.isFixedSizeList(firstChunk.type);
20
37
  }
21
38
  export function rewriteGeoArrowAccessors(options) {
22
39
  const { props, table, layerName } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"rewriteGeoArrowAccessors.js","sourceRoot":"","sources":["../../src/json/rewriteGeoArrowAccessors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAE3D,SAAS,uBAAuB,CAAC,UAAkB;IACjD,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,0BAA0B,CAAC,QAAgB,EAAE,MAAoB;IACxE,8EAA8E;IAC9E,kFAAkF;IAClF,+EAA+E;IAC/E,qEAAqE;IACrE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACpE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAIxC;IACC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,GAAG,OAAO,CAAC;IAC1C,MAAM,aAAa,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACvD,IAAI,CAAC,aAAa,IAAI,aAA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Accessor';\nimport {getLayerCompatibility} from './layerCompatibility';\n\nfunction isSimpleColumnReference(expression: string) {\n return /^[A-Za-z_$][\\w$]*$/.test(expression.trim());\n}\n\nfunction canUseDirectVectorAccessor(propName: string, vector: arrow.Vector) {\n // Direct numeric vectors (for example `getRadius`) currently end up in deck's\n // binary attribute path and trigger `Float64Array` initialization failures in the\n // GeoArrow scatterplot wrapper. Re-test which direct vector accessors are safe\n // after verifying the 0.4.x runtime contract handles them correctly.\n if (!propName.endsWith('Color')) {\n return false;\n }\n\n const firstChunk = vector.data[0];\n if (!firstChunk || !arrow.DataType.isFixedSizeList(firstChunk.type)) {\n return false;\n }\n\n return true;\n}\n\nexport function rewriteGeoArrowAccessors(options: {\n props: Record<string, unknown>;\n table: arrow.Table;\n layerName: string;\n}) {\n const {props, table, layerName} = options;\n const compatibility = getLayerCompatibility(layerName);\n if (!compatibility || compatibility.representation !== 'geoarrow') {\n return props;\n }\n\n const nextProps = {...props};\n\n for (const [propName, propValue] of Object.entries(nextProps)) {\n if (\n typeof propValue !== 'string' ||\n !propValue.startsWith('@@=') ||\n !propName.startsWith('get')\n ) {\n continue;\n }\n\n const expression = propValue.slice(3);\n if (\n compatibility.vectorAccessorProps.includes(propName) &&\n isSimpleColumnReference(expression)\n ) {\n const vector = table.getChild(expression.trim());\n if (vector && canUseDirectVectorAccessor(propName, vector)) {\n nextProps[propName] = vector;\n continue;\n }\n if (!vector) {\n // Column not found — fall through to compileGeoArrowAccessor which\n // handles missing bindings gracefully (returns undefined per row).\n console.warn(\n `Column \"${expression.trim()}\" not found in dataset for accessor \"${propName}\".`,\n );\n }\n }\n\n // This custom compiler handles GeoArrow batch-oriented callbacks. The 0.4.x\n // layers call function accessors with {index, data: {data: batch}, target},\n // which this compiler produces.\n nextProps[propName] = compileGeoArrowAccessor(expression, table);\n }\n\n return nextProps;\n}\n"]}
1
+ {"version":3,"file":"rewriteGeoArrowAccessors.js","sourceRoot":"","sources":["../../src/json/rewriteGeoArrowAccessors.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AAwC,QAAQ,IAAI,CACjF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,4EAA4E;QAC5E,4EAA4E;QAC5E,gCAAgC;QAChC,SAAS,CAAC,QAAQ,CAAC,GAAG,uBAAuB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import * as arrow from 'apache-arrow';\nimport {compileGeoArrowAccessor} from './compileGeoArrowAccessor';\nimport {getLayerCompatibility} from './layerCompatibility';\n\nfunction isSimpleColumnReference(expression: string) {\n return /^[A-Za-z_$][\\w$]*$/.test(expression.trim());\n}\n\nfunction canUseDirectVectorAccessor(propName: string, vector: arrow.Vector) {\n // H3 index columns are safe as Vectors — DeckH3HexagonLayer reads them\n // directly and converts BigInt → hex string when needed.\n if (propName === 'getHexagon') {\n const type = vector.type;\n return (\n arrow.DataType.isUtf8(type) ||\n arrow.DataType.isLargeUtf8(type) ||\n // DuckDB UBIGINT often arrives as Int(true, 64), not instanceof Int64.\n (arrow.DataType.isInt(type) && type.bitWidth === 64)\n );\n }\n\n const firstChunk = vector.data[0];\n if (!firstChunk) {\n return false;\n }\n\n // Heatmap weights are a scalar column. Passing a float Vector through lets\n // GeoArrow put them in binary attributes instead of a new function on every\n // JSON convert (which would look like a data change). Integer columns stay\n // on the function accessor: GeoArrow only uploads float weights, and Int64\n // values are bigint / BigInt64Array which deck.gl cannot use as GPU data.\n if (propName === 'getWeight') {\n return arrow.DataType.isFloat(firstChunk.type);\n }\n\n // Direct numeric vectors (for example `getRadius`) currently end up in deck's\n // binary attribute path and trigger `Float64Array` initialization failures in the\n // GeoArrow scatterplot wrapper. Re-test which direct vector accessors are safe\n // after verifying the 0.4.x runtime contract handles them correctly.\n if (!propName.endsWith('Color')) {\n return false;\n }\n\n return arrow.DataType.isFixedSizeList(firstChunk.type);\n}\n\nexport function rewriteGeoArrowAccessors(options: {\n props: Record<string, unknown>;\n table: arrow.Table;\n layerName: string;\n}) {\n const {props, table, layerName} = options;\n const compatibility = getLayerCompatibility(layerName);\n if (!compatibility || compatibility.representation !== 'geoarrow') {\n return props;\n }\n\n const nextProps = {...props};\n\n for (const [propName, propValue] of Object.entries(nextProps)) {\n if (\n typeof propValue !== 'string' ||\n !propValue.startsWith('@@=') ||\n !propName.startsWith('get')\n ) {\n continue;\n }\n\n const expression = propValue.slice(3);\n if (\n compatibility.vectorAccessorProps.includes(propName) &&\n isSimpleColumnReference(expression)\n ) {\n const vector = table.getChild(expression.trim());\n if (vector && canUseDirectVectorAccessor(propName, vector)) {\n nextProps[propName] = vector;\n continue;\n }\n if (!vector) {\n // Column not found — fall through to compileGeoArrowAccessor which\n // handles missing bindings gracefully (returns undefined per row).\n console.warn(\n `Column \"${expression.trim()}\" not found in dataset for accessor \"${propName}\".`,\n );\n }\n }\n\n // This custom compiler handles GeoArrow batch-oriented callbacks. The 0.4.x\n // layers call function accessors with {index, data: {data: batch}, target},\n // which this compiler produces.\n nextProps[propName] = compileGeoArrowAccessor(expression, table);\n }\n\n return nextProps;\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import type * as arrow from 'apache-arrow';
2
+ declare const SQLROOMS_SCALE_MARKER: unique symbol;
3
+ export type LinearScaleConfig = {
4
+ field: string;
5
+ type?: 'linear';
6
+ domain?: 'auto' | [number, number];
7
+ /** When set, map domain → range. When omitted, use raw field minus domain min. */
8
+ range?: [number, number];
9
+ };
10
+ export type ScaleMarker = LinearScaleConfig & {
11
+ [SQLROOMS_SCALE_MARKER]: true;
12
+ };
13
+ /** Marker returned by the Deck JSON `scale` function before table-aware compile. */
14
+ export declare function createScaleMarker(props: Record<string, unknown>): ScaleMarker | undefined;
15
+ export declare function isScaleMarker(value: unknown): value is ScaleMarker;
16
+ /**
17
+ * Linear scale `@@=` expression. Non-identifier fields need
18
+ * {@link compileLinearScaleAccessor}.
19
+ */
20
+ export declare function compileLinearScaleExpression(table: arrow.Table, scale: LinearScaleConfig): string | undefined;
21
+ /**
22
+ * Elevation accessor for any Arrow column name (incl. non-identifiers).
23
+ * Reads GeoArrow `{index, data}` callbacks or GeoJSON `{properties}` features.
24
+ */
25
+ export declare function compileLinearScaleAccessor(table: arrow.Table, scale: LinearScaleConfig): ((value: unknown) => number) | undefined;
26
+ export {};
27
+ //# sourceMappingURL=scaleFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaleFunction.d.ts","sourceRoot":"","sources":["../../src/json/scaleFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAG3C,QAAA,MAAM,qBAAqB,eAA8C,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,kFAAkF;IAClF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG;IAC5C,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC;CAC/B,CAAC;AAEF,oFAAoF;AACpF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,WAAW,GAAG,SAAS,CA6BzB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAMlE;AAqBD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,iBAAiB,GACvB,MAAM,GAAG,SAAS,CA8BpB;AAsCD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,iBAAiB,GACvB,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,GAAG,SAAS,CAiC1C"}
@@ -0,0 +1,151 @@
1
+ import { isBindableGeoArrowFieldIdentifier } from './compileGeoArrowAccessor';
2
+ const SQLROOMS_SCALE_MARKER = Symbol.for('@sqlrooms/deck/sqlrooms-scale');
3
+ /** Marker returned by the Deck JSON `scale` function before table-aware compile. */
4
+ export function createScaleMarker(props) {
5
+ const field = typeof props.field === 'string' ? props.field.trim() : '';
6
+ if (!field)
7
+ return undefined;
8
+ const domain = props.domain === 'auto'
9
+ ? 'auto'
10
+ : Array.isArray(props.domain) &&
11
+ props.domain.length === 2 &&
12
+ typeof props.domain[0] === 'number' &&
13
+ typeof props.domain[1] === 'number'
14
+ ? [props.domain[0], props.domain[1]]
15
+ : 'auto';
16
+ const range = Array.isArray(props.range) &&
17
+ props.range.length === 2 &&
18
+ typeof props.range[0] === 'number' &&
19
+ typeof props.range[1] === 'number'
20
+ ? [props.range[0], props.range[1]]
21
+ : undefined;
22
+ return {
23
+ [SQLROOMS_SCALE_MARKER]: true,
24
+ field,
25
+ type: 'linear',
26
+ domain,
27
+ ...(range ? { range } : {}),
28
+ };
29
+ }
30
+ export function isScaleMarker(value) {
31
+ return Boolean(value &&
32
+ typeof value === 'object' &&
33
+ value[SQLROOMS_SCALE_MARKER]);
34
+ }
35
+ function readNumericDomain(vector) {
36
+ let min = Infinity;
37
+ let max = -Infinity;
38
+ for (let i = 0; i < vector.length; i++) {
39
+ // Arrow/SQL NULL must not become 0 via Number(null).
40
+ if (typeof vector.isValid === 'function' && !vector.isValid(i)) {
41
+ continue;
42
+ }
43
+ const raw = vector.get(i);
44
+ if (raw == null)
45
+ continue;
46
+ const v = Number(raw);
47
+ if (!Number.isFinite(v))
48
+ continue;
49
+ if (v < min)
50
+ min = v;
51
+ if (v > max)
52
+ max = v;
53
+ }
54
+ if (!Number.isFinite(min) || !Number.isFinite(max))
55
+ return null;
56
+ return [min, max];
57
+ }
58
+ /**
59
+ * Linear scale `@@=` expression. Non-identifier fields need
60
+ * {@link compileLinearScaleAccessor}.
61
+ */
62
+ export function compileLinearScaleExpression(table, scale) {
63
+ const field = scale.field.trim();
64
+ if (!field || !isBindableGeoArrowFieldIdentifier(field))
65
+ return undefined;
66
+ const vector = table.getChild(field);
67
+ if (!vector)
68
+ return undefined;
69
+ const domain = scale.domain === 'auto' || scale.domain === undefined
70
+ ? readNumericDomain(vector)
71
+ : scale.domain;
72
+ if (!domain)
73
+ return undefined;
74
+ const [d0, d1] = domain;
75
+ if (!scale.range) {
76
+ if (d0 === 0)
77
+ return `@@=${field}`;
78
+ return `@@=Math.max(0, ${field} - ${d0})`;
79
+ }
80
+ const [r0, r1] = scale.range;
81
+ const span = d1 - d0;
82
+ if (span === 0) {
83
+ return `@@=${r0}`;
84
+ }
85
+ const lo = Math.min(r0, r1);
86
+ const hi = Math.max(r0, r1);
87
+ // Clamp after linear map (bigint coercion lives in compileGeoArrowAccessor).
88
+ return `@@=Math.max(${lo}, Math.min(${hi}, ${r0} + (${field} - ${d0}) / ${span} * ${r1 - r0}))`;
89
+ }
90
+ function readLinearScaleRawValue(value, field, vector) {
91
+ if (!value || typeof value !== 'object')
92
+ return undefined;
93
+ const object = value;
94
+ if (typeof object.index === 'number') {
95
+ const batch = object.data?.data;
96
+ if (batch?.getChild) {
97
+ return batch.getChild(field)?.get(object.index);
98
+ }
99
+ if (batch) {
100
+ // Batch-local index (GeoArrow) without this field — do not fall back to
101
+ // the table-level vector.
102
+ return undefined;
103
+ }
104
+ return vector.get(object.index);
105
+ }
106
+ const sources = [object.properties, object];
107
+ for (const source of sources) {
108
+ if (source && typeof source === 'object' && field in source) {
109
+ return source[field];
110
+ }
111
+ }
112
+ return undefined;
113
+ }
114
+ /**
115
+ * Elevation accessor for any Arrow column name (incl. non-identifiers).
116
+ * Reads GeoArrow `{index, data}` callbacks or GeoJSON `{properties}` features.
117
+ */
118
+ export function compileLinearScaleAccessor(table, scale) {
119
+ const field = scale.field.trim();
120
+ if (!field)
121
+ return undefined;
122
+ const vector = table.getChild(field);
123
+ if (!vector)
124
+ return undefined;
125
+ const domain = scale.domain === 'auto' || scale.domain === undefined
126
+ ? readNumericDomain(vector)
127
+ : scale.domain;
128
+ if (!domain)
129
+ return undefined;
130
+ const [d0, d1] = domain;
131
+ const range = scale.range;
132
+ return (value) => {
133
+ const raw = readLinearScaleRawValue(value, field, vector);
134
+ if (raw == null)
135
+ return 0;
136
+ const v = Number(raw);
137
+ if (!Number.isFinite(v))
138
+ return 0;
139
+ if (!range) {
140
+ return Math.max(0, v - d0);
141
+ }
142
+ const [r0, r1] = range;
143
+ const span = d1 - d0;
144
+ if (span === 0)
145
+ return r0;
146
+ const lo = Math.min(r0, r1);
147
+ const hi = Math.max(r0, r1);
148
+ return Math.max(lo, Math.min(hi, r0 + ((v - d0) / span) * (r1 - r0)));
149
+ };
150
+ }
151
+ //# sourceMappingURL=scaleFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaleFunction.js","sourceRoot":"","sources":["../../src/json/scaleFunction.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iCAAiC,EAAC,MAAM,2BAA2B,CAAC;AAE5E,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAc1E,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAC/B,KAA8B;IAE9B,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,MAAM,GACV,KAAK,CAAC,MAAM,KAAK,MAAM;QACrB,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;YACzB,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACzB,OAAO,KAAK,CAA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AAE,OAAO,CAAC,CAAC;QAC1B,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QAElC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC;QACvB,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;QACrB,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type * as arrow from 'apache-arrow';\nimport {isBindableGeoArrowFieldIdentifier} from './compileGeoArrowAccessor';\n\nconst SQLROOMS_SCALE_MARKER = Symbol.for('@sqlrooms/deck/sqlrooms-scale');\n\nexport type LinearScaleConfig = {\n field: string;\n type?: 'linear';\n domain?: 'auto' | [number, number];\n /** When set, map domain → range. When omitted, use raw field minus domain min. */\n range?: [number, number];\n};\n\nexport type ScaleMarker = LinearScaleConfig & {\n [SQLROOMS_SCALE_MARKER]: true;\n};\n\n/** Marker returned by the Deck JSON `scale` function before table-aware compile. */\nexport function createScaleMarker(\n props: Record<string, unknown>,\n): ScaleMarker | undefined {\n const field = typeof props.field === 'string' ? props.field.trim() : '';\n if (!field) return undefined;\n\n const domain =\n props.domain === 'auto'\n ? 'auto'\n : Array.isArray(props.domain) &&\n props.domain.length === 2 &&\n typeof props.domain[0] === 'number' &&\n typeof props.domain[1] === 'number'\n ? ([props.domain[0], props.domain[1]] as [number, number])\n : 'auto';\n\n const range =\n Array.isArray(props.range) &&\n props.range.length === 2 &&\n typeof props.range[0] === 'number' &&\n typeof props.range[1] === 'number'\n ? ([props.range[0], props.range[1]] as [number, number])\n : undefined;\n\n return {\n [SQLROOMS_SCALE_MARKER]: true,\n field,\n type: 'linear',\n domain,\n ...(range ? {range} : {}),\n };\n}\n\nexport function isScaleMarker(value: unknown): value is ScaleMarker {\n return Boolean(\n value &&\n typeof value === 'object' &&\n (value as {[SQLROOMS_SCALE_MARKER]?: boolean})[SQLROOMS_SCALE_MARKER],\n );\n}\n\nfunction readNumericDomain(vector: arrow.Vector): [number, number] | null {\n let min = Infinity;\n let max = -Infinity;\n for (let i = 0; i < vector.length; i++) {\n // Arrow/SQL NULL must not become 0 via Number(null).\n if (typeof vector.isValid === 'function' && !vector.isValid(i)) {\n continue;\n }\n const raw = vector.get(i);\n if (raw == null) continue;\n const v = Number(raw);\n if (!Number.isFinite(v)) continue;\n if (v < min) min = v;\n if (v > max) max = v;\n }\n if (!Number.isFinite(min) || !Number.isFinite(max)) return null;\n return [min, max];\n}\n\n/**\n * Linear scale `@@=` expression. Non-identifier fields need\n * {@link compileLinearScaleAccessor}.\n */\nexport function compileLinearScaleExpression(\n table: arrow.Table,\n scale: LinearScaleConfig,\n): string | undefined {\n const field = scale.field.trim();\n if (!field || !isBindableGeoArrowFieldIdentifier(field)) return undefined;\n\n const vector = table.getChild(field);\n if (!vector) return undefined;\n\n const domain =\n scale.domain === 'auto' || scale.domain === undefined\n ? readNumericDomain(vector)\n : scale.domain;\n if (!domain) return undefined;\n\n const [d0, d1] = domain;\n\n if (!scale.range) {\n if (d0 === 0) return `@@=${field}`;\n return `@@=Math.max(0, ${field} - ${d0})`;\n }\n\n const [r0, r1] = scale.range;\n const span = d1 - d0;\n if (span === 0) {\n return `@@=${r0}`;\n }\n\n const lo = Math.min(r0, r1);\n const hi = Math.max(r0, r1);\n // Clamp after linear map (bigint coercion lives in compileGeoArrowAccessor).\n return `@@=Math.max(${lo}, Math.min(${hi}, ${r0} + (${field} - ${d0}) / ${span} * ${r1 - r0}))`;\n}\n\nfunction readLinearScaleRawValue(\n value: unknown,\n field: string,\n vector: arrow.Vector,\n): unknown {\n if (!value || typeof value !== 'object') return undefined;\n\n const object = value as {\n index?: unknown;\n data?: {data?: {getChild?: (name: string) => arrow.Vector | null}};\n properties?: Record<string, unknown>;\n };\n\n if (typeof object.index === 'number') {\n const batch = object.data?.data;\n if (batch?.getChild) {\n return batch.getChild(field)?.get(object.index);\n }\n if (batch) {\n // Batch-local index (GeoArrow) without this field — do not fall back to\n // the table-level vector.\n return undefined;\n }\n return vector.get(object.index);\n }\n\n const sources = [object.properties, object as Record<string, unknown>];\n for (const source of sources) {\n if (source && typeof source === 'object' && field in source) {\n return source[field];\n }\n }\n\n return undefined;\n}\n\n/**\n * Elevation accessor for any Arrow column name (incl. non-identifiers).\n * Reads GeoArrow `{index, data}` callbacks or GeoJSON `{properties}` features.\n */\nexport function compileLinearScaleAccessor(\n table: arrow.Table,\n scale: LinearScaleConfig,\n): ((value: unknown) => number) | undefined {\n const field = scale.field.trim();\n if (!field) return undefined;\n\n const vector = table.getChild(field);\n if (!vector) return undefined;\n\n const domain =\n scale.domain === 'auto' || scale.domain === undefined\n ? readNumericDomain(vector)\n : scale.domain;\n if (!domain) return undefined;\n\n const [d0, d1] = domain;\n const range = scale.range;\n\n return (value) => {\n const raw = readLinearScaleRawValue(value, field, vector);\n if (raw == null) return 0;\n const v = Number(raw);\n if (!Number.isFinite(v)) return 0;\n\n if (!range) {\n return Math.max(0, v - d0);\n }\n\n const [r0, r1] = range;\n const span = d1 - d0;\n if (span === 0) return r0;\n const lo = Math.min(r0, r1);\n const hi = Math.max(r0, r1);\n return Math.max(lo, Math.min(hi, r0 + ((v - d0) / span) * (r1 - r0)));\n };\n}\n"]}
@@ -39,6 +39,7 @@ export declare const DeckMapResourceConfigParameter: z.ZodObject<{
39
39
  longitudeColumn: z.ZodOptional<z.ZodString>;
40
40
  latitudeColumn: z.ZodOptional<z.ZodString>;
41
41
  geometryColumn: z.ZodOptional<z.ZodString>;
42
+ geometryColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
43
  h3Column: z.ZodOptional<z.ZodString>;
43
44
  padding: z.ZodOptional<z.ZodNumber>;
44
45
  maxZoom: z.ZodOptional<z.ZodNumber>;
@@ -92,6 +93,7 @@ export declare const DeckMapResourceToolParameters: z.ZodObject<{
92
93
  longitudeColumn: z.ZodOptional<z.ZodString>;
93
94
  latitudeColumn: z.ZodOptional<z.ZodString>;
94
95
  geometryColumn: z.ZodOptional<z.ZodString>;
96
+ geometryColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
97
  h3Column: z.ZodOptional<z.ZodString>;
96
98
  padding: z.ZodOptional<z.ZodNumber>;
97
99
  maxZoom: z.ZodOptional<z.ZodNumber>;
@@ -103,6 +105,12 @@ export declare const DeckMapResourceToolParameters: z.ZodObject<{
103
105
  }, z.core.$loose>>;
104
106
  settingsOpen: z.ZodOptional<z.ZodBoolean>;
105
107
  }, z.core.$loose>;
108
+ pointBinding: z.ZodOptional<z.ZodObject<{
109
+ dataset: z.ZodString;
110
+ longitudeColumn: z.ZodString;
111
+ latitudeColumn: z.ZodString;
112
+ geometryColumn: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strip>>;
106
114
  tableName: z.ZodOptional<z.ZodString>;
107
115
  replaceLayers: z.ZodOptional<z.ZodBoolean>;
108
116
  replaceDatasets: z.ZodOptional<z.ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"mapAiConfig.d.ts","sourceRoot":"","sources":["../src/mapAiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAuCtB,kFAAkF;AAClF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBN,CAAC;AAEtC,mFAAmF;AACnF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBxC,CAAC"}
1
+ {"version":3,"file":"mapAiConfig.d.ts","sourceRoot":"","sources":["../src/mapAiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAgDtB,kFAAkF;AAClF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBN,CAAC;AAEtC,mFAAmF;AACnF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBxC,CAAC"}
@@ -26,16 +26,23 @@ const DeckMapFitToDataConfig = z.looseObject({
26
26
  longitudeColumn: z.string().optional(),
27
27
  latitudeColumn: z.string().optional(),
28
28
  geometryColumn: z.string().optional(),
29
+ geometryColumns: z.array(z.string()).optional(),
29
30
  h3Column: z.string().optional(),
30
31
  padding: z.number().optional(),
31
32
  maxZoom: z.number().optional(),
32
33
  });
34
+ const DeckMapPointBindingParameter = z.object({
35
+ dataset: z.string().trim().min(1),
36
+ longitudeColumn: z.string().trim().min(1),
37
+ latitudeColumn: z.string().trim().min(1),
38
+ geometryColumn: z.string().trim().min(1).optional(),
39
+ });
33
40
  /** Validates the portable Deck map config accepted from commands and AI tools. */
34
41
  export const DeckMapResourceConfigParameter = z.looseObject({
35
42
  spec: z.union([z.string(), z.record(z.string(), z.unknown())]),
36
43
  datasets: z
37
44
  .record(z.string(), DeckMapDatasetConfig)
38
- .describe('Resource datasets keyed by id. Every dataset in a new map must define source.tableName or source.sqlQuery.'),
45
+ .describe('Resource datasets keyed by id. Every dataset in a new map must define source.tableName or source.sqlQuery. For visual-only updates send an empty object {} so merge keeps the existing registry — do not omit this field.'),
39
46
  configMode: z.enum(['basic', 'custom']).optional(),
40
47
  mapStyle: z.string().optional(),
41
48
  mapProps: z.record(z.string(), z.unknown()).optional(),
@@ -55,6 +62,7 @@ export const DeckMapResourceConfigParameter = z.looseObject({
55
62
  export const DeckMapResourceToolParameters = z.object({
56
63
  title: z.string().optional().default('Map'),
57
64
  config: DeckMapResourceConfigParameter,
65
+ pointBinding: DeckMapPointBindingParameter.optional().describe('Structured point provenance for a table-backed dataset. Prefer this over authoring transformSql when longitude and latitude columns should become WKB point geometry.'),
58
66
  tableName: z.string().optional(),
59
67
  replaceLayers: z
60
68
  .boolean()
@@ -1 +1 @@
1
- {"version":3,"file":"mapAiConfig.js","sourceRoot":"","sources":["../src/mapAiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC,CAAC,WAAW,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB,CAAC;IACF,CAAC,CAAC,WAAW,CAAC;QACZ,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACpC,CAAC;CACH,CAAC,CAAC;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC9C,sHAAsH,CACvH;IACD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,oBAAoB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CA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V,QAAQ,CACP,8GAA8G,CAC/G;IACH,eAAe,EAAE,CAAC;SACf,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,iHAAiH,CAClH;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport type {DeckMapConfig} from './mapConfig';\n\nconst DeckMapDatasetSource = z.union([\n z.looseObject({\n sqlQuery: z.string(),\n }),\n z.looseObject({\n tableName: z.string(),\n transformSql: z.string().optional(),\n }),\n]);\nconst DeckMapDatasetConfig = z.looseObject({\n source: DeckMapDatasetSource.optional().describe(\n 'Dataset source. Required for new maps; may be omitted only by a sparse update patch that retains an existing source.',\n ),\n geometryColumn: z.string().optional(),\n geometryEncodingHint: z.enum(['geoarrow', 'wkb', 'wkt']).optional(),\n});\n\nconst DeckMapInteractionConfig = z.looseObject({\n type: z.literal('point-radius-brush'),\n dataset: z.string(),\n longitudeColumn: z.string(),\n latitudeColumn: z.string(),\n radiusMeters: z.number().optional(),\n event: z.enum(['hover', 'click']).optional(),\n});\n\nconst DeckMapFitToDataConfig = z.looseObject({\n dataset: z.string(),\n longitudeColumn: z.string().optional(),\n latitudeColumn: z.string().optional(),\n geometryColumn: z.string().optional(),\n h3Column: z.string().optional(),\n padding: z.number().optional(),\n maxZoom: z.number().optional(),\n});\n\n/** Validates the portable Deck map config accepted from commands and AI tools. */\nexport const DeckMapResourceConfigParameter = z.looseObject({\n spec: z.union([z.string(), z.record(z.string(), z.unknown())]),\n datasets: z\n .record(z.string(), DeckMapDatasetConfig)\n .describe(\n 'Resource datasets keyed by id. Every dataset in a new map must define source.tableName or source.sqlQuery.',\n ),\n configMode: z.enum(['basic', 'custom']).optional(),\n mapStyle: z.string().optional(),\n mapProps: z.record(z.string(), z.unknown()).optional(),\n showLegends: z.boolean().optional(),\n interaction: DeckMapInteractionConfig.optional(),\n fitToData: DeckMapFitToDataConfig.optional(),\n dataPolicy: z\n .looseObject({\n disabled: z.boolean().optional(),\n maxRows: z.number().int().min(1).optional(),\n reason: z.string().optional(),\n })\n .optional(),\n settingsOpen: z.boolean().optional(),\n}) satisfies z.ZodType<DeckMapConfig>;\n\n/** Validates inputs for an AI or command invocation that writes a map resource. */\nexport const DeckMapResourceToolParameters = z.object({\n title: z.string().optional().default('Map'),\n config: DeckMapResourceConfigParameter,\n tableName: z.string().optional(),\n replaceLayers: z\n .boolean()\n .optional()\n .describe(\n 'Set true when config.spec.layers is the complete desired list and omitted existing layers should be removed.',\n ),\n replaceDatasets: z\n .boolean()\n .optional()\n .describe(\n 'Set true when config.datasets is the complete desired registry and omitted existing datasets should be removed.',\n ),\n reasoning: z.string(),\n});\n"]}
1
+ {"version":3,"file":"mapAiConfig.js","sourceRoot":"","sources":["../src/mapAiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC,CAAC,WAAW,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB,CAAC;IACF,CAAC,CAAC,WAAW,CAAC;QACZ,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACpC,CAAC;CACH,CAAC,CAAC;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC9C,sHAAsH,CACvH;IACD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,oBAAoB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;CACpE,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC7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AAQ,EAAE;KAC9B,CAAC;SACD,QAAQ,EAAE;IACb,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAoC,CAAC;AAEtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC3C,MAAM,EAAE,8BAA8B;IACtC,YAAY,EAAE,4BAA4B,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC5D,uKAAuK,CACxK;IACD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,EAAE,CAAC;SACb,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,8GAA8G,CAC/G;IACH,eAAe,EAAE,CAAC;SACf,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,iHAAiH,CAClH;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport type {DeckMapConfig} from './mapConfig';\nimport type {DeckMapPointBinding} from './mapConfigUtils';\n\nconst DeckMapDatasetSource = z.union([\n z.looseObject({\n sqlQuery: z.string(),\n }),\n z.looseObject({\n tableName: z.string(),\n transformSql: z.string().optional(),\n }),\n]);\nconst DeckMapDatasetConfig = z.looseObject({\n source: DeckMapDatasetSource.optional().describe(\n 'Dataset source. Required for new maps; may be omitted only by a sparse update patch that retains an existing source.',\n ),\n geometryColumn: z.string().optional(),\n geometryEncodingHint: z.enum(['geoarrow', 'wkb', 'wkt']).optional(),\n});\n\nconst DeckMapInteractionConfig = z.looseObject({\n type: z.literal('point-radius-brush'),\n dataset: z.string(),\n longitudeColumn: z.string(),\n latitudeColumn: z.string(),\n radiusMeters: z.number().optional(),\n event: z.enum(['hover', 'click']).optional(),\n});\n\nconst DeckMapFitToDataConfig = z.looseObject({\n dataset: z.string(),\n longitudeColumn: z.string().optional(),\n latitudeColumn: z.string().optional(),\n geometryColumn: z.string().optional(),\n geometryColumns: z.array(z.string()).optional(),\n h3Column: z.string().optional(),\n padding: z.number().optional(),\n maxZoom: z.number().optional(),\n});\n\nconst DeckMapPointBindingParameter = z.object({\n dataset: z.string().trim().min(1),\n longitudeColumn: z.string().trim().min(1),\n latitudeColumn: z.string().trim().min(1),\n geometryColumn: z.string().trim().min(1).optional(),\n}) satisfies z.ZodType<DeckMapPointBinding>;\n\n/** Validates the portable Deck map config accepted from commands and AI tools. */\nexport const DeckMapResourceConfigParameter = z.looseObject({\n spec: z.union([z.string(), z.record(z.string(), z.unknown())]),\n datasets: z\n .record(z.string(), DeckMapDatasetConfig)\n .describe(\n 'Resource datasets keyed by id. Every dataset in a new map must define source.tableName or source.sqlQuery. For visual-only updates send an empty object {} so merge keeps the existing registry — do not omit this field.',\n ),\n configMode: z.enum(['basic', 'custom']).optional(),\n mapStyle: z.string().optional(),\n mapProps: z.record(z.string(), z.unknown()).optional(),\n showLegends: z.boolean().optional(),\n interaction: DeckMapInteractionConfig.optional(),\n fitToData: DeckMapFitToDataConfig.optional(),\n dataPolicy: z\n .looseObject({\n disabled: z.boolean().optional(),\n maxRows: z.number().int().min(1).optional(),\n reason: z.string().optional(),\n })\n .optional(),\n settingsOpen: z.boolean().optional(),\n}) satisfies z.ZodType<DeckMapConfig>;\n\n/** Validates inputs for an AI or command invocation that writes a map resource. */\nexport const DeckMapResourceToolParameters = z.object({\n title: z.string().optional().default('Map'),\n config: DeckMapResourceConfigParameter,\n pointBinding: DeckMapPointBindingParameter.optional().describe(\n 'Structured point provenance for a table-backed dataset. Prefer this over authoring transformSql when longitude and latitude columns should become WKB point geometry.',\n ),\n tableName: z.string().optional(),\n replaceLayers: z\n .boolean()\n .optional()\n .describe(\n 'Set true when config.spec.layers is the complete desired list and omitted existing layers should be removed.',\n ),\n replaceDatasets: z\n .boolean()\n .optional()\n .describe(\n 'Set true when config.datasets is the complete desired registry and omitted existing datasets should be removed.',\n ),\n reasoning: z.string(),\n});\n"]}
@@ -0,0 +1,3 @@
1
+ /** Shared Deck map AI rules for dashboard and document prompts. */
2
+ export declare function getDeckMapSharedAiContractRules(): string;
3
+ //# sourceMappingURL=mapAiSharedInstructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapAiSharedInstructions.d.ts","sourceRoot":"","sources":["../src/mapAiSharedInstructions.ts"],"names":[],"mappings":"AAEA,mEAAmE;AACnE,wBAAgB,+BAA+B,IAAI,MAAM,CAYxD"}
@@ -0,0 +1,16 @@
1
+ import { DECK_TABLE_DATASET_SOURCE_RELATION } from './datasets/tableDatasetSql';
2
+ /** Shared Deck map AI rules for dashboard and document prompts. */
3
+ export function getDeckMapSharedAiContractRules() {
4
+ const src = DECK_TABLE_DATASET_SOURCE_RELATION;
5
+ return `Shared Deck map authoring rules (dashboard and document):
6
+ - Scatterplot/Heatmap/Column require Point positions — do not bind them to Polygon/MultiPolygon geom. Prefer GeoArrowPolygonLayer for Polygon, GeoJsonLayer for WKB/WKT MultiPolygon, or transformSql with ST_AsWKB(ST_Centroid(geom)) / ST_PointOnSurface(geom) when the user wants points (e.g. SELECT * EXCLUDE (geom), ST_AsWKB(ST_Centroid(geom)) AS geom FROM ${src}). The runtime will not invent centroids.
7
+ - Mixed Point/LineString/Polygon columns: use GeoJsonLayer. Typed GeoArrowPolygon/Path/Scatterplot layers need a uniform geometry type. To keep one class, filter with WHERE ST_GeometryType(geom) IN (...) then use the matching typed layer.
8
+ - Never write SELECT *, ST_AsWKB(col) AS col — DuckDB keeps the original column and the WKB alias collides. Use SELECT * EXCLUDE (col), ST_AsWKB(...) AS col, or omit transformSql when geom already exists. Bare ST_Point(...) / table GEOMETRY columns are projected to WKB by the dataset pipeline; prefer explicit ST_AsWKB when practical.
9
+ - GeoArrowHeatmapLayer: omit colorRange (UI scheme selector owns it) and omit getWeight (default uniform density). Do not bind getWeight to a column — basic mode has no weight-column control.
10
+ - Never set mapStyle to a mapbox:// URL — MapLibre cannot load that scheme. Omit mapStyle for the host basemap, or use a token-free MapLibre https:// style URL.
11
+ - GeoArrowH3HexagonLayer: set getHexagon to "@@=h3_column" (or _sqlroomsBinding.hexagonColumn). When aggregating lon/lat, prefer h3_h3_to_string(h3_latlng_to_cell(lat, lon, res)) AS h3_cell (lat before lon).
12
+ - GeoArrowArcLayer: bind WKB via _sqlroomsBinding.sourceGeometryColumn / targetGeometryColumn only (do not set getSourcePosition/getTargetPosition). Use ST_AsWKB(ST_Point(...)); set geometryEncodingHint to "wkb".
13
+ - GeoArrowTripsLayer = animated path over time; GeoArrowArcLayer = static OD curve. Prefer TripsLayer for animated/trips/moving routes.
14
+ - COLOR SCALE FIELD VARIANCE: Before choosing a numeric colorScale field, confirm it has real range (min < max / not all zeros or a single constant). Prefer SUMMARIZE table_name or SELECT min(col), max(col), count(DISTINCT col) FROM ... when unsure. Do NOT color by a flat column unless the user explicitly asks for that column by name. If no varying column exists, use a flat fill color instead of colorScale. Categorical fields need more than one distinct non-null value to be useful. Geometry, lon/lat, H3 index, and opaque ID columns are not useful color fields unless the user asks for them.`;
15
+ }
16
+ //# sourceMappingURL=mapAiSharedInstructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapAiSharedInstructions.js","sourceRoot":"","sources":["../src/mapAiSharedInstructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,4BAA4B,CAAC;AAE9E,mEAAmE;AACnE,MAAM,UAAU,+BAA+B;IAC7C,MAAM,GAAG,GAAG,kCAAkC,CAAC;IAC/C,OAAO;sWAC6V,GAAG;;;;;;;;qlBAQ4O,CAAC;AACtlB,CAAC","sourcesContent":["import {DECK_TABLE_DATASET_SOURCE_RELATION} from './datasets/tableDatasetSql';\n\n/** Shared Deck map AI rules for dashboard and document prompts. */\nexport function getDeckMapSharedAiContractRules(): string {\n const src = DECK_TABLE_DATASET_SOURCE_RELATION;\n return `Shared Deck map authoring rules (dashboard and document):\n- Scatterplot/Heatmap/Column require Point positions — do not bind them to Polygon/MultiPolygon geom. Prefer GeoArrowPolygonLayer for Polygon, GeoJsonLayer for WKB/WKT MultiPolygon, or transformSql with ST_AsWKB(ST_Centroid(geom)) / ST_PointOnSurface(geom) when the user wants points (e.g. SELECT * EXCLUDE (geom), ST_AsWKB(ST_Centroid(geom)) AS geom FROM ${src}). The runtime will not invent centroids.\n- Mixed Point/LineString/Polygon columns: use GeoJsonLayer. Typed GeoArrowPolygon/Path/Scatterplot layers need a uniform geometry type. To keep one class, filter with WHERE ST_GeometryType(geom) IN (...) then use the matching typed layer.\n- Never write SELECT *, ST_AsWKB(col) AS col — DuckDB keeps the original column and the WKB alias collides. Use SELECT * EXCLUDE (col), ST_AsWKB(...) AS col, or omit transformSql when geom already exists. Bare ST_Point(...) / table GEOMETRY columns are projected to WKB by the dataset pipeline; prefer explicit ST_AsWKB when practical.\n- GeoArrowHeatmapLayer: omit colorRange (UI scheme selector owns it) and omit getWeight (default uniform density). Do not bind getWeight to a column — basic mode has no weight-column control.\n- Never set mapStyle to a mapbox:// URL — MapLibre cannot load that scheme. Omit mapStyle for the host basemap, or use a token-free MapLibre https:// style URL.\n- GeoArrowH3HexagonLayer: set getHexagon to \"@@=h3_column\" (or _sqlroomsBinding.hexagonColumn). When aggregating lon/lat, prefer h3_h3_to_string(h3_latlng_to_cell(lat, lon, res)) AS h3_cell (lat before lon).\n- GeoArrowArcLayer: bind WKB via _sqlroomsBinding.sourceGeometryColumn / targetGeometryColumn only (do not set getSourcePosition/getTargetPosition). Use ST_AsWKB(ST_Point(...)); set geometryEncodingHint to \"wkb\".\n- GeoArrowTripsLayer = animated path over time; GeoArrowArcLayer = static OD curve. Prefer TripsLayer for animated/trips/moving routes.\n- COLOR SCALE FIELD VARIANCE: Before choosing a numeric colorScale field, confirm it has real range (min < max / not all zeros or a single constant). Prefer SUMMARIZE table_name or SELECT min(col), max(col), count(DISTINCT col) FROM ... when unsure. Do NOT color by a flat column unless the user explicitly asks for that column by name. If no varying column exists, use a flat fill color instead of colorScale. Categorical fields need more than one distinct non-null value to be useful. Geometry, lon/lat, H3 index, and opaque ID columns are not useful color fields unless the user asks for them.`;\n}\n"]}
@@ -27,6 +27,12 @@ export type DeckMapFitToDataConfig = {
27
27
  longitudeColumn?: string;
28
28
  latitudeColumn?: string;
29
29
  geometryColumn?: string;
30
+ /**
31
+ * Multiple geometry columns whose extents should be combined when fitting
32
+ * the view. Used for arc layers that have separate source and target
33
+ * geometries — a single `geometryColumn` would only cover one endpoint.
34
+ */
35
+ geometryColumns?: string[];
30
36
  h3Column?: string;
31
37
  padding?: number;
32
38
  maxZoom?: number;
@@ -47,7 +53,7 @@ export type DeckMapConfig = {
47
53
  };
48
54
  /** Creates the portable empty configuration used for a new Deck map. */
49
55
  export declare function createEmptyDeckMapConfig(): DeckMapConfig;
50
- /** Adapter-facing dashboard panel shape; worksheet resources never store it. */
56
+ /** Adapter-facing dashboard panel shape; document resources never store it. */
51
57
  export type DeckMapDashboardPanelConfig = DeckMapConfig;
52
58
  export type DeckMapDashboardDatasetConfig = DeckMapDatasetConfig;
53
59
  export type DeckMapDashboardDatasetSource = DeckMapDatasetSource;
@@ -1 +1 @@
1
- {"version":3,"file":"mapConfig.d.ts","sourceRoot":"","sources":["../src/mapConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,gCAAgC,SAAU,CAAC;AAExD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,IAAI,CAA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