Skip to content

Loffe/heatmap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby gem to generate heatmaps

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%