treemaps

J

Javi Jimenez

hello everybody in the list!

For 2 days I have been trying to use acts_as_treemap plugin in my
project. It seemed to be really easy following rob's tutorial
(http://blog.tupleshop.com/2006/7/27/treemap-on-rails).
I have tried with a simple example, only 6 nodes, and I get this error:

stack level too deep

(eval):8:in `color'
(eval):8:in `color'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:61:in
`node_color'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:149:in
`draw_node'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:95:in
`draw_map'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:77:in
`to_html'
#{RAILS_ROOT}/vendor/plugins/acts_as_treemap/lib/treemap_helper.rb:30:in
`html_treemap'
#{RAILS_ROOT}/app/views/breed/index.rhtml:3:in
`_run_rhtml_47app47views47breed47index46rhtml'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
`send'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
`compile_and_render_template'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:301:in
`render_template'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:260:in
`render_file'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:806:in
`render_file'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:711:in
`render_with_no_layout'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/layout.rb:256:in
`render_without_benchmark'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:in
`render'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in
`measure'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:in
`render'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1096:in
`perform_action_without_filters'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in
`call_filter'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
`perform_action_without_benchmark'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in
`measure'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
`perform_action'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`send'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`process_without_filters'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in
`process_without_session_management_support'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
`process'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in
`process'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
`dispatch'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:78:in
`process'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:76:in
`synchronize'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:76:in
`process'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:618:in
`process_client'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:617:in
`each'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:617:in
`process_client'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in
`initialize'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in
`new'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:720:in
`initialize'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:720:in
`new'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:720:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/configurator.rb:271:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/configurator.rb:270:in
`each'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/configurator.rb:270:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:127:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/command.rb:211:in
`run'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:243
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
`load'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
`load'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
`load'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:60
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
script/server:3

Any idea of what is happening?

Thanks!
 
I

Ilan Berci

Javi said:
hello everybody in the list!

For 2 days I have been trying to use acts_as_treemap plugin in my
project. It seemed to be really easy following rob's tutorial
(http://blog.tupleshop.com/2006/7/27/treemap-on-rails).
I have tried with a simple example, only 6 nodes, and I get this error:
C:/instantrails/InstantRails-1.7-win/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
script/server:3

Any idea of what is happening?

Thanks!

Javi,

You are recursively calling the method color() until your stack goes
through the roof. I believe your error has nothing at all to do with
the treemap plugin. If you want, you can post the code for further
analysis

hth

ilan
 
J

Javi Jimenez

You are recursively calling the method color() until your stack goes
through the roof. I believe your error has nothing at all to do with
the treemap plugin. If you want, you can post the code for further
analysis

hth

ilan

thanks ilan!

My view index.rhtml has only this line:

<%= html_treemap(@root) %>

The controller 'breed_controller':

class BreedController < ApplicationController
def index
# Retreive the root node of the treemap
@root = Breed.find(1)
end
end

and the model:

class Breed < ActiveRecord::Base
acts_as_tree :eek:rder => "total"
acts_as_treemap :label => "name", :size => "total", :color => "color"
end


As you can see is very simple code to use this plugin, that is why I
can't see the error, maybe in the database?

id parent_id total name color
1 null 79 'pit bull' '15.30'
2 1 67 'york-shire' '8.11'
3 2 65 'bull dog' '7.15'
4 3 60 'samoyedo' '6.00'

very simple too ....

What is happening? :(

Thank you!
 
J

Javi Jimenez

Javi said:
thanks ilan!

My view index.rhtml has only this line:

<%= html_treemap(@root) %>

The controller 'breed_controller':

class BreedController < ApplicationController
def index
# Retreive the root node of the treemap
@root = Breed.find(1)
end
end

and the model:

class Breed < ActiveRecord::Base
acts_as_tree :eek:rder => "total"
acts_as_treemap :label => "name", :size => "total", :color => "color"
end


As you can see is very simple code to use this plugin, that is why I
can't see the error, maybe in the database?

id parent_id total name color
1 null 79 'pit bull' '15.30'
2 1 67 'york-shire' '8.11'
3 2 65 'bull dog' '7.15'
4 3 60 'samoyedo' '6.00'

very simple too ....

What is happening? :(

Thank you!

I already fixed this problem, it was because of the column name 'color',
i felt so stupid when I found out.

Anyway, I still have not been able to show the map,It says :"no
font_size method".

I have been looking for it in the plugin code and it is there in
node.rb, so now I am more lost than before.


has anyone any experience with treemaps???
 
I

Ilan Berci

Javi said:
Anyway, I still have not been able to show the map,It says :"no
font_size method".

I have been looking for it in the plugin code and it is there in
node.rb, so now I am more lost than before.


has anyone any experience with treemaps???

Javi,

First thing, stop saying "treemaps" and instead read your error
messages.. the error message is indicating that you are calling a method
entitled "font_size" on an object that doesn't support it. If you trace
your call stack you will find the culprit and tackle it from there. As
for acts_as_treemap, check the docs that shipped with the plugin.

hth

ilan
 
J

Javi Jimenez

First thing, stop saying "treemaps" and instead read your error
messages.. the error message is indicating that you are calling a method
entitled "font_size" on an object that doesn't support it. If you trace
your call stack you will find the culprit and tackle it from there. As
for acts_as_treemap, check the docs that shipped with the plugin.

hth

ilan

You were right, I have found this method and several other methos that
call this one. Finnally I have been able to fix it and show the treemap.

Thanks for your comments

Javi
 
P

Peter Marx

Javi said:
You were right, I have found this method and several other methos that
call this one. Finnally I have been able to fix it and show the treemap.

Thanks for your comments

Javi


Hi Javi,

I have also the missing method "font_size" problem. I exactly used the
Sourceforge treemap database and the coding from the tutorial.
Plugin installation for acts_as_tree and acts_as_treemap worked.

I'm on Ruby 1.8.6 and Rails 2.0.2.

The trace gives a beginner like me no indication what's wrong:

undefined method `font_size' for #<SourceforgeNode:0x35da8c4>
...
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in
`method_missing'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:127:in
`draw_label'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:138:in
`draw_node_body'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:156:in
`draw_node'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:95:in
`draw_map'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:77:in
`to_html'
vendor/plugins/acts_as_treemap/lib/treemap_helper.rb:30:in
`html_treemap'
app/views/sourceforge_map/index.html.erb:1:in
`_run_erb_47app47views47sourceforge_map47index46html46erb'

Could you give me an advice how you found the related spot ?

Regards

Peter
 
J

Javi Jimenez

Hi Javi,
I have also the missing method "font_size" problem. I exactly used the
Sourceforge treemap database and the coding from the tutorial.
Plugin installation for acts_as_tree and acts_as_treemap worked.

I'm on Ruby 1.8.6 and Rails 2.0.2.

The trace gives a beginner like me no indication what's wrong:

undefined method `font_size' for #<SourceforgeNode:0x35da8c4>
...
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in
`method_missing'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:127:in
`draw_label'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:138:in
`draw_node_body'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:156:in
`draw_node'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:95:in
`draw_map'
C:/ruby/lib/ruby/gems/1.8/gems/ruby-treemap-0.0.2/lib/treemap/html_output.rb:77:in
`to_html'
vendor/plugins/acts_as_treemap/lib/treemap_helper.rb:30:in
`html_treemap'
app/views/sourceforge_map/index.html.erb:1:in
`_run_erb_47app47views47sourceforge_map47index46html46erb'

Could you give me an advice how you found the related spot ?

Regards

Peter

hi Peter!

I found the lines where font_size was called on the gem code and just
commented them and it worked (I realized that font_size was not used any
more).
I did not like the result so finnally i did not used it on my project.
Maybe you should use a javascript in order to have a nice view. If you
find anything interesting please share it!

Regards,

Javi
 
P

Peter Marx

hi Peter!
I found the lines where font_size was called on the gem code and just
commented them and it worked (I realized that font_size was not used any
more).
I did not like the result so finnally i did not used it on my project.
Maybe you should use a javascript in order to have a nice view. If you
find anything interesting please share it!

Regards,

Javi

Hi Javi,

It worked. But I agree, the result doesn't have a "commercial look". If
first have to dive deeper in Ajax, RAP or something else before thinking
of a professional look and feel for a treemap...

P.S: how can it be that the plugin being used in a tutorial produces
this error? Does this come from Rails 2.0 ? I lost days in trying to
learn Ruby with books and tutorials not working with 2.0. I think Ruby
lost a lot of possible friends..

have a good time
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help me out!!!!! 1
InstantRails windows Installation, problem with Gem 16
Net::SSH Problems 0
Triggering the debugger II 5
NoMethodError 0
File upload help 3
Email errors 4
SQL Error 2

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top