Making interactive figures for journal articles
Flash end of life and pdfs.While we knew that Adobe was abandoning Flash for browsers in favor of html 5, it remained unclear what the story would be for Flash (.swf) content embedded in pdfs. The answer is, tough. The Adobe webpage for the impact on Acrobat says that .swf material will not be readable by Adobe products going forward. It alludes to embedding "rich material" being supported going forward, including (somehow) importing rich html material into pdfs. As of this writing, I am unsure of the specific paths that might be possible; online Adobe documentation seems geared solely to linear video material. I believe that at the moment that this means that you can only embed video (in several formats), use layers, or import 3-D models within a pdf with the tools that will continue to work after the start of 2021.
This mini-site is dedicated to assembling directions for making some styles of interactive figures that can be embedded in journal articles (as opposed to being separate figures that are downloaded separately). The focus is on tricks to get into pdf files, as most users will download a pdf instead of view an html version (which remains frequently quite ugly despite CSS and style sheets and HTML5.0). It should also be possible to do this within html versions of papers (indeed, it should even be easier), but until publishers release single download versions of papers or the web interfaces to papers improve on formatted pdfs, it seems more sensible to focus on the pdf opportunities.
A 2013 article in PLOSone (that I missed until recently) documents embedding 3-D images in pdfs
Why do this? Why spend the time and trouble to make such figures? Well, for one thing, they can permit several figures to be combined as one, making it easier to have more material in a paper. In many cases, this allows the reader to explore the data more thoroughly than with static images. Ideally, this permits a stronger line of communication with the reader, allowing your work to have greater impact.
A summary of ideas (as time permits, I'll rewrite the external link material into how-tos with a more common setup):
- Embed existing animation (movie) into a pdf. Trivially done with Acrobat, but also possible with LaTEX. But some publishers don't like it.
- Allow illustration layers to be turned on and off in pdf. Acrobat Reader has supported layers since about v.6. These can be created within Acrobat from a series of images, or more easily from Illustrator by exporting to a pdf with Acrobat Layers from Top-Level Layers enabled. Note that you can add buttons to turn on and off layers so that versions of complex figures can be changed easily by the user while allowing the user to use the Layers tool in Acrobat Reader to investigate all the layers.
- Embed a (Flash) file in a pdf. This requires Acrobat (or LaTEX, apparently) to embed the Flash file within the pdf. Flash is great for doing a lot of things--too bad that Adobe overreached with Flash to make it something of a security pariah (much the same has happened with Java). There are two potential gotchas: you need to be sure fonts are embedded and that dynamic libraries are in the code. The first is controlled in the Font Embedding menu command under Text. The second is buried in the ActionScript settings in the File menu--choose under the Library Path tab to embed libraries in the code. What can you do with Flash? A lot as it has a programming language that has some real capability to it:
- Identification overlays (e.g., labels on points). Easy for a few points, more challenging if a lot. There are toolkits out there for this, such as Open Flash Chart (which is now offline). A list of quasi-open and commercial toolkits is here.
- User drawing layer. Handy if users can toggle through different layers, they can mark things they want to compare between images. It is pretty straightforward to add to an existing Flash animation working from instructions here or a different set here.
- User-driven calculations. It is possible, for instance, to allow a user to choose, say, the slope of a line and show then the resulting misfit of your data to that line, or deselect some points and recalculate the best regression onto the remaining points.
- Zoomable images preserving legends and overview location insets. (some pieces of code useful for this are here)
- Maintain a live link to updated/community datasets (e.g., IRIS, USGS earthquake lists, NAVDAT or other PetChem databases). This of course is a capability of Flash that causes some heartburn for IT professionals but one worth contemplating.
- Embed manipulatable 3-D images. A set of tools and instructions for this was published by Barnes et al. in PLOSone in 2013. (although, ironically, you have to download an auxillary version to see the embedded 3-D). This is designed with medical imaging in mind but should be applicable to earth science applications. A separate, but somewhat parallel, tutorial online comes from astronomy.
- Embed dynamic map using Google Earth/Map .kml technology. Currently Elsevier is doing this but only within Science Direct (online). Other Elsevier initiatives that are relevant (I think all are using online tools) include dynamic x-y plots, 3-D model viewer, MATLAB figure viewer.
On a related note, I've been starting to keep a list of interactive figures online that might provide ideas on what could be done (many of these are implemented in HTML5, I think, and so cannot simply be placed in a pdf).
Please send mail to
cjones@colorado.edu if
you encounter any problems or have suggestions.
C.
H. Jones | CIRES | Dept.
of Geological Sciences | Univ.
of Colorado at Boulder
Last modified at
June 13, 2020 4:59 PM