Skip to content

RailsConf 2018 Proposal: An adventure with Daru on Rails

Shekhar Prasad Rajak edited this page Jan 19, 2018 · 1 revision

Javascript charts without writing javascript

Session format

Regular Session

Track

Modern Javascript in Rails

Abstract

"Interactive Visualization of data in Rails app", did you type something similar in Search engine and ended up using javascript code? Okay Rubyist! let's see how to use some of the most popular JS plotting libraries using few lines of Ruby code in Rails with daru-view gem, which is capable of plotting charts/graphs using GoogleCharts, HighCharts, Nyaplot and datatable JS.

Details

Outlines

I will be using GSoC 2017 Blog to show features of daru-view plugin gem

and how we can import and export data in various format using daru-io gem

Main points will be as follows :

  • Ruby is powerful for Data Analysis and visualisation ?

Ruby has NArray, NMatrix (new but promising), Statsample, Ruby/GSL, libsvm, ruby-fann (neural networks), tlearn (neural networks), ai4r, algorithms (k-d tree to do KNN), bayes_motel and others. These powerful tools are well enough for data science and to build tool for data analysis. Ruby is also the preferred language for DevOps related tasks (e.g Puppet and Chef).

Most of the things are online today, so people want to do analysis of data and view the results quickly using plotting. Ruby has very popular frameworks like Rails, Sinatra, Nanoc, Hanami to build the dynamic website.

Hence isn't Ruby has all the things required for data science and data analysis and visualisation?

  • Why to use daru-view and what makes it powerful gem for Data analysis and visualisation ?

In this section, you will learn how we can use daru for analyzing large data sets and get a tour of daru being coupled with other Ruby tools like pry, iruby and nyaplot, Google Charts, Highcharts, data-tables tool for interactive and standalone data analysis and plotting for gaining quick insights into your data — all with a few lines of Ruby code.

  • Demo of interactive plotting system in Rails web applications and in IRuby notebook using daru-view.
  • Other languages are failed to provide very interactive charts and tables. daru-view gem is useful in plotting charts and tables in IRuby notebook as well as in web applications (Rails/Sinatra/Nanoc). daru-view uses Nyaplot, highcharts, google charts for plotting and DataTables for generating table with various features mainly searching, pagination, sorting.

Requirement

Basic knowledge of Ruby.


Outcomes

Audience will learn a powerful data analysis & visualisation gem daru and newly created gem daru-view, that can be used smoothly in Rails app . Audience will be able to create small Rails web application(like this ) and will run examples in IRuby Notebook. We already have some good examples in daru-view github repo, wiki page, documentation.


Pitch

If you have searched about plotting tools to be used in Rails app, surely you came up interactive charts in javascript library, that are just beautiful. But why to code in javascript inside Rails app, while coding in Ruby? Let's learn how to plot charts using daru-view, which is capable of generating the interactive charts using GoogleCharts, Highcharts, Nyaplot and datatables.

Why daru-view?

Charts

Charts are an integrable part of the visualization. There are multiple gems that provide multiple kinds of charts that includes simple charts such as Pie chart, Bar chart, Line chart to complex charts such as Geo-spatial charts, Temperature charts and so on. Daru-view is built on the adapter principle, wherein support is provided for many plotting libraries, and adapter to be used has to set before plotting.

Table

Tables are another important part of visualizing data, that enable viewing individual data points in a plain tabular form. DataTables offer the features to paginate, search and sort based on any column of the table. This has been used by the daru-view table to easily present a dataframe in a tabular form.

Without data analysis?

As a web developer, you might have to present an admin dashboard to your data analyst colleague / boss with different charts and tables between various features and labels. In such cases of building a dashboard with visualizations, you can just simply use daru-view rather than researching through all of the different plotting libraries.

How I am best person to speak on this topic

I am one of the contributor of daru github repository and my Google Summer of Code 2017 project is related to daru gem. I am author of plugin gem for daru, named daru-view which provides interactive charts in web application as well as IRuby Notebook. So I have expert level knowledge on this topic. I can convey my thought easily. My work during GSoC 2017 is described here.

Speaker Information

Shekhar is an Open Source enthusiast and contributor in SciRuby (Ruby Science Foundation), Bunlder & SymPy. He has worked as Google Summer of Code Student developer in 2016 (SymPy Org.) & 2017 (SciRuby Org.) . He is author of daru-view (a plugin gem to daru). daru-view can generate interactive data tables and charts in iruby notebook as well as in webpages. He likes playing chess, watching and reading about ancient India, spirituality, cricket and travelling.

Clone this wiki locally