Skip to contents

Set Figure export options: size, frame, background, fonts, title and axis labels, axes, legend, preview, what Export downloads; only those given change, nothing is exported.

Usage

cellucid_figure_export_set(
  viewer,
  auto_text_size,
  background,
  background_color,
  depth_sort,
  download,
  dpi,
  emphasize_selection,
  export_all_views,
  font_family,
  font_sizes,
  frame,
  height,
  include_axes,
  include_legend,
  legend_position,
  optimized_target_count,
  preview,
  reference_grid,
  selection_muted_opacity,
  show_orientation,
  size_preset,
  svg_strategy,
  title,
  title_follows_dataset,
  width,
  x_label,
  y_label
)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

auto_text_size

Size the text from the figure's size (font_sizes is then null). TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

background

The background: the viewer's, white, transparent or custom. One of "viewer", "white", "transparent", "custom". Left out unless given (the viewer then chooses as its own control does).

background_color

The custom background colour, lowercase #rrggbb. Text. Left out unless given (the viewer then chooses as its own control does).

depth_sort

Draw 3D points back to front. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

download

What Export downloads. One of "svg", "png", "svg+png", "png-multi", "all". Left out unless given (the viewer then chooses as its own control does).

dpi

The resolution of a PNG. One of 150, 300, 600. Left out unless given (the viewer then chooses as its own control does).

emphasize_selection

Fade the cells that are not highlighted. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

export_all_views

Export every view of the multiview, side by side. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

font_family

The font of every text. One of "Arial, Helvetica, sans-serif", "Helvetica, Arial, sans-serif", "\"Times New Roman\", Times, serif". Left out unless given (the viewer then chooses as its own control does).

font_sizes

Text sizes in pixels while auto_text_size is off, else null. A named list or NULL. Left out unless given (the viewer then chooses as its own control does).

base

A whole number (at least 1, at most 500). Required.

centroid_label

A whole number (at least 1, at most 500). Required.

legend

A whole number (at least 1, at most 500). Required.

ticks

A whole number (at least 1, at most 500). Required.

title

A whole number (at least 1, at most 500). Required.

frame

The part of the view exported (needs the preview on), or null for the whole view. A named list or NULL. Left out unless given (the viewer then chooses as its own control does).

rect

The frame as fractions of the view, from its top left. A named list. Required.

width

A number (at least 0, at most 1). Required.

x

A number (at least 0, at most 1). Required.

y

A number (at least 0, at most 1). Required.

height

Plot height in CSS pixels. A whole number (at least 100, at most 20000). Left out unless given (the viewer then chooses as its own control does).

include_axes

Draw the axes. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

include_legend

Draw the legend. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

legend_position

Where the legend goes. One of "right", "bottom". Left out unless given (the viewer then chooses as its own control does).

optimized_target_count

How many points an optimized SVG keeps. A whole number (at least 1000, at most 5000000). Left out unless given (the viewer then chooses as its own control does).

preview

The preview in the panel and the colour-vision deficiency it simulates. A named list. Left out unless given (the viewer then chooses as its own control does).

enabled

TRUE or FALSE. Required.

reference_grid

Draw a reference grid. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

selection_muted_opacity

The opacity of the faded cells, 0 to 1. A number (at least 0, at most 1). Left out unless given (the viewer then chooses as its own control does).

show_orientation

Draw the 3D orientation indicator. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

size_preset

The size preset shown in the panel. One of "screen-half", "screen", "1200x900", "1600x1200", "1920x1080". Left out unless given (the viewer then chooses as its own control does).

svg_strategy

How an SVG draws many points, or null until chosen. One of "full-vector", "optimized-vector", "hybrid", NULL. Left out unless given (the viewer then chooses as its own control does).

title

The figure title while it does not follow the dataset, else null. Text or NULL. Left out unless given (the viewer then chooses as its own control does).

title_follows_dataset

The title is the dataset's name (title is then null). TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

width

Plot width in CSS pixels. A whole number (at least 100, at most 20000). Left out unless given (the viewer then chooses as its own control does).

x_label

The x axis label. Text. Left out unless given (the viewer then chooses as its own control does).

y_label

The y axis label. Text. Left out unless given (the viewer then chooses as its own control does).

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 its outcome (what it did, as names, counts and ids), or NULL when it had nothing to report; request$step is the history step it made.

Details

The viewer's action figure-export.set (Settings). It changes what the viewer shows: one step of the viewer's history, labelled as R's, undone like any other. The state it can change: settings.

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_figure_export_set(viewer, height = 900,
      include_axes = FALSE, width = 1200)
  print(request)
  # cellucid_action_result(request) waits for its outcome.
  cellucid_stop(viewer)
}