new_plugin: Board plugin

View source: R/board-plugins.R

new_pluginR Documentation

Board plugin

Description

A core mechanism for extending or customizing UX aspects of the board module is a "plugin" architecture. All plugins inherit from plugin and a sub-class is assigned to each specific plugin. The "manage blocks" plugin for example has a class vector c("manage_blocks", "plugin"). Sets of plugins are handled via a wrapper class plugins. Each plugin needs a server component, in most cases accompanied by a UI component and is optionally bundled with a validator function.

Usage

new_plugin(
  server,
  ui = NULL,
  validator = function(x, ...) x,
  class = character()
)

is_plugin(x)

as_plugin(x)

board_plugins(which = NULL)

plugins(...)

is_plugins(x)

as_plugins(x)

validate_plugins(x)

Arguments

server, ui

Server/UI for the plugin module

validator

Validator function that validates server return values

class

Plugin subclass

x

Plugin object

which

(Optional) character vectors of plugins to include

...

Plugin objects

Value

Constructors new_plugin()/plugins() return plugin and plugins objects, respectively, as do as_plugin()/as_plugins() and validators validate_plugin()/validate_plugins(), which are typically called for their side effects of throwing errors in case of validation failure. Inheritance checkers is_plugin()/is_plugins() return scalar logicals and finally, the convenience function board_plugins() returns a plugins object with all known plugins (or a selected subset thereof).

Examples

plg <- board_plugins()

is_plugins(plg)
names(plg)

plg[1:3]

is_plugin(plg[["preserve_board"]])


blockr.core documentation built on June 8, 2025, 1:43 p.m.