Authored by Pawel

Custom interactive CSS/HTML tooltips with ggplot, shiny and R (ggvis like).

3.72 KB
  • Hi Pawel,

    This is very helpful, and works wonderfully! I am reordering the scatterplot in an ascending order in my ggplot. The tooltip however, does not get rearranged. How can I fix that?

    Here is my code:

    losd <- ggplot(lo_sd, aes(x = uid, y = bc, color = color)) + geom_point(aes(x = reorder(lo_sd$uid, lo_sd$bc), y = lo_sd$bc), size=2) + geom_errorbar(aes(ymin = lo_sd$lci, ymax = lo_sd$uci), width=0.00, show_guide = F, size = 1) + geom_hline(yintercept = 0, linetype="solid", color = "#6b5e4f", size=1) + scale_y_continuous(limits = c(-0.65, 0.65)) + scale_x_discrete(limits = lo_sd$uid, labels = lo_sd$cname) + scale_color_discrete(name = "Subject tests") + labs(y = "Effect size (sd)", x = "", title = "") + coord_flip()

    Any thoughts?

    Thanks you so much!

  • Hi Pawel,

    I would like to use nearPoints on a ggplot map. I was planning on using something like the attached shiny app:


    However, it is clear that nearPoints is off. It seems to be more off in the top left than the bottom right.

    changing the projection from

    coord_map("polyconic" ) to coord_map() makes the difference smaller, but it still exists.

    Do you have any insights on how to read the appropriate nearPoint?

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment