Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HTML export after moving to MIME bundle #2574

Merged
merged 5 commits into from Apr 17, 2018
Merged
Diff settings

Always

Just for now

Next

Fall back to Bokeh.index lookup outside notebook context

  • Loading branch information...
Philipp Rudiger Philipp Rudiger
Philipp Rudiger authored and Philipp Rudiger committed Apr 17, 2018
commit 6489bd42a13710e8857c00da3bcf56b8b98d9c82
@@ -24,7 +24,11 @@ var BokehMethods = {
}
var data = this.frames[current];
if (data !== undefined) {
var doc = HoloViews.plot_index[data.root].model.document;
if (data.root in HoloViews.plot_index) {
var doc = HoloViews.plot_index[data.root].model.document;
} else {
var doc = Bokeh.index[data.root].model.document;
}
doc.apply_json_patch(data.content);
}
},
@@ -37,7 +41,11 @@ var BokehMethods = {
return HoloViewsWidget.prototype.init_comms.call(this);
},
process_msg : function(msg) {
var doc = HoloViews.plot_index[this.plot_id].model.document;
if (this.plot_id in HoloViews.plot_index) {
var doc = HoloViews.plot_index[this.plot_id].model.document;
} else {
var doc = Bokeh.index[this.plot_id].model.document;
}
if (this.receiver === null) { return }
var receiver = this.receiver;
if (msg.buffers.length > 0) {
@@ -34,15 +34,20 @@

# Following JS block becomes body of the message handler callback
bokeh_msg_handler = """
var plot = HoloViews.plot_index["{plot_id}"];
if ("{plot_id}" in HoloViews.receivers) {{
var receiver = HoloViews.receivers["{plot_id}"];
var plot_id = "{plot_id}";
if (plot_id in HoloViews.plot_index) {
var doc = HoloViews.plot_index[plot_id];
} else {
var doc = Bokeh.index[plot_id];
}
if (plot_id in HoloViews.receivers) {{
var receiver = HoloViews.receivers[plot_id];
}} else if (Bokeh.protocol === undefined) {{
return;
}} else {{
var receiver = new Bokeh.protocol.Receiver();
HoloViews.receivers["{plot_id}"] = receiver;
HoloViews.receivers[plot_id] = receiver;
}}
if (buffers.length > 0) {{
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.