📣 Dash v1.7.0 released

Dash 1.7.0 is a minor release adding support for inline clientside callbacks, improving dcc’s Slider and RangeSlider styling and behavior, and fixing some additional bugs for async components.

Changelog
Dash v.1.7.0

Highlights

Previous Releases

In Depth

Inline Clientside Callbacks

import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import ClientsideFunction, Input, Output

app = dash.Dash(__name__)

app.layout = html.Div([
    dcc.Input(id='input'),
    html.Div(id='output-clientside'),
    html.Div(id='output-serverside')
])

@app.callback(
    Output('output-serverside', 'children'),
    [Input('input', 'value')])
def update_output(value):
    return 'Server says "{}"'.format(value)


app.clientside_callback(
#     ClientsideFunction(
#         namespace='clientside',
#         function_name='display'
#     ),
    """
    function (value) {
        if (value && value.indexOf('--') === 0) {
            throw window.dash_clientside.PreventUpdate;
        }

        if (value && value.indexOf('__') === 0) {
            return window.dash_clientside.no_update;
        }

        return 'Client says "' + value + '"';
    }
    """,
    Output('output-clientside', 'children'),
    [Input('input', 'value')]
)

if __name__ == "__main__":
    app.run_server(port=8070)
7 Likes

The upgrade of dash from 1.6.1 to 1.7.0 seems to have broken one of my applications. Specifically, i have observed that some of the callback are now executed multiple times, with the final state of the page not correspond to the latest state.

Has there been any changes to how the (normal server side) callbacks are handled?