Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby gem to generate heatmaps
Ruby
branch: master

Merge pull request #3 from kapkaev/master

update to current changes
latest commit ff857ed3b1
@hyfen authored

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.