sund2bBreadcrumb: Advanced Customization of 'd2b' Breadcrumb

View source: R/d2b.R

sund2bBreadcrumbR Documentation

Advanced Customization of 'd2b' Breadcrumb

Description

Advanced Customization of 'd2b' Breadcrumb

Usage

sund2bBreadcrumb(enabled = NULL, html = NULL, orient = NULL)

Arguments

enabled

boolean to enable or disable the breadcrumbs.

html

character or htmlwidgets::JS to customize the content of the breadcrumb. To provide a function, the arguments for the 'JavaScript' function will be 'function(nodedata, size, percent)' and the function should return a string.

orient

character which should be one of "top", "left", "right", "bottom" to control the orientation of the breadcrumb relative to the chart.

Value

list

Examples

if(interactive()){

library(sunburstR)

# use a sample of the sequences csv data
sequences <- read.csv(
  system.file("examples/visit-sequences.csv",package="sunburstR")
  ,header = FALSE
  ,stringsAsFactors = FALSE
)[1:200,]

# disable the breadcrumb
sund2b(
  sequences,
  breadcrumbs = sund2bBreadcrumb(
    enabled = FALSE
  )
)

# change the breadcrumb content
sund2b(
  sequences,
  breadcrumbs = sund2bBreadcrumb(
    html = htmlwidgets::JS("
function(nodedata, size, percent) {
  return '<span style=\"font-weight: bold;\">' + nodedata.name + '</span>' + ' ' + size
}
    ")
  )
)


}

sunburstR documentation built on Feb. 16, 2023, 6:37 p.m.