-
Notifications
You must be signed in to change notification settings - Fork 20
Beauty of JavaScript charts using daru view
"Interactive Visualization in Ruby web app",did you type something similar in search engine and ended up using JavaScript code? let's see how to use some of the most popular JS plotting libraries in iruby notebook and Ruby web application frameworks with few lines of Ruby code with daru-view
gem.
If you have searched about plotting tools to be used in Rails app, surely you would have came up about 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 from GoogleCharts, Highcharts, Nyaplot and datatables.
I will be using GSoC 2017 Blog to show features of daru-view plugin gem :
and 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 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.
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.
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.
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.
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.
Basic knowledge of Ruby.
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.