A blank template for a reveal.js presentation with d3 support, plus some useful scripts. This is very much a work in progress and will be continuously hacked at as I add ever-more-frivolous animations to my presentations, and change the old stuff. I mostly just keep generic d3 scripts in this repository--customizations to reveal.js go in a fork of that project.
I make no promises about maintaining backwards compatibility or adding particular features (PRs and suggestions are still welcome). I'm only targeting my own development environment, which is OS X. I believe everything should work out of the box on Linux though.
To make a presentation, clone this project into a new folder and run
source setup.sh to create symbolic links to the reveal.js installation. Then, modify index.html to create your presentation.
Connecting Slide Fragments to d3
reveal-to-d3.js in your
index.html file. That script defines an object
pt.slideIdToFunctions. For each slide that contains JS fragments, add an object to describe those fragments, using the slide ID as the key. The fragment functions should be indexed in order:
To trigger these functions you will need to add fragments to your slide. You can do this with something like
I'm putting this up here in case others find it useful, but the overwhelming majority of the credit is due to Hakim El Hattab for building reveal.js, and to Mike Bostock for d3. Additional kudos to Pablo Tamarit who wrote the original code that connected the two projects.