Hi everyone!
I was hoping to use JS to grab to the subset of my data within a histogram -- I see the counts
on hover but I'd like to get those specific rows and use them to filter my data in R.
ggplotly(
ggplot(iris, aes(y = Sepal.Length)) +
geom_histogram()
) %>%
htmlwidgets::onRender("
function(el) {
el.on('plotly_click', function(d) {
// not sure what the subset of my bar is within `d`
let a = d.points.blahblah
// then I probably need to use Shiny.setInputValue('filtered_data', a)
});
}
")
Does this workflow make sense? Is there an easier way to do this in R? ANY help appreciated!!!