Fixed bug in widget JS code when outside notebook
@@ -65,11 +65,13 @@ HoloViewsWidget.prototype.dynamic_update = function(current){
}
}
this.current = current;
- var kernel = IPython.notebook.kernel;
+ if ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null)) {
+ var kernel = Jupyter.notebook.kernel;
callbacks = {iopub: {output: $.proxy(callback, this, this.initialized)}};
var cmd = "holoviews.plotting.widgets.NdWidget.widgets['" + this.id + "'].update(" + current + ")";
kernel.execute("import holoviews;" + cmd, callbacks, {silent : false});
}
+}
HoloViewsWidget.prototype.update_cache = function(force){
var frame_len = Object.keys(this.frames).length;
