@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,78 @@
1
+ /**
2
+ * Detects `SELECT *, ST_AsWKB(...) AS col` same-list collisions (DuckDB renames
3
+ * the WKB alias). Detection only — no rewrite. Does not flag sampling wrappers
4
+ * like `SELECT * FROM (… ST_AsWKB …)`.
5
+ */
6
+ function findTopLevelFromIndex(sql, selectStarEnd) {
7
+ let depth = 0;
8
+ for (let i = selectStarEnd; i < sql.length; i++) {
9
+ const ch = sql[i];
10
+ if (ch === '(') {
11
+ depth += 1;
12
+ continue;
13
+ }
14
+ if (ch === ')') {
15
+ if (depth === 0)
16
+ return -1;
17
+ depth -= 1;
18
+ continue;
19
+ }
20
+ if (depth !== 0)
21
+ continue;
22
+ if ((sql[i] === 'F' || sql[i] === 'f') &&
23
+ /^FROM\b/i.test(sql.slice(i)) &&
24
+ (i === 0 || !/[A-Za-z0-9_]/.test(sql[i - 1]))) {
25
+ return i;
26
+ }
27
+ }
28
+ return -1;
29
+ }
30
+ /** True when SELECT * mixes with `ST_AsWKB(...) AS` reusing an inner name. */
31
+ export function hasSelectStarAsWkbCollision(sql) {
32
+ const re = /\bSELECT\s+(?:[A-Za-z_][\w$]*\.)?\*/gi;
33
+ let match;
34
+ while ((match = re.exec(sql)) !== null) {
35
+ const afterStar = sql.slice(match.index + match[0].length);
36
+ if (/^\s*(EXCLUDE|REPLACE)\b/i.test(afterStar))
37
+ continue;
38
+ // `SELECT * FROM ...` has no sibling projections — not a collision.
39
+ if (!/^\s*,/.test(afterStar))
40
+ continue;
41
+ const fromAt = findTopLevelFromIndex(sql, match.index + match[0].length);
42
+ if (fromAt < 0)
43
+ continue;
44
+ const selectList = sql.slice(match.index, fromAt);
45
+ const asWkbRe = /\bST_AsWKB\s*\(/gi;
46
+ let asWkb;
47
+ while ((asWkb = asWkbRe.exec(selectList)) !== null) {
48
+ let depth = 1;
49
+ let i = asWkb.index + asWkb[0].length;
50
+ const exprStart = i;
51
+ while (i < selectList.length && depth > 0) {
52
+ const ch = selectList[i];
53
+ if (ch === '(')
54
+ depth += 1;
55
+ else if (ch === ')')
56
+ depth -= 1;
57
+ i += 1;
58
+ }
59
+ if (depth !== 0)
60
+ continue;
61
+ const exprBody = selectList.slice(exprStart, i - 1);
62
+ const asMatch = selectList
63
+ .slice(i)
64
+ .match(/^\s+AS\s+("([^"]+)"|([A-Za-z_][\w$]*))/i);
65
+ if (!asMatch)
66
+ continue;
67
+ const col = asMatch[2] ?? asMatch[3];
68
+ if (!col)
69
+ continue;
70
+ // Alias reuse inside ST_AsWKB only (`AS geom` collision); new aliases are fine.
71
+ const aliasRe = new RegExp(`(^|[^A-Za-z0-9_])${col.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}([^A-Za-z0-9_]|$)`, 'i');
72
+ if (aliasRe.test(exprBody))
73
+ return true;
74
+ }
75
+ }
76
+ return false;
77
+ }
78
+ //# sourceMappingURL=selectStarAsWkbCollision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectStarAsWkbCollision.js","sourceRoot":"","sources":["../src/selectStarAsWkbCollision.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,SAAS,qBAAqB,CAAC,GAAW,EAAE,aAAqB;IAC/D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,aAAa,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,KAAK,IAAI,CAAC,CAAC;YACX,SAAS;QACX,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,IAAI,KAAK,KAAK,CAAC;gBAAE,OAAO,CAAC,CAAC,CAAC;YAC3B,KAAK,IAAI,CAAC,CAAC;YACX,SAAS;QACX,CAAC;QACD,IAAI,KAAK,KAAK,CAAC;YAAE,SAAS;QAC1B,IACE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;YAClC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,CAAC,EAC9C,CAAC;YACD,OAAO,CAAC,CA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CAAC,CAAC,CAAC,CAAC;gBACzB,IAAI,EAAE,KAAK,GAAG;oBAAE,KAAK,IAAI,CAAC,CAAC;qBACtB,IAAI,EAAE,KAAK,GAAG;oBAAE,KAAK,IAAI,CAAC,CAAC;gBAChC,CAAC,IAAI,CAAC,CAAC;YACT,CAAC;YACD,IAAI,KAAK,KAAK,CAAC;gBAAE,SAAS;YAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACpD,MAAM,OAAO,GAAG,UAAU;iBACvB,KAAK,CAAC,CAAC,CAAC;iBACR,KAAK,CAAC,yCAAyC,CAAC,CAAC;YACpD,IAAI,CAAC,OAAO;gBAAE,SAAS;YACvB,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,GAAG;gBAAE,SAAS;YACnB,gFAAgF;YAChF,MAAM,OAAO,GAAG,IAAI,MAAM,CACxB,oBAAoB,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,mBAAmB,EACjF,GAAG,CACJ,CAAC;YACF,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAC;QAC1C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Detects `SELECT *, ST_AsWKB(...) AS col` same-list collisions (DuckDB renames\n * the WKB alias). Detection only — no rewrite. Does not flag sampling wrappers\n * like `SELECT * FROM (… ST_AsWKB …)`.\n */\nfunction findTopLevelFromIndex(sql: string, selectStarEnd: number): number {\n let depth = 0;\n for (let i = selectStarEnd; i < sql.length; i++) {\n const ch = sql[i];\n if (ch === '(') {\n depth += 1;\n continue;\n }\n if (ch === ')') {\n if (depth === 0) return -1;\n depth -= 1;\n continue;\n }\n if (depth !== 0) continue;\n if (\n (sql[i] === 'F' || sql[i] === 'f') &&\n /^FROM\\b/i.test(sql.slice(i)) &&\n (i === 0 || !/[A-Za-z0-9_]/.test(sql[i - 1]!))\n ) {\n return i;\n }\n }\n return -1;\n}\n\n/** True when SELECT * mixes with `ST_AsWKB(...) AS` reusing an inner name. */\nexport function hasSelectStarAsWkbCollision(sql: string): boolean {\n const re = /\\bSELECT\\s+(?:[A-Za-z_][\\w$]*\\.)?\\*/gi;\n let match: RegExpExecArray | null;\n while ((match = re.exec(sql)) !== null) {\n const afterStar = sql.slice(match.index + match[0].length);\n if (/^\\s*(EXCLUDE|REPLACE)\\b/i.test(afterStar)) continue;\n // `SELECT * FROM ...` has no sibling projections — not a collision.\n if (!/^\\s*,/.test(afterStar)) continue;\n\n const fromAt = findTopLevelFromIndex(sql, match.index + match[0].length);\n if (fromAt < 0) continue;\n const selectList = sql.slice(match.index, fromAt);\n\n const asWkbRe = /\\bST_AsWKB\\s*\\(/gi;\n let asWkb: RegExpExecArray | null;\n while ((asWkb = asWkbRe.exec(selectList)) !== null) {\n let depth = 1;\n let i = asWkb.index + asWkb[0].length;\n const exprStart = i;\n while (i < selectList.length && depth > 0) {\n const ch = selectList[i];\n if (ch === '(') depth += 1;\n else if (ch === ')') depth -= 1;\n i += 1;\n }\n if (depth !== 0) continue;\n const exprBody = selectList.slice(exprStart, i - 1);\n const asMatch = selectList\n .slice(i)\n .match(/^\\s+AS\\s+(\"([^\"]+)\"|([A-Za-z_][\\w$]*))/i);\n if (!asMatch) continue;\n const col = asMatch[2] ?? asMatch[3];\n if (!col) continue;\n // Alias reuse inside ST_AsWKB only (`AS geom` collision); new aliases are fine.\n const aliasRe = new RegExp(\n `(^|[^A-Za-z0-9_])${col.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}([^A-Za-z0-9_]|$)`,\n 'i',\n );\n if (aliasRe.test(exprBody)) return true;\n }\n }\n return false;\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -9,7 +9,7 @@ type DeckDatasetBase = {
9
9
  geometryColumn?: string;
10
10
  geometryEncodingHint?: GeometryEncodingHint;
11
11
  };
12
- export type DeckAutoLayerType = 'GeoJsonLayer' | 'GeoArrowScatterplotLayer' | 'GeoArrowHeatmapLayer' | 'GeoArrowColumnLayer' | 'GeoArrowPathLayer' | 'GeoArrowPolygonLayer' | 'GeoArrowArcLayer' | 'GeoArrowTripsLayer' | 'GeoArrowH3HexagonLayer';
12
+ export type DeckAutoLayerType = 'GeoJsonLayer' | 'GeoArrowScatterplotLayer' | 'GeoArrowHeatmapLayer' | 'GeoArrowColumnLayer' | 'GeoArrowPathLayer' | 'GeoArrowPolygonLayer' | 'GeoArrowSolidPolygonLayer' | 'GeoArrowArcLayer' | 'GeoArrowTripsLayer' | 'GeoArrowH3HexagonLayer';
13
13
  export type DeckSqlDatasetInput = DeckDatasetBase & {
14
14
  /**
15
15
  * Literal SQL query used as the full dataset source.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAC,cAAc,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAEpD,KAAK,SAAS,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AACpD,OAAO,KAAK,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAE/E,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,KAAK,eAAe,GAAG;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB,cAAc,G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AAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qBAAqB,CAAC,EAAE,CACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,KAC7C,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,gBAAgB,GACtB,KAAK,IAAI,mBAAmB,CAE9B;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,gBAAgB,GACtB,KAAK,IAAI,qBAAqB,CAEhC;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,gBAAgB,GACtB,KAAK,IAAI,0BAA0B,CAErC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoHA,MAAM,UAAU,iBAAiB,CAC/B,KAAuB;IAEvB,OAAO,UAAU,IAAI,KAAK,CAAC;AAC7B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CACjC,KAAuB;IAEvB,OAAO,WAAW,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,KAAuB;IAEvB,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type * as arrow from 'apache-arrow';\nimport type {ComponentProps, ReactNode} from 'react';\nimport type DeckGLReact from '@deck.gl/react';\nimport type {MapProps} from 'react-map-gl/maplibre';\n\ntype DeckProps = ComponentProps<typeof DeckGLReact>;\nimport type {GeometryEncodingHint, PreparedDeckDataset} from './prepare/types';\n\nexport type {\n ColorScaleFunction,\n DeckJsonMapLayerSpec,\n DeckJsonMapSpec,\n LayerBindingConfig,\n LayerBindingProps,\n} from './DeckJsonMapSpec';\n\ntype DeckDatasetBase = {\n geometryColumn?: string;\n geometryEncodingHint?: GeometryEncodingHint;\n};\n\nexport type DeckAutoLayerType =\n | 'GeoJsonLayer'\n | 'GeoArrowScatterplotLayer'\n | 'GeoArrowHeatmapLayer'\n | 'GeoArrowColumnLayer'\n | 'GeoArrowPathLayer'\n | 'GeoArrowPolygonLayer'\n | 'GeoArrowArcLayer'\n | 'GeoArrowTripsLayer'\n | 'GeoArrowH3HexagonLayer';\n\nexport type DeckSqlDatasetInput = DeckDatasetBase & {\n /**\n * Literal SQL query used as the full dataset source.\n *\n * SQLRooms does not rewrite this query when dashboard selected tables change.\n * Use `DeckTableDatasetInput` when a dataset should follow a structured\n * table source.\n */\n sqlQuery: string;\n};\n\n/**\n * Structured table-backed dataset source.\n *\n * `tableName` identifies the source relation. When `transformSql` is present,\n * it must be a complete SELECT query that reads from the reserved\n * `__sqlrooms_source` relation supplied by SQLRooms at execution time.\n */\nexport type DeckTableDatasetInput = DeckDatasetBase & {\n tableName: string;\n transformSql?: string;\n};\n\nexport type DeckTable = arrow.Table;\n\nexport type DeckArrowTableDatasetInput = DeckDatasetBase & {\n arrowTable: DeckTable | undefined;\n};\nexport type DeckDatasetInput =\n | DeckSqlDatasetInput\n | DeckTableDatasetInput\n | DeckArrowTableDatasetInput;\n\nexport type DeckJsonSpecDatasetHint = {\n prefer?: 'heatmap';\n type?: DeckAutoLayerType;\n sourceGeometryColumn?: string;\n targetGeometryColumn?: string;\n timestampColumn?: string;\n hexagonColumn?: string;\n};\n\nexport type CreateDeckJsonSpecFromDatasetsOptions = {\n datasets: Record<string, DeckDatasetInput>;\n hints?: Record<string, DeckJsonSpecDatasetHint>;\n};\n\nexport type PreparedDeckDatasetState =\n | {status: 'loading'}\n | {status: 'ready'; prepared: PreparedDeckDataset}\n | {status: 'error'; error: Error};\n\nexport type DeckJsonMapHandle = {\n jumpTo: (opts: {\n longitude: number;\n latitude: number;\n zoom: number;\n bearing?: number;\n pitch?: number;\n }) => void;\n};\n\nexport type DeckJsonMapProps = {\n spec: string | Record<string, unknown>;\n datasets: Record<string, DeckDatasetInput>;\n mapStyle?: string;\n /**\n * When true, deck.gl renders into the map's own WebGL context rather than\n * creating a separate overlay canvas. This halves the number of WebGL\n * contexts per map panel (from 2 to 1), which matters because browsers\n * limit active contexts to ~8–16 per page. Defaults to true.\n */\n interleaved?: boolean;\n deckProps?: Partial<DeckProps>;\n mapProps?: Partial<MapProps>;\n showLegends?: boolean;\n className?: string;\n children?: ReactNode;\n onDatasetStatesChange?: (\n states: Record<string, PreparedDeckDatasetState>,\n ) => void;\n onRenderingError?: (error: Error) => void;\n};\n\nexport function isSqlDatasetInput(\n input: DeckDatasetInput,\n): input is DeckSqlDatasetInput {\n return 'sqlQuery' in input;\n}\n\n/** Returns true when the dataset input describes a structured table source. */\nexport function isTableDatasetInput(\n input: DeckDatasetInput,\n): input is DeckTableDatasetInput {\n return 'tableName' in input;\n}\n\nexport function isArrowTableDatasetInput(\n input: DeckDatasetInput,\n): input is DeckArrowTableDatasetInput {\n return 'arrowTable' in input;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAqHA,MAAM,UAAU,iBAAiB,CAC/B,KAAuB;IAEvB,OAAO,UAAU,IAAI,KAAK,CAAC;AAC7B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CACjC,KAAuB;IAEvB,OAAO,WAAW,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,KAAuB;IAEvB,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type * as arrow from 'apache-arrow';\nimport type {ComponentProps, ReactNode} from 'react';\nimport type DeckGLReact from '@deck.gl/react';\nimport type {MapProps} from 'react-map-gl/maplibre';\n\ntype DeckProps = ComponentProps<typeof DeckGLReact>;\nimport type {GeometryEncodingHint, PreparedDeckDataset} from './prepare/types';\n\nexport type {\n ColorScaleFunction,\n DeckJsonMapLayerSpec,\n DeckJsonMapSpec,\n LayerBindingConfig,\n LayerBindingProps,\n} from './DeckJsonMapSpec';\n\ntype DeckDatasetBase = {\n geometryColumn?: string;\n geometryEncodingHint?: GeometryEncodingHint;\n};\n\nexport type DeckAutoLayerType =\n | 'GeoJsonLayer'\n | 'GeoArrowScatterplotLayer'\n | 'GeoArrowHeatmapLayer'\n | 'GeoArrowColumnLayer'\n | 'GeoArrowPathLayer'\n | 'GeoArrowPolygonLayer'\n | 'GeoArrowSolidPolygonLayer'\n | 'GeoArrowArcLayer'\n | 'GeoArrowTripsLayer'\n | 'GeoArrowH3HexagonLayer';\n\nexport type DeckSqlDatasetInput = DeckDatasetBase & {\n /**\n * Literal SQL query used as the full dataset source.\n *\n * SQLRooms does not rewrite this query when dashboard selected tables change.\n * Use `DeckTableDatasetInput` when a dataset should follow a structured\n * table source.\n */\n sqlQuery: string;\n};\n\n/**\n * Structured table-backed dataset source.\n *\n * `tableName` identifies the source relation. When `transformSql` is present,\n * it must be a complete SELECT query that reads from the reserved\n * `__sqlrooms_source` relation supplied by SQLRooms at execution time.\n */\nexport type DeckTableDatasetInput = DeckDatasetBase & {\n tableName: string;\n transformSql?: string;\n};\n\nexport type DeckTable = arrow.Table;\n\nexport type DeckArrowTableDatasetInput = DeckDatasetBase & {\n arrowTable: DeckTable | undefined;\n};\nexport type DeckDatasetInput =\n | DeckSqlDatasetInput\n | DeckTableDatasetInput\n | DeckArrowTableDatasetInput;\n\nexport type DeckJsonSpecDatasetHint = {\n prefer?: 'heatmap';\n type?: DeckAutoLayerType;\n sourceGeometryColumn?: string;\n targetGeometryColumn?: string;\n timestampColumn?: string;\n hexagonColumn?: string;\n};\n\nexport type CreateDeckJsonSpecFromDatasetsOptions = {\n datasets: Record<string, DeckDatasetInput>;\n hints?: Record<string, DeckJsonSpecDatasetHint>;\n};\n\nexport type PreparedDeckDatasetState =\n | {status: 'loading'}\n | {status: 'ready'; prepared: PreparedDeckDataset}\n | {status: 'error'; error: Error};\n\nexport type DeckJsonMapHandle = {\n jumpTo: (opts: {\n longitude: number;\n latitude: number;\n zoom: number;\n bearing?: number;\n pitch?: number;\n }) => void;\n};\n\nexport type DeckJsonMapProps = {\n spec: string | Record<string, unknown>;\n datasets: Record<string, DeckDatasetInput>;\n mapStyle?: string;\n /**\n * When true, deck.gl renders into the map's own WebGL context rather than\n * creating a separate overlay canvas. This halves the number of WebGL\n * contexts per map panel (from 2 to 1), which matters because browsers\n * limit active contexts to ~8–16 per page. Defaults to true.\n */\n interleaved?: boolean;\n deckProps?: Partial<DeckProps>;\n mapProps?: Partial<MapProps>;\n showLegends?: boolean;\n className?: string;\n children?: ReactNode;\n onDatasetStatesChange?: (\n states: Record<string, PreparedDeckDatasetState>,\n ) => void;\n onRenderingError?: (error: Error) => void;\n};\n\nexport function isSqlDatasetInput(\n input: DeckDatasetInput,\n): input is DeckSqlDatasetInput {\n return 'sqlQuery' in input;\n}\n\n/** Returns true when the dataset input describes a structured table source. */\nexport function isTableDatasetInput(\n input: DeckDatasetInput,\n): input is DeckTableDatasetInput {\n return 'tableName' in input;\n}\n\nexport function isArrowTableDatasetInput(\n input: DeckDatasetInput,\n): input is DeckArrowTableDatasetInput {\n return 'arrowTable' in input;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useDeckMapFitToBounds.d.ts","sourceRoot":"","sources":["../src/useDeckMapFitToBounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA+B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AASnE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAE/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAIlD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,QAI7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,wBAAwB,CAAC;IACpC,KAAK,EAAE,8BAA8B,CAAC;IACtC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACjD;;EAiDA"}
1
+ {"version":3,"file":"useDeckMapFitToBounds.d.ts","sourceRoot":"","sources":["../src/useDeckMapFitToBounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA+B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAMnE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAE/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAIlD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,QAI7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,wBAAwB,CAAC;IACpC,KAAK,EAAE,8BAA8B,CAAC;IACtC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACjD;;EAiDA"}
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'react';
2
2
  import { asDeckJsonMapConfig, resolveDeckMapDashboardDatasetSource, } from './dashboardConfig';
3
- import { resolveDeckMapFitToData, useDeckMapFitController, } from './mapFit';
3
+ import { resolveDeckMapFitToData, useDeckMapFitController } from './mapFit';
4
4
  export { createDeckMapBoundsQuery } from './mapFit';
5
5
  const deckMapDashboardFitRequestTarget = new EventTarget();
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useDeckMapFitToBounds.js","sourceRoot":"","sources":["../src/useDeckMapFitToBounds.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAiB,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAElD,MAAM,gCAAgC,GAAG,IAAI,WAAW,EAAE,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,OAAe;IAC5D,gCAAgC,CAAC,aAAa,CAC5C,IAAI,WAAW,CAAC,UAAU,EAAE,EAAC,MAAM,EAAE,EAAC,OAAO,EAAC,EAAC,CAAC,CACjD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAMrC;IACC,MAAM,EAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAC,GAAG,OAAO,CAAC;IACnE,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,OAAO,CACvB,GAAG,EAAE,CAAC,uBAAuB,CAAC,SAAS,CAAC,EACxC,CAAC,SAAS,CAAC,CACZ,CAAC;IACF,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CACH,SAAS;QACP,CAAC,CAAC,CAAC,oCAAoC,CAAC;YACpC,SAAS;YACT,KAAK;YACL,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC;SAChD,CAAC,IAAI,IAAI,CAAC;QACb,CAAC,CAAC,IAAI,EACV,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,CACnD,CAAC;IACF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAE,EAAE;YACxC,MAAM,MAAM,GAAI,KAAyC,CAAC,MAAM,CAAC;YACjE,IAAI,MAAM,EAAE,OAAO,KAAK,OAAO,EAAE,CAAC;gBAChC,iBAAiB,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC;QACF,gCAAgC,CAAC,gBAAgB,CAC/C,UAAU,EACV,gBAAgB,CACjB,CAAC;QACF,OAAO,GAAG,EAAE,CACV,gCAAgC,CAAC,mBAAmB,CAClD,UAAU,EACV,gBAAgB,CACjB,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,uBAAuB,CAAC;QACtB,OAAO,EAAE,OAAO;QAChB,SAAS;QACT,MAAM;QACN,SAAS;QACT,UAAU;QACV,cAAc;QACd,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,OAAO,EAAC,SAAS,EAAC,CAAC;AACrB,CAAC","sourcesContent":["import type {\n MosaicDashboardEntryType,\n MosaicDashboardPanelConfigType,\n} from '@sqlrooms/mosaic';\nimport {useEffect, useMemo, useState, type RefObject} from 'react';\nimport {\n asDeckJsonMapConfig,\n resolveDeckMapDashboardDatasetSource,\n} from './dashboardConfig';\nimport {\n resolveDeckMapFitToData,\n useDeckMapFitController,\n} from './mapFit';\nimport type {DeckJsonMapHandle} from './types';\n\nexport {createDeckMapBoundsQuery} from './mapFit';\n\nconst deckMapDashboardFitRequestTarget = new EventTarget();\n\n/**\n * Requests a manual fit-to-data operation for a Mosaic dashboard map panel.\n *\n * @param panelId - Dashboard panel whose map view should be fitted.\n */\nexport function emitDeckMapDashboardFitRequest(panelId: string) {\n deckMapDashboardFitRequestTarget.dispatchEvent(\n new CustomEvent('fit-view', {detail: {panelId}}),\n );\n}\n\n/**\n * Adapts Mosaic dashboard state and panel fit events to the shared Deck fit\n * controller.\n *\n * This adapter resolves dashboard-selected table semantics while keeping all\n * query execution, viewport calculation, and request state in the host-neutral\n * fit engine.\n *\n * @param options - Mosaic dashboard/panel state and rendered map/container refs.\n * @returns The normalized fit configuration used by dashboard dataset clients.\n */\nexport function useDeckMapFitToBounds(options: {\n panelId: string;\n dashboard: MosaicDashboardEntryType;\n panel: MosaicDashboardPanelConfigType;\n container: HTMLElement | null;\n deckMapRef: RefObject<DeckJsonMapHandle | null>;\n}) {\n const {panelId, dashboard, panel, container, deckMapRef} = options;\n const mapConfig = asDeckJsonMapConfig(panel.config);\n const fitToData = useMemo(\n () => resolveDeckMapFitToData(mapConfig),\n [mapConfig],\n );\n const source = useMemo(\n () =>\n fitToData\n ? (resolveDeckMapDashboardDatasetSource({\n dashboard,\n panel,\n dataset: mapConfig?.datasets[fitToData.dataset],\n }) ?? null)\n : null,\n [dashboard, fitToData, mapConfig?.datasets, panel],\n );\n const [requestVersion, setRequestVersion] = useState(0);\n\n useEffect(() => {\n const handleFitRequest = (event: Event) => {\n const detail = (event as CustomEvent<{panelId?: string}>).detail;\n if (detail?.panelId === panelId) {\n setRequestVersion((version) => version + 1);\n }\n };\n deckMapDashboardFitRequestTarget.addEventListener(\n 'fit-view',\n handleFitRequest,\n );\n return () =>\n deckMapDashboardFitRequestTarget.removeEventListener(\n 'fit-view',\n handleFitRequest,\n );\n }, [panelId]);\n\n useDeckMapFitController({\n scopeId: panelId,\n fitToData,\n source,\n container,\n deckMapRef,\n requestVersion,\n autoFit: true,\n });\n\n return {fitToData};\n}\n"]}
1
+ {"version":3,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CAAC;IACF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAE,EAAE;YACxC,MAAM,MAAM,GAAI,KAAyC,CAAC,MAAM,CAAC;YACjE,IAAI,MAAM,EAAE,OAAO,KAAK,OAAO,EAAE,CAAC;gBAChC,iBAAiB,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC;QACF,gCAAgC,CAAC,gBAAgB,CAC/C,UAAU,EACV,gBAAgB,CACjB,CAAC;QACF,OAAO,GAAG,EAAE,CACV,gCAAgC,CAAC,mBAAmB,CAClD,UAAU,EACV,gBAAgB,CACjB,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,uBAAuB,CAAC;QACtB,OAAO,EAAE,OAAO;QAChB,SAAS;QACT,MAAM;QACN,SAAS;QACT,UAAU;QACV,cAAc;QACd,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,OAAO,EAAC,SAAS,EAAC,CAAC;AACrB,CAAC","sourcesContent":["import type {\n MosaicDashboardEntryType,\n MosaicDashboardPanelConfigType,\n} from '@sqlrooms/mosaic';\nimport {useEffect, useMemo, useState, type RefObject} from 'react';\nimport {\n asDeckJsonMapConfig,\n resolveDeckMapDashboardDatasetSource,\n} from './dashboardConfig';\nimport {resolveDeckMapFitToData, useDeckMapFitController} from './mapFit';\nimport type {DeckJsonMapHandle} from './types';\n\nexport {createDeckMapBoundsQuery} from './mapFit';\n\nconst deckMapDashboardFitRequestTarget = new EventTarget();\n\n/**\n * Requests a manual fit-to-data operation for a Mosaic dashboard map panel.\n *\n * @param panelId - Dashboard panel whose map view should be fitted.\n */\nexport function emitDeckMapDashboardFitRequest(panelId: string) {\n deckMapDashboardFitRequestTarget.dispatchEvent(\n new CustomEvent('fit-view', {detail: {panelId}}),\n );\n}\n\n/**\n * Adapts Mosaic dashboard state and panel fit events to the shared Deck fit\n * controller.\n *\n * This adapter resolves dashboard-selected table semantics while keeping all\n * query execution, viewport calculation, and request state in the host-neutral\n * fit engine.\n *\n * @param options - Mosaic dashboard/panel state and rendered map/container refs.\n * @returns The normalized fit configuration used by dashboard dataset clients.\n */\nexport function useDeckMapFitToBounds(options: {\n panelId: string;\n dashboard: MosaicDashboardEntryType;\n panel: MosaicDashboardPanelConfigType;\n container: HTMLElement | null;\n deckMapRef: RefObject<DeckJsonMapHandle | null>;\n}) {\n const {panelId, dashboard, panel, container, deckMapRef} = options;\n const mapConfig = asDeckJsonMapConfig(panel.config);\n const fitToData = useMemo(\n () => resolveDeckMapFitToData(mapConfig),\n [mapConfig],\n );\n const source = useMemo(\n () =>\n fitToData\n ? (resolveDeckMapDashboardDatasetSource({\n dashboard,\n panel,\n dataset: mapConfig?.datasets[fitToData.dataset],\n }) ?? null)\n : null,\n [dashboard, fitToData, mapConfig?.datasets, panel],\n );\n const [requestVersion, setRequestVersion] = useState(0);\n\n useEffect(() => {\n const handleFitRequest = (event: Event) => {\n const detail = (event as CustomEvent<{panelId?: string}>).detail;\n if (detail?.panelId === panelId) {\n setRequestVersion((version) => version + 1);\n }\n };\n deckMapDashboardFitRequestTarget.addEventListener(\n 'fit-view',\n handleFitRequest,\n );\n return () =>\n deckMapDashboardFitRequestTarget.removeEventListener(\n 'fit-view',\n handleFitRequest,\n );\n }, [panelId]);\n\n useDeckMapFitController({\n scopeId: panelId,\n fitToData,\n source,\n container,\n deckMapRef,\n requestVersion,\n autoFit: true,\n });\n\n return {fitToData};\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqlrooms/deck",
3
- "version": "0.29.0-rc.10",
3
+ "version": "0.29.0-rc.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/sqlrooms/sqlrooms.git"
@@ -38,22 +38,22 @@
38
38
  "typedoc": "typedoc"
39
39
  },
40
40
  "dependencies": {
41
- "@deck.gl/core": "^9.3.1",
42
- "@deck.gl/geo-layers": "^9.3.1",
43
- "@deck.gl/json": "^9.3.1",
44
- "@deck.gl/layers": "^9.3.1",
45
- "@deck.gl/mapbox": "^9.3.1",
46
- "@deck.gl/react": "^9.3.1",
41
+ "@deck.gl/core": "9.3.2",
42
+ "@deck.gl/geo-layers": "9.3.2",
43
+ "@deck.gl/json": "9.3.2",
44
+ "@deck.gl/layers": "9.3.2",
45
+ "@deck.gl/mapbox": "9.3.2",
46
+ "@deck.gl/react": "9.3.2",
47
47
  "@geoarrow/deck.gl-geoarrow": "^0.4.1",
48
48
  "@loaders.gl/geoarrow": "^4.4.1",
49
49
  "@loaders.gl/gis": "^4.4.1",
50
50
  "@loaders.gl/wkt": "^4.4.1",
51
51
  "@paralleldrive/cuid2": "^3.0.0",
52
- "@sqlrooms/color-scales": "0.29.0-rc.10",
53
- "@sqlrooms/documents": "0.29.0-rc.10",
54
- "@sqlrooms/duckdb": "0.29.0-rc.10",
55
- "@sqlrooms/room-store": "0.29.0-rc.10",
56
- "@sqlrooms/ui": "0.29.0-rc.10",
52
+ "@sqlrooms/color-scales": "0.29.0-rc.12",
53
+ "@sqlrooms/documents": "0.29.0-rc.12",
54
+ "@sqlrooms/duckdb": "0.29.0-rc.12",
55
+ "@sqlrooms/room-store": "0.29.0-rc.12",
56
+ "@sqlrooms/ui": "0.29.0-rc.12",
57
57
  "ai": "^6.0.177",
58
58
  "immer": "^11.0.1",
59
59
  "lucide-react": "^0.555.0",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@jest/globals": "^30.3.0",
67
- "@sqlrooms/mosaic": "0.29.0-rc.10",
67
+ "@sqlrooms/mosaic": "0.29.0-rc.12",
68
68
  "@types/geojson": "^7946.0.16",
69
69
  "@types/jest": "^30.0.0",
70
70
  "@uwdata/mosaic-core": "^0.21.0",
@@ -73,7 +73,7 @@
73
73
  "ts-jest": "^29.4.4"
74
74
  },
75
75
  "peerDependencies": {
76
- "@sqlrooms/mosaic": "0.29.0-rc.10",
76
+ "@sqlrooms/mosaic": "0.29.0-rc.12",
77
77
  "@uwdata/mosaic-core": "^0.21.0",
78
78
  "@uwdata/mosaic-sql": "^0.21.0",
79
79
  "apache-arrow": "17.0.0",
@@ -94,5 +94,5 @@
94
94
  "publishConfig": {
95
95
  "access": "public"
96
96
  },
97
- "gitHead": "dbcff5982d39cc07d0c1d0b1189795b19f1e8d87"
97
+ "gitHead": "f24a807aa57e52ce0a88207fc511849673a3fe03"
98
98
  }