Skip to content

Instantly share code, notes, and snippets.

@Fazendaaa
Created February 10, 2022 20:04
Show Gist options
  • Save Fazendaaa/7feb941f197c65fbe09ef575eeb1dee5 to your computer and use it in GitHub Desktop.
Save Fazendaaa/7feb941f197c65fbe09ef575eeb1dee5 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='25e70f600bc10d2adfa66426aede31bc' class='plotdiv'></div>
<div>
<script type='text/javascript'>
Bokeh.$(function() {
var modelid = '5f015cbcc0c30948d995148e4430da8a';
var elementid = '25e70f600bc10d2adfa66426aede31bc';
var docid = '0b4e4b53173ee3d69b059f60e5f0cb89';
var docs_json = {"0b4e4b53173ee3d69b059f60e5f0cb89":{"version":"0.12.5","title":"Bokeh Figure","roots":{"root_ids":["5f015cbcc0c30948d995148e4430da8a"],"references":[{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","attributes":{"id":"5f015cbcc0c30948d995148e4430da8a","plot_width":500,"plot_height":500,"sizing_mode":"scale_both","x_range":{"type":"Range1d","id":"9e617cff10007664488a00dbbbe45b7e"},"y_range":{"type":"Range1d","id":"22a7d37bd1bfa455ffcd4b6e5f61ac59"},"left":[{"type":"LinearAxis","id":"d50031f4bed06fac92d87c27858f4445"}],"below":[{"type":"LinearAxis","id":"ce4e1330ef999a395c13a9cdc2cd9cc9"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"a635c5c6c8b1941c0d8d7b1c0a84e2b6"},{"type":"GlyphRenderer","id":"91b11128001f96ab7ac8e2062c16ae59"},{"type":"LinearAxis","id":"ce4e1330ef999a395c13a9cdc2cd9cc9"},{"type":"Grid","id":"7c3961dc1dc597a57759e7cb21a15ad5"},{"type":"LinearAxis","id":"d50031f4bed06fac92d87c27858f4445"},{"type":"Grid","id":"a297deeec2812f61c1597a063fd01afc"}],"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":"b1ac9bec7f99bb26695edd068a7df9b6"},"tool_events":{"type":"ToolEvents","id":"457199a089303d46d709df338cafad7e"}},"subtype":"Figure"},{"type":"Toolbar","id":"b1ac9bec7f99bb26695edd068a7df9b6","attributes":{"id":"b1ac9bec7f99bb26695edd068a7df9b6","tags":[],"active_drag":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"type":"PanTool","id":"a1655c3c38b2bc9e7906fc680abcec3f"},{"type":"WheelZoomTool","id":"e46672d623296878f6a1af91fff79644"},{"type":"BoxZoomTool","id":"ab5c2fcffb37924a473490781edb67c3"},{"type":"ResetTool","id":"b8237aaf262aad33927263ff58d3d188"},{"type":"SaveTool","id":"0dfaca30c49a56a6559323d93fedcc80"},{"type":"HelpTool","id":"05d8adb350c3d386a1374ab69161c114"}],"logo":null}},{"type":"PanTool","id":"a1655c3c38b2bc9e7906fc680abcec3f","attributes":{"id":"a1655c3c38b2bc9e7906fc680abcec3f","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"dimensions":"both"}},{"type":"ToolEvents","id":"457199a089303d46d709df338cafad7e","attributes":{"id":"457199a089303d46d709df338cafad7e","tags":[]},"geometries":[]},{"type":"WheelZoomTool","id":"e46672d623296878f6a1af91fff79644","attributes":{"id":"e46672d623296878f6a1af91fff79644","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"dimensions":"both"}},{"type":"BoxAnnotation","id":"a635c5c6c8b1941c0d8d7b1c0a84e2b6","attributes":{"id":"a635c5c6c8b1941c0d8d7b1c0a84e2b6","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":"ab5c2fcffb37924a473490781edb67c3","attributes":{"id":"ab5c2fcffb37924a473490781edb67c3","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"a635c5c6c8b1941c0d8d7b1c0a84e2b6"}}},{"type":"ResetTool","id":"b8237aaf262aad33927263ff58d3d188","attributes":{"id":"b8237aaf262aad33927263ff58d3d188","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"}}},{"type":"SaveTool","id":"0dfaca30c49a56a6559323d93fedcc80","attributes":{"id":"0dfaca30c49a56a6559323d93fedcc80","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"}}},{"type":"HelpTool","id":"05d8adb350c3d386a1374ab69161c114","attributes":{"id":"05d8adb350c3d386a1374ab69161c114","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"redirect":"https://hafen.github.io/rbokeh/","help_tooltip":"Click to learn more about rbokeh."}},{"type":"ColumnDataSource","id":"6bb63b88335fde3d6229ffd9bdf25f50","attributes":{"id":"6bb63b88335fde3d6229ffd9bdf25f50","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":"3e0951506fd10ffdb883967690b49c72","attributes":{"id":"3e0951506fd10ffdb883967690b49c72","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":"76e1142d8e76fa2f7b8da108526b57fc","attributes":{"id":"76e1142d8e76fa2f7b8da108526b57fc","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":"aedb3808b75549d1c510e9399f8c1602","attributes":{"id":"aedb3808b75549d1c510e9399f8c1602","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":"91b11128001f96ab7ac8e2062c16ae59","attributes":{"id":"91b11128001f96ab7ac8e2062c16ae59","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"76e1142d8e76fa2f7b8da108526b57fc"},"hover_glyph":{"type":"Circle","id":"aedb3808b75549d1c510e9399f8c1602"},"name":null,"data_source":{"type":"ColumnDataSource","id":"6bb63b88335fde3d6229ffd9bdf25f50"},"glyph":{"type":"Circle","id":"3e0951506fd10ffdb883967690b49c72"}}},{"type":"Range1d","id":"9e617cff10007664488a00dbbbe45b7e","attributes":{"id":"9e617cff10007664488a00dbbbe45b7e","tags":[],"start":0.37,"end":10.63}},{"type":"Range1d","id":"22a7d37bd1bfa455ffcd4b6e5f61ac59","attributes":{"id":"22a7d37bd1bfa455ffcd4b6e5f61ac59","tags":[],"start":0.37,"end":10.63}},{"type":"LinearAxis","id":"ce4e1330ef999a395c13a9cdc2cd9cc9","attributes":{"id":"ce4e1330ef999a395c13a9cdc2cd9cc9","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"axis_label":"index","formatter":{"type":"BasicTickFormatter","id":"6751ebcf5d0218710889aba6d8bbe3b4"},"ticker":{"type":"BasicTicker","id":"bff067787861de9953ee46d469666ff1"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"6751ebcf5d0218710889aba6d8bbe3b4","attributes":{"id":"6751ebcf5d0218710889aba6d8bbe3b4","tags":[]}},{"type":"BasicTicker","id":"bff067787861de9953ee46d469666ff1","attributes":{"id":"bff067787861de9953ee46d469666ff1","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"7c3961dc1dc597a57759e7cb21a15ad5","attributes":{"id":"7c3961dc1dc597a57759e7cb21a15ad5","tags":[],"dimension":0,"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"bff067787861de9953ee46d469666ff1"}}},{"type":"LinearAxis","id":"d50031f4bed06fac92d87c27858f4445","attributes":{"id":"d50031f4bed06fac92d87c27858f4445","tags":[],"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"axis_label":"1:10","formatter":{"type":"BasicTickFormatter","id":"16ddb3e4dc278a15d151ff384bfdad76"},"ticker":{"type":"BasicTicker","id":"8841db19bdf2bc638ab4d5284a6c250c"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"16ddb3e4dc278a15d151ff384bfdad76","attributes":{"id":"16ddb3e4dc278a15d151ff384bfdad76","tags":[]}},{"type":"BasicTicker","id":"8841db19bdf2bc638ab4d5284a6c250c","attributes":{"id":"8841db19bdf2bc638ab4d5284a6c250c","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"a297deeec2812f61c1597a063fd01afc","attributes":{"id":"a297deeec2812f61c1597a063fd01afc","tags":[],"dimension":1,"plot":{"type":"Plot","id":"5f015cbcc0c30948d995148e4430da8a","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"8841db19bdf2bc638ab4d5284a6c250c"}}}]}}};
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