Skip to content

Instantly share code, notes, and snippets.

@mwhitaker
Created June 2, 2016 22:50
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/c79cef60fa0ec3c8fa4e7375632bdffe to your computer and use it in GitHub Desktop.
Save mwhitaker/c79cef60fa0ec3c8fa4e7375632bdffe to your computer and use it in GitHub Desktop.
test
license: none
height:
scrolling: no
border: yes
figure() %>% ly_points(1:10)
<!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="564c43a820fc48deb0a1dbd40ecc3657" class="plotdiv"></div>
<script type="text/javascript">
Bokeh.$(function() {
var modelid = "5f4bbcbb9a8d1d2569b1457065983544";
var elementid = "564c43a820fc48deb0a1dbd40ecc3657";
var docid = "63f4ccb74613251fd847f64f05df7eba";
var docs_json = {"63f4ccb74613251fd847f64f05df7eba":{"version":"0.11.1","title":"Bokeh Figure","roots":{"root_ids":["5f4bbcbb9a8d1d2569b1457065983544"],"references":[{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","attributes":{"title":null,"id":"5f4bbcbb9a8d1d2569b1457065983544","plot_width":[],"plot_height":[],"x_range":{"type":"Range1d","id":"7397aba6e68cba7d3652102c7d30697e"},"y_range":{"type":"Range1d","id":"32d568ad33e8feace320d3e3cb6d5516"},"left":[{"type":"LinearAxis","id":"3d8604634486002d9001587c3199cb19"}],"below":[{"type":"LinearAxis","id":"b2721d9b8357f625f062aaeec1eec5c4"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"3eccc1e5d36324b156f789ba947979e4"},{"type":"GlyphRenderer","id":"1df70d3800cc88f93d3afb8c3163e41c"},{"type":"LinearAxis","id":"b2721d9b8357f625f062aaeec1eec5c4"},{"type":"Grid","id":"a277cfb6cd0fc7a8d775e151d62d6a94"},{"type":"LinearAxis","id":"3d8604634486002d9001587c3199cb19"},{"type":"Grid","id":"3aed3c36c113a3ecf8d52171f6a6100c"}],"tools":[{"type":"PanTool","id":"a6f3101e4330e5b83e0e86ed18fa4c6d"},{"type":"WheelZoomTool","id":"3cff46ad9f3da0ba9892706f9a4837ef"},{"type":"BoxZoomTool","id":"8d90f75183edbbc9b9c356fcc01e709c"},{"type":"ResizeTool","id":"b109c631b4eb0df1675af351c554a49d"},{"type":"ResetTool","id":"c984ce5927271b56f680524c7551670b"},{"type":"PreviewSaveTool","id":"d1b83015d5fabe5d5dd88977bc433b5d"},{"type":"HelpTool","id":"432f2085bbc9cd6ac2895ac67658571b"}],"tool_events":{"type":"ToolEvents","id":"1715ac1cc63c8c6425f8c2abb41f23e7"},"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":"a6f3101e4330e5b83e0e86ed18fa4c6d","attributes":{"id":"a6f3101e4330e5b83e0e86ed18fa4c6d","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"ToolEvents","id":"1715ac1cc63c8c6425f8c2abb41f23e7","attributes":{"id":"1715ac1cc63c8c6425f8c2abb41f23e7","tags":[],"doc":null},"geometries":[]},{"type":"WheelZoomTool","id":"3cff46ad9f3da0ba9892706f9a4837ef","attributes":{"id":"3cff46ad9f3da0ba9892706f9a4837ef","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"BoxAnnotation","id":"3eccc1e5d36324b156f789ba947979e4","attributes":{"id":"3eccc1e5d36324b156f789ba947979e4","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":"8d90f75183edbbc9b9c356fcc01e709c","attributes":{"id":"8d90f75183edbbc9b9c356fcc01e709c","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"3eccc1e5d36324b156f789ba947979e4"}}},{"type":"ResizeTool","id":"b109c631b4eb0df1675af351c554a49d","attributes":{"id":"b109c631b4eb0df1675af351c554a49d","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"}}},{"type":"ResetTool","id":"c984ce5927271b56f680524c7551670b","attributes":{"id":"c984ce5927271b56f680524c7551670b","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"}}},{"type":"PreviewSaveTool","id":"d1b83015d5fabe5d5dd88977bc433b5d","attributes":{"id":"d1b83015d5fabe5d5dd88977bc433b5d","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"}}},{"type":"HelpTool","id":"432f2085bbc9cd6ac2895ac67658571b","attributes":{"id":"432f2085bbc9cd6ac2895ac67658571b","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"redirect":["http://hafen.github.io/rbokeh"],"help_tooltip":["Click to learn more about rbokeh."]}},{"type":"ColumnDataSource","id":"051ca8f13f2a29f9c2ea54a6e8e1f715","attributes":{"id":"051ca8f13f2a29f9c2ea54a6e8e1f715","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":"5a9ac533c2971bac8e566f14aea7a474","attributes":{"id":"5a9ac533c2971bac8e566f14aea7a474","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":"271e48b32012ef81fb99c1f2c35d5b51","attributes":{"id":"271e48b32012ef81fb99c1f2c35d5b51","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":"05cd8b982a6eabda8ef319136a4ff7db","attributes":{"id":"05cd8b982a6eabda8ef319136a4ff7db","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":"1df70d3800cc88f93d3afb8c3163e41c","attributes":{"id":"1df70d3800cc88f93d3afb8c3163e41c","tags":[],"doc":null,"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"271e48b32012ef81fb99c1f2c35d5b51"},"hover_glyph":{"type":"Circle","id":"05cd8b982a6eabda8ef319136a4ff7db"},"server_data_source":null,"name":null,"data_source":{"type":"ColumnDataSource","id":"051ca8f13f2a29f9c2ea54a6e8e1f715"},"glyph":{"type":"Circle","id":"5a9ac533c2971bac8e566f14aea7a474"}}},{"type":"Range1d","id":"7397aba6e68cba7d3652102c7d30697e","attributes":{"id":"7397aba6e68cba7d3652102c7d30697e","tags":[],"doc":null,"start":0.37,"end":10.63}},{"type":"Range1d","id":"32d568ad33e8feace320d3e3cb6d5516","attributes":{"id":"32d568ad33e8feace320d3e3cb6d5516","tags":[],"doc":null,"start":0.37,"end":10.63}},{"type":"LinearAxis","id":"b2721d9b8357f625f062aaeec1eec5c4","attributes":{"id":"b2721d9b8357f625f062aaeec1eec5c4","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"axis_label":"index","formatter":{"type":"BasicTickFormatter","id":"2e8eb86eb6a2ccb3ac48967c264e6711"},"ticker":{"type":"BasicTicker","id":"98f9726843650be13085e830709a62e7"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"2e8eb86eb6a2ccb3ac48967c264e6711","attributes":{"id":"2e8eb86eb6a2ccb3ac48967c264e6711","tags":[],"doc":null}},{"type":"BasicTicker","id":"98f9726843650be13085e830709a62e7","attributes":{"id":"98f9726843650be13085e830709a62e7","tags":[],"doc":null,"num_minor_ticks":5}},{"type":"Grid","id":"a277cfb6cd0fc7a8d775e151d62d6a94","attributes":{"id":"a277cfb6cd0fc7a8d775e151d62d6a94","tags":[],"doc":null,"dimension":0,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"98f9726843650be13085e830709a62e7"}}},{"type":"LinearAxis","id":"3d8604634486002d9001587c3199cb19","attributes":{"id":"3d8604634486002d9001587c3199cb19","tags":[],"doc":null,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"axis_label":"1:10","formatter":{"type":"BasicTickFormatter","id":"142c1a2d0c6ac24cb19b7e705a2cac88"},"ticker":{"type":"BasicTicker","id":"068094e65cf42288f2470dd290ad567e"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"142c1a2d0c6ac24cb19b7e705a2cac88","attributes":{"id":"142c1a2d0c6ac24cb19b7e705a2cac88","tags":[],"doc":null}},{"type":"BasicTicker","id":"068094e65cf42288f2470dd290ad567e","attributes":{"id":"068094e65cf42288f2470dd290ad567e","tags":[],"doc":null,"num_minor_ticks":5}},{"type":"Grid","id":"3aed3c36c113a3ecf8d52171f6a6100c","attributes":{"id":"3aed3c36c113a3ecf8d52171f6a6100c","tags":[],"doc":null,"dimension":1,"plot":{"type":"Plot","id":"5f4bbcbb9a8d1d2569b1457065983544","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"068094e65cf42288f2470dd290ad567e"}}}]}}};
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