# # treemap_helper.rb - Helper functions to draw treemap in view # # Copyright (c) 2006 by Andrew Bruno # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # require 'treemap' module TreemapHelper # XXX Configure to your needs def html_treemap(root) output = Treemap::HtmlOutput.new do |o| o.width = 800 o.height = 500 o.margin_top = 50 o.margin_left = 25 o.full_html = true o.center_labels_at_depth = 1 o.color = Treemap::GradientColor.new do |g| g.mean_color = "CCCCCC" end end output.to_html(root) end end