philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

window.$jit - Web Workers issue #96

Open pedrofaustino opened 12 years ago

pedrofaustino commented 12 years ago

Hi there!

Is there a reason why JIT uses window.$jit to define $jit as a global variable? Can't we define $jit outside the anonymous function with "var $jit" (as YUI does, see http://www.yuiblog.com/blog/2006/06/01/global-domination/#comment-45762)?

I want to use some of the operations provided by $jit on an already created Spacetree from a Web Worker, and when I try to load it from the worker script using importScripts, of course it complains about the window.$jit statement.

At the moment I have the following hack in place, but would really like to have something more elegant: if(!importScripts) $jit = window.$jit;

I know that Extras.js and in other places there are references to window, but I won't be using those functions anyways.

Thanks