rwebapplate

M. Edward (Ed) Borasky

2015-03-16

The goal?

Science writing for the small screen

  • Deliver technical articles and even books as smartphone apps
  • Initial target: Firefox OS phones
    • Maybe Android Firefox

The challenges?

Typing is painful

  • You can’t expect readers to enter data!

Low capacity

  • A smartphone is not a desktop!
  • It’s not even a little tablet.
  • It has limited processor, RAM and storage capacity.
  • It may not always have high-speed Internet.

Distracted readers

  • “One eyeball and one thumb”

The road map?

1. Get a clue, Ed!

2. Read it again

Badass: Making Users Awesome by Kathy Sierra.

3. Assemble the tools

4. Write, edit, publish, repeat.

5. ??????

6. Profit!

Write & edit

RStudio® & RMarkdown

  • R for data acquisition, analysis and visualization
  • RStudio for integrated development
  • RMarkdown for authoring

Reveal.js

  • Slideshows in HTML/CSS/JavaScript

revealjs

  • RMarkdown authoring of Reveal.js presentations

Why Reveal.js?

  • Responsive: adapts to screen size and orientation
  • Touch-enabled
  • Linking slides is easy
  • Two-dimensional navigation (left-right and up-down)
  • Displays code and math well
  • R revealjs package
  • Speaker notes
  • Long science tradition of slide “lecture notes”

Why not EPUB?

  • No good reader for Firefox OS
  • An extra layer of complexity on top of HTML/CSS/JavaScript
  • Coding required to create EPUB from RMarkdown

Publish

Webapplate

  • Mozilla tool to package web apps
  • Can make
    • Firefox OS app
    • Firefox for Android app
    • Firefox desktop app
    • Chrome desktop app
    • Android app via Apache Cordova
    • iOS app via Apache Cordova

Firefox Marketplace

  • Only distribution channel planned for now

What it looks like now

Sample plot

Sample code/results

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Sample math

  • Inline, for example, \(e=mc^2\), or
  • Standalone, for example, \[y = \beta_0 + \beta_1 x_1 + \beta_2 x_2\]

Todo list

Make webapplate documentation badass

  • Very sparse at the moment
  • Requires familiarity with Node.js / npm / Grunt

Fix the revealjs CSS

  • The typography is awful
    • should be able to switch in Mozilla fonts
  • The themes need tweaking for small screens

Fix bugs

  • get rid of annoying dark background for code!!
  • left-justify all the lists

Homework

You really should …

Yes, you should