Skip to contents

Class representing a widget.

Value

The value.

The ESM string.

List of values.

The width.

The height.

The port number.

Details

AnyHtmlWidget

Methods


Method new()

Create a new widget instance.

Usage

AnyHtmlWidget$new(.esm, .mode, .width = NA, .height = NA, .commands = NA, ...)

Arguments

.esm

The EcmaScript module as a string.

.mode

The widget mode.

.width

The widget width. Optional.

.height

The widget height. Optional.

.commands

TODO

...

All other named arguments will be used to create active bindings on the instance.


Method .set_value()

Set a value.

Usage

AnyHtmlWidget$.set_value(key, val, emit_change = TRUE)

Arguments

key

The key of the value to set.

val

The new value.

emit_change

Should the .on_change handler be called?


Method .on_change()

Register a change handler to call if emit_change is TRUE in .set_value.

Usage

AnyHtmlWidget$.on_change(callback)

Arguments

callback

A callback function to register.


Method .get_value()

Get a particular value.

Usage

AnyHtmlWidget$.get_value(key)

Arguments

key

The key of the value to get.


Method .get_esm()

Get the ESM string.

Usage

AnyHtmlWidget$.get_esm()


Method .get_values()

Get all widget values

Usage

AnyHtmlWidget$.get_values()


Method .get_width()

Get the widget width.

Usage

AnyHtmlWidget$.get_width()


Method .get_height()

Get the widget height.

Usage

AnyHtmlWidget$.get_height()


Method .set_values()

Set all values. TODO: is this ever used?

Usage

AnyHtmlWidget$.set_values(new_values)

Arguments

new_values

A list of new values.


Method .set_mode()

Set the widget mode.

Usage

AnyHtmlWidget$.set_mode(mode)

Arguments

mode

The new widget mode.


Method .start_server()

Start the server, if not running.

Usage

AnyHtmlWidget$.start_server()


Method .stop_server()

Stop the server, if running.

Usage

AnyHtmlWidget$.stop_server()


Method .get_host()

Get the server hostname.

Usage

AnyHtmlWidget$.get_host()

Returns

The hostname as a string.


Method .get_port()

Get the server port.

Usage

AnyHtmlWidget$.get_port()


Method print()

Custom print function for the R6 class. If mode is "shiny", falls back to original R6 print behavior. Otherwise, renders the widget.

Usage

AnyHtmlWidget$print()


Method render()

Render the widget.

Usage

AnyHtmlWidget$render()


Method clone()

The objects of this class are cloneable with this method.

Usage

AnyHtmlWidget$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.