TealSlicesBlock: 'TealSlicesBlock'

TealSlicesBlockR Documentation

TealSlicesBlock

Description

Specialized TealSlicesBlock block for managing filter panel content in reports.

Super classes

teal.reporter::ContentBlock -> teal.reporter::TextBlock -> TealSlicesBlock

Methods

Public methods

Inherited methods

Method new()

Returns a TealSlicesBlock object.

Usage
TealSlicesBlock$new(content = teal_slices(), style = "verbatim")
Arguments
content

(teal_slices) object returned from teal_slices() function.

style

(character(1)) string specifying style to apply.

Details

Returns a TealSlicesBlock object with no content and no parameters.

Returns

Object of class TealSlicesBlock, invisibly.


Method set_content()

Sets content of this TealSlicesBlock. Sets content as YAML text which represents a list generated from teal_slices. The list displays limited number of fields from teal_slice objects, but this list is sufficient to conclude which filters were applied. When selected field in teal_slice object is a range, then it is displayed as a "min"

Usage
TealSlicesBlock$set_content(content)
Arguments
content

(teal_slices) object returned from teal_slices() function.

Returns

self, invisibly.


Method from_list()

Create the TealSlicesBlock from a list.

Usage
TealSlicesBlock$from_list(x)
Arguments
x

(⁠named list⁠) with two fields text and style. Use the get_available_styles method to get all possible styles.

Returns

self, invisibly.

Examples
TealSlicesBlock <- getFromNamespace("TealSlicesBlock", "teal")
block <- TealSlicesBlock$new()
block$from_list(list(text = "sth", style = "default"))


Method to_list()

Convert the TealSlicesBlock to a list.

Usage
TealSlicesBlock$to_list()
Returns

⁠named list⁠ with a text and style.

Examples
TealSlicesBlock <- getFromNamespace("TealSlicesBlock", "teal")
block <- TealSlicesBlock$new()
block$to_list()


Method clone()

The objects of this class are cloneable with this method.

Usage
TealSlicesBlock$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `TealSlicesBlock$from_list`
## ------------------------------------------------

TealSlicesBlock <- getFromNamespace("TealSlicesBlock", "teal")
block <- TealSlicesBlock$new()
block$from_list(list(text = "sth", style = "default"))


## ------------------------------------------------
## Method `TealSlicesBlock$to_list`
## ------------------------------------------------

TealSlicesBlock <- getFromNamespace("TealSlicesBlock", "teal")
block <- TealSlicesBlock$new()
block$to_list()


teal documentation built on April 3, 2025, 5:32 p.m.