use_svgzoom {vtree}R Documentation

Setup for interactive Vtree

Description

This function must be called in the UI, in order to make the vtree interactive.

Usage

use_svgzoom(minheight = "200px", cursor_all = "all-scroll",
  overflow = "inherit !important", position = "sticky",
  fill = "transparent", cursor_text = "pointer",
  init_event = c("mouseenter", "click", "dblclick"),
  onwindow_resize = TRUE, shortcuts = TRUE)

Arguments

minheight

minimum height in "px". Default is "200px".

cursor_all

The cursor symbol for the whole SVG. Default is "all-scroll".

overflow

Overflow value for the whole SVG. Default is "inherit".

position

CSS position of the SVG. Default is "sticky".

fill

Fill color for the SVG background. Default is "transparent".

cursor_text

The cursor symbol for text nodes. Default is "pointer".

init_event

The mouse event to activate zooming and panning. Default is mouseenter.

onwindow_resize

Should the SVG be resized when the window size changes? Default is TRUE.

shortcuts

Should Keyboard shortcuts be used to control the SVG? Default is TRUE.

See Also

vtreeOutput, vtree

Other Shiny Functions: init_js(), inlineCssSetup(), renderVtree(), vtreeOutput()

Examples

## Not run: 
library(shiny)
library(vtree)

ui <- fluidPage(
  use_svgzoom(),
  helpText(div(style="font-weight: 800; font-size: large; color: black;",
               HTML("Zooming and Panning is possible with mouse-drag ",
                    "and mouse-wheel <br>, or with shortcuts;",
                    " +,- and arrow-keys and CTRL+Backspace to",
                    " resize+fit+center the svg.."))),
  vtreeOutput("vtree", width = "100%", height = "500px")
)

server <- function(input, output, session) {
  output$vtree <- renderVtree({
    vtree(FakeData,"Severity Sex",
          labelnode=list(Sex=(c("Male"="M","Female"="F"))),
          pngknit=FALSE)
  })
}

shinyApp(ui, server)

## End(Not run)

[Package vtree version 5.6.5 Index]