Re: [therubyracer] exporting highcharts from ruby

99 views
Skip to first unread message

Charles Lowell

unread,
Dec 26, 2012, 10:41:26 PM12/26/12
to therub...@googlegroups.com
Karl,

I don't know the extent to which you'll need to stub it out, but you can embed a Ruby object that plays the part of the window in the context which you're evaluating highcharts.

class Window
  def location
  end
end

context = V8::Context.new
context[:window] = Window.new

cheers,
Charles

On Dec 26, 2012, at 9:10 PM, Karl Baum wrote:

Spent some time playing with highcharts from the rubyracer and it quickly became clear that i was in over my head.  The main issue seems to be that highcharts depends on the browser window object.  I came across this post about using node.js to export highcharts on the server:


Would it be possible to do the same within therubyracer?

thx!

-karl

Charles Lowell 
thefrontside.net | twitter: @cowboyd | github: cowboyd




Karl Baum

unread,
Dec 27, 2012, 8:26:19 AM12/27/12
to therub...@googlegroups.com
I tried a different version of that and quickly ran into another dependency on a method within the window object.  My guess is that highcharts makes heavy use of the browser.  Would it be possible to make use of the node.js project jsdom?  If not, is there an alternative library that simulates a browser within javascript?

thx!

-karl
Reply all
Reply to author
Forward
0 new messages