Update: version 1.16 has been released since this was posted.
Dash 1.8.0 is a minor release improving dcc.Graph
responsiveness on page and parent element resize and adds markdown support to the DataTable
.
Changelog
Dash v1.8.0
Highlights
- Update to Plotly.js 1.52.1, Plotly.js 1.52.0, Plotly.js 1.51.3
- Improved
dcc.Graph
responsiveness - Table markdowns
- Various bug fixes for the DataTable and Dash
Previous Releases
Delving Deeper
Graph Responsiveness
The Plotly.js library allows the container to be resize on window resize but does not react to parent element resize, which can lead to some undesired behavior. To help usability, in addition to using the figure.layout.autosize
and config.responsive
flags in Plotly, it is now possible to override thedcc.Graph
behavior by passing responsive=False|True|'auto'(default)
.
- If
responsive=True
: will be responsive to both window and parent resize and will override any default behavior from config/figure - If `responsive=False: will be not be responsive even if it could have been.
- If
responsive='auto'
(default): will be responsive on both window and parent resize if it would otherwise have been responsive on page resize, will not be responsive otherwise.
Table Markdowns
The table now has a new presentation='markdown'
option on columns that can be used with type='text'
. The table will parse the text as markdown and display the result.
import dash
from dash_html_components import Div
from dash_table import DataTable
app = dash.Dash(__name__)
data=[
dict(a=''' ```javascript
return 20;
```
'''), # need to dedent the ``` for actual usage
dict(a='''An image\n
![Plotly](https://global.discourse-cdn.com/flex020/uploads/plot/original/2X/7/7957b51729ad7fd9472879cd620b9b068d7105bb.png)'''),
dict(a='''
_italics_\n
**bold**\n
~~strikethrough~~
'''),
dict(a='''Nested table
Statement | Is it true?
--- | ---
This page has two tables | yes
This table has two rows | no
This is an example of tableception | yes
'''),
dict(a='[Dash documentation](https://dash.plot.ly)')
]
app.layout = Div([
DataTable(
columns=[
dict(name='a', id='a', type='text', presentation='markdown'),
],
css=[
dict(selector='img[alt=Plotly]', rule='height: 50px;')
],
data=data
),
])
app.run_server(debug=True)