Ruby gem to generate heatmaps
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
.gitignore
Gemfile
Rakefile
heatmap.gemspec
readme.md

readme.md

Ruby Heatmaps

A gem to generate heatmaps.

Usage

require 'heatmap'

heatmap = Heatmap::Map.new

heatmap.points << Heatmap::Point.new(0, 0, 0.1)
heatmap.points << Heatmap::Point.new(80, 5, 0.3)
heatmap.points << Heatmap::Point.new(10, 5, 0.2)
heatmap.points << Heatmap::Point.new(23, 5, 0.8)
heatmap.points << Heatmap::Point.new(50, 50, 0.9)
heatmap.points << Heatmap::Point.new(20, 10, 0.9)
heatmap.points << Heatmap::Point.new(100, 85, 1.0)
heatmap.points << Heatmap::Point.new(100, 60, 1.0)
heatmap.points << Heatmap::Point.new(90, 90, 1.0)
heatmap.points << Heatmap::Point.new(90, 30, 0.8)
heatmap.points << Heatmap::Point.new(90, 45, 0.9)

heatmap.output("output.png")

Sample output

Sample Heatmap

Giving it a whirl

$ git clone git@github.com:hyfen/heatmap.git
$ cd heatmap
$ rake build
$ gem install pkg/heatmap-0.0.2.gem

In IRB:

require 'heatmap'
heatmap = Heatmap::Map.new

Inspiration

  • gheat (gradient and dot files in examples/ come from here)
  • Ruby implementation of GMercatorProject comes from this gist

TODOs

  • customizability
  • generate tiles useful for Google Map mashups