r-spatial / mapedit

Interactive editing of spatial data in R
https://www.r-spatial.org/r/2019/03/31/mapedit_leafpm.html
Other
218 stars 33 forks source link

how to handle reproducibility? #26

Closed tim-salabim closed 7 years ago

tim-salabim commented 7 years ago

How should we handle recording of what has been done to a set of features or a map? editMap currently returns a list with entries drawn , edited, deleted and finished, some of which will be NULL depending on what has been done. In order to ensure reproducibility, I think that all higer level functions (such as a potential editFeatures) should ensure that any changes are recorded somehow. I am just not quite sure how to implement this.

Any thoughts more than welcome!

edzer commented 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
timelyportfolio commented 7 years ago

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.

timelyportfolio commented 7 years ago

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.

timelyportfolio commented 7 years ago

see https://github.com/r-spatial/mapedit/issues/29#issuecomment-309207288

timelyportfolio commented 7 years ago

As an example see https://bl.ocks.org/timelyportfolio/c078f0e4de651e39f2249df77dad7f1b.

mapedit_record_flubber