-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathdeckgl_map.py
More file actions
35 lines (30 loc) · 1014 Bytes
/
deckgl_map.py
File metadata and controls
35 lines (30 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import json
from typing import Any, Dict, List, Union
import pydeck
from webviz_subsurface_components import DeckGLMap as DeckGLMapBase
from .types.deckgl_props import DeckGLMapProps
class DeckGLMap(DeckGLMapBase):
"""Wrapper for the wsc.DeckGLMap with default props."""
def __init__(
self,
id: Union[str, Dict[str, str]],
layers: List[pydeck.Layer],
bounds: List[float] = DeckGLMapProps.bounds,
edited_data: Dict[str, Any] = DeckGLMapProps.edited_data,
resources: Dict[str, Any] = {},
**kwargs: Any,
) -> None:
"""Args:
id: Unique id
layers: A list of pydeck.Layers
bounds: ...
""" # Possible to get super docstring using e.g. @wraps?
super().__init__(
id=id,
layers=[json.loads(layer.to_json()) for layer in layers],
bounds=bounds,
editedData=edited_data,
resources=resources,
zoom=-4,
**kwargs,
)