Hi,
I’m trying to produce a plot which shows three datasets (as separate sources, etc) on a single plot. (In this instance, mass spectral data)
I would like the ability to use the checkbox buttons to toggle the display of these on/off.
I assume it’s possible using the customJS widget code, but I can’t make much sense of it.
For example,
…
p3 = figure(tools=TOOLS, title=y[:-9],width=800, height=600, x_axis_label=‘m/z’,y_axis_label=‘Rel Abun’,y_range=[min(data[“RA”]),max(data[“RA”])],x_range=[0,800])
p3.segment(x0=0,x1=800,y0=0,y1=0,line_width=1, line_color=“black”)
p3.segment(x0=‘mz’,y0=0,x1=‘mz’,y1=‘RA’,source=source,line_width=linewidth, line_color=“black”) #pair1
p3.scatter(x=‘mz’, y=‘RA’,source=source,fill_color=‘black’,line_color=None) #pair1
p3.segment(x0=‘mz’,y0=0,x1=‘mz’,y1=‘RA’,source=isosource,line_width=linewidth, line_color=“green”) #pair2
p3.scatter(x=‘mz’, y=‘RA’,source=isosource,fill_color=‘green’,line_color=None) #pair2
p3.segment(x0=‘mz’,y0=0,x1=‘mz’,y1=‘RA’,source=nosource,line_width=linewidth, line_color=“red”) #pair3
p3.scatter(x=‘mz’, y=‘RA’,source=nosource,fill_color=‘red’,line_color=None) #pair3
…
``
I would like to be able to toggle the display of the pairs of segment/scatter plots shown…
Anyone have any ideas how/if this is possible?