Am Montag, 13. Februar 2017 16:01:48 UTC+1 schrieb Bryan Van de ven:
You need to also load the bokeh-widgets-0.12.4.min.[js|css] files for CDN in your template, as described here:
[http://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#components](http://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#components)
Bryan
On Feb 13, 2017, at 08:59, ‘Janis’ via Bokeh Discussion - Public bo...@continuum.io wrote:
I get the following error in my browser when I try to include tables in the bokeh layout using flask:
x
Bokeh Error
Model `StringFormatter’ does not exist. This could be due to a widget or a custom model not being registered before first usage
This is how I turn my pandas DataFrame into a bokeh table:
df = df_func()
df.reset_index(inplace=True)
df.rename(columns={“index”: “Typ”}, inplace=True)
source = ColumnDataSource(df)
table1_columns = [ TableColumn(field=“Typ”, title=“Typ”), TableColumn(field=“Betrag”, title=“Betrag”),
TableColumn(field="Trend", title="Trend") ]
table1 = DataTable(source=source, columns=initial_columns, width=500, height=280)
I then combine the table with two (working) plots into a single layout:
layout = vplot(row(plot1, plot2), row(table1))
script, div = components(layout, )
My HTML file looks like this:
<link rel="stylesheet" href="[http://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.css](http://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.css)" type="text/css" />
<script type="text/javascript" src="[http://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.js](http://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.js)"></script>
</head>
<body style = "background-color: #3b424f" >
<h1><color="whitesmoke">BokehTest</font></h1>
{{ div | safe }}
{{ script | safe }}
</body>
I also tried it with the {{ script | safe }} inside the .
I get the following three erros inside my browser (one at a time):
Model `DataTable’ does not exist (…)
or
Model `StringEditor’ does not exist. (…)
or
Model `StringFormatter’ does not exist. (…)
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7d831ed2-9582-4633-bbea-9d6f60d51089%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.