MITLibraries / oastats-ui

The User Interface for the MIT Libraries Open Access Statistics Project
0 stars 2 forks source link

Need to implement PNG export of SVG visualizations #130

Open matt-bernhardt opened 9 years ago

matt-bernhardt commented 9 years ago

Export options were intended to include PNG versions of the graphic displays, and recently I found a technique described at http://stackoverflow.com/a/23667012 that looks promising. I put it in place on a sandbox project over break, and it seems to work relatively well - provided the display rules are declared inline, rather than via an external stylesheet.

matt-bernhardt commented 9 years ago

Here's a sample of what the map export would look like now:

download

Based on this test, two things that immediately jump to mind are that the map title and the legend need to be moved inside the visualization. Right now both are external HTML elements, and are thus excluded from the export.

OTOH, I don't think that the interactivity (hover state, etc) should be captured - just the base visualization?

matt-bernhardt commented 9 years ago

Unfortunately, the timeline display isn't quite export-ready:

download 1

This one appears to use an external stylesheet for some of the display rules, which the function I'm evaluating can't parse. The code that generates this display will need to be altered.