Hello,
the idea should be:
when run as an htmlwidget in R markdown, the widget does not send any input back to R (there's no R session anyway so that's not possible). It just takes as inputs, say, a named list of selection options and a list of ggplot2 plots/other widgets associated with each selection option, and allows the user to display plots depending on the selection made in the selector.
Currently I do this kind of things by injecting the js code directly into the R markdown, but that's quite hacky and I would like to have a widget that makes the process easier and streamlined. The user shouldn't need to use any js.
In a shiny context, however, I would like the widget to retain the above behaviour, but to also act as a shiny input, so that the developer could access the user selected value from R and use it in a reactive context in shiny to trigger other behaviour.
I hope this clarifies it a bit?