Open JinraeKim opened 3 years ago
I don't know how Dash.jl works but I guess that adding a layer only to the callbacks whose output is "shown on web" will work. Probably...?
@JinraeKim The fact is that the result of the callback turns into json and is sent to the front end (i.e. to JavaScript code). The frontend knows nothing about Julia types, and in general about backend types.
As an idea for the future development of Dash.jl maybe I will make it possible to type the input parameters of callbacks. But it will work the same way, just the json coming from the frontend will not be parsed into the default type (dict or vector), but into a custom type according to some user-defined rules. But you can do the same now inside the callback, typing will just be a convenient wrapper so that the conversion happens automatically.
Related: https://github.com/plotly/dash/pull/1784 - not merged yet, but allows keeping some type info in the front end such that when returning it to the back end in a callback that type can be reconstructed... as well as supporting alternate and possibly more efficient serializations for certain types. If you'd like to look at that implementation and comment on how to make it more useful to Julia in the future, now's the time :)
Hi, I'm new to Dash.jl so the terminology may be confusing.
In my case, I'd like to send a
ComponentArray
(exported from ComponentArrays.jl) from a callback to another callback.I found that after passing through a callback,
ComponentArray
becomes a normal array (Vector
). Is it possible to make Dash.jl compatible withComponentArray
or any other abstract array types?Because of the powerful abstraction of
ComponentArrary
and other cool array types in Julia, preserving array type would be really helpful for dealing with data manipulation.