File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 1
- from shiny .express import ui
1
+ import geopandas as gpd
2
+ from shiny import reactive
3
+ from shiny .express import input , ui
2
4
from shinywidgets import render_widget
3
5
4
- from lonboard import Map
6
+ from lonboard import Map , ScatterplotLayer
5
7
6
8
colors = {
7
9
"Red" : [200 , 0 , 0 ],
12
14
ui .input_select ("color_select" , "Color" , choices = list (colors .keys ()))
13
15
14
16
15
- # @render_widget
16
- # def layer():
17
- # gdf = gpd.read_file(gpd.datasets.get_path("naturalearth_cities"))
18
- # return ScatterplotLayer.from_geopandas(gdf, radius_min_pixels=2)
17
+ @render_widget
18
+ def layer ():
19
+ gdf = gpd .read_file (gpd .datasets .get_path ("naturalearth_cities" ))
20
+ return ScatterplotLayer .from_geopandas (gdf , radius_min_pixels = 2 )
19
21
20
22
21
23
@render_widget
22
24
def map ():
23
25
return Map ([])
24
26
25
27
26
- # @reactive.effect
27
- # def set_fill_color():
28
- # layer.widget.get_fill_color = colors[input.color_select()]
28
+ @reactive .effect
29
+ def set_fill_color ():
30
+ layer .widget .get_fill_color = colors [input .color_select ()]
You can’t perform that action at this time.
0 commit comments