@deck.gl/jupyter-widget 8.8.9 → 8.8.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/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/playground/create-deck.js +19 -10
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@deck.gl/jupyter-widget",
|
|
3
3
|
"description": "Jupyter widget for rendering deck.gl in a Jupyter notebook",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "8.8.
|
|
5
|
+
"version": "8.8.10",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"jupyter",
|
|
8
8
|
"jupyterlab",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"prepublishOnly": "webpack -p"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@deck.gl/aggregation-layers": "8.8.
|
|
33
|
-
"@deck.gl/carto": "8.8.
|
|
34
|
-
"@deck.gl/geo-layers": "8.8.
|
|
35
|
-
"@deck.gl/google-maps": "8.8.
|
|
36
|
-
"@deck.gl/json": "8.8.
|
|
37
|
-
"@deck.gl/layers": "8.8.
|
|
38
|
-
"@deck.gl/mesh-layers": "8.8.
|
|
39
|
-
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3",
|
|
32
|
+
"@deck.gl/aggregation-layers": "8.8.10",
|
|
33
|
+
"@deck.gl/carto": "8.8.10",
|
|
34
|
+
"@deck.gl/geo-layers": "8.8.10",
|
|
35
|
+
"@deck.gl/google-maps": "8.8.10",
|
|
36
|
+
"@deck.gl/json": "8.8.10",
|
|
37
|
+
"@deck.gl/layers": "8.8.10",
|
|
38
|
+
"@deck.gl/mesh-layers": "8.8.10",
|
|
39
|
+
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4",
|
|
40
40
|
"@loaders.gl/3d-tiles": "^3.2.5",
|
|
41
41
|
"@loaders.gl/core": "^3.2.5",
|
|
42
42
|
"@loaders.gl/csv": "^3.2.5",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"jupyterlab": {
|
|
47
47
|
"extension": "src/plugin"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "102716bbb1ff42eeb131ab9280d2d886602d1e6f"
|
|
50
50
|
}
|
|
@@ -15,19 +15,22 @@ import {addSupportComponents} from '../lib/components/index';
|
|
|
15
15
|
|
|
16
16
|
import * as deck from '../deck-bundle';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const classesFilter = x => x.charAt(0) === x.charAt(0).toUpperCase();
|
|
19
|
+
const functionsFilter = x => x.charAt(0) === x.charAt(0).toLowerCase() && x.charAt(0) != '_';
|
|
20
|
+
|
|
21
|
+
function extractElements(library = {}, filter) {
|
|
22
|
+
// Extracts exported elements as a dictionary from a library
|
|
23
|
+
const dict = {};
|
|
24
|
+
const elements = Object.keys(library).filter(filter);
|
|
25
|
+
for (const el of elements) {
|
|
26
|
+
dict[el] = library[el];
|
|
24
27
|
}
|
|
25
|
-
return
|
|
28
|
+
return dict;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
// Handle JSONConverter and loaders configuration
|
|
29
32
|
const jsonConverterConfiguration = {
|
|
30
|
-
classes:
|
|
33
|
+
classes: extractElements(deck, classesFilter),
|
|
31
34
|
// Will be resolved as `<enum-name>.<enum-value>`
|
|
32
35
|
enumerations: {
|
|
33
36
|
COORDINATE_SYSTEM: deck.COORDINATE_SYSTEM,
|
|
@@ -43,7 +46,8 @@ const jsonConverter = new deck.JSONConverter({
|
|
|
43
46
|
|
|
44
47
|
function addModuleToConverter(module, converter) {
|
|
45
48
|
const newConfiguration = {
|
|
46
|
-
classes:
|
|
49
|
+
classes: extractElements(module, classesFilter),
|
|
50
|
+
functions: extractElements(module, functionsFilter)
|
|
47
51
|
};
|
|
48
52
|
converter.mergeConfiguration(newConfiguration);
|
|
49
53
|
}
|
|
@@ -177,10 +181,15 @@ function createDeck({
|
|
|
177
181
|
jsonInput,
|
|
178
182
|
tooltip,
|
|
179
183
|
handleEvent,
|
|
180
|
-
customLibraries
|
|
184
|
+
customLibraries,
|
|
185
|
+
configuration
|
|
181
186
|
}) {
|
|
182
187
|
let deckgl;
|
|
183
188
|
try {
|
|
189
|
+
if (configuration) {
|
|
190
|
+
jsonConverter.mergeConfiguration(configuration);
|
|
191
|
+
}
|
|
192
|
+
|
|
184
193
|
const oldLayers = jsonInput.layers || [];
|
|
185
194
|
const props = jsonConverter.convert(jsonInput);
|
|
186
195
|
|