I am trying to show a bokeh plot saved as html in a bootstrap popover, I think the JS doesn’t get executed, any ideas how to manage this?
Here’s how far I got:
serving the plot:
@main.route('/bokeh-plot', methods=['GET'])
def bokeh_plot():
return send_from_directory(app.config.get('PLOTS_PATH'), 'content.html', mimetype='text/html')
showing the plot:
<script>
function adjustPopover(popover, iframe) {
var height = iframe.contentWindow.document.body.scrollHeight + 'px',
popoverContent = $(popover).next('.popover-content');
iframe.style.height=height;
popoverContent.css('height', height);
}
$(document).ready(function(){
$('[data-toggle="popover2"]').popover({
trigger: 'hover',
html: true,
container: 'body',
content: function() {
return '<iframe src="bokeh-plot">'+
'</iframe>';
}
})
});
</script>

