Skip to contents

Blocks consist of a set of fields, an expression that defines what the block produces (given the result of the previous block combined with user input), plus some meta data.

Usage

new_block(
  fields,
  expr,
  name = rand_names(),
  submit = FALSE,
  ...,
  class = character()
)

is_block(x)

Arguments

fields

A list of field, each entry inheriting from "field"

expr

A quoted expression (compatible with partial substitution as implemented in base::bquote() and intended for evaluation in the context of the fields)

name

Block name

submit

Whether this block requires to press a submit button to get the results. Boolean, default to FALSE, which means no submit button. If NA, then no computation is triggered and the user needs to click on the button to see the block result. If TRUE, computation is automatically triggered and the button is shown (which is useful when restoring a stack).

...

Further (metadata) attributes

class

Block subclass

x

An object inheriting from "block"