【发布时间】:2020-05-09 09:37:03
【问题描述】:
我正在创建散景图,并传递 html 代码 script, div = components(plot)
return render_template('results.html',the_div=div,the_script=script)
脚本和 div 已被传递到浏览器,但显示的不是绘图,而是 html 代码。
{% extends "bootstrap/base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block html_attribs %} lang="en" charset="utf-8"{% endblock %}
{% block title %} Results {% endblock %}
{% block metas %}
</mysite/static/favicon-96x96.png">
<link rel="stylesheet" href= "https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-2.0.2.min.js"
crossorigin="anonymous"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.2.min.js"
crossorigin="anonymous"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.2.min.js"
crossorigin="anonymous"></script>
{% endblock %}
{% block content %}
<div class="container">
{{ the_script }}
{{ the_div }}
</div>
有人能指出我哪里出错了吗? -我检查了我使用的散景版本是 2.0.2 我不熟悉 javascript,所以我假设它可能是一个简单的修复
【问题讨论】:
标签: javascript html rendering bokeh