Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New @deck.gl/json syntax support - Part 2] pydeck: Use @@type in ren…
…dered JSON (#3959)
- Loading branch information
1 parent
f90b742
commit b0f014c
Showing
35 changed files
with
668 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import glob | ||
import json | ||
import os | ||
import logging | ||
|
||
|
||
here = os.path.dirname(os.path.abspath(__file__)) | ||
fixture_path = os.path.join(here, './fixtures/') | ||
json_glob = os.path.join(fixture_path, '*.json') | ||
|
||
fixtures = {} | ||
|
||
for fname in glob.glob(json_glob): | ||
fixture_text = open(fname).read() | ||
fixture_name = os.path.basename(fname).replace('.json', '') | ||
fixtures[fixture_name] = fixture_text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"initialViewState": { | ||
"bearing": -27.396674584323023, | ||
"latitude": 52.232395363869415, | ||
"longitude": -1.4157267858730052, | ||
"maxZoom": 15, | ||
"minZoom": 5, | ||
"pitch": 40.5, | ||
"zoom": 6.6 | ||
}, | ||
"layers": [ | ||
{ | ||
"@@type": "HexagonLayer", | ||
"coverage": 1, | ||
"data": "https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/3d-heatmap/heatmap-data.csv", | ||
"elevationRange": [ | ||
0, | ||
3000 | ||
], | ||
"elevationScale": 50, | ||
"extruded": true, | ||
"getPosition": "[lng, lat]", | ||
"id": "heatmap", | ||
"lightSettings": { | ||
"ambientRatio": 0.4, | ||
"diffuseRatio": 0.6, | ||
"lightsPosition": [ | ||
-0.144528, | ||
49.739968, | ||
8000, | ||
-3.807751, | ||
54.104682, | ||
8000 | ||
], | ||
"numberOfLights": 2 | ||
} | ||
} | ||
], | ||
"mapStyle": "mapbox://styles/mapbox/dark-v9", | ||
"views": [ | ||
{ | ||
"@@type": "MapView", | ||
"controller": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"initialViewState": { | ||
"bearing": 0, | ||
"latitude": -122.45, | ||
"longitude": 37.8, | ||
"maxZoom": 20, | ||
"minZoom": 0, | ||
"pitch": 0, | ||
"zoom": 12 | ||
}, | ||
"layers": [ | ||
{ | ||
"@@type": "ScatterplotLayer", | ||
"data": [ | ||
{ | ||
"position": [ | ||
-122.45, | ||
37.8 | ||
] | ||
} | ||
], | ||
"getFillColor": [ | ||
255, | ||
0, | ||
0, | ||
255 | ||
], | ||
"getPosition": "position", | ||
"getRadius": 1000, | ||
"id": "scatterplot" | ||
}, | ||
{ | ||
"@@type": "TextLayer", | ||
"data": [ | ||
{ | ||
"position": [ | ||
-122.45, | ||
37.8 | ||
], | ||
"text": "Hello World" | ||
} | ||
], | ||
"getPosition": "[lng, lat]", | ||
"getTextAnchor": "end", | ||
"id": "textlayer" | ||
}, | ||
{ | ||
"@@type": "GeoJsonLayer", | ||
"data": { | ||
"features": [ | ||
{ | ||
"geometry": { | ||
"coordinates": [ | ||
-122.42923736572264, | ||
37.80544394934271 | ||
], | ||
"type": "Point" | ||
}, | ||
"properties": {}, | ||
"type": "Feature" | ||
} | ||
], | ||
"type": "FeatureCollection" | ||
}, | ||
"filled": true, | ||
"getFillColor": [ | ||
200, | ||
160, | ||
0, | ||
180 | ||
], | ||
"getLineColor": [ | ||
255, | ||
100, | ||
100 | ||
], | ||
"getPosition": "features.geometry.coordinates", | ||
"id": "geojsonlayer", | ||
"lineWidthMinPixels": 2, | ||
"opacity": 0.4, | ||
"stroked": true | ||
} | ||
], | ||
"mapStyle": "mapbox://styles/mapbox/dark-v9", | ||
"views": [ | ||
{ | ||
"@@type": "MapView", | ||
"controller": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.