Closed tim-salabim closed 7 years ago
I tend to think of editing a map as a sequence of actions with a type (add, delete, move) and an object involved. If you store it like that, you could redo the editing as a function call, like
new = redo_edit(old, edit_sequence)
or
old %>% redo_edit(edit_sequence) -> new
I agree this would be really nice. Each Shiny event is like an action, so we could keep some record of actions similar to Redux
that would allow time travel.
In my mind, the real trick will be to tie/join actions to features. It would be nice to come up with a more robust method than our first draft in selectFeatures
and what I have done so far in editMap
.
The new module functionality will be helpful here, so once I wrap up the editMap
module, I will demonstrate a proof of concept for reproducibility.
As an example see https://bl.ocks.org/timelyportfolio/c078f0e4de651e39f2249df77dad7f1b.
How should we handle recording of what has been done to a set of features or a map?
editMap
currently returns a list with entriesdrawn
,edited
,deleted
andfinished
, some of which will beNULL
depending on what has been done. In order to ensure reproducibility, I think that all higer level functions (such as a potentialeditFeatures
) should ensure that any changes are recorded somehow. I am just not quite sure how to implement this.record
argument?Any thoughts more than welcome!