You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The picks data in the table should be the same as the data in tops-storage and changes to one should update the other.
Currently, there is only one-way behavior: when picks are updated by clicking on the interactive plot, the changes are represented in the table. This is accomplished by the update_data_table() callback.
However, changes to the table (pick name, depth changes, pick deletions and additions) do not update tops-storage.
I tried solving this issue by adding table.data as an input to the update_pick_storage callback but this creates a "circular callback error" where changes to tops-storage trigger changes to table.data which triggers changes to tops-storage ... etc. I can't currently figure out how to get around that.
The text was updated successfully, but these errors were encountered:
I just spent a bit of time reading some dash documentation (big 🧠 idea), and I think I see now how to solve this issue.
There is a section on this page about circular callbacks. Circular callbacks are allowed if they are in the same callback. There are several examples on that page doing exactly what we need: keeping multiple outputs/inputs in sync.
Sounds like what we will need to do is consolidate the update_data_table() callback with the update_pick_storage() callback. So that one will have multiple outputs that will both be updated when there is a change to one or the other.
Does that have the potential to break other functionality? It would probably be good to spin off most functions to another *.p to help organize some of the interactivity. That is a pretty big redesign of the code. I think that it would help with some of our errors too at startup.
If done right, it shouldn't break anything else. update_data_table() is a small callback and should be able to be rolled into update_pick_storage() without creating any issue. That way when any change to tops-storage or table.data happens, both the data storage and the table data are updated by the same callback.
I think it might be good for all the functions (except for callbacks) to be moved out of the app.py file. It will be a little cleaner to only have app initialization, layout, and callbacks in app.py.
Addresses #47 and #46.
The picks data in the table should be the same as the data in
tops-storage
and changes to one should update the other.Currently, there is only one-way behavior: when picks are updated by clicking on the interactive plot, the changes are represented in the table. This is accomplished by the
update_data_table()
callback.However, changes to the table (pick name, depth changes, pick deletions and additions) do not update tops-storage.
I tried solving this issue by adding
table.data
as an input to theupdate_pick_storage
callback but this creates a "circular callback error" where changes totops-storage
trigger changes totable.data
which triggers changes totops-storage
... etc. I can't currently figure out how to get around that.The text was updated successfully, but these errors were encountered: