@sqlrooms/deck 0.29.0-rc.4 → 0.29.0-rc.6

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 (75) hide show
  1. package/README.md +24 -2
  2. package/dist/DeckJsonMap.d.ts +1 -1
  3. package/dist/DeckJsonMap.d.ts.map +1 -1
  4. package/dist/DeckJsonMap.js +16 -11
  5. package/dist/DeckJsonMap.js.map +1 -1
  6. package/dist/LatitudeSelector.d.ts +11 -0
  7. package/dist/LatitudeSelector.d.ts.map +1 -0
  8. package/dist/LatitudeSelector.js +25 -0
  9. package/dist/LatitudeSelector.js.map +1 -0
  10. package/dist/LongitudeSelector.d.ts +11 -0
  11. package/dist/LongitudeSelector.d.ts.map +1 -0
  12. package/dist/LongitudeSelector.js +27 -0
  13. package/dist/LongitudeSelector.js.map +1 -0
  14. package/dist/MapSettings.d.ts +10 -0
  15. package/dist/MapSettings.d.ts.map +1 -0
  16. package/dist/MapSettings.js +96 -0
  17. package/dist/MapSettings.js.map +1 -0
  18. package/dist/ai.d.ts +168 -0
  19. package/dist/ai.d.ts.map +1 -0
  20. package/dist/ai.js +232 -0
  21. package/dist/ai.js.map +1 -0
  22. package/dist/dashboard.d.ts.map +1 -1
  23. package/dist/dashboard.js +72 -105
  24. package/dist/dashboard.js.map +1 -1
  25. package/dist/dashboardConfig.d.ts +22 -6
  26. package/dist/dashboardConfig.d.ts.map +1 -1
  27. package/dist/dashboardConfig.js +2 -5
  28. package/dist/dashboardConfig.js.map +1 -1
  29. package/dist/dashboardIntegration.d.ts +3 -0
  30. package/dist/dashboardIntegration.d.ts.map +1 -0
  31. package/dist/dashboardIntegration.js +16 -0
  32. package/dist/dashboardIntegration.js.map +1 -0
  33. package/dist/datasets/PreparedDatasetStore.js +2 -1
  34. package/dist/datasets/PreparedDatasetStore.js.map +1 -1
  35. package/dist/index.d.ts +8 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +5 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/json/colorScaleFunction.d.ts +1 -1
  40. package/dist/json/colorScaleFunction.d.ts.map +1 -1
  41. package/dist/json/colorScaleFunction.js +7 -1
  42. package/dist/json/colorScaleFunction.js.map +1 -1
  43. package/dist/json/extractColorScaleLegends.d.ts.map +1 -1
  44. package/dist/json/extractColorScaleLegends.js +0 -1
  45. package/dist/json/extractColorScaleLegends.js.map +1 -1
  46. package/dist/json/layerCompatibility.d.ts.map +1 -1
  47. package/dist/json/layerCompatibility.js +2 -0
  48. package/dist/json/layerCompatibility.js.map +1 -1
  49. package/dist/mapConfigUtils.d.ts +62 -0
  50. package/dist/mapConfigUtils.d.ts.map +1 -0
  51. package/dist/mapConfigUtils.js +233 -0
  52. package/dist/mapConfigUtils.js.map +1 -0
  53. package/dist/mapDataPolicy.d.ts +4 -0
  54. package/dist/mapDataPolicy.d.ts.map +1 -0
  55. package/dist/mapDataPolicy.js +25 -0
  56. package/dist/mapDataPolicy.js.map +1 -0
  57. package/dist/mapLayerConfigUtils.d.ts +38 -0
  58. package/dist/mapLayerConfigUtils.d.ts.map +1 -0
  59. package/dist/mapLayerConfigUtils.js +185 -0
  60. package/dist/mapLayerConfigUtils.js.map +1 -0
  61. package/dist/prepare/wkbDecoder.d.ts.map +1 -1
  62. package/dist/prepare/wkbDecoder.js +266 -67
  63. package/dist/prepare/wkbDecoder.js.map +1 -1
  64. package/dist/prepare/wkbParser.d.ts +19 -0
  65. package/dist/prepare/wkbParser.d.ts.map +1 -0
  66. package/dist/prepare/wkbParser.js +115 -0
  67. package/dist/prepare/wkbParser.js.map +1 -0
  68. package/dist/types.d.ts +8 -0
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/types.js.map +1 -1
  71. package/package.json +8 -7
  72. package/dist/useDeckLayersReadyRedraw.d.ts +0 -13
  73. package/dist/useDeckLayersReadyRedraw.d.ts.map +0 -1
  74. package/dist/useDeckLayersReadyRedraw.js +0 -35
  75. package/dist/useDeckLayersReadyRedraw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AK,IAAI,0BAA0B,CAErC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyEA,MAAM,UAAU,iBAAiB,CAC/B,KAAuB;IAEvB,OAAO,UAAU,IAAI,KAAK,CAAC;AAC7B,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 sqlQuery: string;\n};\n\nexport type DeckTable = arrow.Table;\n\nexport type DeckArrowTableDatasetInput = DeckDatasetBase & {\n arrowTable: DeckTable | undefined;\n};\nexport type DeckDatasetInput = DeckSqlDatasetInput | 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 DeckJsonMapProps = {\n spec: string | Record<string, unknown>;\n datasets: Record<string, DeckDatasetInput>;\n mapStyle?: string;\n deckProps?: Partial<DeckProps>;\n mapProps?: Partial<MapProps>;\n showLegends?: boolean;\n className?: string;\n children?: ReactNode;\n};\n\nexport function isSqlDatasetInput(\n input: DeckDatasetInput,\n): input is DeckSqlDatasetInput {\n return 'sqlQuery' 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":"AAmFA,MAAM,UAAU,iBAAiB,CAC/B,KAAuB;IAEvB,OAAO,UAAU,IAAI,KAAK,CAAC;AAC7B,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 sqlQuery: string;\n};\n\nexport type DeckTable = arrow.Table;\n\nexport type DeckArrowTableDatasetInput = DeckDatasetBase & {\n arrowTable: DeckTable | undefined;\n};\nexport type DeckDatasetInput = DeckSqlDatasetInput | 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 DeckJsonMapProps = {\n spec: string | Record<string, unknown>;\n datasets: Record<string, DeckDatasetInput>;\n mapStyle?: string;\n /**\n * When true, deck.gl layers are inserted into MapLibre's layer stack sharing\n * the same WebGL2 context. This allows rendering deck layers between basemap\n * layers (e.g. under labels). Requires WebGL2 (MapLibre GL v3+).\n * Defaults to false (deck renders in a separate overlay canvas on top).\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};\n\nexport function isSqlDatasetInput(\n input: DeckDatasetInput,\n): input is DeckSqlDatasetInput {\n return 'sqlQuery' in input;\n}\n\nexport function isArrowTableDatasetInput(\n input: DeckDatasetInput,\n): input is DeckArrowTableDatasetInput {\n return 'arrowTable' in input;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqlrooms/deck",
3
- "version": "0.29.0-rc.4",
3
+ "version": "0.29.0-rc.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/sqlrooms/sqlrooms.git"
@@ -30,19 +30,20 @@
30
30
  "@deck.gl/core": "^9.3.1",
31
31
  "@deck.gl/json": "^9.3.1",
32
32
  "@deck.gl/layers": "^9.3.1",
33
+ "@deck.gl/mapbox": "^9.3.1",
33
34
  "@deck.gl/react": "^9.3.1",
34
35
  "@geoarrow/deck.gl-layers": "0.3.2",
35
- "@loaders.gl/core": "^4.4.1",
36
36
  "@loaders.gl/geoarrow": "^4.4.1",
37
37
  "@loaders.gl/gis": "^4.4.1",
38
38
  "@loaders.gl/wkt": "^4.4.1",
39
39
  "@paralleldrive/cuid2": "^3.0.0",
40
- "@sqlrooms/color-scales": "0.29.0-rc.4",
41
- "@sqlrooms/duckdb": "0.29.0-rc.4",
42
- "@sqlrooms/mosaic": "0.29.0-rc.4",
43
- "@sqlrooms/ui": "0.29.0-rc.4",
40
+ "@sqlrooms/color-scales": "0.29.0-rc.6",
41
+ "@sqlrooms/duckdb": "0.29.0-rc.6",
42
+ "@sqlrooms/mosaic": "0.29.0-rc.6",
43
+ "@sqlrooms/ui": "0.29.0-rc.6",
44
44
  "@uwdata/mosaic-core": "^0.21.0",
45
45
  "@uwdata/mosaic-sql": "^0.21.0",
46
+ "ai": "^6.0.159",
46
47
  "lucide-react": "^0.555.0",
47
48
  "maplibre-gl": "^5.12.0",
48
49
  "react-map-gl": "^8.1.1",
@@ -64,5 +65,5 @@
64
65
  "publishConfig": {
65
66
  "access": "public"
66
67
  },
67
- "gitHead": "8694bab9d3d915a06d28675ad801b21444bcc55f"
68
+ "gitHead": "fbf5ee8897c5c06306b5433d26378cf658b5b298"
68
69
  }
@@ -1,13 +0,0 @@
1
- import type { DeckGLRef } from '@deck.gl/react';
2
- import type { RefObject } from 'react';
3
- /**
4
- * Schedule a post-layer redraw once meaningful layers are available, while
5
- * ignoring reference-only layer array churn. DeckGL still receives the latest
6
- * `layers` prop; the shallow-stable value is only for this effect dependency.
7
- */
8
- export declare function useDeckLayersReadyRedraw({ deckRef, hasRenderingError, layers, }: {
9
- deckRef: RefObject<DeckGLRef | null>;
10
- hasRenderingError: boolean;
11
- layers: readonly unknown[];
12
- }): void;
13
- //# sourceMappingURL=useDeckLayersReadyRedraw.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDeckLayersReadyRedraw.d.ts","sourceRoot":"","sources":["../src/useDeckLayersReadyRedraw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAcrC;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,iBAAiB,EACjB,MAAM,GACP,EAAE;IACD,OAAO,EAAE,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CAC5B,QAsBA"}
@@ -1,35 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { shallow } from 'zustand/shallow';
3
- function useShallowStableArray(value) {
4
- const [stableValue, setStableValue] = useState(value);
5
- if (!shallow(stableValue, value)) {
6
- setStableValue(value);
7
- }
8
- return stableValue;
9
- }
10
- /**
11
- * Schedule a post-layer redraw once meaningful layers are available, while
12
- * ignoring reference-only layer array churn. DeckGL still receives the latest
13
- * `layers` prop; the shallow-stable value is only for this effect dependency.
14
- */
15
- export function useDeckLayersReadyRedraw({ deckRef, hasRenderingError, layers, }) {
16
- const stableLayers = useShallowStableArray(layers);
17
- useEffect(() => {
18
- if (hasRenderingError || stableLayers.length === 0) {
19
- return;
20
- }
21
- let secondFrame = null;
22
- const firstFrame = requestAnimationFrame(() => {
23
- secondFrame = requestAnimationFrame(() => {
24
- deckRef.current?.deck?.redraw('SQLRooms layers ready');
25
- });
26
- });
27
- return () => {
28
- cancelAnimationFrame(firstFrame);
29
- if (secondFrame !== null) {
30
- cancelAnimationFrame(secondFrame);
31
- }
32
- };
33
- }, [deckRef, hasRenderingError, stableLayers]);
34
- }
35
- //# sourceMappingURL=useDeckLayersReadyRedraw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDeckLayersReadyRedraw.js","sourceRoot":"","sources":["../src/useDeckLayersReadyRedraw.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAExC,SAAS,qBAAqB,CAA+B,KAAQ;IACnE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QACjC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,OAAO,EACP,iBAAiB,EACjB,MAAM,GAKP;IACC,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnD,OAAO;QACT,CAAC;QAED,IAAI,WAAW,GAAkB,IAAI,CAAC;QACtC,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,EAAE;YAC5C,WAAW,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBACvC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,uBAAuB,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,UAAU,CAAC,CAAC;YACjC,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;gBACzB,oBAAoB,CAAC,WAAW,CAAC,CAAC;YACpC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,YAAY,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type {DeckGLRef} from '@deck.gl/react';\nimport type {RefObject} from 'react';\nimport {useEffect, useState} from 'react';\nimport {shallow} from 'zustand/shallow';\n\nfunction useShallowStableArray<T extends readonly unknown[]>(value: T) {\n const [stableValue, setStableValue] = useState(value);\n\n if (!shallow(stableValue, value)) {\n setStableValue(value);\n }\n\n return stableValue;\n}\n\n/**\n * Schedule a post-layer redraw once meaningful layers are available, while\n * ignoring reference-only layer array churn. DeckGL still receives the latest\n * `layers` prop; the shallow-stable value is only for this effect dependency.\n */\nexport function useDeckLayersReadyRedraw({\n deckRef,\n hasRenderingError,\n layers,\n}: {\n deckRef: RefObject<DeckGLRef | null>;\n hasRenderingError: boolean;\n layers: readonly unknown[];\n}) {\n const stableLayers = useShallowStableArray(layers);\n\n useEffect(() => {\n if (hasRenderingError || stableLayers.length === 0) {\n return;\n }\n\n let secondFrame: number | null = null;\n const firstFrame = requestAnimationFrame(() => {\n secondFrame = requestAnimationFrame(() => {\n deckRef.current?.deck?.redraw('SQLRooms layers ready');\n });\n });\n\n return () => {\n cancelAnimationFrame(firstFrame);\n if (secondFrame !== null) {\n cancelAnimationFrame(secondFrame);\n }\n };\n }, [deckRef, hasRenderingError, stableLayers]);\n}\n"]}