0.01
Low commit activity in last 3 years
No release in over a year
Minimalistic wrapper around chartkick to use it within IRuby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.0

Runtime

~> 4.1.0
>= 0
 Project Readme

iruby-chartkick build

You like writing Ruby within Juypter notebooks? Awesome, you're not alone - we do so, too ☀️ Since we also fell in love with the handy charting API of ankane/chartkick, we wrote this little gem bringing them together.

iruby-chartkick was made for easy plug-n-play plotting data using the awesomeness of chartkick within IRuby-backed Jupyter notebooks.

Installation

gem install iruby-chartkick

Usage

You can either include the module IRuby::Chartkick and use the wrapper methods, like line_chart:

include IRuby::Chartkick
		
data = {
  2019 => 1,
  2020 => 122,
  2021 => 34
}
 
line_chart(data)

Or you use the chart wrapper classes directly:

include IRuby::Chartkick
		
data = {
  2019 => 1,
  2020 => 122,
  2021 => 34
}

IRuby::Chartkick::LineChart.new(data).plot

Examples:

include IRuby::Chartkick

data = [
  {
    name: "Monkeys",
    data: {
      2010 => 20,
      2011 => 190,
      2012 => 188,
      2013 => 230,
      2014 => 422,
      2015 => 56,
      2016 => 299,
      2019 => 100
    }
  },
  {
    name: "Pirates",
    data: {
      2010 => 20,
      2011 => 90,
      2012 => 488,
      2013 => 430,
      2014 => 122,
      2015 => 6,
      2016 => 399,
      2019 => 500
    }
  }
]

LineChart

line_chart(data)

LineChart

line_chart(data, points: false)

LineChart

line_chart(data, points: false, width: "700px", min: 50, max: 300)

LineChart

AreaChart

area_chart(data)

AreaChart

ColumnChart

column_chart(data)

ColumnChart

BarChart

bar_chart(data)

BarChart

ScatterChart

scatter_chart(data)

ScatterChart

PieChart

include IRuby::Chartkick

data = [
  ["Blueberry", 44],
  ["Strawberry", 23],
  ["Banana", 22],
  ["Apple", 21],
  ["Grape", 13]
]

pie_chart(data)

PieChart