I also found this, in dash.py:
def clientside_callback(
self, clientside_function, output, inputs=[], state=[]):
"""
Create a callback that updates the output by calling a clientside
(JavaScript) function instead of a Python function.
Unlike `@app.calllback`, `clientside_callback` is not a decorator:
it takes a
`dash.dependencies.ClientsideFunction(namespace, function_name)`
argument that describes which JavaScript function to call
(Dash will look for the JavaScript function at
`window[namespace][function_name]`).
For example:
```
app.clientside_callback(
ClientsideFunction('my_clientside_library', 'my_function'),
Output('my-div' 'children'),
[Input('my-input', 'value'),
Input('another-input', 'value')]
)
```
With this signature, Dash's front-end will call
`window.my_clientside_library.my_function` with the current
values of the `value` properties of the components
`my-input` and `another-input` whenever those values change.
Include a JavaScript file by including it your `assets/` folder.
The file can be named anything but you'll need to assign the
function's namespace to the `window`. For example, this file might
look like:
```
window.my_clientside_library = {
my_function: function(input_value_1, input_value_2) {
return (
parseFloat(input_value_1, 10) +
parseFloat(input_value_2, 10)
);
}
}
```
"""