update_tooltips {shinyfilter}R Documentation

Update the tooltips/popovers based on the currently available filter options

Description

Updates all tooltips or popovers for shinyfilter filter selectizeInput widgets. Tooltips/popovers can be used to show the currently unavailable filter options, i.e. the filter options that are not available at the moment because of the dataframe presented in the reactable is filtered by the choices made in the other filters. It is also possible to list the available filter options as well.

If you want to use tooltips/popovers, you need to call use_tooltips() from within the UI definition of your shiny app.

Usage

update_tooltips(
  react_id,
  session,
  tooltip = TRUE,
  show_avail = TRUE,
  title_avail = "Available values:",
  title_nonavail = "Currently not available filters:",
  popover_title = "Filter options",
  max_avail = NULL,
  max_nonavail = max_avail,
  more_avail = "... (# more)",
  more_nonavail = "... (# more)",
  placement = "top"
)

Arguments

react_id

The output variable/ID of the reactable to which the filters are linked.

session

The session variable provided as an argument to the server function.

tooltip

If TRUE, tooltips will be shown. If FALSE, popovers will be shown.

show_avail

If TRUE not only the unavailable filter options will be listed in the tooltips/popovers, but the unavailable ones as well.

title_avail

Header text for the list of available filter options.

title_nonavail

Header text for the list of unavailable filter options.

popover_title

Title text for the popover window. Only relevant when tooltips = FALSE.

max_avail

Maximum number of available filter options shown. Use the more_avail argument to determine what is shown if the number of available filter options exceeds max_avail.

max_nonavail

Maximum number of non-available filter options shown. Use the more_nonavail argument to determine what is shown if the number of non-available filter options exceeds max_nonavail.

more_avail

Text to be shown if show_avail = TRUE and the number of available filter options exceeds max_avail. In this case, only the first max_avail filter options are shown followed by more_avail. In more_avail you can use # as a placeholder for the number of filter options exceeding max_avail.

more_nonavail

Text to be shown if the number of available filter options exceeds max_nonavail. In this case, only the first max_nonavail filter options are shown followed by more_nonavail. In more_nonavail you can use # as a placeholder for the number of filter options exceeding max_nonavail.

placement

Defines where the tooltip/popover is placed relative to the filter (i.e. selectizeInput widget) it belongs to. Can be either "top", "bottom", "left" or "right".

Details

For a full example of a shiny app using shinyfilter please call up the help for update_filters(). See the README.md file or the GitHub repo on https://github.com/jsugarelli/shinyfilter for a comprehensive shinyfilter tutorial.

Tip: If your tooltips/popovers do not show up, attach the shinyBS package directly in your Shiny app by adding library(shinyBS) to your code. The shinyBS package is used to create the tooltips and popovers.

Value

No return value.


[Package shinyfilter version 0.1.1 Index]