Skip to content

Instantly share code, notes, and snippets.

@danielperezr88
Created August 26, 2016 11:30
Show Gist options
  • Save danielperezr88/90cd99575274f542cdb40ed0566fd0b0 to your computer and use it in GitHub Desktop.
Save danielperezr88/90cd99575274f542cdb40ed0566fd0b0 to your computer and use it in GitHub Desktop.
{#
Renders Bokeh models into a basic .html file.
:param title: value for ``<title>`` tags
:type title: str
:param plot_resources: typically the output of RESOURCES
:type plot_resources: str
:param plot_script: typically the output of PLOT_SCRIPT
:type plot_script: str
:param plot_div: typically the output of PLOT_DIV
:type plot_div: str
Users can customize the file output by providing their own Jinja2 template
that accepts these same parameters.
#}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ title if title else "Bokeh Plot" }}</title>
<script type="text/javascript">
window.setTimeout(function(){
but = document.getElementsByClassName("bk-tool-icon-reset");
but[0].click();
},3500);
function copyHeight(item, whom){
item.style.height = whom.clientHeight + ' px';
}
var timer = window.setTimeout(function(){console.log('Timer was just defined');},50);
</script>
{{ bokeh_css }}
{{ bokeh_js }}
<style>
html {
width: 100%;
height: 100%;
}
body {
width: 90%;
height: 100%;
margin: auto;
}
.bk-grid-row, .bk-grid-column {
min-height: 250px;
}
</style>
</head>
<body>
{{ plot_div|indent(8) }}
{{ plot_script|indent(8) }}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment