Victorian-Bioinformatics-Consortium / degust

Deprecated : Use https://github.com/drpowell/degust
GNU General Public License v3.0
44 stars 15 forks source link

Generate "print" quality diagrams #8

Open drpowell opened 10 years ago

drpowell commented 10 years ago

The difficulty is the parallel coordinates and MA-plot that both use a combination of SVG and canvas.

Look into: http://svgopen.org/2010/papers/62-From_SVG_to_Canvas_and_Back http://www.nihilogic.dk/labs/canvas2image/ https://github.com/Causata/svgenie

drpowell commented 10 years ago

Tried a couple of stalled attempts:

  1. Modify the parallel coordinates module to merge the multiple canvas items and SVG (for axes) into a single canvas at high resolution for printing. Unable to get this working properly. Main problem was the rendering of the SVG as a data uri does not use any css styling
  2. Use css "print" media settings to only show the parallel coordinates plot. This works, but really need to redraw the plot at higher resolution on "print". This can be triggered in firefox using onbeforeprint, and on chrome with matchMedia. But fiddly and awkward.
  3. Create a temporary "div" over the whole body just showing a plot at high resolution. This seems most promising and have a working prototype. Need to add options to control line width and text size though.
drpowell commented 7 years ago

Added support for SVG only plots. Need support for canvas based ones, parcoords & ma-plot. Needs more work as these have multiple overlayed canvas