Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
GSoC 2014 proposal version 2


The goal of my project is to build interactive visualization, and still allows fast prototyping, customizability, and integration to other SciRuby components. I think we can complete this goal with the client-server model shown below: server provides JSON data throgh REST API, and client get it with Ajax and generate plots based on it. Server-side gem will be build with SciRuby components like NMatrix, and client-side will use D3.js for plotting. This model is inspired by Prof. Karl Broman's work. (

Project plan

Client side

alt text

Base gem

  • This gem is tentatively named SciPlot.
  • SciPlot provides low level API for plotting like 'line,' 'rect,' and 'dot.'
  • This can generate plots that imports data from Ajax data source. D3.js already has asynchronous loading API like d3.json, and we can add this feature easier.

Plotting gems

  • We will create 3 new gems for plotting - Plotting for general use, Biology, and 3D plotting.
  • 3D plotting library will not depend on SciPlot because it do not use 2D API. I will implement it only for practice of Ajax loading and implementation of Ruby wrapper for JavaScript.

Supported plots

  • 10 charts for SciPlot STL (general use charts)
  • Scatter
  • Bar
  • Box
  • Line
  • and 6 more
  • BioPlot
  • HeatMap
  • Network
  • Matrix
  • and more
  • 3D Plots
  • see here

Mock code

require 'sciplot'
scatter =[1,2,3]) #-> show charts on IRuby notebook
require 'bioplot'
genomemap = # internally using SciPlot's DSL #-> IRuby

Server side

alt text


  • SciRuby-Server consists of 4 parts, Server, REST API, Web interface and DataBase.
  • We can deploy it into www server, or publish to closed network, or use in local environment.
  • SciRuby::Dataframe internally use REST API and push or pull data through it.
  • Users need not to be aware of where they store their data.
  • I will implement it with Sinatra and non-SQL Database. I will also use Thin for testing server in local environment.

Mock code

require 'sciruby'
require 'sciplot'
db = = some_data, ...)
db.connect(url) # do configuration when connecting to SciRuby-Server on Web. # generates plots from web source.


alt text

Local environment

Public environment

  • After publishing SciRuby-Server, you can also update data through REST API, using Dataframe of other wrapper.
  • REST-API also enables us to automatically update data. (like sensor and another server)
  • Some plots generated with our Client-side gem dinamically import data from SciRuby-Server.


  • implementation of client-side libraries (2-3 weeks)
    • First I will implement general plots for SciPlot STL, and implement reusable API based on that work.
  • implementation of wrapper gems for JS library (at the same time as previous step)
  • implementation of more advanced library ( 1-2 weeks)
  • BioPlot and 3D plot.
  • implementation of SciRuby-Server and SciRuby::Dataframe (2 weeks)
  • experimental implementation of SciRuby DB based on Dataframe (1 week)
    • Thin + Sinatra App + some DB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment