domitry / nyaplot

interactive plots generator for Ruby
MIT License
219 stars 27 forks source link

Package JS libraries in nyaplot and don't rely on external CDN #77

Open v0dro opened 8 years ago

v0dro commented 8 years ago

This elagans link: (https://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable","THREE":"https://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min) is not being downloaded via the CDN.

I think including it with the repo would solve the problem.

mrkn commented 8 years ago

Inlining JS file can fix this issue, I think.

I want to introduce a feature like load_notebook in bokeh. It can allow us to specify where assets are loaded from. At least I want to select inline or cdn at nyaplot initialization time, and I prefer the default is inline (bokeh's default is also inline).

But it needs to change nyaplot initialization protocol. While we just need to do require 'nyaplot'currently, introducing bokeh feature requires explicit initialization.

I think this modification is acceptable. How do you think about it?

v0dro commented 8 years ago

Sure. We can have some reliable default setting that works most of the time and also allow flexibility to choose sources with the load_notebook initialization.

mrkn commented 8 years ago

I've submit a pull-request https://github.com/domitry/nyaplot/pull/80