Changed
-
#1876 Delays finalizing
Dash.config
attributes not used in the constructor untilinit_app()
. -
#1869, #1873 Upgrade Plotly.js to v2.8.3. This includes:
- Feature release 2.5.0:
- 3D traces are now compatible with
no-unsafe-eval
CSP rules.
- 3D traces are now compatible with
- Feature release 2.6.0:
- Add
smith
subplots andscattersmith
traces, for drawing Smith charts.
- Add
- Feature release 2.7.0:
- Add text data for
histogram
traces. - Fix an interaction between
uirevision
andautorange
that pops up in some cases of mixed clientside / serverside figure generation.
- Add text data for
- Feature release 2.8.0:
- Add horizontal colorbars.
- Add text data on
heatmap
and related trace types. - Control legend group title fonts.
- Patch releases 2.5.1, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.8.1, 2.8.2, and 2.8.3 containing bugfixes.
- This PR also upgrades various other dependencies of dash renderer and component suites.
- Feature release 2.5.0:
-
#1745:
Improve ourextras_require
: there are now five options here, each with a well-defined role:dash[dev]
: for developing and building dash components.dash[testing]
: for using thepytest
plugins in thedash.testing
moduledash[diskcache]
: required if you useDiskcacheLongCallbackManager
dash[celery]
: required if you useCeleryLongCallbackManager
dash[ci]
: mainly for internal use, these are additional requirements for the Dash CI tests, exposed for other component libraries to use a matching configuration.
Added
-
#1883 in DataTable added
page_current
topersisted_props
as requested in #1860 -
Dash and Dash Renderer
Input
,State
, andOutput
now accept components instead of ID strings and Dashcallback
will auto-generate the component's ID under-the-hood if not supplied. This allows usage like:
my_input = dcc.Input() my_output = html.Div() app.layout = html.Div([my_input, my_output]) @dash.callback(Output(my_output, 'children'), Input(my_input, 'value')) def update(value): return f'You have entered {value}'
Or, if using Python >=3.8 you can use the
:=
walrus operator:app.layout = html.Div([ my_input := dcc.Input(), my_output := html.Div() ]) @dash.callback(Output(my_output, 'children'), Input(my_input, 'value')) def update(value): return f'You have entered {value}'
#1894 restricted this feature so auto-generated IDs are not allowed if the app uses
dash_snapshots
(a Dash Enterprise package) or if the component usespersistence
, as this can create confusing errors. Callback definitions can still reference components in these cases, but those components must have explicit IDs.Dash Core Components
Rearranged Keyword Arguments & Flexible Types
Dropdown
,RadioItem
, andChecklist
- Rearranged Keyword Arguments -
options
&value
are now the first two keywords which means they can be supplied as positional arguments without the keyword. Supplying the keywords (options=
andvalue=
) is still supported. - Flexible Types -
options
can be supplied in two new forms:- An array of
string|number|bool
wherelabel
andvalue
are equal to the items in the list. - A dictionary where the keys and values set as
value
andlabel
respectively.
- An array of
Before:
dcc.Dropdown( options=[ {'label': 'New York', 'value': 'New York'}, {'label': 'Montreal', 'value': 'Montreal'}, ], value='New York' )
or
dcc.Dropdown( options=[ {'label': 'New York', 'value': 'NYC'}, {'label': 'Montreal', 'value': 'MTL'}, ], value='New York' )
After:
dcc.Dropdown(['New York', 'Montreal'], 'New York')
Or
dcc.Dropdown({'NYC': 'New York', 'MTL': 'Montreal'}, 'New York')
RangeSlider
&Slider
- Rearranged Keyword Arugments -
min
,max
, andstep
are now the first three keyword arguments which means they can be supplied as positional arguments without the keyword. - Flexible Types
step
will be calculated implicitly if not given.marks
will be auto generated if not given. It will usemin
andmax
and will respectstep
if supplied. Auto generated marks labels are SI unit formatted. Around 5 human-readable marks will be created.- To remove the Slider's marks, set
marks=None
.
Before:
dcc.Slider(marks={1: 2, 2: 2, 3: 3})
After:
dcc.Slider(min=1, max=3, step=1)
Or equivalently:
dcc.Slider(1, 3, 1)
Step can also be omitted and the
Slider
will attempt to create a nice, human readable step with SI units and around 5 marks:dcc.Slider(0, 100)
The SI units and ranges supported in
marks
are:µ
- micro, 10⁻⁶m
- milli, 10⁻³
(none) - 10⁰k
- kilo, 10³M
- mega, 10⁶G
- giga, 10⁹T
- tera, 10¹²P
- peta, 10¹⁵E
- exa, 10¹⁸
Ranges below 10µ are not supported by the Slider. This is a bug: #1766
DataTable
- Rearranged Keyword Arguments -
data
andcolumns
the first twokeyword arguments which means they can be supplied as positional arguments without the keyword. - Inferred Properties - If
columns
isn't supplied then it is extracted from the the first row indata
Before:
dash_table.DataTable(data=df.to_dict('records'), columns=[{'name': i, 'id': i} for i in df.columns])
After:
dash_table.DataTable(data=df.to_dict('records'))
New Component Properties
Checklist
&RadioItems
- A new property
inline
appendsdisplay: inline-block
tolabelStyle
.
dcc.Checklist(inline=True)
Fixed
-
#1879 Delete redundancy in pattern-matching callback implementation, specifically when
ALL
andMATCH
wildcards are used together. This patch was submitted by an anonymous Dash Enterprise customer. Many thanks! -
#1858 Support
mini-css-extract-plugin
Webpack plugin with@plotly/webpack-dash-dynamic-import
node package - used by components to support dash async chunks. Updated dependencies of other@plotly
node packages. -
#1836 Fix
__all__
in dcc and table for extras: dcc download helpers and table format helpers. This also restores this functionality to the obsolete top-level packagesdash_core_components
anddash_table
. -
#1822 Remove Radium from renderer dependencies, as part of investigating React 17 support.
-
- Clean up our handling of serialization problems, including fixing
orjson
for Python 3.6 - Added the ability for
dash.testing
percy_snapshot
methods to choose widths to generate.
- Clean up our handling of serialization problems, including fixing
-
#1778 DataTable: Fix React warnings stating
that each child in a list should have a unique "key" prop -
#1895 Support debug=True if native namespace-packages are present