I'm using Shiny to make an app that displays health data geographically (using leaflet), but I also want to display the data as a stripchart to make it easy to visualize the mean, distribution, quantiles of the data. Right now I'm using ggplot to make a 1-d plot and overlaying a boxplot. What I would really like, though, is to allow for a pop-up to display when I click a point.
Is there a way to make pop-ups in ggplot? If not, what package should I be looking at to replicate what I have here but add the pop-up feature?
What I have here:
testdf <- data.frame(vxals = c(1, 4, 6, 8, 100))
TestPalette <- colorNumeric(palette = rev(brewer.pal(5, "RdYlGn")), domain = testdf$xvals)
ggplot(testdf, aes(x = 1, y = xvals, color = xvals)) +
geom_boxplot(width= 0.03) +
geom_point(size = 5) +
scale_color_gradientn(colors = TestPalette(range(testdf$xvals))) +
geom_vline(slope = NULL, intercept = 1, color = "green") +
coord_flip() +
theme(aspect.ratio = 0.1)