Creating presentations programatically

One can convey quite complex ideas in presentations using the right diagrams, however composing diagrams using software like PowerPoint of OpenOffice Impress can be time consuming since elements are created and manipulated individually. This becomes even more problematic when showing an evolution of an idea through several slides: changing some aspect (e.g., color) in the first diagram requires manual modification to all subsequent diagrams.

In some cases, the diagram content can be represented using a few lines of code, for example when demonstrating a computer algorithm. Programatically authoring presentations could be a good solution in such cases.

The following is a short survey of relevant tools. I’ve used are the Linux Presentation HOWTO, and web searches.

HTML/JavaScript

Several JavaScript libraries allow graphics rendering. JavaScript presentations enjoy being platform independent, so running your presentation on a host computer could be easy. Raphael.js provides drawable objects with attributes that can be modified in the course of an animation. Paper.js manipulates objects through methods. Processing.js has a flatter model for drawing, where the canvas is painted on (similar to Cairo), so it is a lower-level engine.  A comparison article highlights the differences between the three libraries. Some lists of JavaScript libraries are focused on data-visualisation, but some of these can be used to construct presentations.

D3.js is a framework for manipulating DOM objects based on data, and has good facilities to reason about animations (“transitions” in D3 language). This is a strong contestant for an animation engine.

Slide deck libraries display information in sequence, and some provide slide sorter menus and presenter mode. Some operate on the standard concept of slides, while others use scrolling or zoom-and-translate (like Prezi). Two promising libraries are deck.js and reveal.js. Both work with my USB clicker.

Python-based libraries

Pyglet provides low-level access to OpenGL, which enables 3D, while PyGame focuses on 2D animations and interaction. PyGTK supports Cairo python bindings to draw on its DrawingArea. These all seem like very low-level mechanisms.

SVG-based

InkScape is a program to create beautiful SVGs, and has a plugin model that allows extensions. SVG files can be animated using the SMIL standard; the InkScape wiki is a good introduction to SMIL animations. SMIL gives higher level control over animations, which could be well suited for presentations, reasoning about object paths and object attributes (for example, size), that change linearly or are bezier-interpolated over time.

Plugins like Sozi and JessyInk make presentations from InkScape, maybe this type of method can be used to program presentations.

Standalone programs

These are not what we were looking for, but might be adapted for use. Bruce and Pinpoint both render text files into presentations, and support the presented with processing key-presses and showing presenter mode.

Other options

Perfuse is a Java library to create visualizations. Latex-based presentations (e.g., Beamer) could be an option for some.

Posted in Tech Blog.

Leave a Reply

Your email address will not be published. Required fields are marked *