On Dec 9, 2016, at 12:32 PM, Rob Pritchard <kangaroorob@gmail.com> wrote:
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?
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/99e3f926-54ce-4f9d-93ed-5677901aaef3%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.