def graph_scatter(self, df, df_coord, update_data):
scatter_source = ColumnDataSource(self.create_scatter_source(df, df_coord, ['Location']))
# create map
map_options = GMapOptions(lat=39.82, lng=-98.57, map_type="roadmap", zoom=4)
scatter = GMapPlot(plot_width=1200, plot_height=800,
x_range=DataRange1d(), y_range=DataRange1d(), map_options=map_options,
api_key='#########################'
)
circle_unselected = Circle(x='lon', y='lat', size='diameter', fill_color='Blue', fill_alpha=0.6, line_color='color',name = "circle")
circle = Circle(x='lon', y='lat', size='diameter', fill_color='color', fill_alpha=0.6, line_color='color',name = "circle")
if(update_data != None):
df = df.loc[df['Location'].isin(update_data)]
df_unselected = df.loc[-df['Location'].isin(update_data)]
scatter_source_unselected = ColumnDataSource(self.create_scatter_source(df_unselected, df_coord, ['Location']))
scatter.add_glyph(scatter_source_unselected, circle_deselected, name="circle")
r = scatter.add_glyph(scatter_source, circle,name="circle")
return scatter, r
graph,r = make_graph(df,df_coord,None)
show(graph)
#when a circle is clicked on go to update
r.data_source.on_change('selected',update)
···
update(attr, old, new):
#creates a list of adjacent circles and sends it to graph_scatter
graph_scatter(self, df, df_coord, update_data)
``
The problem that I’m having is that the graph isn’t updating. Is there a way to select multiple glyphs instead of just the one that is clicked on?