JavaScript の可視化ライブラリ達

holidayworking

本日紹介するライブラリ達

  • Polychart2.js
  • Morris.js
  • NVD3
  • xCharts
  • HighCharts
  • Rickshaw

Polychart2.js

Polychart2.js is an easy-to-use yet powerful JavaScript graphing library. It takes many ideas from the Grammar of Graphics and the R library ggplot2, and adds interactive elements to take full advantage of the web.

Morris.js

Morris.js is the library that powers the graphs on http://howmanyleft.co.uk/. It's a very simple API for drawing line, bar, area and donut charts.

NVD3

A reusable chart library for d3.JS.

xCharts

xCharts is a D3-based library for building custom charts and graphs. Written and maintained by tenXer.

HighCharts

Highcharts is a charting library written in pure HTML5/JavaScript, offering intuitive, interactive charts to your web site or web application. Highcharts currently supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types.

Rickshaw

Rickshaw is a JavaScript toolkit for creating interactive time series graphs, developed at Shutterstock

Confession

  • 実はこれらのライブラリの使い方は知らないです
  • ライブラリの使い方を知らなくても、使う方法があるのです
  • R の知識があればね!
  • このスライドにのせてあるサンプルも rCharts という R のパッケージで作りました

rCharts

What is rCharts ?

  • rCharts is an R package to create, customize and publish interactive javascript visualizations from R using a familiar lattice style plotting interface.
  • This project is maintained by Ramnath Vaidyanathan

How to use

Sample : Morris.js

data(economics, package = 'ggplot2')
econ <- transform(economics, date = as.character(date))
m1 <- mPlot(x = 'date', y = c('psavert', 'uempmed'), type = 'Line', data = econ)
m1$set(pointSize = 0, lineWidth = 1)
m1

Sample : NVD3

hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair, group = "Eye", data = hair_eye_male, type = 'multiBarChart')
n1