Skip to content

Commit

Permalink
Add full state prop to the map component (equinor#445)
Browse files Browse the repository at this point in the history
By removing the map spec state from the react component, the state will be
handled by Dash (in their redux store), so it makes it possible to get it on
the python side. In this way, there's no need to keep the state in python either.
  • Loading branch information
alexandruandrei91 authored Jul 9, 2021
1 parent 7974b84 commit 262d119
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 171 deletions.
190 changes: 92 additions & 98 deletions react/src/demo/example-data/deckgl-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,105 +9,99 @@
"resources": {
"propertyMap": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/propertyMap.png"
},
"deckglSpecPatch": [
{
"op": "replace",
"path": "",
"value": {
"initialViewState": {
"target": [
434962.5,
6478095.5,
0
],
"zoom": -3
},
"layers": [
{
"@@type": "ColormapLayer",
"id": "colormap-layer",
"bounds": [
432205,
6475078,
437720,
6481113
],
"image": "@@#resources.propertyMap",
"colormap": "https://cdn.jsdelivr.net/gh/kylebarron/deck.gl-raster/assets/colormaps/plasma.png",
"valueRange": [
2782,
3513
],
"pickable": true
},
{
"@@type": "Hillshading2DLayer",
"id": "hillshading-layer",
"bounds": [
432205,
6475078,
437720,
6481113
],
"valueRange": [
2782,
3513
],
"opacity": 1.0,
"image": "@@#resources.propertyMap",
"pickable": true
},
{
"@@type": "WellsLayer",
"id": "wells-layer",
"data": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/volve_wells.json",
"logData": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/volve_logs.json",
"opacity": 1.0,
"lineWidthScale": 5,
"logRadius": 6,
"logrunName": "BLOCKING",
"logName": "ZONELOG",
"pointRadiusScale": 8,
"outline": true,
"logCurves": true
},
{
"@@type": "FaultPolygonsLayer",
"id": "fault-polygons-layer",
"data": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/fault_polygons.geojson",
"lineWidthMinPixels": 2
},
{
"@@type": "PieChartLayer",
"id": "pie-layer",
"data": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/piechart.json"
},
{
"@@type": "DrawingLayer",
"id": "drawing-layer",
"mode": "drawLineString",
"data": {
"type": "FeatureCollection",
"features": []
}
}
"deckglSpecBase": {
"initialViewState": {
"target": [
434962.5,
6478095.5,
0
],
"zoom": -3
},
"layers": [
{
"@@type": "ColormapLayer",
"id": "colormap-layer",
"bounds": [
432205,
6475078,
437720,
6481113
],
"image": "@@#resources.propertyMap",
"colormap": "https://cdn.jsdelivr.net/gh/kylebarron/deck.gl-raster/assets/colormaps/plasma.png",
"valueRange": [
2782,
3513
],
"pickable": true
},
{
"@@type": "Hillshading2DLayer",
"id": "hillshading-layer",
"bounds": [
432205,
6475078,
437720,
6481113
],
"views": [
{
"@@type": "OrthographicView",
"id": "main",
"controller": {
"doubleClickZoom": false
},
"x": "0%",
"y": "0%",
"width": "100%",
"height": "100%",
"flipY": false
}
]
"valueRange": [
2782,
3513
],
"opacity": 1.0,
"image": "@@#resources.propertyMap",
"pickable": true
},
{
"@@type": "WellsLayer",
"id": "wells-layer",
"data": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/volve_wells.json",
"logData": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/volve_logs.json",
"opacity": 1.0,
"lineWidthScale": 5,
"logRadius": 6,
"logrunName": "BLOCKING",
"logName": "zonelog",
"pointRadiusScale": 8,
"outline": true,
"logCurves": true
},
{
"@@type": "FaultPolygonsLayer",
"id": "fault-polygons-layer",
"data": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/fault_polygons.geojson",
"lineWidthMinPixels": 2
},
{
"@@type": "PieChartLayer",
"id": "pie-layer",
"data": "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/piechart.json"
},
{
"@@type": "DrawingLayer",
"id": "drawing-layer",
"mode": "drawLineString",
"data": {
"type": "FeatureCollection",
"features": []
}
}
],
"views": [
{
"@@type": "OrthographicView",
"id": "main",
"controller": {
"doubleClickZoom": false
},
"x": "0%",
"y": "0%",
"width": "100%",
"height": "100%",
"flipY": false
}
}
]
]
}
}
]
Loading

0 comments on commit 262d119

Please sign in to comment.