JohnCoene / tippy

💬 Tippy.js for Shiny
http://tippy.john-coene.com/
Other
76 stars 2 forks source link

tippy_theme function? #3

Closed mpadge closed 3 years ago

mpadge commented 5 years ago

Great package @JohnCoene! Thanks for immediately beautifying my world! This may already be possible, but I at least couldn't readily see how. Is there some kind of tippy_theme() function to set a bunch of default parameters so subsequent calls within same R session can then be just tippy("text", tooltip = "tip") minus the other distracting guff? Obvious and direct analogy to ggplot2::theme_update(). This functionality - if not currently possible - ought to be pretty easy to incorporate, and would at least for me be quite useful.

JohnCoene commented 5 years ago

Thanks!

Good idea, I'll implement that function.

JohnCoene commented 3 years ago

At long last, after 2 years+, I've finally pushed a this feature.

I do apologise it took so long.

library(shiny)
library(tippy)

tippy_global_theme("light")

ui <- fluidPage(
  useTippy(),
  p("Another tooltip", id = "tip"),
  tippyThis(
    "tip",
    "This is indeed an tooltip"
  )
)

server <- function(input, output) {}

shinyApp(ui, server)
mpadge commented 3 years ago

That's brilliant - nothing like realising you'd completely forgotten about some long-gone request, only for it to be solved and then realise it's still really, really helpful! Thank you!