-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserving the type of the output of callbacks #129
Comments
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: plotly/dash#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 with
ComponentArray
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.The text was updated successfully, but these errors were encountered: