tskit-dev / tsqc

Utilities for evaluating inferred tree sequences
MIT License
3 stars 7 forks source link

Enable saving plots #107

Open jeromekelleher opened 6 months ago

jeromekelleher commented 6 months ago

Bokeh supports saving plots to some degree. We should see if we can use this to export particular views of (e.g.) the mutations browser.

benjeffery commented 3 months ago

I've started looking into this, and have a basic png of the mutations plot: mutations_scatter

This requires selenium which is available with a pip install. Are we ok with this as it is a heavy dependency, we could make it an optional one?

jeromekelleher commented 3 months ago

Would need some discussion I think. Is there a way to do a "screen grab" with some JS, client side?

benjeffery commented 3 months ago

Ah, I now realise this issue is focussed on having a save button on the UI when viewing on web. I was mainly thinking about the non-interactive pipeline use case.

jeromekelleher commented 3 months ago

Yeah, that's a separate issue

benjeffery commented 3 months ago

There's no easy way to screenshot part of a webpage from JavaScript. (You have to play games like re-rendering the html to a canvas) Best way would be to serve pngs made by the API suggested at #158.

jeromekelleher commented 3 months ago

Best way would be to serve pngs made by the API suggested at #158.

It is a somewhat different use-case as we want poeple to be able to do some zooming in etc. But they can always just use screen grabs to be honest, so maybe we should just not bother with this.