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
24from shinywidgets import render_widget
35
4- from lonboard import Map
6+ from lonboard import Map , ScatterplotLayer
57
68colors = {
79 "Red" : [200 , 0 , 0 ],
1214ui .input_select ("color_select" , "Color" , choices = list (colors .keys ()))
1315
1416
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 )
1921
2022
2123@render_widget
2224def map ():
2325 return Map ([])
2426
2527
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