Package 'shinyTree'

Title: jsTree Bindings for Shiny
Description: Exposes bindings to jsTree -- a JavaScript library that supports interactive trees -- to enable a rich, editable trees in Shiny.
Authors: Trestle Technology, LLC [aut], Jeff Allen [cre], Institut de Radioprotection et de Sûreté Nucléaire [cph], Ivan Bozhanov [ctb, cph] (jsTree), The Dojo Foundation [ctb, cph] (require.js), jQuery Foundation, Inc. [ctb, cph], Mike Schaffer [ctb], Timm Danker [ctb]
Maintainer: Jeff Allen <[email protected]>
License: MIT + file LICENSE
Version: 0.3.11
Built: 2024-10-04 02:35:59 UTC
Source: https://github.com/timelyportfolio/shinyTree

Help Index


Get Leaf Nodes

Description

Get Leaf Nodes

Usage

get_leaf_nodes(tree = NULL)

Arguments

tree

List returned from a 'ShinyTree'.


Get the selected nodes from a tree

Description

Extract the nodes from the tree that are selected in a more convenient format. You can choose which format you prefer.

Usage

get_selected(tree, format = c("names", "slices", "classid"))

Arguments

tree

The input$tree shinyTree you want to inspect.

format

In which format you want the output. Use names to get a simple list of the names (with attributes describing the node's ancestry), or slices to get a list of lists, each of which is a slice of the list used to get down to the selected node.


Get Selected Nodes

Description

Get Selected Nodes

Usage

get_selected_nodes(tree = NULL, field = NULL)

Arguments

tree

List returned from a 'ShinyTree'.

field

character name of field to return instead of 'text'


Get State for Leaf Nodes

Description

Get State for Leaf Nodes

Usage

get_state_nodes(tree = NULL, leaves = TRUE)

Arguments

tree

List returned from a 'ShinyTree'.

leaves

logical if TRUE then return only leaf nodes.


Render an empty ShinyTree

Description

Renders a tree with no defined nodes. shinyTree.

Usage

renderEmptyTree(env = parent.frame(), quoted = FALSE)

See Also

shinyTree


Render a ShinyTree

Description

Should return a list from the given expression which will be converted into a shinyTree.

Usage

renderTree(expr, env = parent.frame(), quoted = FALSE)

Arguments

expr

The expression to be evaluated which should produce a list.

env

The environment in which expr should be evaluated.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

See Also

shinyTree


Create a Shiny Tree

Description

This creates a spot in your Shiny UI for a shinyTree which can then be filled in using renderTree

Usage

shinyTree(
  outputId,
  checkbox = FALSE,
  search = FALSE,
  dragAndDrop = FALSE,
  theme = "default",
  themeIcons = TRUE,
  themeDots = TRUE,
  config = NULL
)

Arguments

outputId

The ID associated with this element

checkbox

If TRUE, will enable checkboxes next to each node to make the selection of multiple nodes in the tree easier.

search

If TRUE, will enable search functionality in the tree by adding a search box above the produced tree. Alternatively, you can set the parameter to the ID of the text input you wish to use as the search field.

dragAndDrop

If TRUE, will allow the user to rearrange the nodes in the tree.

theme

jsTree theme, one of default, default-dark, or proton.

themeIcons

If TRUE, will show theme icons for each item.

themeDots

If TRUE, will include level dots.

config

list of additional jsTree config

See Also

renderTree


Update the tree with new data

Description

Extract the nodes from the tree that are selected in a more convenient format. You can choose which format you prefer.

Usage

updateTree(session, treeId, data = NULL)

Arguments

session

The current session variable.

treeId

The identifier for the shinyTree object

data

JSON data or nested list representing the new tree structure.