Right now our clientside callbacks need to reference a separate file - typically loaded in via assets - where the functions are defined in a special namespace:
window.dash_clientside=Object.assign({},window.dash_clientside,{large_params_function: function(largeValue1,largeValue2){returnsomeTransform(largeValue1,largeValue2);}});Then in the app you reference these functions by namespace and name:
app.clientside_callback(
ClientsideFunction('clientside', 'large_params_function'),
Output('out-component', 'value'),
[Input('in-component1', 'value'), Input('in-component2', 'value')]
)From a user standpoint, at least for simple functions it would be convenient to be able to provide the function just as a string with the callback definition. We would then package these up with some automatic namespace and naming, either as a separate endpoint or just a special case of _dash-component-suites, and reference it in the generated index alongside all the other scripts.
app.clientside_callback(
""" function(largeValue1, largeValue2) { return someTransform(largeValue1, largeValue2); } """,
Output('out-component', 'value'),
[Input('in-component1', 'value'), Input('in-component2', 'value')]
)
Right now our clientside callbacks need to reference a separate file - typically loaded in via assets - where the functions are defined in a special namespace:
Then in the app you reference these functions by namespace and name:
From a user standpoint, at least for simple functions it would be convenient to be able to provide the function just as a string with the callback definition. We would then package these up with some automatic namespace and naming, either as a separate endpoint or just a special case of
_dash-component-suites, and reference it in the generated index alongside all the other scripts.