Skip to content

Instantly share code, notes, and snippets.

@mwhitaker
Created June 2, 2016 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwhitaker/f7faa68ab4595a000742731db23d7911 to your computer and use it in GitHub Desktop.
Save mwhitaker/f7faa68ab4595a000742731db23d7911 to your computer and use it in GitHub Desktop.
temp.html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.pydata.org/bokeh/release/bokeh-0.11.1.min.js"></script>
<link href="https://cdn.pydata.org/bokeh/release/bokeh-0.11.1.min.css" rel="stylesheet">
</head>
<body>
<div id="a73ee825087c4d734028b06bb47bc3e4" class="plotdiv"></div>
<script type="text/javascript">
Bokeh.$(function() {
var modelid = "d3c76f9946c7a15b511376e2e50ddc7e";
var elementid = "a73ee825087c4d734028b06bb47bc3e4";
var docid = "d45679a88d17120115dc513a9689dbc6";
var docs_json = {"d45679a88d17120115dc513a9689dbc6":{"version":"0.11.1","title":"Bokeh Figure","roots":{"root_ids":["d3c76f9946c7a15b511376e2e50ddc7e"],"references":[{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","attributes":{"title":null,"id":"d3c76f9946c7a15b511376e2e50ddc7e","plot_width":[],"plot_height":[],"x_range":{"type":"Range1d","id":"536ceab89501bd3103ae401fd6603447"},"y_range":{"type":"Range1d","id":"fb9966c0a3cb11aaeb5df15163c5bd12"},"left":[{"type":"LinearAxis","id":"38a50c19033e400121f50c3b953cd8c8"}],"below":[{"type":"LinearAxis","id":"7e83259d7661b2c7a32f9f373f83c26e"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"de35fa52a23b48178a64318e0a4611a5"},{"type":"GlyphRenderer","id":"85f71b93115015bfe799aa800dfe9ba8"},{"type":"LinearAxis","id":"7e83259d7661b2c7a32f9f373f83c26e"},{"type":"Grid","id":"13cf380911f0686280128d1901cd7e19"},{"type":"LinearAxis","id":"38a50c19033e400121f50c3b953cd8c8"},{"type":"Grid","id":"d4efa84eb4ed71eea841d279c58cc795"}],"tools":[{"type":"PanTool","id":"94d6ff276cd9733476b7b7b4f9ee52c3"},{"type":"WheelZoomTool","id":"30f2994fd17b67797bfd454b395cdbf8"},{"type":"BoxZoomTool","id":"36ebfc5d166007429f95b5e8d55cf2a6"},{"type":"ResizeTool","id":"e68c5969e0a72c45a6b6f408d22ff8b3"},{"type":"ResetTool","id":"ba3c5d4920e89602a96d2fd54ae790b5"},{"type":"PreviewSaveTool","id":"05226d7dc5199aed44b2e5d2110b2fc2"},{"type":"HelpTool","id":"552d7e368bcbd9b5704ffdaf7a232928"}],"tool_events":{"type":"ToolEvents","id":"ced29c5fc2db6a5527b5960ceadf3a8a"},"extra_y_ranges":{},"extra_x_ranges":{},"tags":[],"doc":null,"min_border_left":4,"min_border_right":4,"min_border_top":4,"min_border_bottom":4,"lod_threshold":null},"subtype":"Figure"},{"type":"PanTool","id":"94d6ff276cd9733476b7b7b4f9ee52c3","attributes":{"id":"94d6ff276cd9733476b7b7b4f9ee52c3","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"ToolEvents","id":"ced29c5fc2db6a5527b5960ceadf3a8a","attributes":{"id":"ced29c5fc2db6a5527b5960ceadf3a8a","tags":[],"doc":null},"geometries":[]},{"type":"WheelZoomTool","id":"30f2994fd17b67797bfd454b395cdbf8","attributes":{"id":"30f2994fd17b67797bfd454b395cdbf8","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"BoxAnnotation","id":"de35fa52a23b48178a64318e0a4611a5","attributes":{"id":"de35fa52a23b48178a64318e0a4611a5","tags":[],"doc":null,"line_color":{"units":"data","value":"black"},"line_alpha":{"units":"data","value":1},"fill_color":{"units":"data","value":"lightgrey"},"fill_alpha":{"units":"data","value":0.5},"line_dash":[4,4],"line_width":{"units":"data","value":2},"level":"overlay","top_units":"screen","bottom_units":"screen","left_units":"screen","right_units":"screen","render_mode":"css"}},{"type":"BoxZoomTool","id":"36ebfc5d166007429f95b5e8d55cf2a6","attributes":{"id":"36ebfc5d166007429f95b5e8d55cf2a6","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"de35fa52a23b48178a64318e0a4611a5"}}},{"type":"ResizeTool","id":"e68c5969e0a72c45a6b6f408d22ff8b3","attributes":{"id":"e68c5969e0a72c45a6b6f408d22ff8b3","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"}}},{"type":"ResetTool","id":"ba3c5d4920e89602a96d2fd54ae790b5","attributes":{"id":"ba3c5d4920e89602a96d2fd54ae790b5","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"}}},{"type":"PreviewSaveTool","id":"05226d7dc5199aed44b2e5d2110b2fc2","attributes":{"id":"05226d7dc5199aed44b2e5d2110b2fc2","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"}}},{"type":"HelpTool","id":"552d7e368bcbd9b5704ffdaf7a232928","attributes":{"id":"552d7e368bcbd9b5704ffdaf7a232928","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"redirect":["http://hafen.github.io/rbokeh"],"help_tooltip":["Click to learn more about rbokeh."]}},{"type":"ColumnDataSource","id":"e0024c55d120c9eba1a741224c225954","attributes":{"id":"e0024c55d120c9eba1a741224c225954","tags":[],"doc":null,"column_names":["x","y"],"selected":[],"discrete_ranges":{},"cont_ranges":{},"data":{"x":[1,2,3,4,5,6,7,8,9,10],"y":[1,2,3,4,5,6,7,8,9,10]}}},{"type":"Circle","id":"721f514ef113d2a460e026997726d223","attributes":{"id":"721f514ef113d2a460e026997726d223","tags":[],"doc":null,"size":{"units":"screen","value":10},"visible":true,"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"9bfe5534695e53e7005baaf4346207b6","attributes":{"id":"9bfe5534695e53e7005baaf4346207b6","tags":[],"doc":null,"size":{"units":"screen","value":10},"visible":true,"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"748ac4527f088177a2c4b3354f80896a","attributes":{"id":"748ac4527f088177a2c4b3354f80896a","tags":[],"doc":null,"size":{"units":"screen","value":10},"visible":true,"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"85f71b93115015bfe799aa800dfe9ba8","attributes":{"id":"85f71b93115015bfe799aa800dfe9ba8","tags":[],"doc":null,"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"9bfe5534695e53e7005baaf4346207b6"},"hover_glyph":{"type":"Circle","id":"748ac4527f088177a2c4b3354f80896a"},"server_data_source":null,"name":null,"data_source":{"type":"ColumnDataSource","id":"e0024c55d120c9eba1a741224c225954"},"glyph":{"type":"Circle","id":"721f514ef113d2a460e026997726d223"}}},{"type":"Range1d","id":"536ceab89501bd3103ae401fd6603447","attributes":{"id":"536ceab89501bd3103ae401fd6603447","tags":[],"doc":null,"start":0.37,"end":10.63}},{"type":"Range1d","id":"fb9966c0a3cb11aaeb5df15163c5bd12","attributes":{"id":"fb9966c0a3cb11aaeb5df15163c5bd12","tags":[],"doc":null,"start":0.37,"end":10.63}},{"type":"LinearAxis","id":"7e83259d7661b2c7a32f9f373f83c26e","attributes":{"id":"7e83259d7661b2c7a32f9f373f83c26e","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"axis_label":"index","formatter":{"type":"BasicTickFormatter","id":"2f33662a9189b82cc9f1ccee4d204439"},"ticker":{"type":"BasicTicker","id":"f3e72552bbde5dfec2c3c1cbbd419a31"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"2f33662a9189b82cc9f1ccee4d204439","attributes":{"id":"2f33662a9189b82cc9f1ccee4d204439","tags":[],"doc":null}},{"type":"BasicTicker","id":"f3e72552bbde5dfec2c3c1cbbd419a31","attributes":{"id":"f3e72552bbde5dfec2c3c1cbbd419a31","tags":[],"doc":null,"num_minor_ticks":5}},{"type":"Grid","id":"13cf380911f0686280128d1901cd7e19","attributes":{"id":"13cf380911f0686280128d1901cd7e19","tags":[],"doc":null,"dimension":0,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"f3e72552bbde5dfec2c3c1cbbd419a31"}}},{"type":"LinearAxis","id":"38a50c19033e400121f50c3b953cd8c8","attributes":{"id":"38a50c19033e400121f50c3b953cd8c8","tags":[],"doc":null,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"axis_label":"1:10","formatter":{"type":"BasicTickFormatter","id":"7174b770d99c75b9ea412ab3ece2f758"},"ticker":{"type":"BasicTicker","id":"fee64c99eed440d35585f2626cf9cfc0"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"7174b770d99c75b9ea412ab3ece2f758","attributes":{"id":"7174b770d99c75b9ea412ab3ece2f758","tags":[],"doc":null}},{"type":"BasicTicker","id":"fee64c99eed440d35585f2626cf9cfc0","attributes":{"id":"fee64c99eed440d35585f2626cf9cfc0","tags":[],"doc":null,"num_minor_ticks":5}},{"type":"Grid","id":"d4efa84eb4ed71eea841d279c58cc795","attributes":{"id":"d4efa84eb4ed71eea841d279c58cc795","tags":[],"doc":null,"dimension":1,"plot":{"type":"Plot","id":"d3c76f9946c7a15b511376e2e50ddc7e","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"fee64c99eed440d35585f2626cf9cfc0"}}}]}}};
var refkey = Object.keys(docs_json)[0]
var refs = docs_json[refkey].roots.references
function traverseObject(obj) {
for(var key in obj) {
if(obj[key].constructor === Object) {
traverseObject(obj[key]);
} else if(obj[key].constructor === Array) {
for (var i = 0; i < obj[key].length; i++) {
if(obj[key][i] === null)
obj[key][i] = NaN;
};
}
};
}
for(var i = 0; i < refs.length; i++) {
if(refs[i].type === "ColumnDataSource")
traverseObject(refs[i].attributes.data);
};
var render_items = [{
"docid": docid,
"elementid": elementid,
"modelid": modelid
}];
Bokeh.set_log_level('info');
Bokeh.embed.embed_items(docs_json, render_items);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment