Kelbec commited on
Commit
71f23e9
1 Parent(s): 59f44a2
Files changed (1) hide show
  1. pages/visualization.py +47 -14
pages/visualization.py CHANGED
@@ -10,7 +10,7 @@ zoom = solara.reactive(2)
10
  center = solara.reactive((44.428,11.9086))
11
  config = {'version': 'v1',
12
  'config': {'visState': {'filters': [{'dataId': ['data'],
13
- 'id': '58woufh3',
14
  'name': ['ts'],
15
  'type': 'range',
16
  'value': [0, 1.68], ###time change here
@@ -19,7 +19,7 @@ config = {'version': 'v1',
19
  'animationWindow': 'free',
20
  'yAxis': None,
21
  'speed': 1}],
22
- 'layers': [{'id': 'lqz57i8',
23
  'type': 'geojson',
24
  'config': {
25
  'color': [18, 147, 154],
@@ -48,11 +48,11 @@ config = {'version': 'v1',
48
  '#FEEDB1',
49
  '#FEAD54',
50
  '#D50255']},
51
- 'radius': 10,
52
- 'sizeRange': [0, 10],
53
- 'radiusRange': [0, 50],
54
- 'heightRange': [0, 500],
55
- 'elevationScale': 5,
56
  'enableElevationZoomFactor': True,
57
  'stroked': True,
58
  'filled': False,
@@ -83,12 +83,12 @@ config = {'version': 'v1',
83
  'animationConfig': {'currentTime': None, 'speed': 1}},
84
  'mapState': {'bearing': 0,
85
  'dragRotate': False,
86
- 'latitude': 44.428,
87
- 'longitude': 11.9086,
88
  'pitch': 0,
89
  'zoom': 8.776177236597563,
90
  'isSplit': False},
91
- 'mapStyle': {'styleType': 'dark',
92
  'topLayerGroups': {},
93
  'visibleLayerGroups': {'label': True,
94
  'road': True,
@@ -128,13 +128,46 @@ class Map(leafmap.Map):
128
  "features": [point_feature]
129
  }
130
  self.add_geojson(geojson_data, layer_name="Station")
131
- self.config = config
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
 
133
 
134
  @solara.component
135
  def MapComponent(lat,lon):
136
 
137
- m = Map(center=(lat,lon)) #44.433333°, 11.683333
138
  m.element( # type: ignore
139
  zoom=zoom.value,
140
  on_zoom=zoom.set,
@@ -225,10 +258,10 @@ def Page():
225
  if map_loaded:
226
 
227
  if open_station_1:
228
- MapComponent(44.428,11.9086)
229
  PlotComponent(os.getcwd()+"/data/dati_1.csv")
230
  if open_station_2:
231
- MapComponent(44.433333, 11.683333)
232
  PlotComponent(os.getcwd()+"/data/dati_2.csv")
233
 
234
 
 
10
  center = solara.reactive((44.428,11.9086))
11
  config = {'version': 'v1',
12
  'config': {'visState': {'filters': [{'dataId': ['data'],
13
+ 'id': 'Station',
14
  'name': ['ts'],
15
  'type': 'range',
16
  'value': [0, 1.68], ###time change here
 
19
  'animationWindow': 'free',
20
  'yAxis': None,
21
  'speed': 1}],
22
+ 'layers': [{'id': 'Station',
23
  'type': 'geojson',
24
  'config': {
25
  'color': [18, 147, 154],
 
48
  '#FEEDB1',
49
  '#FEAD54',
50
  '#D50255']},
51
+ 'radius': 100,
52
+ 'sizeRange': [0, 100],
53
+ 'radiusRange': [0, 500],
54
+ 'heightRange': [0, 5000],
55
+ 'elevationScale': 50,
56
  'enableElevationZoomFactor': True,
57
  'stroked': True,
58
  'filled': False,
 
83
  'animationConfig': {'currentTime': None, 'speed': 1}},
84
  'mapState': {'bearing': 0,
85
  'dragRotate': False,
86
+ 'latitude': 44.43329,
87
+ 'longitude': 10.653654,
88
  'pitch': 0,
89
  'zoom': 8.776177236597563,
90
  'isSplit': False},
91
+ 'mapStyle': {'styleType': 'satellite',
92
  'topLayerGroups': {},
93
  'visibleLayerGroups': {'label': True,
94
  'road': True,
 
128
  "features": [point_feature]
129
  }
130
  self.add_geojson(geojson_data, layer_name="Station")
131
+ self.config = {
132
+ 'version': 'v1',
133
+ 'config': {
134
+ 'mapStyle': {
135
+ 'styleType': 'satellite'
136
+ },
137
+ 'mapState': {'bearing': 0,
138
+ 'dragRotate': False,
139
+ 'latitude': 44.43329,
140
+ 'longitude': 10.653654,
141
+ 'pitch': 0,
142
+ 'zoom': 12.776177236597563,
143
+ 'isSplit': False},
144
+ 'visState': {
145
+ 'layers': [
146
+ {
147
+ 'type': 'point',
148
+ 'config': {
149
+ 'colorRange': {
150
+ 'colors': ['#ff0000'],
151
+ 'domain': [0, 100],
152
+ 'size': 100
153
+ },
154
+ 'visConfig': {
155
+ 'radius': 1000, # Adjust the size of the points
156
+ 'opacity': 0.8, # Adjust the opacity of the points
157
+ }
158
+ },
159
+ },
160
+ ],
161
+ },
162
+ },
163
+ }
164
+
165
 
166
 
167
  @solara.component
168
  def MapComponent(lat,lon):
169
 
170
+ m = Map(center=(lat,lon))
171
  m.element( # type: ignore
172
  zoom=zoom.value,
173
  on_zoom=zoom.set,
 
258
  if map_loaded:
259
 
260
  if open_station_1:
261
+ MapComponent(44.43329,10.653654)
262
  PlotComponent(os.getcwd()+"/data/dati_1.csv")
263
  if open_station_2:
264
+ MapComponent(44.430042,10.667628)
265
  PlotComponent(os.getcwd()+"/data/dati_2.csv")
266
 
267