maintain_selection function

Synchronize Shiny brush selection with shared data