Skip to content

Instantly share code, notes, and snippets.

@Fazendaaa
Created February 10, 2022 19:35
Show Gist options
  • Save Fazendaaa/a491753b5a26984330d249210a42143c to your computer and use it in GitHub Desktop.
Save Fazendaaa/a491753b5a26984330d249210a42143c 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.12.5.min.js'></script>
<link href='https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css' rel='stylesheet'>
</head>
<body>
<div class='bk-root' class='plotdiv' style=' width: 500px; height: 500px;'>
<div id='2780bc79a818d609636b2d03804ebaa6' class='plotdiv'></div>
<div>
<script type='text/javascript'>
Bokeh.$(function() {
var modelid = 'e79b97dd4e8361910e643ba09260b97a';
var elementid = '2780bc79a818d609636b2d03804ebaa6';
var docid = '329b6aab3b1ff20031d51407193187c4';
var docs_json = {"329b6aab3b1ff20031d51407193187c4":{"version":"0.12.5","title":"Bokeh Figure","roots":{"root_ids":["e79b97dd4e8361910e643ba09260b97a"],"references":[{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","attributes":{"id":"e79b97dd4e8361910e643ba09260b97a","plot_width":500,"plot_height":500,"sizing_mode":"scale_both","x_range":{"type":"Range1d","id":"47dcf9d5a32e0204dfc5e3a2a497ac5e"},"y_range":{"type":"Range1d","id":"b0e32cb95bd5228da75d461b59b8b7ca"},"left":[{"type":"LinearAxis","id":"ad08b48ae6910a2e3545c9648546852a"}],"below":[{"type":"LinearAxis","id":"d0a6325f2161fbae622f7e2fa9510ccd"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"c775f7a08bd148b8044a2ea9faf95db9"},{"type":"GlyphRenderer","id":"1c56a468c3c1e278d54c16330e0170e0"},{"type":"LinearAxis","id":"d0a6325f2161fbae622f7e2fa9510ccd"},{"type":"Grid","id":"41c266890d42b9b8bb6fe786e8b4e420"},{"type":"LinearAxis","id":"ad08b48ae6910a2e3545c9648546852a"},{"type":"Grid","id":"f7463f1de4c2f6a9e79f5398cd84a150"}],"extra_y_ranges":{},"extra_x_ranges":{},"tags":[],"min_border_left":4,"min_border_right":4,"min_border_top":4,"min_border_bottom":4,"lod_threshold":null,"toolbar":{"type":"Toolbar","id":"e916e10a3a4718e780edb77a2c29673e"},"tool_events":{"type":"ToolEvents","id":"e9fbbdca57c7bc36fe78e1c346bb8845"}},"subtype":"Figure"},{"type":"Toolbar","id":"e916e10a3a4718e780edb77a2c29673e","attributes":{"id":"e916e10a3a4718e780edb77a2c29673e","tags":[],"active_drag":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"type":"PanTool","id":"def3a63fcf293d798c22e43b9ec4c1a7"},{"type":"WheelZoomTool","id":"db1ddacb262dcb99acd420d1bdc6b89e"},{"type":"BoxZoomTool","id":"ffb4a1662d28fc09ed8373a50bb09fe4"},{"type":"ResetTool","id":"bd2dae1811c2b7bf65a1a85b3130332e"},{"type":"SaveTool","id":"2cabf3af8c790f88fb813cf9ec02edaa"},{"type":"HelpTool","id":"9ee38aae45737ab1cbca86a0191b8324"}],"logo":null}},{"type":"PanTool","id":"def3a63fcf293d798c22e43b9ec4c1a7","attributes":{"id":"def3a63fcf293d798c22e43b9ec4c1a7","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"dimensions":"both"}},{"type":"ToolEvents","id":"e9fbbdca57c7bc36fe78e1c346bb8845","attributes":{"id":"e9fbbdca57c7bc36fe78e1c346bb8845","tags":[]},"geometries":[]},{"type":"WheelZoomTool","id":"db1ddacb262dcb99acd420d1bdc6b89e","attributes":{"id":"db1ddacb262dcb99acd420d1bdc6b89e","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"dimensions":"both"}},{"type":"BoxAnnotation","id":"c775f7a08bd148b8044a2ea9faf95db9","attributes":{"id":"c775f7a08bd148b8044a2ea9faf95db9","tags":[],"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":"ffb4a1662d28fc09ed8373a50bb09fe4","attributes":{"id":"ffb4a1662d28fc09ed8373a50bb09fe4","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"c775f7a08bd148b8044a2ea9faf95db9"}}},{"type":"ResetTool","id":"bd2dae1811c2b7bf65a1a85b3130332e","attributes":{"id":"bd2dae1811c2b7bf65a1a85b3130332e","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"}}},{"type":"SaveTool","id":"2cabf3af8c790f88fb813cf9ec02edaa","attributes":{"id":"2cabf3af8c790f88fb813cf9ec02edaa","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"}}},{"type":"HelpTool","id":"9ee38aae45737ab1cbca86a0191b8324","attributes":{"id":"9ee38aae45737ab1cbca86a0191b8324","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"redirect":"https://hafen.github.io/rbokeh/","help_tooltip":"Click to learn more about rbokeh."}},{"type":"ColumnDataSource","id":"17edc6d4a7b50c0f90c21911394bff07","attributes":{"id":"17edc6d4a7b50c0f90c21911394bff07","tags":[],"column_names":["x","y"],"selected":[],"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":"77802d6ab049dde6225d911f422e3d8e","attributes":{"id":"77802d6ab049dde6225d911f422e3d8e","tags":[],"size":{"units":"screen","value":10},"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":"264a257b980b6fd7a4116d1923b7eaf2","attributes":{"id":"264a257b980b6fd7a4116d1923b7eaf2","tags":[],"size":{"units":"screen","value":10},"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":"d628cee1d9b3287f3100839316a31812","attributes":{"id":"d628cee1d9b3287f3100839316a31812","tags":[],"size":{"units":"screen","value":10},"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":"1c56a468c3c1e278d54c16330e0170e0","attributes":{"id":"1c56a468c3c1e278d54c16330e0170e0","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"264a257b980b6fd7a4116d1923b7eaf2"},"hover_glyph":{"type":"Circle","id":"d628cee1d9b3287f3100839316a31812"},"name":null,"data_source":{"type":"ColumnDataSource","id":"17edc6d4a7b50c0f90c21911394bff07"},"glyph":{"type":"Circle","id":"77802d6ab049dde6225d911f422e3d8e"}}},{"type":"Range1d","id":"47dcf9d5a32e0204dfc5e3a2a497ac5e","attributes":{"id":"47dcf9d5a32e0204dfc5e3a2a497ac5e","tags":[],"start":0.37,"end":10.63}},{"type":"Range1d","id":"b0e32cb95bd5228da75d461b59b8b7ca","attributes":{"id":"b0e32cb95bd5228da75d461b59b8b7ca","tags":[],"start":0.37,"end":10.63}},{"type":"LinearAxis","id":"d0a6325f2161fbae622f7e2fa9510ccd","attributes":{"id":"d0a6325f2161fbae622f7e2fa9510ccd","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"axis_label":"index","formatter":{"type":"BasicTickFormatter","id":"a012fe809a496a3117130dfc61d7f6e7"},"ticker":{"type":"BasicTicker","id":"4f79b132d9208b7f5ba5936322387b9c"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"a012fe809a496a3117130dfc61d7f6e7","attributes":{"id":"a012fe809a496a3117130dfc61d7f6e7","tags":[]}},{"type":"BasicTicker","id":"4f79b132d9208b7f5ba5936322387b9c","attributes":{"id":"4f79b132d9208b7f5ba5936322387b9c","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"41c266890d42b9b8bb6fe786e8b4e420","attributes":{"id":"41c266890d42b9b8bb6fe786e8b4e420","tags":[],"dimension":0,"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"4f79b132d9208b7f5ba5936322387b9c"}}},{"type":"LinearAxis","id":"ad08b48ae6910a2e3545c9648546852a","attributes":{"id":"ad08b48ae6910a2e3545c9648546852a","tags":[],"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"axis_label":"1:10","formatter":{"type":"BasicTickFormatter","id":"d5d00adf56a51bf09710414632cc355a"},"ticker":{"type":"BasicTicker","id":"3338bf38c7c46334c9029d343b47b43e"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"d5d00adf56a51bf09710414632cc355a","attributes":{"id":"d5d00adf56a51bf09710414632cc355a","tags":[]}},{"type":"BasicTicker","id":"3338bf38c7c46334c9029d343b47b43e","attributes":{"id":"3338bf38c7c46334c9029d343b47b43e","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"f7463f1de4c2f6a9e79f5398cd84a150","attributes":{"id":"f7463f1de4c2f6a9e79f5398cd84a150","tags":[],"dimension":1,"plot":{"type":"Plot","id":"e79b97dd4e8361910e643ba09260b97a","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"3338bf38c7c46334c9029d343b47b43e"}}}]}}};
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