Edinburgh-Genome-Foundry / DnaFeaturesViewer

:eye: Python library to plot DNA sequence features (e.g. from Genbank files)
https://edinburgh-genome-foundry.github.io/DnaFeaturesViewer/
MIT License
584 stars 90 forks source link

Specify bokeh tools #35

Closed MrTomRod closed 4 years ago

MrTomRod commented 4 years ago

I absolutely love this library, especially bokeh! I have a feature request, though:

It would be great if it were possible to specify the tools of the plot. Currently, I do it like this:

plot = graphic_record.plot_with_bokeh()

# remove hover tool
from bokeh.plotting._tools import process_tools_arg
tool_objs, tool_map = process_tools_arg(plot, "xpan,xwheel_zoom,reset,tap")
plot.tools = tool_objs

How I'd like it to work:

plot = graphic_record.plot_with_bokeh(tools=["xpan,xwheel_zoom,reset,tap"])

PS: In the function plot_with_bokeh of the class BokehPlottableMixin on line 78, you have a silly print statement. :)

veghp commented 4 years ago

Thank you for the suggestion. Could you please perhaps make a pull request for this feature?

veghp commented 4 years ago

Thank you very much, I merged your PR