commit: Commit Data to Stack Frame

Description Usage Arguments Value Examples

View source: R/stack.R

Description

Function adds a new view to the stack frame. Multiple views can be added to one frame, but in this case every plot must be supplied with certain parameters to distiguish one view from another. In the case of single plot parameters are not necessary. For multiple views parameters will be automaticaly converted to UI controls like sliders and drop down lists.

Usage

1
2
3
4
5
6
7
8
commit(
  frame,
  obj,
  description = NULL,
  params = NULL,
  handler = auto_handler(),
  ...
)

Arguments

frame

A frame you want to commit.

obj

A data to commit. Data will be preprocessed by the handler but dependently on auto_push mode will be sent to server or not. If auto_push is False then the data won't be sent. Explicit push call need anyway to process committed data. auto_push is useful only in the case of multiple data objects in the stack frame, e.g. set of plots with settings.

description

Description of the data.

params

Parameters associated with this data, e.g. plot settings.

handler

A handler which can be specified in the case of custom content, but by default it is auto_handler.

...

Optional parameters is an alternative to params. If both are present this one will be merged into params.

Value

Changed frame.

Examples

1
2
3
4
5
6
library(ggplot2)
library(dstack)
image <- qplot(clarity, data = diamonds, fill = cut, geom = "bar")
frame <- create_frame(stack = "diamonds")
frame <- commit(frame, image, "Diamonds bar chart")
print(push(frame)) # print actual stack URL

dstack documentation built on Aug. 12, 2020, 5:08 p.m.