Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Doing Interesting Things With Your Rails Data

Doing Interesting Things With Your Rails Data

Avatar for Serena Wales

Serena Wales

August 01, 2013

Other Decks in Programming

Transcript

  1. WHO AM I? • Serena Wales • @gangleton on Github

    and Twitter • 2012 Code for America fellow • CTO of Textizen • Rails dev
  2. Explore your data • Gauss • https://github.com/wayoutmind/gauss • All kinds

    of fun statistical functions • Underscore.js Collection and Array Methods • http://documentcloud.github.io/underscore/ • Like Enumerable, but different
  3. Explore your data • http://misoproject.com/dataset/ • Handles loading, parsing, sorting,

    and querying • Great if your underlying data is changing regularly
  4. Front end: Pros • Great visualization options • Use tools

    developed for rich user experiences • Works with dynamic data • Can build in interaction and allow people to customize their views
  5. But not always great • Too much processing or data

    can lock your interface • If you’re not using most of the data, that can be a lot of extra traffic and memory
  6. Make charts in Ruby • Googlecharts • https://github.com/mattetti/googlecharts require  ‘googlecharts’

    data  =  [1,  1.2,  1.7,  1.5,  0.7,  0.3] Gchart.bar(:data  =>  data)
  7. Make charts in Ruby • Gruff • https://github.com/topfunky/gruff require  ‘gruff’

    data  =  [1,  1.2,  1.7,  1.5,  0.7,  0.3] g  =  Gruff::Bar.new g.data  :heights,  data g.write(‘chart.png’)
  8. Where do I put this stuff? • Not in your

    view. • Probably not in your model • Use more classes
  9. Load time > 3 minutes • Optimize for reading •

    Cache results • Recalculate after changes
  10. Doing complicated things with numbers? • Scientists seem to like

    R • RSRuby • https://github.com/alexgutteridge/rsruby • Rook • http://cran.r-project.org/web/packages/Rook/ index.html