@sqlrooms/deck 0.29.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +10 -0
- package/README.md +654 -0
- package/dist/BlockMapSettings.d.ts +3 -0
- package/dist/BlockMapSettings.d.ts.map +1 -0
- package/dist/BlockMapSettings.js +57 -0
- package/dist/BlockMapSettings.js.map +1 -0
- package/dist/DashboardMapSettings.d.ts +7 -0
- package/dist/DashboardMapSettings.d.ts.map +1 -0
- package/dist/DashboardMapSettings.js +52 -0
- package/dist/DashboardMapSettings.js.map +1 -0
- package/dist/DeckJsonMap.d.ts +4 -0
- package/dist/DeckJsonMap.d.ts.map +1 -0
- package/dist/DeckJsonMap.js +370 -0
- package/dist/DeckJsonMap.js.map +1 -0
- package/dist/DeckJsonMapSpec.d.ts +7617 -0
- package/dist/DeckJsonMapSpec.d.ts.map +1 -0
- package/dist/DeckJsonMapSpec.js +82 -0
- package/dist/DeckJsonMapSpec.js.map +1 -0
- package/dist/DeckMapDefaultStylesProvider.d.ts +28 -0
- package/dist/DeckMapDefaultStylesProvider.d.ts.map +1 -0
- package/dist/DeckMapDefaultStylesProvider.js +23 -0
- package/dist/DeckMapDefaultStylesProvider.js.map +1 -0
- package/dist/DeckMapSurface.d.ts +39 -0
- package/dist/DeckMapSurface.d.ts.map +1 -0
- package/dist/DeckMapSurface.js +137 -0
- package/dist/DeckMapSurface.js.map +1 -0
- package/dist/DeckMapsSlice.d.ts +99 -0
- package/dist/DeckMapsSlice.d.ts.map +1 -0
- package/dist/DeckMapsSlice.js +89 -0
- package/dist/DeckMapsSlice.js.map +1 -0
- package/dist/MapSettings.d.ts +16 -0
- package/dist/MapSettings.d.ts.map +1 -0
- package/dist/MapSettings.js +292 -0
- package/dist/MapSettings.js.map +1 -0
- package/dist/MapSettingsControls.d.ts +40 -0
- package/dist/MapSettingsControls.d.ts.map +1 -0
- package/dist/MapSettingsControls.js +54 -0
- package/dist/MapSettingsControls.js.map +1 -0
- package/dist/ai.d.ts +261 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +392 -0
- package/dist/ai.js.map +1 -0
- package/dist/block.d.ts +21 -0
- package/dist/block.d.ts.map +1 -0
- package/dist/block.js +105 -0
- package/dist/block.js.map +1 -0
- package/dist/blockDocumentRegistration.d.ts +45 -0
- package/dist/blockDocumentRegistration.d.ts.map +1 -0
- package/dist/blockDocumentRegistration.js +68 -0
- package/dist/blockDocumentRegistration.js.map +1 -0
- package/dist/createDeckJsonSpecFromDatasets.d.ts +11 -0
- package/dist/createDeckJsonSpecFromDatasets.d.ts.map +1 -0
- package/dist/createDeckJsonSpecFromDatasets.js +85 -0
- package/dist/createDeckJsonSpecFromDatasets.js.map +1 -0
- package/dist/createOrUpdateDeckMapResource.d.ts +81 -0
- package/dist/createOrUpdateDeckMapResource.d.ts.map +1 -0
- package/dist/createOrUpdateDeckMapResource.js +82 -0
- package/dist/createOrUpdateDeckMapResource.js.map +1 -0
- package/dist/dashboard.d.ts +6 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +337 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/dashboardConfig.d.ts +25 -0
- package/dist/dashboardConfig.d.ts.map +1 -0
- package/dist/dashboardConfig.js +82 -0
- package/dist/dashboardConfig.js.map +1 -0
- package/dist/dashboardIntegration.d.ts +3 -0
- package/dist/dashboardIntegration.d.ts.map +1 -0
- package/dist/dashboardIntegration.js +16 -0
- package/dist/dashboardIntegration.js.map +1 -0
- package/dist/datasetSourceUtils.d.ts +16 -0
- package/dist/datasetSourceUtils.d.ts.map +1 -0
- package/dist/datasetSourceUtils.js +25 -0
- package/dist/datasetSourceUtils.js.map +1 -0
- package/dist/datasets/PreparedDatasetStore.d.ts +120 -0
- package/dist/datasets/PreparedDatasetStore.d.ts.map +1 -0
- package/dist/datasets/PreparedDatasetStore.js +268 -0
- package/dist/datasets/PreparedDatasetStore.js.map +1 -0
- package/dist/datasets/helpers.d.ts +57 -0
- package/dist/datasets/helpers.d.ts.map +1 -0
- package/dist/datasets/helpers.js +155 -0
- package/dist/datasets/helpers.js.map +1 -0
- package/dist/datasets/normalizeDatasets.d.ts +11 -0
- package/dist/datasets/normalizeDatasets.d.ts.map +1 -0
- package/dist/datasets/normalizeDatasets.js +50 -0
- package/dist/datasets/normalizeDatasets.js.map +1 -0
- package/dist/datasets/tableAdapter.d.ts +11 -0
- package/dist/datasets/tableAdapter.d.ts.map +1 -0
- package/dist/datasets/tableAdapter.js +11 -0
- package/dist/datasets/tableAdapter.js.map +1 -0
- package/dist/datasets/tableDatasetSql.d.ts +16 -0
- package/dist/datasets/tableDatasetSql.d.ts.map +1 -0
- package/dist/datasets/tableDatasetSql.js +49 -0
- package/dist/datasets/tableDatasetSql.js.map +1 -0
- package/dist/datasets/types.d.ts +40 -0
- package/dist/datasets/types.d.ts.map +1 -0
- package/dist/datasets/types.js +2 -0
- package/dist/datasets/types.js.map +1 -0
- package/dist/datasets/usePreparedDatasetStates.d.ts +16 -0
- package/dist/datasets/usePreparedDatasetStates.d.ts.map +1 -0
- package/dist/datasets/usePreparedDatasetStates.js +59 -0
- package/dist/datasets/usePreparedDatasetStates.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/json/aggregateWaypoints.d.ts +14 -0
- package/dist/json/aggregateWaypoints.d.ts.map +1 -0
- package/dist/json/aggregateWaypoints.js +190 -0
- package/dist/json/aggregateWaypoints.js.map +1 -0
- package/dist/json/colorScaleFunction.d.ts +27 -0
- package/dist/json/colorScaleFunction.d.ts.map +1 -0
- package/dist/json/colorScaleFunction.js +46 -0
- package/dist/json/colorScaleFunction.js.map +1 -0
- package/dist/json/compileColorScale.d.ts +12 -0
- package/dist/json/compileColorScale.d.ts.map +1 -0
- package/dist/json/compileColorScale.js +125 -0
- package/dist/json/compileColorScale.js.map +1 -0
- package/dist/json/compileGeoArrowAccessor.d.ts +18 -0
- package/dist/json/compileGeoArrowAccessor.d.ts.map +1 -0
- package/dist/json/compileGeoArrowAccessor.js +129 -0
- package/dist/json/compileGeoArrowAccessor.js.map +1 -0
- package/dist/json/createDeckJsonConfiguration.d.ts +9 -0
- package/dist/json/createDeckJsonConfiguration.d.ts.map +1 -0
- package/dist/json/createDeckJsonConfiguration.js +315 -0
- package/dist/json/createDeckJsonConfiguration.js.map +1 -0
- package/dist/json/defaultClasses.d.ts +12 -0
- package/dist/json/defaultClasses.d.ts.map +1 -0
- package/dist/json/defaultClasses.js +35 -0
- package/dist/json/defaultClasses.js.map +1 -0
- package/dist/json/extractColorScaleLegends.d.ts +8 -0
- package/dist/json/extractColorScaleLegends.d.ts.map +1 -0
- package/dist/json/extractColorScaleLegends.js +86 -0
- package/dist/json/extractColorScaleLegends.js.map +1 -0
- package/dist/json/heatmapDefaults.d.ts +8 -0
- package/dist/json/heatmapDefaults.d.ts.map +1 -0
- package/dist/json/heatmapDefaults.js +14 -0
- package/dist/json/heatmapDefaults.js.map +1 -0
- package/dist/json/layerCompatibility.d.ts +21 -0
- package/dist/json/layerCompatibility.d.ts.map +1 -0
- package/dist/json/layerCompatibility.js +168 -0
- package/dist/json/layerCompatibility.js.map +1 -0
- package/dist/json/layerConfig.d.ts +14 -0
- package/dist/json/layerConfig.d.ts.map +1 -0
- package/dist/json/layerConfig.js +54 -0
- package/dist/json/layerConfig.js.map +1 -0
- package/dist/json/layers/DeckColumnLayer.d.ts +10 -0
- package/dist/json/layers/DeckColumnLayer.d.ts.map +1 -0
- package/dist/json/layers/DeckColumnLayer.js +26 -0
- package/dist/json/layers/DeckColumnLayer.js.map +1 -0
- package/dist/json/layers/DeckH3HexagonLayer.d.ts +37 -0
- package/dist/json/layers/DeckH3HexagonLayer.d.ts.map +1 -0
- package/dist/json/layers/DeckH3HexagonLayer.js +118 -0
- package/dist/json/layers/DeckH3HexagonLayer.js.map +1 -0
- package/dist/json/layers/DeckTripsLayer.d.ts +46 -0
- package/dist/json/layers/DeckTripsLayer.d.ts.map +1 -0
- package/dist/json/layers/DeckTripsLayer.js +170 -0
- package/dist/json/layers/DeckTripsLayer.js.map +1 -0
- package/dist/json/layers/createTableToRecordBatchAdapter.d.ts +20 -0
- package/dist/json/layers/createTableToRecordBatchAdapter.d.ts.map +1 -0
- package/dist/json/layers/createTableToRecordBatchAdapter.js +81 -0
- package/dist/json/layers/createTableToRecordBatchAdapter.js.map +1 -0
- package/dist/json/layers/index.d.ts +5 -0
- package/dist/json/layers/index.d.ts.map +1 -0
- package/dist/json/layers/index.js +5 -0
- package/dist/json/layers/index.js.map +1 -0
- package/dist/json/rewriteGeoArrowAccessors.d.ts +7 -0
- package/dist/json/rewriteGeoArrowAccessors.d.ts.map +1 -0
- package/dist/json/rewriteGeoArrowAccessors.js +55 -0
- package/dist/json/rewriteGeoArrowAccessors.js.map +1 -0
- package/dist/mapAiConfig.d.ts +111 -0
- package/dist/mapAiConfig.d.ts.map +1 -0
- package/dist/mapAiConfig.js +69 -0
- package/dist/mapAiConfig.js.map +1 -0
- package/dist/mapConfig.d.ts +73 -0
- package/dist/mapConfig.d.ts.map +1 -0
- package/dist/mapConfig.js +47 -0
- package/dist/mapConfig.js.map +1 -0
- package/dist/mapConfigUtils.d.ts +111 -0
- package/dist/mapConfigUtils.d.ts.map +1 -0
- package/dist/mapConfigUtils.js +502 -0
- package/dist/mapConfigUtils.js.map +1 -0
- package/dist/mapDataPolicy.d.ts +9 -0
- package/dist/mapDataPolicy.d.ts.map +1 -0
- package/dist/mapDataPolicy.js +25 -0
- package/dist/mapDataPolicy.js.map +1 -0
- package/dist/mapFit.d.ts +62 -0
- package/dist/mapFit.d.ts.map +1 -0
- package/dist/mapFit.js +325 -0
- package/dist/mapFit.js.map +1 -0
- package/dist/mapLayerConfigUtils.d.ts +54 -0
- package/dist/mapLayerConfigUtils.d.ts.map +1 -0
- package/dist/mapLayerConfigUtils.js +296 -0
- package/dist/mapLayerConfigUtils.js.map +1 -0
- package/dist/mapResourceAuthoring.d.ts +40 -0
- package/dist/mapResourceAuthoring.d.ts.map +1 -0
- package/dist/mapResourceAuthoring.js +266 -0
- package/dist/mapResourceAuthoring.js.map +1 -0
- package/dist/mosaic.d.ts +9 -0
- package/dist/mosaic.d.ts.map +1 -0
- package/dist/mosaic.js +8 -0
- package/dist/mosaic.js.map +1 -0
- package/dist/prepare/detectGeometryColumn.d.ts +19 -0
- package/dist/prepare/detectGeometryColumn.d.ts.map +1 -0
- package/dist/prepare/detectGeometryColumn.js +126 -0
- package/dist/prepare/detectGeometryColumn.js.map +1 -0
- package/dist/prepare/geoarrow.d.ts +18 -0
- package/dist/prepare/geoarrow.d.ts.map +1 -0
- package/dist/prepare/geoarrow.js +114 -0
- package/dist/prepare/geoarrow.js.map +1 -0
- package/dist/prepare/geometryDecoder.d.ts +8 -0
- package/dist/prepare/geometryDecoder.d.ts.map +1 -0
- package/dist/prepare/geometryDecoder.js +2 -0
- package/dist/prepare/geometryDecoder.js.map +1 -0
- package/dist/prepare/prepareDeckDataset.d.ts +57 -0
- package/dist/prepare/prepareDeckDataset.d.ts.map +1 -0
- package/dist/prepare/prepareDeckDataset.js +112 -0
- package/dist/prepare/prepareDeckDataset.js.map +1 -0
- package/dist/prepare/toGeoJsonBinary.d.ts +9 -0
- package/dist/prepare/toGeoJsonBinary.d.ts.map +1 -0
- package/dist/prepare/toGeoJsonBinary.js +26 -0
- package/dist/prepare/toGeoJsonBinary.js.map +1 -0
- package/dist/prepare/types.d.ts +25 -0
- package/dist/prepare/types.d.ts.map +1 -0
- package/dist/prepare/types.js +2 -0
- package/dist/prepare/types.js.map +1 -0
- package/dist/prepare/wkbDecoder.d.ts +3 -0
- package/dist/prepare/wkbDecoder.d.ts.map +1 -0
- package/dist/prepare/wkbDecoder.js +419 -0
- package/dist/prepare/wkbDecoder.js.map +1 -0
- package/dist/prepare/wkbParser.d.ts +24 -0
- package/dist/prepare/wkbParser.d.ts.map +1 -0
- package/dist/prepare/wkbParser.js +139 -0
- package/dist/prepare/wkbParser.js.map +1 -0
- package/dist/types.d.ts +92 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/useDeckMapDatasetSchema.d.ts +33 -0
- package/dist/useDeckMapDatasetSchema.d.ts.map +1 -0
- package/dist/useDeckMapDatasetSchema.js +138 -0
- package/dist/useDeckMapDatasetSchema.js.map +1 -0
- package/dist/useDeckMapDatasets.d.ts +17 -0
- package/dist/useDeckMapDatasets.d.ts.map +1 -0
- package/dist/useDeckMapDatasets.js +69 -0
- package/dist/useDeckMapDatasets.js.map +1 -0
- package/dist/useDeckMapFitToBounds.d.ts +31 -0
- package/dist/useDeckMapFitToBounds.d.ts.map +1 -0
- package/dist/useDeckMapFitToBounds.js +58 -0
- package/dist/useDeckMapFitToBounds.js.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
const LAYER_COMPATIBILITY = {
|
|
2
|
+
GeoJsonLayer: {
|
|
3
|
+
representation: 'geojson',
|
|
4
|
+
vectorAccessorProps: [],
|
|
5
|
+
},
|
|
6
|
+
GeoArrowScatterplotLayer: {
|
|
7
|
+
representation: 'geoarrow',
|
|
8
|
+
bindings: [
|
|
9
|
+
{
|
|
10
|
+
prop: 'getPosition',
|
|
11
|
+
kind: 'geometry',
|
|
12
|
+
configKey: 'geometryColumn',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
vectorAccessorProps: [
|
|
16
|
+
'getPosition',
|
|
17
|
+
'getRadius',
|
|
18
|
+
'getFillColor',
|
|
19
|
+
'getLineColor',
|
|
20
|
+
'getLineWidth',
|
|
21
|
+
],
|
|
22
|
+
allowGeoArrowPromotion: true,
|
|
23
|
+
},
|
|
24
|
+
GeoArrowHeatmapLayer: {
|
|
25
|
+
representation: 'geoarrow',
|
|
26
|
+
bindings: [
|
|
27
|
+
{
|
|
28
|
+
prop: 'getPosition',
|
|
29
|
+
kind: 'geometry',
|
|
30
|
+
configKey: 'geometryColumn',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
vectorAccessorProps: ['getPosition', 'getWeight'],
|
|
34
|
+
allowGeoArrowPromotion: true,
|
|
35
|
+
},
|
|
36
|
+
GeoArrowColumnLayer: {
|
|
37
|
+
representation: 'geoarrow',
|
|
38
|
+
bindings: [
|
|
39
|
+
{
|
|
40
|
+
prop: 'getPosition',
|
|
41
|
+
kind: 'geometry',
|
|
42
|
+
configKey: 'geometryColumn',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
vectorAccessorProps: [
|
|
46
|
+
'getPosition',
|
|
47
|
+
'getFillColor',
|
|
48
|
+
'getLineColor',
|
|
49
|
+
'getLineWidth',
|
|
50
|
+
'getElevation',
|
|
51
|
+
],
|
|
52
|
+
allowGeoArrowPromotion: true,
|
|
53
|
+
},
|
|
54
|
+
GeoArrowPathLayer: {
|
|
55
|
+
representation: 'geoarrow',
|
|
56
|
+
bindings: [
|
|
57
|
+
{
|
|
58
|
+
prop: 'getPath',
|
|
59
|
+
kind: 'geometry',
|
|
60
|
+
configKey: 'geometryColumn',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
vectorAccessorProps: ['getPath', 'getColor', 'getWidth'],
|
|
64
|
+
allowGeoArrowPromotion: true,
|
|
65
|
+
},
|
|
66
|
+
GeoArrowTripsLayer: {
|
|
67
|
+
representation: 'geoarrow',
|
|
68
|
+
bindings: [
|
|
69
|
+
{
|
|
70
|
+
prop: 'getPath',
|
|
71
|
+
kind: 'geometry',
|
|
72
|
+
configKey: 'geometryColumn',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
prop: 'getTimestamps',
|
|
76
|
+
kind: 'column',
|
|
77
|
+
configKey: 'timestampColumn',
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
vectorAccessorProps: ['getPath', 'getTimestamps', 'getColor', 'getWidth'],
|
|
82
|
+
allowGeoArrowPromotion: true,
|
|
83
|
+
},
|
|
84
|
+
GeoArrowPolygonLayer: {
|
|
85
|
+
representation: 'geoarrow',
|
|
86
|
+
bindings: [
|
|
87
|
+
{
|
|
88
|
+
prop: 'getPolygon',
|
|
89
|
+
kind: 'geometry',
|
|
90
|
+
configKey: 'geometryColumn',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
vectorAccessorProps: [
|
|
94
|
+
'getPolygon',
|
|
95
|
+
'getFillColor',
|
|
96
|
+
'getLineColor',
|
|
97
|
+
'getLineWidth',
|
|
98
|
+
'getElevation',
|
|
99
|
+
],
|
|
100
|
+
allowGeoArrowPromotion: true,
|
|
101
|
+
},
|
|
102
|
+
GeoArrowSolidPolygonLayer: {
|
|
103
|
+
representation: 'geoarrow',
|
|
104
|
+
bindings: [
|
|
105
|
+
{
|
|
106
|
+
prop: 'getPolygon',
|
|
107
|
+
kind: 'geometry',
|
|
108
|
+
configKey: 'geometryColumn',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
vectorAccessorProps: [
|
|
112
|
+
'getPolygon',
|
|
113
|
+
'getElevation',
|
|
114
|
+
'getFillColor',
|
|
115
|
+
'getLineColor',
|
|
116
|
+
],
|
|
117
|
+
allowGeoArrowPromotion: true,
|
|
118
|
+
},
|
|
119
|
+
GeoArrowArcLayer: {
|
|
120
|
+
representation: 'geoarrow',
|
|
121
|
+
bindings: [
|
|
122
|
+
{
|
|
123
|
+
prop: 'getSourcePosition',
|
|
124
|
+
kind: 'geometry',
|
|
125
|
+
configKey: 'sourceGeometryColumn',
|
|
126
|
+
required: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
prop: 'getTargetPosition',
|
|
130
|
+
kind: 'geometry',
|
|
131
|
+
configKey: 'targetGeometryColumn',
|
|
132
|
+
required: true,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
vectorAccessorProps: [
|
|
136
|
+
'getSourcePosition',
|
|
137
|
+
'getTargetPosition',
|
|
138
|
+
'getSourceColor',
|
|
139
|
+
'getTargetColor',
|
|
140
|
+
'getWidth',
|
|
141
|
+
'getHeight',
|
|
142
|
+
'getTilt',
|
|
143
|
+
],
|
|
144
|
+
allowGeoArrowPromotion: true,
|
|
145
|
+
},
|
|
146
|
+
GeoArrowH3HexagonLayer: {
|
|
147
|
+
representation: 'geoarrow',
|
|
148
|
+
bindings: [
|
|
149
|
+
{
|
|
150
|
+
prop: 'getHexagon',
|
|
151
|
+
kind: 'column',
|
|
152
|
+
configKey: 'hexagonColumn',
|
|
153
|
+
required: true,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
vectorAccessorProps: [
|
|
157
|
+
'getHexagon',
|
|
158
|
+
'getFillColor',
|
|
159
|
+
'getElevation',
|
|
160
|
+
'getLineColor',
|
|
161
|
+
'getLineWidth',
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
export function getLayerCompatibility(layerName) {
|
|
166
|
+
return LAYER_COMPATIBILITY[layerName];
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=layerCompatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerCompatibility.js","sourceRoot":"","sources":["../../src/json/layerCompatibility.ts"],"names":[],"mappings":"AAuBA,MAAM,mBAAmB,GAAuC;IAC9D,YAAY,EAAE;QACZ,cAAc,EAAE,SAAS;QACzB,mBAAmB,EAAE,EAAE;KACxB;IACD,wBAAwB,EAAE;QACxB,cAAc,EAAE,UAAU;QAC1B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE,gBAAgB;aAC5B;SACF;QACD,mBAAmB,EAAE;YACnB,aAAa;YACb,WAAW;YACX,cAAc;YACd,cAAc;YACd,cAAc;SACf;QACD,sBAAsB,EAAE,IAAI;KAC7B;IACD,oBAAoB,EAAE;QACpB,cAAc,EAAE,UAAU;QAC1B,QAAQ,EA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fig';\n\ntype GeoJsonCompatibility = {\n representation: 'geojson';\n vectorAccessorProps: string[];\n};\n\ntype GeoArrowBinding = {\n prop: string;\n kind: 'geometry' | 'column';\n configKey: LayerConfigColumnKey;\n required?: boolean;\n};\n\ntype GeoArrowCompatibility = {\n representation: 'geoarrow';\n bindings: GeoArrowBinding[];\n vectorAccessorProps: string[];\n allowGeoArrowPromotion?: boolean;\n};\n\ntype LayerCompatibility = GeoJsonCompatibility | GeoArrowCompatibility;\n\nconst LAYER_COMPATIBILITY: Record<string, LayerCompatibility> = {\n GeoJsonLayer: {\n representation: 'geojson',\n vectorAccessorProps: [],\n },\n GeoArrowScatterplotLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPosition',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n ],\n vectorAccessorProps: [\n 'getPosition',\n 'getRadius',\n 'getFillColor',\n 'getLineColor',\n 'getLineWidth',\n ],\n allowGeoArrowPromotion: true,\n },\n GeoArrowHeatmapLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPosition',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n ],\n vectorAccessorProps: ['getPosition', 'getWeight'],\n allowGeoArrowPromotion: true,\n },\n GeoArrowColumnLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPosition',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n ],\n vectorAccessorProps: [\n 'getPosition',\n 'getFillColor',\n 'getLineColor',\n 'getLineWidth',\n 'getElevation',\n ],\n allowGeoArrowPromotion: true,\n },\n GeoArrowPathLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPath',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n ],\n vectorAccessorProps: ['getPath', 'getColor', 'getWidth'],\n allowGeoArrowPromotion: true,\n },\n GeoArrowTripsLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPath',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n {\n prop: 'getTimestamps',\n kind: 'column',\n configKey: 'timestampColumn',\n required: true,\n },\n ],\n vectorAccessorProps: ['getPath', 'getTimestamps', 'getColor', 'getWidth'],\n allowGeoArrowPromotion: true,\n },\n GeoArrowPolygonLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPolygon',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n ],\n vectorAccessorProps: [\n 'getPolygon',\n 'getFillColor',\n 'getLineColor',\n 'getLineWidth',\n 'getElevation',\n ],\n allowGeoArrowPromotion: true,\n },\n GeoArrowSolidPolygonLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getPolygon',\n kind: 'geometry',\n configKey: 'geometryColumn',\n },\n ],\n vectorAccessorProps: [\n 'getPolygon',\n 'getElevation',\n 'getFillColor',\n 'getLineColor',\n ],\n allowGeoArrowPromotion: true,\n },\n GeoArrowArcLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getSourcePosition',\n kind: 'geometry',\n configKey: 'sourceGeometryColumn',\n required: true,\n },\n {\n prop: 'getTargetPosition',\n kind: 'geometry',\n configKey: 'targetGeometryColumn',\n required: true,\n },\n ],\n vectorAccessorProps: [\n 'getSourcePosition',\n 'getTargetPosition',\n 'getSourceColor',\n 'getTargetColor',\n 'getWidth',\n 'getHeight',\n 'getTilt',\n ],\n allowGeoArrowPromotion: true,\n },\n GeoArrowH3HexagonLayer: {\n representation: 'geoarrow',\n bindings: [\n {\n prop: 'getHexagon',\n kind: 'column',\n configKey: 'hexagonColumn',\n required: true,\n },\n ],\n vectorAccessorProps: [\n 'getHexagon',\n 'getFillColor',\n 'getElevation',\n 'getLineColor',\n 'getLineWidth',\n ],\n },\n};\n\nexport function getLayerCompatibility(layerName: string) {\n return LAYER_COMPATIBILITY[layerName];\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColorLegendConfig, ColorScaleConfig } from '@sqlrooms/color-scales';
|
|
2
|
+
import type { ColorScaleFunction, LayerBindingConfig } from '../DeckJsonMapSpec';
|
|
3
|
+
export type LayerConfigColumnKey = keyof Pick<LayerBindingConfig, 'geometryColumn' | 'sourceGeometryColumn' | 'targetGeometryColumn' | 'timestampColumn' | 'hexagonColumn'>;
|
|
4
|
+
export declare function resolveDatasetId(props: Record<string, unknown>, datasetIds: string[]): string | undefined;
|
|
5
|
+
export declare function isManagedLayer(props: Record<string, unknown>, datasetIds: string[]): boolean;
|
|
6
|
+
export declare function stripLayerExtensionProps(props: Record<string, unknown>): {
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveGeometryColumn(props: Record<string, unknown>): string | undefined;
|
|
10
|
+
export declare function resolveConfiguredColumn(props: Record<string, unknown>, key: LayerConfigColumnKey): string | undefined;
|
|
11
|
+
export declare function isColorScaleFunction(value: unknown): value is ColorScaleFunction;
|
|
12
|
+
export declare function resolveColorScale(props: Record<string, unknown>, key?: string): ColorScaleConfig | undefined;
|
|
13
|
+
export declare function resolveColorLegend(props: Record<string, unknown>, key?: string): ColorLegendConfig | undefined;
|
|
14
|
+
//# sourceMappingURL=layerConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerConfig.d.ts","sourceRoot":"","sources":["../../src/json/layerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AAoB5B,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAC3C,kBAAkB,EAChB,gBAAgB,GAChB,sBAAsB,GACtB,sBAAsB,GACtB,iBAAiB,GACjB,eAAe,CAClB,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,UAAU,EAAE,MAAM,EAAE,sBAarB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,UAAU,EAAE,MAAM,EAAE,WAGrB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;EAItE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,sBAKnE;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,EAAE,oBAAoB,sBAK1B;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kBAAkB,CAM7B;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,gBAAgB,GAAG,SAAS,CAG9B;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,iBAAiB,GAAG,SAAS,CAE/B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function hasExtensionKeys(props) {
|
|
2
|
+
return (typeof props._sqlroomsBinding === 'object' && props._sqlroomsBinding != null);
|
|
3
|
+
}
|
|
4
|
+
function getLayerConfig(props) {
|
|
5
|
+
const layerProps = props;
|
|
6
|
+
if (!layerProps._sqlroomsBinding ||
|
|
7
|
+
typeof layerProps._sqlroomsBinding !== 'object') {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return layerProps._sqlroomsBinding;
|
|
11
|
+
}
|
|
12
|
+
export function resolveDatasetId(props, datasetIds) {
|
|
13
|
+
const layerProps = props;
|
|
14
|
+
const config = getLayerConfig(props);
|
|
15
|
+
if (typeof config?.dataset === 'string' && config.dataset) {
|
|
16
|
+
return config.dataset;
|
|
17
|
+
}
|
|
18
|
+
if (datasetIds.length === 1 && layerProps.data === undefined) {
|
|
19
|
+
return datasetIds[0];
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
export function isManagedLayer(props, datasetIds) {
|
|
24
|
+
return hasExtensionKeys(props) || resolveDatasetId(props, datasetIds) != null;
|
|
25
|
+
}
|
|
26
|
+
export function stripLayerExtensionProps(props) {
|
|
27
|
+
const nextProps = { ...props };
|
|
28
|
+
delete nextProps._sqlroomsBinding;
|
|
29
|
+
return nextProps;
|
|
30
|
+
}
|
|
31
|
+
export function resolveGeometryColumn(props) {
|
|
32
|
+
const config = getLayerConfig(props);
|
|
33
|
+
return typeof config?.geometryColumn === 'string' && config.geometryColumn
|
|
34
|
+
? config.geometryColumn
|
|
35
|
+
: undefined;
|
|
36
|
+
}
|
|
37
|
+
export function resolveConfiguredColumn(props, key) {
|
|
38
|
+
const config = getLayerConfig(props);
|
|
39
|
+
const value = config?.[key];
|
|
40
|
+
return typeof value === 'string' && value ? value : undefined;
|
|
41
|
+
}
|
|
42
|
+
export function isColorScaleFunction(value) {
|
|
43
|
+
return Boolean(value &&
|
|
44
|
+
typeof value === 'object' &&
|
|
45
|
+
value['@@function'] === 'colorScale');
|
|
46
|
+
}
|
|
47
|
+
export function resolveColorScale(props, key) {
|
|
48
|
+
const value = key ? props[key] : undefined;
|
|
49
|
+
return isColorScaleFunction(value) ? value : undefined;
|
|
50
|
+
}
|
|
51
|
+
export function resolveColorLegend(props, key) {
|
|
52
|
+
return resolveColorScale(props, key)?.legend;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=layerConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerConfig.js","sourceRoot":"","sources":["../../src/json/layerConfig.ts"],"names":[],"mappings":"AAOA,SAAS,gBAAgB,CAAC,KAA8B;IACtD,OAAO,CACL,OAAO,KAAK,CAAC,gBAAgB,KAAK,QAAQ,IAA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c,KAAK,QAAQ,IAAI,MAAM,CAAC,cAAc;QACxE,CAAC,CAAC,MAAM,CAAC,cAAc;QACvB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAA8B,EAC9B,GAAyB;IAEzB,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,KAAc;IAEd,OAAO,OAAO,CACZ,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACxB,KAAkC,CAAC,YAAY,CAAC,KAAK,YAAY,CACnE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAA8B,EAC9B,GAAY;IAEZ,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3C,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,KAA8B,EAC9B,GAAY;IAEZ,OAAO,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC;AAC/C,CAAC","sourcesContent":["import type {ColorLegendConfig, ColorScaleConfig} from '@sqlrooms/color-scales';\nimport type {\n ColorScaleFunction,\n LayerBindingConfig,\n LayerBindingProps,\n} from '../DeckJsonMapSpec';\n\nfunction hasExtensionKeys(props: Record<string, unknown>) {\n return (\n typeof props._sqlroomsBinding === 'object' && props._sqlroomsBinding != null\n );\n}\n\nfunction getLayerConfig(props: Record<string, unknown>) {\n const layerProps = props as LayerBindingProps & {data?: unknown};\n if (\n !layerProps._sqlroomsBinding ||\n typeof layerProps._sqlroomsBinding !== 'object'\n ) {\n return undefined;\n }\n\n return layerProps._sqlroomsBinding;\n}\n\nexport type LayerConfigColumnKey = keyof Pick<\n LayerBindingConfig,\n | 'geometryColumn'\n | 'sourceGeometryColumn'\n | 'targetGeometryColumn'\n | 'timestampColumn'\n | 'hexagonColumn'\n>;\n\nexport function resolveDatasetId(\n props: Record<string, unknown>,\n datasetIds: string[],\n) {\n const layerProps = props as LayerBindingProps & {data?: unknown};\n const config = getLayerConfig(props);\n if (typeof config?.dataset === 'string' && config.dataset) {\n return config.dataset;\n }\n\n if (datasetIds.length === 1 && layerProps.data === undefined) {\n return datasetIds[0];\n }\n\n return undefined;\n}\n\nexport function isManagedLayer(\n props: Record<string, unknown>,\n datasetIds: string[],\n) {\n return hasExtensionKeys(props) || resolveDatasetId(props, datasetIds) != null;\n}\n\nexport function stripLayerExtensionProps(props: Record<string, unknown>) {\n const nextProps = {...props};\n delete nextProps._sqlroomsBinding;\n return nextProps;\n}\n\nexport function resolveGeometryColumn(props: Record<string, unknown>) {\n const config = getLayerConfig(props);\n return typeof config?.geometryColumn === 'string' && config.geometryColumn\n ? config.geometryColumn\n : undefined;\n}\n\nexport function resolveConfiguredColumn(\n props: Record<string, unknown>,\n key: LayerConfigColumnKey,\n) {\n const config = getLayerConfig(props);\n const value = config?.[key];\n return typeof value === 'string' && value ? value : undefined;\n}\n\nexport function isColorScaleFunction(\n value: unknown,\n): value is ColorScaleFunction {\n return Boolean(\n value &&\n typeof value === 'object' &&\n (value as {'@@function'?: unknown})['@@function'] === 'colorScale',\n );\n}\n\nexport function resolveColorScale(\n props: Record<string, unknown>,\n key?: string,\n): ColorScaleConfig | undefined {\n const value = key ? props[key] : undefined;\n return isColorScaleFunction(value) ? value : undefined;\n}\n\nexport function resolveColorLegend(\n props: Record<string, unknown>,\n key?: string,\n): ColorLegendConfig | undefined {\n return resolveColorScale(props, key)?.legend;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GeoArrowColumnLayer adapter that accepts Table + Vector data (the format
|
|
3
|
+
* used by our JSON pipeline) and bridges to the 0.4.x RecordBatch API.
|
|
4
|
+
* Also includes a fix for the deck.gl ColumnLayer wireframe index buffer
|
|
5
|
+
* bug (#10021).
|
|
6
|
+
*
|
|
7
|
+
* Remove the prototype patch once deck.gl includes the upstream fix (PR #10094).
|
|
8
|
+
*/
|
|
9
|
+
export declare const DeckColumnLayer: new (props: Record<string, unknown>) => import("@deck.gl/core").Layer;
|
|
10
|
+
//# sourceMappingURL=DeckColumnLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeckColumnLayer.d.ts","sourceRoot":"","sources":["../../../src/json/layers/DeckColumnLayer.ts"],"names":[],"mappings":"AA2BA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,uEAG3B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ColumnLayer } from '@deck.gl/layers';
|
|
2
|
+
import { GeoArrowColumnLayer } from '@geoarrow/deck.gl-geoarrow';
|
|
3
|
+
import { createTableToRecordBatchAdapter } from './createTableToRecordBatchAdapter';
|
|
4
|
+
// Workaround for deck.gl bug #10021: the ColumnLayer's wireframe index buffer
|
|
5
|
+
// leaks onto the fill model when using binary data (as GeoArrow does), causing
|
|
6
|
+
// the fill model to render with line-list indices instead of triangle-strip.
|
|
7
|
+
// This produces half-rendered columns with missing caps.
|
|
8
|
+
// See: https://github.com/visgl/deck.gl/pull/10094
|
|
9
|
+
const originalColumnDraw = ColumnLayer.prototype.draw;
|
|
10
|
+
ColumnLayer.prototype.draw = function (opts) {
|
|
11
|
+
const fillModel = this.state.fillModel;
|
|
12
|
+
if (fillModel?.vertexArray?.indexBuffer) {
|
|
13
|
+
fillModel.setIndexBuffer(null);
|
|
14
|
+
}
|
|
15
|
+
return originalColumnDraw.call(this, opts);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* GeoArrowColumnLayer adapter that accepts Table + Vector data (the format
|
|
19
|
+
* used by our JSON pipeline) and bridges to the 0.4.x RecordBatch API.
|
|
20
|
+
* Also includes a fix for the deck.gl ColumnLayer wireframe index buffer
|
|
21
|
+
* bug (#10021).
|
|
22
|
+
*
|
|
23
|
+
* Remove the prototype patch once deck.gl includes the upstream fix (PR #10094).
|
|
24
|
+
*/
|
|
25
|
+
export const DeckColumnLayer = createTableToRecordBatchAdapter(GeoArrowColumnLayer, 'GeoArrowColumnLayer');
|
|
26
|
+
//# sourceMappingURL=DeckColumnLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeckColumnLayer.js","sourceRoot":"","sources":["../../../src/json/layers/DeckColumnLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAC,+BAA+B,EAAC,MAAM,mCAAmC,CAAC;AAElF,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,yDAAyD;AACzD,mDAAmD;AACnD,MAAM,kBAAkB,GAAG,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC;AACtD,WAAW,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,IAAyB;IAC9D,MAAM,SAAS,GACb,IAQD,CAAC,KAAK,CAAC,SAAS,CAAC;IAClB,IAAI,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;QACxC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,+BAA+B,CAC5D,mBAA0B,EAC1B,qBAAqB,CACtB,CAAC","sourcesContent":["import {ColumnLayer} from '@deck.gl/layers';\nimport {GeoArrowColumnLayer} from '@geoarrow/deck.gl-geoarrow';\nimport {createTableToRecordBatchAdapter} from './createTableToRecordBatchAdapter';\n\n// Workaround for deck.gl bug #10021: the ColumnLayer's wireframe index buffer\n// leaks onto the fill model when using binary data (as GeoArrow does), causing\n// the fill model to render with line-list indices instead of triangle-strip.\n// This produces half-rendered columns with missing caps.\n// See: https://github.com/visgl/deck.gl/pull/10094\nconst originalColumnDraw = ColumnLayer.prototype.draw;\nColumnLayer.prototype.draw = function (opts: {uniforms: unknown}) {\n const fillModel = (\n this as unknown as {\n state: {\n fillModel: {\n vertexArray: {indexBuffer: unknown};\n setIndexBuffer: (b: null) => void;\n };\n };\n }\n ).state.fillModel;\n if (fillModel?.vertexArray?.indexBuffer) {\n fillModel.setIndexBuffer(null);\n }\n return originalColumnDraw.call(this, opts);\n};\n\n/**\n * GeoArrowColumnLayer adapter that accepts Table + Vector data (the format\n * used by our JSON pipeline) and bridges to the 0.4.x RecordBatch API.\n * Also includes a fix for the deck.gl ColumnLayer wireframe index buffer\n * bug (#10021).\n *\n * Remove the prototype patch once deck.gl includes the upstream fix (PR #10094).\n */\nexport const DeckColumnLayer = createTableToRecordBatchAdapter(\n GeoArrowColumnLayer as any,\n 'GeoArrowColumnLayer',\n);\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CompositeLayer, type Layer, type LayersList } from '@deck.gl/core';
|
|
2
|
+
import * as arrow from 'apache-arrow';
|
|
3
|
+
/**
|
|
4
|
+
* Custom GeoArrow-compatible H3HexagonLayer wrapper.
|
|
5
|
+
*
|
|
6
|
+
* The upstream GeoArrowH3HexagonLayer (from @geoarrow/deck.gl-geoarrow@0.4.x)
|
|
7
|
+
* expects `getHexagon: Data<Utf8 | Uint64>`, but our pipeline may produce
|
|
8
|
+
* BigInt H3 indices that need hex-string conversion. Additionally, H3HexagonLayer
|
|
9
|
+
* internally iterates rows using createIterable and calls getHexagon(object)
|
|
10
|
+
* expecting string H3 indices, which is incompatible with binary attribute passing.
|
|
11
|
+
*
|
|
12
|
+
* This wrapper converts Arrow data to row objects with proper BigInt→hex string
|
|
13
|
+
* conversion, then passes them to the native H3HexagonLayer.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DeckH3HexagonLayer extends CompositeLayer<{
|
|
16
|
+
data: arrow.Table;
|
|
17
|
+
getHexagon: arrow.Vector;
|
|
18
|
+
getFillColor?: arrow.Vector | [number, number, number, number] | ((...args: any[]) => any);
|
|
19
|
+
getElevation?: arrow.Vector | number | ((...args: any[]) => any);
|
|
20
|
+
getLineColor?: arrow.Vector | [number, number, number, number] | ((...args: any[]) => any);
|
|
21
|
+
getLineWidth?: arrow.Vector | number | ((...args: any[]) => any);
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}> {
|
|
24
|
+
static layerName: string;
|
|
25
|
+
static defaultProps: {
|
|
26
|
+
highPrecision: string;
|
|
27
|
+
coverage: {
|
|
28
|
+
type: string;
|
|
29
|
+
min: number;
|
|
30
|
+
max: number;
|
|
31
|
+
value: number;
|
|
32
|
+
};
|
|
33
|
+
extruded: boolean;
|
|
34
|
+
};
|
|
35
|
+
renderLayers(): Layer | LayersList | null;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=DeckH3HexagonLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeckH3HexagonLayer.d.ts","sourceRoot":"","sources":["../../../src/json/layers/DeckH3HexagonLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC;AAE1E,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC;IACrD,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;IACzB,YAAY,CAAC,EACT,KAAK,CAAC,MAAM,GACZ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IACjE,YAAY,CAAC,EACT,KAAK,CAAC,MAAM,GACZ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IACjE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;IACA,MAAM,CAAC,SAAS,SAA4B;IAC5C,MAAM,CAAC,YAAY;;;;;;;;;MAIjB;IAEF,YAAY,IAAI,KAAK,GAAG,UAAU,GAAG,IAAI;CA4G1C"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { CompositeLayer } from '@deck.gl/core';
|
|
2
|
+
import { H3HexagonLayer } from '@deck.gl/geo-layers';
|
|
3
|
+
import * as arrow from 'apache-arrow';
|
|
4
|
+
/**
|
|
5
|
+
* Custom GeoArrow-compatible H3HexagonLayer wrapper.
|
|
6
|
+
*
|
|
7
|
+
* The upstream GeoArrowH3HexagonLayer (from @geoarrow/deck.gl-geoarrow@0.4.x)
|
|
8
|
+
* expects `getHexagon: Data<Utf8 | Uint64>`, but our pipeline may produce
|
|
9
|
+
* BigInt H3 indices that need hex-string conversion. Additionally, H3HexagonLayer
|
|
10
|
+
* internally iterates rows using createIterable and calls getHexagon(object)
|
|
11
|
+
* expecting string H3 indices, which is incompatible with binary attribute passing.
|
|
12
|
+
*
|
|
13
|
+
* This wrapper converts Arrow data to row objects with proper BigInt→hex string
|
|
14
|
+
* conversion, then passes them to the native H3HexagonLayer.
|
|
15
|
+
*/
|
|
16
|
+
export class DeckH3HexagonLayer extends CompositeLayer {
|
|
17
|
+
static layerName = 'GeoArrowH3HexagonLayer';
|
|
18
|
+
static defaultProps = {
|
|
19
|
+
highPrecision: 'auto',
|
|
20
|
+
coverage: { type: 'number', min: 0, max: 1, value: 1 },
|
|
21
|
+
extruded: true,
|
|
22
|
+
};
|
|
23
|
+
renderLayers() {
|
|
24
|
+
const { data: table, getHexagon: hexProp, ...otherProps } = this.props;
|
|
25
|
+
if (!table || !hexProp)
|
|
26
|
+
return null;
|
|
27
|
+
const numRows = table.numRows;
|
|
28
|
+
const isVector = hexProp instanceof arrow.Vector;
|
|
29
|
+
const isBigIntColumn = isVector &&
|
|
30
|
+
(hexProp.type instanceof arrow.Int64 ||
|
|
31
|
+
hexProp.type instanceof arrow.Uint64);
|
|
32
|
+
// Build a lookup from global row index to {batch, localIndex} for
|
|
33
|
+
// multi-batch tables so compiled accessors receive the correct batch.
|
|
34
|
+
const batches = table.batches;
|
|
35
|
+
const batchOffsets = new Int32Array(batches.length);
|
|
36
|
+
for (let i = 1; i < batches.length; i++) {
|
|
37
|
+
batchOffsets[i] = batchOffsets[i - 1] + batches[i - 1].numRows;
|
|
38
|
+
}
|
|
39
|
+
const resolveBatchContext = (globalIndex) => {
|
|
40
|
+
let batchIdx = batches.length - 1;
|
|
41
|
+
for (let i = 1; i < batches.length; i++) {
|
|
42
|
+
if (globalIndex < batchOffsets[i]) {
|
|
43
|
+
batchIdx = i - 1;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
batch: batches[batchIdx],
|
|
49
|
+
localIndex: globalIndex - batchOffsets[batchIdx],
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
// Resolve hex value per row
|
|
53
|
+
const getHexValue = (i) => {
|
|
54
|
+
if (isVector) {
|
|
55
|
+
const raw = hexProp.get(i);
|
|
56
|
+
if (isBigIntColumn && typeof raw === 'bigint') {
|
|
57
|
+
return raw.toString(16);
|
|
58
|
+
}
|
|
59
|
+
return String(raw ?? '');
|
|
60
|
+
}
|
|
61
|
+
// Compiled accessor function
|
|
62
|
+
if (typeof hexProp === 'function') {
|
|
63
|
+
const { batch, localIndex } = resolveBatchContext(i);
|
|
64
|
+
const result = hexProp({
|
|
65
|
+
index: localIndex,
|
|
66
|
+
data: { data: batch },
|
|
67
|
+
target: [],
|
|
68
|
+
});
|
|
69
|
+
if (typeof result === 'bigint')
|
|
70
|
+
return result.toString(16);
|
|
71
|
+
return String(result ?? '');
|
|
72
|
+
}
|
|
73
|
+
return '';
|
|
74
|
+
};
|
|
75
|
+
// Build row objects from Arrow table
|
|
76
|
+
const rows = Array.from({ length: numRows }, (_, i) => {
|
|
77
|
+
const row = {};
|
|
78
|
+
for (const field of table.schema.fields) {
|
|
79
|
+
row[field.name] = table.getChild(field.name)?.get(i);
|
|
80
|
+
}
|
|
81
|
+
row.__h3Index = getHexValue(i);
|
|
82
|
+
return row;
|
|
83
|
+
});
|
|
84
|
+
// Resolve accessor props: Arrow Vectors → row functions, keep scalars
|
|
85
|
+
const layerProps = {};
|
|
86
|
+
for (const [propName, propValue] of Object.entries(otherProps)) {
|
|
87
|
+
if (propValue instanceof arrow.Vector) {
|
|
88
|
+
// Arrow Vector → row accessor (H3 layer uses row-based iteration)
|
|
89
|
+
const vec = propValue;
|
|
90
|
+
layerProps[propName] = (d, { index }) => {
|
|
91
|
+
return vec.get(index);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else if (typeof propValue === 'function') {
|
|
95
|
+
// Compiled GeoArrow accessor → wrap with batch context
|
|
96
|
+
const fn = propValue;
|
|
97
|
+
layerProps[propName] = (_object, objectInfo) => {
|
|
98
|
+
const { batch, localIndex } = resolveBatchContext(objectInfo.index);
|
|
99
|
+
return fn({
|
|
100
|
+
index: localIndex,
|
|
101
|
+
data: { data: batch },
|
|
102
|
+
target: objectInfo.target,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
layerProps[propName] = propValue;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return new H3HexagonLayer({
|
|
111
|
+
...layerProps,
|
|
112
|
+
id: `${this.props.id}-geoarrow-h3`,
|
|
113
|
+
data: rows,
|
|
114
|
+
getHexagon: (d) => d.__h3Index,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=DeckH3HexagonLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeckH3HexagonLayer.js","sourceRoot":"","sources":["../../../src/json/layers/DeckH3HexagonLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAA8B,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cActC;IACA,MAAM,CAAC,SAAS,GAAG,wBAAwB,CAAC;IAC5C,MAAM,CAAC,YAAY,GAAG;QACpB,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;QACpD,QAAQ,EAAE,IAAI;KACf,CAAC;IAEF,YAAY;QACV,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,UAAU,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAErE,IAAI,CAAC,KAAK,IAAI,CAAC,O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EAAE,EAAE,CAAC,CAAC,CAAC,SAAmB;SAC3D,CAAC,CAAC;IACZ,CAAC","sourcesContent":["import {CompositeLayer, type Layer, type LayersList} from '@deck.gl/core';\nimport {H3HexagonLayer} from '@deck.gl/geo-layers';\nimport * as arrow from 'apache-arrow';\n\n/**\n * Custom GeoArrow-compatible H3HexagonLayer wrapper.\n *\n * The upstream GeoArrowH3HexagonLayer (from @geoarrow/deck.gl-geoarrow@0.4.x)\n * expects `getHexagon: Data<Utf8 | Uint64>`, but our pipeline may produce\n * BigInt H3 indices that need hex-string conversion. Additionally, H3HexagonLayer\n * internally iterates rows using createIterable and calls getHexagon(object)\n * expecting string H3 indices, which is incompatible with binary attribute passing.\n *\n * This wrapper converts Arrow data to row objects with proper BigInt→hex string\n * conversion, then passes them to the native H3HexagonLayer.\n */\nexport class DeckH3HexagonLayer extends CompositeLayer<{\n data: arrow.Table;\n getHexagon: arrow.Vector;\n getFillColor?:\n | arrow.Vector\n | [number, number, number, number]\n | ((...args: any[]) => any);\n getElevation?: arrow.Vector | number | ((...args: any[]) => any);\n getLineColor?:\n | arrow.Vector\n | [number, number, number, number]\n | ((...args: any[]) => any);\n getLineWidth?: arrow.Vector | number | ((...args: any[]) => any);\n [key: string]: unknown;\n}> {\n static layerName = 'GeoArrowH3HexagonLayer';\n static defaultProps = {\n highPrecision: 'auto',\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n extruded: true,\n };\n\n renderLayers(): Layer | LayersList | null {\n const {data: table, getHexagon: hexProp, ...otherProps} = this.props;\n\n if (!table || !hexProp) return null;\n\n const numRows = table.numRows;\n const isVector = hexProp instanceof arrow.Vector;\n const isBigIntColumn =\n isVector &&\n (hexProp.type instanceof arrow.Int64 ||\n hexProp.type instanceof arrow.Uint64);\n\n // Build a lookup from global row index to {batch, localIndex} for\n // multi-batch tables so compiled accessors receive the correct batch.\n const batches = table.batches;\n const batchOffsets = new Int32Array(batches.length);\n for (let i = 1; i < batches.length; i++) {\n batchOffsets[i] = batchOffsets[i - 1]! + batches[i - 1]!.numRows;\n }\n\n const resolveBatchContext = (globalIndex: number) => {\n let batchIdx = batches.length - 1;\n for (let i = 1; i < batches.length; i++) {\n if (globalIndex < batchOffsets[i]!) {\n batchIdx = i - 1;\n break;\n }\n }\n return {\n batch: batches[batchIdx]!,\n localIndex: globalIndex - batchOffsets[batchIdx]!,\n };\n };\n\n // Resolve hex value per row\n const getHexValue = (i: number): string => {\n if (isVector) {\n const raw = hexProp.get(i);\n if (isBigIntColumn && typeof raw === 'bigint') {\n return raw.toString(16);\n }\n return String(raw ?? '');\n }\n // Compiled accessor function\n if (typeof hexProp === 'function') {\n const {batch, localIndex} = resolveBatchContext(i);\n const result = (hexProp as (...args: unknown[]) => unknown)({\n index: localIndex,\n data: {data: batch},\n target: [],\n });\n if (typeof result === 'bigint') return result.toString(16);\n return String(result ?? '');\n }\n return '';\n };\n\n // Build row objects from Arrow table\n const rows: Record<string, unknown>[] = Array.from(\n {length: numRows},\n (_, i) => {\n const row: Record<string, unknown> = {};\n for (const field of table.schema.fields) {\n row[field.name] = table.getChild(field.name)?.get(i);\n }\n row.__h3Index = getHexValue(i);\n return row;\n },\n );\n\n // Resolve accessor props: Arrow Vectors → row functions, keep scalars\n const layerProps: Record<string, unknown> = {};\n for (const [propName, propValue] of Object.entries(otherProps)) {\n if (propValue instanceof arrow.Vector) {\n // Arrow Vector → row accessor (H3 layer uses row-based iteration)\n const vec = propValue;\n layerProps[propName] = (\n d: Record<string, unknown>,\n {index}: {index: number},\n ) => {\n return vec.get(index);\n };\n } else if (typeof propValue === 'function') {\n // Compiled GeoArrow accessor → wrap with batch context\n const fn = propValue;\n layerProps[propName] = (\n _object: unknown,\n objectInfo: {index: number; target?: number[]},\n ) => {\n const {batch, localIndex} = resolveBatchContext(objectInfo.index);\n return fn({\n index: localIndex,\n data: {data: batch},\n target: objectInfo.target,\n });\n };\n } else {\n layerProps[propName] = propValue;\n }\n }\n\n return new H3HexagonLayer({\n ...layerProps,\n id: `${this.props.id}-geoarrow-h3`,\n data: rows,\n getHexagon: (d: Record<string, unknown>) => d.__h3Index as string,\n } as any);\n }\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CompositeLayer, type Layer, type LayersList } from '@deck.gl/core';
|
|
2
|
+
import * as arrow from 'apache-arrow';
|
|
3
|
+
/**
|
|
4
|
+
* Custom GeoArrow-compatible TripsLayer wrapper.
|
|
5
|
+
*
|
|
6
|
+
* The upstream GeoArrowTripsLayer (from @geoarrow/deck.gl-geoarrow@0.4.x)
|
|
7
|
+
* expects `getTimestamps: Data<List<Float>>`, which may not match raw DuckDB
|
|
8
|
+
* timestamp types. Additionally, deck.gl 9.3's PathLayer/TripsLayer attribute
|
|
9
|
+
* manager fails to initialize raw typed arrays correctly, producing
|
|
10
|
+
* "Float64Array Error: Float64Array".
|
|
11
|
+
*
|
|
12
|
+
* This wrapper extracts the binary data from Arrow vectors and passes it to the
|
|
13
|
+
* native TripsLayer in a compatible format, properly resolving accessor props
|
|
14
|
+
* (Arrow Vectors → binary attributes, functions → wrapped with batch context).
|
|
15
|
+
*/
|
|
16
|
+
export declare class DeckTripsLayer extends CompositeLayer<{
|
|
17
|
+
data: arrow.Table;
|
|
18
|
+
getPath: arrow.Vector;
|
|
19
|
+
getTimestamps: arrow.Vector;
|
|
20
|
+
getColor?: arrow.Vector | [number, number, number, number] | ((...args: any[]) => any);
|
|
21
|
+
getWidth?: arrow.Vector | number | ((...args: any[]) => any);
|
|
22
|
+
currentTime?: number;
|
|
23
|
+
trailLength?: number;
|
|
24
|
+
fadeTrail?: boolean;
|
|
25
|
+
widthMinPixels?: number;
|
|
26
|
+
widthMaxPixels?: number;
|
|
27
|
+
opacity?: number;
|
|
28
|
+
_tripsMaxTimestamp?: number;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}> {
|
|
31
|
+
static layerName: string;
|
|
32
|
+
static defaultProps: {
|
|
33
|
+
currentTime: {
|
|
34
|
+
type: string;
|
|
35
|
+
value: number;
|
|
36
|
+
};
|
|
37
|
+
trailLength: {
|
|
38
|
+
type: string;
|
|
39
|
+
value: number;
|
|
40
|
+
};
|
|
41
|
+
fadeTrail: boolean;
|
|
42
|
+
_pathType: string;
|
|
43
|
+
};
|
|
44
|
+
renderLayers(): Layer | LayersList | null;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=DeckTripsLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeckTripsLayer.d.ts","sourceRoot":"","sources":["../../../src/json/layers/DeckTripsLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC;AAE1E,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAsCtC;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAe,SAAQ,cAAc,CAAC;IACjD,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;IACtB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;IAC5B,QAAQ,CAAC,EACL,KAAK,CAAC,MAAM,GACZ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,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