I'm trying to show a table of strings using Bokeh (I'm already using bokeh plots within a vplot+tabs, and wanted a table of data also in the vplot).
My strings are multiline via having '\n' characters, but when attempting to display these within a Bokeh DataTable the line breaks are stripped. Any way to avoid this?
Example code in a jupyter python3 notebook:
import bokeh
from bokeh.plotting import figure, output_notebook, show, vplot
from bokeh.io import output_file, show, vform
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import DataTable, StringFormatter, TableColumn
output_notebook()
table_data = ColumnDataSource(dict(strings=['[ -1.23456, \n \
7.89012, \n \
3.456789 \n \
]', \
'[ -1.23456, \n \
7.89012, \n \
3.456789 \n \
]']
))
columns = [TableColumn(field="strings", title="Strings", formatter=StringFormatter(text_color='#BB0000')) ]
tableplot = DataTable(source=table_data, columns=columns)
show(vform(tableplot))
(note: this example code is also at https://github.com/seltzered/Bokeh-multiline-datatable-demo
Environment: Python 3.5, Jupyter 1.0 / Notebook 4.1.0, bokeh 0.11.1
Small update: not solved yet, but realized that the web layout for the table/slickgrid seems to set hard height values (of 25px/line) and offsets for later rows, so I'm thinking this is an expected limitation.