All notable changes to dash
will be documented in this file.
This project adheres to Semantic Versioning.
setProps
path, leading to hashes being incorrectdash-hooks
to underscored dash_hooks
. Fix #3272
dashChildrenUpdate = true
on the component, eg: Tabs.dashChildrenUpdate = true
className_*
props in dcc.Upload
component.dashRenderType
to determine why the component layout was changed (internal
, callback
, parent
, clientsideApi
):
dashRenderType
defined as a prop, and the dashRenderType = true
must be set on the component, eg (Div.dashRenderType = true
)-t
, --custom-typing-module
argument to dash-generate-components
CLI, default to dash_prop_typing
and can contains definitions in variables:
custom_imports: dict[ComponentName, list[str]]
import statement to be copied at the top of the component class definition.custom_props: dict[ComponentName, dict[PropName, function]]
for custom props. The function signature is: def generate_type(type_info, component_name, prop_name) -> str
PropType
generation for Typescript components allowing runtime prop validation when in debug mode.entry_points
with key dash-hooks
to their setup.py
for a module to be run when a Dash app is started.dash.hooks
methods to hook into Dash apps.
hooks.layout
takes the layout as argument and must return a layout, can be used to wrap or add to the layout of Dash apps.hooks.callback
defines a callback to be added to Dash apps.hooks.clientside_callback
defines a clientside callback to be added to Dash apps.hooks.setup
is called before a Dash app is started to get an instance of the app as first argument.hooks.error
to receive all callback errors.hooks.index
to change the Dash.index_string
.hooks.route
to add a Flask route to the Dash app.hooks.custom_data
to add custom data called from the callback route to the user callback.window.dash_component_api
for components developer as alternative to removed _dashprivate
props.
dash_component_api.useDashContext
, dash_component_api.DashContext
to access the redux store and loading mechanisms.
DashContext.componentPath
hold the path to the current component.DashContext.useLoading(options?)
selector to get a boolean if the component is loading.DashContext.isLoading
in case you need to use outside of a functional component.DashContext.useSelector
to create custom selectors for the connected redux store.DashContext.useStore
get the Dash app redux store.DashContext.useDispatch
to dispatch new actions on the Dash redux store.dash_component_api.getLayout(path)
to replace _dashprivate_layout
.stringifyId
in window.dash_component_api
. #3175
window.dash_component_api.ExternalWrapper
to render Dash components that are not part of the layout tree. #3170 #3183
loading_state
removed from components props.dash.development.component_loader
, components libraries now required to generate the components with dash-generate-components
.Dash.run_server
has been removed in favor of Dash.run
.dcc.LogoutButton
component.long
references to background
.dash_core_components
, dash_html_components
and dash_table
stub packages from dash
install requirements.defaultProps
on functional components now emits a deprecation warning.custom_data
hook.stringifyId
in window.dash_component_api
.ExternalWrapper
rendering children and support pattern matching ids.-t
, --custom-typing-module
argument to dash-generate-components
CLI, default to dash_prop_typing
and can contains definitions in variables:
custom_imports: dict[ComponentName, list[str]]
import statement to be copied at the top of the component class definition.custom_props: dict[ComponentName, dict[PropName, function]]
for custom props. The function signature is: def generate_type(type_info, component_name, prop_name) -> str
window.dash_component_api.ExternalWrapper
to render Dash components that are not part of the layout tree.__init__
.PropType
generation for Typescript components allowing runtime prop validation when in debug mode.window.dash_component_api
for components developer as alternative to removed _dashprivate
props.
dash_component_api.useDashContext
, dash_component_api.DashContext
to access the redux store and loading mechanisms.
DashContext.componentPath
hold the path to the current component.DashContext.useLoading(options?)
selector to get a boolean if the component is loading.DashContext.isLoading
in case you need to use outside of a functional component.DashContext.useSelector
to create custom selectors for the connected redux store.DashContext.useStore
get the Dash app redux store.DashContext.useDispatch
to dispatch new actions on the Dash redux store.dash_component_api.getLayout(path)
to replace _dashprivate_layout
.entry_points
with key dash-hooks
to their setup.py
for a module to be run when a Dash app is started.dash.hooks
methods to hook into Dash apps.
hooks.layout
takes the layout as argument and must return a layout, can be used to wrap or add to the layout of Dash apps.hooks.callback
defines a callback to be added to Dash apps.hooks.clientside_callback
defines a clientside callback to be added to Dash apps.hooks.setup
is called before a Dash app is started to get an instance of the app as first argument.hooks.error
to receive all callback errors.hooks.index
to change the Dash.index_string
.hooks.route
to add a Flask route to the Dash app.loading_state
removed from components props.dash.development.component_loader
, components libraries now required to generate the components with dash-generate-components
.Dash.run_server
has been removed in favor of Dash.run
.dcc.LogoutButton
component.long
references to background
.defaultProps
on functional components now emits a deprecation warning.merge_duplicate_header=True
. Fixes #2870
None
to array properties with exact
or shape
element types. Fixes #3010
metadata.json
files to reduce package size.run_server
, use run
instead.dcc.LogoutButton
, can be replaced with a html.Button
or html.A
. eg: html.A(href=os.getenv('DASH_LOGOUT_URL'))
on a Dash Enterprise instance.Dash.__init__
keywords:
plugins
keyword will be removed.long_callback_manager
keyword will be removed, can use background_callback_manager
instead.no_update
. Access to original callback context is preserved and set_props
works inside the error handler._allow_dynamic_callbacks
#2832 Add dash startup route setup on Dash init.
#2819 Add dash subcomponents receive additional parameters passed by the parent component. Fixes #2814.
#2826 When using Pages, allows for app.title
and (new) app.description
to be used as defaults for the page title and description. Fixes #2811.
#2795 Allow list of components to be passed as layout.
#2760 New additions to dcc.Loading resolving multiple issues:
delay_show
and delay_hide
props to prevent flickering during brief loading periods (similar to Dash Bootstrap Components dbc.Spinner)overlay_style
for styling the loading overlay, such as setting visibility and opacity for childrentarget_components
specifies components/props triggering the loading spinnercustom_spinner
enables using a custom component for loading messages instead of built-in spinnersdisplay
overrides the loading status with options for "show," "hide," or "auto"npm run first-build
dynamic_loading=True
to dash init.preloaded_libraries=[]
to dash init, included libraries names will be loaded on the index like before.setProps
to dash_clientside.clientSide_setProps
to allow for JS code to interact directly with the dash eco-system.mjs
ending as js modulestriggered_id
to dash_clientside.callback_context
. Fixes #2692
tooltip.template
a string for the format template, {value} will be formatted with the actual value.tooltip.style
a style object to give to the div of the tooltip.tooltip.transform
a reference to a function in the window.dccFunctions
namespace._dash_error
to setProps
, allowing component developers to send error without throwing in render. Usage props.setProps({_dash_error: new Error("custom error")})
_allow_dynamic_callbacks
for newly-added components.get_caller_name
in case the source is not available.__name__
to Dash constructor.routing_callback_inputs
allowing to pass more Input and/or State arguments to the pages routing callback_allow_dynamic_callbacks
, register new callbacks inside other callbacks.
WARNING: dynamic callback creation can be dangerous, use at you own risk. It is not intended for use in a production app, multi-user or multiprocess use as it only works for a single user.
moduleResolution
, fixes #2618
jupyter_mode
argument to app.run
, defaults to inline
and configurable via jupyter_dash.default_mode
.JupyterDash
to app.run
: jupyter_width
, jupyter_height
, jupyter_server_url
.<2.3
.<2.2.3
because we expect the Dash ecosystem to be incompatible with the next minor release of Flask (this excludes the current latest Flask release 2.3.x). We will raise the upper bound to <2.4
after we fix incompatibilities elsewhere in the Dash ecosystem.include_pages_meta=True
to Dash
constructor, and fix a security issue in pages meta tags #2536.#2533 and #2538 Update Plotly.js to v2.23.2 from v2.20.0.
legend
references to traces.label.texttemplate
to parametric shapes.#2538 Update JS dependencies in dcc, html, dash-table, dash-renderer, and dash
Location
objects are removed from the layout. Event handlers would not be removed and eventually change props of a random DOM element, fix #1346
Patch
objects by making Patch
objects picklableKeyError
"Callback function not found for output [...], , perhaps you forgot to prepend the '@'?" issue when using duplicate callbacks targeting the same output. This issue would occur when the app is restarted or when running with multiple gunicorn
workers.allow_duplicate
output with clientside callback, fix #2467
display: block
if inline
is false in RadioItems & Checklist components. To keep previous behavior, set inline=True
. This is already how it was described and worked in our documentation and other places with CSS stylesheets that set the default orientation of RadioItems and Checklist options to vertical (including Dash Design Kit), but for unstyled pages it is a breaking change.pathlib.path
for pages_folder
, to match assets_folder
use_pages=True
when you supply a custom pages_folder
pages_folder
that includes special charactersclear_pages_state
refresh="callback-nav"
in dcc.Location
. This allows for navigation without refreshing the page when url is updated in a callback.add_log_handler=True
to Dash init, if you don't want a log stream handler at all.REACT_VERSION=18.2.0
before running your app, or inside the app call dash._dash_renderer._set_react_version("18.2.0")
. THIS FEATURE IS EXPERIMENTAL. It has not been tested with component suites outside the Dash core, and we may add or remove available React versions in any future release.dash.Patch
for partial update Output props without transferring the previous value in a State.allow_duplicate
to Output
arguments allowing duplicate callbacks to target the same prop.dcc.Geolocation
componentdash[testing]
not installed, fix #946.backround=True
callbacks.dash.dash
, as library logger it should be on that namespace instead of the user app.disable_n_clicks=True
to the html.Div
components in page_container
.disable_n_clicks
prop to all html components to make it possible to remove onclick event listenersfavicon.ico
to the current Plotly logoplaceholder_text
property to filterOptions
for DataTable which allows overriding the default filter field placeholder.sankey
links, and editSelection
option to config.scatter
and scatter-like traces and increased control of automargin and legend sizingscattermapbox
traces and restricted bounds to mapbox
plots.pages_folder
is nested, or the 404 page is nested inside pages_folder
.before_first_request
as reported in #2177.flask-compress
dependency to new extras requires dash[compress]
plotly.js
from dcc.Graph
are properly sequenced even if React initiates multiple render cycles in quick succession.dash.page_registry
.suppress_callback_exceptions=True
the validation_layout
is not set.dash[testing]
is not installed.plotly_selected
event on plot API calls and GUI edits.sankey
select error (regression introduced in 2.13.0).sankey
traces to fix select error.dragmode
s when an existing selection is modified.maxHeight
to Dropdown options menu.background=False
to dash.callback
to use instead of app.long_callback
.app.long_callback
arguments to dash.callback
(interval
, running
, cancel
, progress
, progress_default
, cache_args_to_ignore
, manager
)search
prop to dcc.Dropdown
options, allowing to search the dropdown options with something other than the label or value.cell_selectable=False
..
were not excluded when building dash.page_registry
.not_found_404
page is incorrect in the dash.page_registry
when not using the pages
folder.React.FC
empty valueDeclaration error & support empty props components.dcc.Dropdown
search with component as prop for option label.dash.long_callback.managers.CeleryLongCallbackManager
, use dash.CeleryManager
instead.dash.long_callback.managers.DiskcacheLongCallbackManager
, use dash.DiskcacheManager
instead.long_callback_manager
in favor of background_callback_manager
.selections
, newselection
, and activeselection
, along with an updated UI allowing you to modify a selection you created.parcoords
traces.violin
traces.automargin
behavior.args_grouping
function.app = Dash(meta_tags=[{"name": "viewport"}])
path
to the pages_folder
was incorrect on Windows.args_grouping_values
property which was incompatible with pattern-matching callbacks.pages
- a better way to build multi-page apps. For more information see the forum post.
wait_for_class_to_equal
and wait_for_contains_class
methods to dash.testing
find_element
and find_elements
to accept an attribute
argument that aligns with Selenium's By
class, allowing you to search elements by other attributes. Default value is CSS_SELECTOR
to maintain backwards compatibility with previous find_elements
.dangerously_allow_html=True
+ mathjax=True
works in some cases, and in some cases not.dcc.Dropdown
with a value but no options.DASH_DEBUG
as environment variable gets ignored.dash[testing]
is not installed.#1952 Improved callback_context
dash.ctx
, a more concise name for dash.callback_context
ctx.triggered_prop_ids
, a dictionary of the component ids and props that triggered the callback.ctx.triggered_id
, the id
of the component that triggered the callback.ctx.args_grouping
, a dict of the inputs used with flexible callback signatures.#2009 Add support for Promises within Client-side callbacks as requested in #1364.
#1956 Add TypeScript components generation.
#2034 Add link_target
prop to dcc.Markdown component. Closes #1827
#2035 Add type annotations to testing fixtures.
#2029 Restrict the number of props listed explicitly in generated component constructors - default is 250. This prevents exceeding the Python 3.6 limit of 255 arguments. The omitted props are still in the docstring and can still be provided the same as before, they just won't appear in the signature so autocompletion may be affected.
#1968 Fix bug #1877, code which uses merge_duplicate_headers
and style_header_conditional
to highlight columns, it incorrectly highlights header cells.
#2015 Fix bug #1854 in which the combination of row_selectable="single or multi" and filter_action="native" caused the JS error.
#1976 Fix #1962 in which DatePickerSingle and DatePickerRange are extremely slow when provided a long list of disabled_days.
#2035 Fix #2033 In-App error reporting does not render HTML.
#1970 dcc.Dropdown Refactor fixes:
#1751 Rename app.run_server
to app.run
while preserving app.run_server
for backwards compatibility.
#1839 The callback
decorator returns the original function, not the wrapped function, so that you can still call these functions directly, for example in tests. Note that in this case there will be no callback context so not all callbacks can be tested this way.
#2016 Drop the 375px width from default percy_snapshot calls, keep only 1280px
#2027 Improve the error message when a user doesn't wrap children in a list
black
to v22.3.0 for Python 3.7+ - if you use dash[ci]
and you call black
, this may alter your code formatting slightly, including more consistently breaking Python 2 compatibility.dcc.Markdown
and dcc.Graph
. A new boolean prop mathjax
was added to these two components, defaulting to False
. Set mathjax=True
to enable math rendering. This work uses MathJax v3, although dcc.Graph
and Plotly.js can also be used with MathJax v2.
dcc.Markdown
this has two flavors: inline math is any content between single dollar signs, for example "$E=mc^2$"
, and "display" math (on its own line, potentially multi-line) is delimited by double dollar signs.dcc.Graph
, most text fields (graph and axis titles, trace names, scatter and bar text) can use math, and it's enabled with single dollar sign delimiters. A limitation here is that currently a given piece of text can only be one or the other: if math is found, everything outside the delimiters is ignored. See https://plotly.com/python/LaTeX/ for details.fillpattern
for scatter
traces with filled areaunsafe-eval
. Please note: the regl
-based traces (scattergl
, scatterpolargl
, parcoords
, and splom
) are only strict in the strict
bundle, which is NOT served by default in Dash. To use this bundle with Dash, you must either download it and put it in your assets/
folder, or include it as an external_script
from the CDN: https://cdn.plot.ly/plotly-strict-2.11.0.min.js. All other trace types are strict in the normal bundle.mesh3d
traces.#1915 Fix bug #1474 when both dcc.Graph and go.Figure have animation, and when the second animation in Figure is executed, the Frames from the first animation are played instead of the second one.
#1953 Fix bug #1783 in which a failed hot reloader blocks the UI with alerts.
#1942 Fix bug #1663 preventing pie traces from sending customdata
with clickData
and other events.
dash.get_relative_path
dash.strip_relative_path
dash.get_asset_url
This is similar to dash.callback
where you don't need the app
object. It makes it possible to use these
functions in the pages
folder of a multi-page app without running into the circular app
imports issue.#1911 Upgrade Plotly.js to v2.9.0 (from v2.8.3).
ticklabelstep
to axes to reduce tick labels while still showing all ticks./assets
vs the versions built into dcc
or ddk
.#1930 Upgrade JavaScript dependencies across renderer and all components.
#1876 Delays finalizing Dash.config
attributes not used in the constructor until init_app()
.
#1869, #1873 Upgrade Plotly.js to v2.8.3. This includes:
no-unsafe-eval
CSP rules.smith
subplots and scattersmith
traces, for drawing Smith charts.histogram
traces.uirevision
and autorange
that pops up in some cases of mixed clientside / serverside figure generation.heatmap
and related trace types.#1745:
Improve our extras_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 the pytest
plugins in the dash.testing
moduledash[diskcache]
: required if you use DiskcacheLongCallbackManager
dash[celery]
: required if you use CeleryLongCallbackManager
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.#1883 in DataTable added page_current
to persisted_props
as requested in #1860
Input
, State
, and Output
now accept components instead of ID strings and Dash callback
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 uses persistence
, as this can create confusing errors. Callback definitions can still reference components in these cases, but those components must have explicit IDs.
Dropdown
, RadioItem
, and Checklist
options
& value
are now the first two keywords which means they can be supplied as positional arguments without the keyword. Supplying the keywords (options=
and value=
) is still supported.options
can be supplied in two new forms:
string|number|bool
where label
and value
are equal to the items in the list.value
and label
respectively.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
min
, max
, and step
are now the first three keyword arguments which means they can be supplied as positional arguments without the keyword.step
will be calculated implicitly if not given.marks
will be auto generated if not given. It will use min
and max
and will respect step
if supplied. Auto generated marks labels are SI unit formatted. Around 5 human-readable marks will be created.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: https://github.com/plotly/dash/issues/1766
DataTable
data
and columns
the first twokeyword arguments which means they can be supplied as positional arguments without the keyword.columns
isn't supplied then it is extracted from the the first row in data
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'))
Checklist
& RadioItems
inline
appends display: inline-block
to labelStyle
.dcc.Checklist(inline=True)
#1879 Delete redundancy in pattern-matching callback implementation, specifically when ALL
and MATCH
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 packages dash_core_components
and dash_table
.
#1822 Remove Radium from renderer dependencies, as part of investigating React 17 support.
orjson
for Python 3.6dash.testing
percy_snapshot
methods to choose widths to generate.#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
@app.long_callback
decorator to support callback functions that take a long time to run. See the PR and documentation for more information.orjson
package is installed.request_refresh_jwt
hook and retry requests that used expired JWT tokens.dash
, dash-core-components
, dash-html-components
, and dash-table
into a singular monorepo and move component packages into dash
. This change makes the component modules available for import within the dash
namespace, and simplifies the import pattern for a Dash app. From a development standpoint, all future changes to component modules will be made within the components
directory, and relevant packages updated with the dash-update-components
CLI command.compress
argument to the dash.Dash
constructor to False
. This change reduces CPU usage, and was made in recognition of the fact that many deployment platforms (e.g. Dash Enterprise) already apply their own compression. If deploying to an environment that does not already provide compression, the Dash 1 behavior may be restored by adding compress=True
to the dash.Dash
constructor.npm run build
script to simplify build process involving dash-renderer
and subcomponent libraries within dash
.dcc.Slider
and dcc.RangeSlider
where steps were not being set to marks if None was passed as the prop argument. Added a check to set the min and max based on the range of marks if they are not explicitly defined (for more info, see #1843 and #1851).#1729 Include F#, C#, and MATLAB in markdown code highlighting, for the upcoming .NET and MATLAB flavors of dash.
#1735 Upgrade Plotly.js to v2.4.2. This includes:
d3-format
upgrade.geo
projections.scattergl
, splom
and parcoords
traces.legend.groupclick
bbox
of hover items in event data, to support custom dash-driven hover effects#1735 New dcc.Tooltip
component. This is particularly useful for rich hover information on dcc.Graph
charts, using the bbox
information included in the event data in plotly.js v2.4.0
html
elements - <command>
, <element>
, <isindex>
, <listing>
, <multicol>
, <nextid>
. These are obsolete and had been previously removed from the reference table.Dash
constructor argument extra_hot_reload_paths
. This allows you to re-initialize the Python code of the app when non-Python files change, if you know that these files impact the app.requests_pathname_prefix
ends with routes_pathname_prefix
. When you are serving your app behind a reverse proxy that rewrites URLs that constraint needs to be violated.src/jl
- fixes an issue on case-insensitive filesystems when the component name and module name match (modulo case) and no prefix is used. Also reduces JS/Julia clutter in the overloaded src
directory.timing_information
after certain modifications to Flask behaviorThis applies the fix from #878 to the RangeSlider. It not only fixes the bug where the tooltips were visible when slider was not, but it also reduces the lag in the tooltip when the slider handles are moved.
Plotly.d3
, and remove many other deep pieces of the public API. This does not affect the dcc.Graph
component, but if you make use of Plotly
from the global scope in some other way you may be affected.contourgl
and area
, as well as legacy pre-scatterpolar
polar attributes bar.r
, bar.t
, scatter.r
, scatter.t
, layout.radialaxis
, layout.angularaxis
. Use scatterpolar
, barpolar
, and polar
subplots instead.heatmapgl
and pointcloud
trace types, and the transform
attribute are deprecated, and will be removed in a future release.strict
bundle) in your assets
folder you will have no function constructors.hovermode
to "closest".textposition
to "auto" in bar
traces. If you previously used the bar.text
attribute for hover only, you will need to explicitly set textposition="none"
.bar.marker.pattern
, image.zsmooth
, and various other features and bugfixes.icicle
trace type.legendrank
trace attribute.%h
) for date formattingdisabled_days
prop to DatePickerRange
and DatePickerSingle
components. With this prop you can specify days that should be made unselectable in the date picker, in addition to those that fall outside of the range specified by min_date_allowed
and max_date_allowed
.dash-info.yaml
to regenerate examples without attaching now-deprecated core component packages (dashHtmlComponents
, dashCoreComponents
, or dashTable
).dash-info.yaml
to regenerate examples without attaching now-deprecated core component packages (dashHtmlComponents
, dashCoreComponents
, or dashTable
).html
option to markdown_options
prop. This enables the use of html tags in markdown text.filter_options
- to control case of all filters, columns.filter_options
- to control filter case for each columni=
, ieq
, i>=
, ige
, i>
, igt
, i<=
, ile
, i<
, ilt
, i!=
, ine
, icontains
- for case-insensitive filtering, s=
, seq
, s>=
, sge
, s>
, sgt
, s<=
, sle
, s<
, slt
, s!=
, sne
, scontains
- to force case-sensitive filtering on case-insensitive columnshighlight.js
upgrade changes code highlighting in markdown: we have long used their "github" style, this has been updated to more closely match current github styles.dash-info.yaml
to regenerate example without attaching now-deprecated core component packages (dashHtmlComponents
, dashCoreComponents
, or dashTable
).outputs
vs output
to avoid a perceived security issue.Download
component. Along with this several utility functions are added to help construct the appropriate data format:
dcc.send_file
- send a file from diskdcc.send_data_frame
- send a DataFrame
, using one of its writer methodsdcc.send_bytes
- send a bytestring or the result of a bytestring writerdcc.send_string
- send a string or the result of a string writerDatePickerRange
that would sometimes shift the allowed dates by one day.EnhancedTab
component that ignored disabled_className
property#179 - Fixes #77 Added allow
and referrerPolicy
properties to html.Iframe
#178 - Fix #161 data
property, and fix #129 obsolete, deprecated, and discouraged elements. No elements were removed, but comments were added to the documentation about these elements detailing their limitations.
dash.callback_context
this addresses many use cases which require circular callbacks.dash[testing]
requirements for easier integration in external projects. This PR also bumps many dash[dev]
requirements.get_asset_url
now pulls from an external source if assets_external_path
is set.
_add_assets_resource
to build asset urls the same way as get_asset_url
.assets_external_path
Dash argument to be more clear that it will always be joined with the assets_url_path
argument when determining the url to an external asset.import dash
fail with a cryptic error message asking whether you have a file named "dash.py"figure
prop of dcc.Graph
receives updates from user interactions in the graph, by using the same layout
object as provided in the prop rather than cloning it. Fixes #879.drag_value
prop to dcc.Slider
to be able to fire callbacks from dragging and releasing the slider.app.callback(...)
a decorator.flask-compress==1.6.0
causing performance degradation on server requestswidth
in particular) that previously caused errors.getTransform
logic in the renderer to handle persistenceTransforms
for both nested and non-nested persisted props. This was used to to fix dcc#700 in conjunction with dcc#854 by using persistenceTransforms to strip the time part of the datetime so that datepickers can persist when defined in callbacks.script-src
hashes of all added inline scripts by calling app.csp_hashes()
(both Dash internal inline scripts, and those added with app.clientside_callback
) .n_clicks
props are used as inputs of the same callback. The callback will now trigger once with all the triggered n_clicks
props changes.callback_context.record_timing(name, seconds)
prevent_initial_call
as a positional arg in callback definitionsapp.logger.setLevel(logging.WARNING)
.--jl-prefix
option to dash-generate-components
, optionally generates Julia version of components and corresponding Julia packageInput
, Output
, and State
in callback definitions don't need to be in lists. You still need to provide Output
items first, then Input
items, then State
, and the list form is still supported. In particular, if you want to return a single output item wrapped in a length-1 list, you should still wrap the Output
in a list. This can be useful for procedurally-generated callbacks.title
parameter to set the
document title. This is the recommended alternative to setting app.title or overriding
the index HTML.update_title
parameter to set or disable the "Updating...." document title during updates. Closes #856 and #732
FLASK_ENV
is modified during app execution_wait_for_callbacks
to failDASH_PROXY
env var to tell app.run_server
to report the correct URL to view your app, when it's being proxied. Throws an error if the proxy is incompatible with the host and port you've given the server.callback_context
to clientside callbacks (e.g. dash_clientside.callback_context.triggered
). Supports triggered
, inputs
, inputs_list
, states
, and states_list
, all of which closely resemble their serverside cousins.dash.testing
is compatible with more pytest
plugins, particularly pytest-flake8
and pytest-black
.@app.callback(..., prevent_initial_call=True)
and similar for app.clientside_callback
. The app-wide default can also be changed with app=Dash(prevent_initial_callbacks=True)
, then individual callbacks may disable this behavior.app.validation_layout
allows you to create a multi-page app without suppress_callback_exceptions=True
or layout function tricks. Set this to a component layout containing the superset of all IDs on all pages in your app.ALL
wildcards in their Output
which would fail if no components matched the pattern.flask.has_request_context() == False
inside an app.layout
function to provide a special layout containing all IDs for validation purposes in a multi-page app. Dash 1.11 broke this when we moved most of this validation into the renderer. This change makes it work again.ALL
, MATCH
, and ALLSMALLER
, available from dash.dependencies
. This lets you create components on demand, and have callbacks respond to any and all of them. To help with this, dash.callback_context
gets three new entries: outputs_list
, inputs_list
, and states_list
, which contain all the ids, properties, and except for the outputs, the property values from all matched components.dash.testing
option --pause
: after opening the dash app in a test, will invoke pdb
for live debugging of both Javascript and Python. Use with a single test case like pytest -k cbwc001 --pause
.dash.callback_context.triggered
now does NOT reflect any initial values, and DOES reflect EVERY value which has been changed either by activity in the app or as a result of a previous callback. That means that the initial call of a callback with no prerequisite callbacks will list nothing as triggering. For backward compatibility, we continue to provide a length-1 list for triggered
, but its id
and property
are blank strings, and bool(triggered)
is False
.dash.run_server()
host and port parameters to be set with environment variables HOST & PORT, respectivelycompress
config variable to be set with an environment variable with DASH_COMPRESS=FALSEapp.get_relative_path
& app.trim_relative_path
.
These functions are particularly useful for apps deployed on Dash Enterprise where the apps served under a URL prefix (the app name) which is unlike apps served on localhost:8050.
app.get_relative_path
returns a path with the config setting requests_pathname_prefix
prefixed. Use app.get_relative_path
anywhere you would provide a relative pathname, like dcc.Link(href=app.relative_path('/page-2'))
or even as an alternative to app.get_asset_url
with e.g. html.Img(src=app.get_relative_path('/assets/logo.png'))
.app.trim_relative_path
a path with requests_pathname_prefix
and leading & trailing
slashes stripped from it. Use this function in callbacks that deal with dcc.Location
pathname
routing.
Example usage:app.layout = html.Div([
dcc.Location(id='url'),
html.Div(id='content')
])
@app.callback(Output('content', 'children'), [Input('url', 'pathname')])
def display_content(path):
page_name = app.strip_relative_path(path)
if not page_name: # None or ''
return html.Div([
html.Img(src=app.get_relative_path('/assets/logo.png')),
dcc.Link(href=app.get_relative_path('/page-1')),
dcc.Link(href=app.get_relative_path('/page-2')),
])
elif page_name == 'page-1':
return chapters.page_1
if page_name == "page-2":
return chapters.page_2
visit_and_snapshot
API in dash.testing.browser
to stay on the page so you can run other checks.children
in an array, and they get passed to other props.dash.testing
stop API with process application runner in Python2. Use kill()
instead of communicate()
to avoid hanging.clear_input()
API in dash.testing
, so it's more robust handling react input
.percy_snapshot()
API more robust, and the timeout of wait_for_callbacks
(if set to True) will not fail the snapshot execution, but logged as potential error.metadata
in version._force_eager_loading
when application is loaded with gunicornthrow window.dash_clientside.PreventUpdate;
window.dash_clientside.no_update
wait_for_callbacks
to ensure that, in the context of a dash app testing, the percy snapshot action will happen only after all callbacks get fired.dashr
fixture, primarily useful for tests with assets. dashr.start_server
supports a cwd
argument to set an explicit working directory, and has smarter defaults when it's omitted: if app
is a path to an R script, uses the directory of that path; if app
is a string, uses the directory the test file itself is in.dash.testing
methods can now be called with either an element or a CSS selector: select_dcc_dropdown
, multiple_click
, clear_input
, zoom_in_graph_by_ratio
, click_at_coord_fractions
.dash.testing
methods: clear_local_storage
, clear_session_storage
, and clear_storage
(to clear both together)dash.testing
adds two APIs zoom_in_graph_by_ratio
and click_at_coord_fractions
about advanced interactions using mouse ActionChain
#923 Add one configuration --percy-assets
in pytest
to specify extra application assets path if needed.
#918 Add wait_for_element_by_id
and visit_and_snapshot
APIs in browser, add raw_command
option (with higher priority than the default waitress one) and optional start_timeout
argument to handle large applications within the process runner.
#903 Persistence: enable props edited by the user to persist across recreating the component or reloading the page. Components need to define three new props: persistence
, persisted_props
, and persistence_type
as described in the lead comment of src/persistence.js
. App developers then enable this behavior by, in the simplest case, setting persistence: true
on the component. First use case is table, see dash-table#566
dash-generate-components
on Windows.--remote
pytest argument which was not effective in the code, adding a new argument --remote-url
to support the selenium grid usage in the cloud.npm run build:local
and pip install in editable mode, i.e. pip install -e .
dev_tools_prune_errors
to app.run_server
and app.enable_dev_tools
. Default True
, tracebacks only include user code and below. Set it False
for the previous behavior showing all the Dash and Flask parts of the stack.dash.testing
pytest framework.💥 #808 Remove strong dash.testing
dependencies per community feedback. Testing users should do pip install dash[testing]
afterwards.
#805 Add headless mode for dash.testing, add pytest_setup_options
hook for full configuration of WebDriver Options
.
Bump dash-table version from 4.0.0 to 4.0.1
💥 #761 Several breaking changes to the dash.Dash
API:
static_folder
and components_cache_max_age
supress_callback_exceptions
fallbackresources.config.infer_from_layout
app.config
: ALL constructor args are now stored in config
, with three exceptions: server
, index_string
, and plugins
. None of these are stored in any other instance attributes anymore.hot_reload_interval
from msec to seconds, for consistency with hot_reload_watch_interval
enable_dev_tools
, debug=True
by default. It's still False
by default from run_server
.✨ #744 Introducing Dash Testing (dash.testing
) - read the full tutorial at https://dash.plotly.com/testing.
#753 Component
no longer inherits MutableMapping
, so values
, keys
, and more are no longer methods. Fixes an issue reported in dcc#440 where components with certain prop names defined but not provided would cause a failure to render. During component generation we now disallow all props with leading underscores or matching a few remaining reserved words: UNDEFINED
, REQUIRED
, to_plotly_json
, available_properties
, and available_wildcard_properties
.
#739 Allow the Flask app to be provided to Dash after object initialization. This allows users to define Dash layouts etc when using the app factory pattern, or any other pattern that inhibits access to the app object. This broadly complies with the flask extension API, allowing Dash to be considered as a Flask extension where it needs to be.
#774 Allow the Flask app to set the Dash app name if the name is not provided by users.
#722 Assets are served locally by default. Both JS scripts and CSS files are affected. This improves robustness and flexibility in numerous situations, but in certain cases initial loading could be slowed. To restore the previous CDN serving, set app.scripts.config.serve_locally = False
(and similarly with app.css
, but this is generally less important).
#724, renderer#175 Undo/redo toolbar is removed by default, you can enable it with app=Dash(show_undo_redo=true)
. The CSS hack ._dash-undo-redo:{display:none;}
is no longer needed
💥 #709 Merge the dash-renderer
project into the main dash repo to simplify feature dev workflow. We will keep the deprecated one for archive purpose.
app.run_server
:
dev_tools_props_check
- turn on/off property validation.dev_tools_ui
- turn on/off the UI.children=0
case.dev_tools_ui
config flag in app.run_server
(serialized in <script id="_dash-config" type="application/json">
) to display or hide the forthcoming Dev Tools UI in Dash's front-end (dash-renderer).dash_renderer._set_react_version
support for 15.4.2 and 16.2.0setProps
to components even with no callbacks to use it.dash.callback_context.response
.dash.callback_context.triggered
dash.callback_context.states.get('btn.n_clicks')
__repr__
to base component instead of being generated.Event
system. Use event properties instead, for example the n_clicks
property instead of the click
event, see #531. dash_renderer
MUST be upgraded to >=0.17.0 together with this, and it is recommended to update dash_core_components
to >=0.43.0 and dash_html_components
to >=0.14.0.assets_folder
argument now defaults to 'assets'name
argument, the default of __main__
will get the cwd
.Loading...
if no configs as before renderer#108.dynamic
resources from index resources collection.--r-prefix
option to dash-generate-components
, optionally generates R version of components and corresponding R package.--ignore
option to dash-generate-components
, defaults to ^_
.key
to rendered components, fixing renderer#379
InvalidIndexException
, DependencyException
, ResourceException
)_imports_.py
indentation generation.extract-meta
and Python component files generation in a clidev_tools_silence_routes_logging
.Dash.registered_paths
changed to a collections.defaultdict(set)
, was appending the same package paths on every index.Component.traverse()
and Component.traverse_with_paths()
for components with children
of type tuple
, not just list
.add_url
function definition out of Dash.__init__
app.run_server(dev_tools_serve_dev_bundles=True)
Cache-Control
headers to files served by Dash.serve_component_suites
, and time modified query string to collected components suites resources.InvalidResourceError
error and a Flask error handler so unregistered paths in serve_component_suites
return a 404 instead of 500.get_asset_url
with a different assets_url_path
.url_base_pathname
to None
in Dash.__init__
. Fix #364
Dash.get_asset_url
will give the prefixed url for the asset file.requests_pathname_prefix
._validate_layout
which would not let a user set app.layout
to be a function that returns a layout (fixes #334).assets_ignore
init keyword, regex filter for the assets files.DASH_
).requests_pathname_prefix
config when creating scripts tags.requests/routes_pathname_prefix
must start and end with /
.requests_pathname_prefix
must end with routes_pathname_prefix
. If you supplied both requests
and routes
pathname before this update, make sure requests_pathname_prefix
ends with the same value as routes_pathname_prefix
.url_base_pathname
sets both requests/routes
pathname, cannot supply it with either requests
or routes
pathname prefixes.dash-html-components
with Python 3.7.ie-compat
meta tag to the index by default.external_script
and external_css
keywords to dash __init__
._dash-error
class to the "Error loading layout" and "Error loading dependencies" messages.Boolean
value to the page no longer crashes the app.id
which does not exist in the DOM tree at the time it is executed, throw a more informative front-end exception.updateProps
with multiple properties, Dash would fire the callback multiple times (once for each property). Now the callback only fires once.aria-*
and data-*
attributes in all dash html components. These new keywords can be added using a dictionary expansion, e.g. html.Div(id="my-div", **{"data-toggle": "toggled", "aria-toggled": "true"})
import dash_renderer
# Set the react version before setting up the Dash application
dash_renderer._set_react_version('16.2.0')
app = dash.Dash(...)
react
and react-dom
bundles for development modecomponent_loader
now has the following behavior to create docstrings as determined in discussion in #187:
PropTypes
-generated typing, the docstring uses the PropTypes
, regardless of whether the component also has Flow types (current behavior).
PropTypes
, the docstring now uses the objects generated by react-docgen
from the Flow types.exceptions.PreventUpdate
can be raised inside a callback to prevent the callback from updating the app. See https://community.plotly.com/t/improving-handling-of-aborted-callbacks/7536/2.dash
namespace for better IDE completion.POST
requests with content type application/json
which are not susceptible to unwanted requests from 3rd party sites. See #141.app.server.secret_key
is no longer required since CSRF protection was removed. Setting app.server.secret_key
was difficult to document and a very common source of confusion, so it's great that users won't get bitten by this anymore app.config
is now a dict
instead of a class. You can set config variables with app.config['suppress_callback_exceptions'] = True
now. The previous class-based syntax (e.g. app.config.suppress_callback_exceptions
) has been maintained for backwards compatibility.<div class="_dash-loading-callback"/>
to the DOM. Users can style this element using custom CSS to display loading screen overlays. This feature is in alpha, we may remove it at any time./
.supress_callback_exceptions
to suppress_callback_exceptions
. The original spelling is kept for backward compatibility.endpoint
to each of the URLs to allow for multiple routes.app.layout
is a function, then it used to be called excessively. Now it is called just once on startup and just once on page load./static/
folder and endpoint that is implicitly initialized by flask. This is too implicit for my comfort level: I worry that users will not be aware that their files in their static
folder are accessiblefilename
, sharing
and app_url
arguments. This was never documented or officially supported. Authentication has been moved to the dash-auth
package.config
variables: routes_pathname_prefix
and requests_pathname_prefix
to provide more flexibility for API routing when Dash apps are run behind proxy servers. routes_pathname_prefix
is a prefix applied to the backend routes and requests_pathname_prefix
prefixed in requests made by Dash's front-end. dash-renderer==0.8.0rc3
uses these endpoints.id
to KeyError
exceptions in components.dash-renderer
contains the bulk of the integration tests.✨ This is the initial open-source release of Dash.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )