Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby gem to generate heatmaps
Ruby
Branch: master
Pull request Compare This branch is 1 commit ahead, 10 commits behind hyfen:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

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
Something went wrong with that request. Please try again.