Skip to contents

A PNG of a view as the figure export draws it (points, legend), returned as base64; nothing is downloaded.

Usage

cellucid_view_picture(viewer, height = 480, legend = TRUE, view, width = 640)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

height

The plot's height in pixels. A whole number (at least 100, at most 20000). Default 480, the viewer's own.

legend

Draw the colour legend beside the plot. TRUE or FALSE. Default TRUE, the viewer's own.

view

The view: "View N" as the Compare views list numbers it; the selected view when left out. Text. Left out unless given (the viewer then chooses as its own control does).

width

The plot's width in pixels (the picture adds its margins and the legend). A whole number (at least 100, at most 20000). Default 640, the viewer's own.

Value

A cellucid_action_request, at once and invisibly: the action is sent now, or when the viewer's channel opens. cellucid_action_result(request) returns what it read: a list of height (The image's height in pixels), notes (What the picture leaves out of what the view shows (an overlay it cannot draw)), plot (The plot's size in the image, as asked for), png (The image, base64-encoded PNG bytes (an agent receives it as an image)), view (The view drawn, by its name), width (The image's width in pixels). Cells in it are original positions (0-based rows of the dataset's obs).

Details

The viewer's action view.picture (Views). It reads, and changes nothing: it makes no step of the history.

See also

cellucid_act() sends any action by its type, and cellucid_action_result() collects its answer.

Examples

if (interactive() && requireNamespace("SeuratObject", quietly = TRUE)) {
  data("pbmc_small", package = "SeuratObject")
  viewer <- cellucid_view(SeuratObject::UpdateSeuratObject(pbmc_small))
  request <- cellucid_view_picture(viewer)
  print(request)
  # cellucid_action_result(request) waits for what it read.
  cellucid_stop(viewer)
}