The native widget reports edits to Shiny through an input named
paste0(outputId, "_state"). This function turns that value back into a
dragmapr_state() so server code can persist, merge, or re-render the user's
live composition. It is the inbound half of the widget bridge that
dragmapr_widget() / updateDragmapr() form on the outbound side.
Details
The browser's monotonic revision becomes the state version unchanged –
the client owns the live counter, so the server records the edit faithfully
rather than bumping it again. The empty-string selection sentinel is mapped
back to NULL.
Examples
if (FALSE) { # \dontrun{
shiny::observeEvent(input$map_state, {
state <- dragmapr_widget_state(input$map_state)
write_dragmapr_state(state, "composition.json")
})
} # }
