jbrowse icon indicating copy to clipboard operation
jbrowse copied to clipboard

Restore lost functionality of GBrowse_img

Open jogoodma opened this issue 7 years ago • 3 comments

With the GBrowse_img component of GBrowse, we had the ability to export any region and track(s) to an external web page. The regions could be embedded as an image via a simple image tag

e.g.

<img src="http://localhost/cgi-bin/gb2/gbrowse_img/MG1655/?name=NC_000913:3923000..3951000"></img>

or as an imagemap to make features in the image clickable.

<iframe src="http://localhost/cgi-bin/gbrowse_img/elegans?name=B0001;embed=1" width="100%" height="250">
   <img src="http://localhost/cgi-bin/gbrowse_img/elegans?name=B0001"/>
</iframe>

At FlyBase, we use the second method extensively throughout the site. One difference being that we wrap the call to the gbrowse_img in another script that injects the result of the call into the HTML report page. This allows us to get around the use of iframes documented on the GBrowse_img wiki page. These images are used for report to report navigation so that users don't have to navigate through GBrowse. For example, when viewing the insertion P{EPg}CG42321[HP26676] you can use the image map to navigate to any of the neighboring insertions that you may be interested in.

Please note, we are not asking that imagemaps be used again, only that we have the ability to display any region from JBrowse in an external page and that image have configurable clickable regions.

These images and clickable image maps are currently used dozens of times in hundreds of thousands of reports and is a critical feature that we have to maintain. As such, we cannot fully replace GBrowse with JBrowse until this functionality is implemented.

Related issues: #772 , #575

jogoodma avatar Aug 29 '16 15:08 jogoodma

Adding a gist from @cmdcolin for future reference. This example sets up data, JBrowse, and JBrowse config options to render an image in an external page, without pulling in JBrowse via an iframe.

An example of this approach can be seen in this screenshot. image

For a live view, see the Transcript section of this gene report.

jogoodma avatar Aug 31 '16 20:08 jogoodma

for actual rendering to image type thing, here's an example https://ourcodeworld.com/articles/read/38/how-to-capture-an-image-from-a-dom-element-with-javascript

cmdcolin avatar Jul 08 '18 14:07 cmdcolin

I am just posting that link as a reference, not that it has been tested in jbrowse codebase currently

cmdcolin avatar Jul 08 '18 14:07 cmdcolin