add_catmaply_slider: Add catmaply slider traces

View source: R/trace.R

add_catmaply_sliderR Documentation

Add catmaply slider traces

Description

Function to produce catmaply traces.

Usage

add_catmaply_slider(
  fig,
  df,
  annotated,
  text_color = "#444",
  text_size = 12,
  text_font_family = c("Open Sans", "verdana", "arial", "sans-serif"),
  slider_steps,
  slider_currentvalue_prefix = "",
  slider_step_visible,
  slider_currentvalue_visible,
  slider_tick_visible,
  hover_hide,
  color_palette,
  categorical_color_range,
  category_items,
  legend_items,
  legend
)

Arguments

fig

plotly object

df

data.frame or tibble holding the data.

annotated

boolean indicating if annotations should be displayed.

text_color

font color to be used for text; (default: "#444").

text_size

font size to be used for text/annotation. Needs to be a number greater than or equal to 1; (default: 12).

slider_steps

list holding the configuration of the steps to be created. There are two alternatives: auto and custom; whereas the auto mode creates the steps automatically and custom takes custom instructions on how to create the steps. For mode auto, a list with the following elements has to be submitted (values of the list element are just examples):
list(
slider_start=1,
slider_range=15,
slider_shift=5,
)
This will create the steps automatically for you, essentially starting at position slider_start, shifting the window of size slider_range along the x axis with a stepsize of slider_shift. The stepnames are automatically selected with the x value of the left side of the slider_range (so for 1 it would take the first value of the x axis as name of the step).
With custom, on the other hand, you can define the step configuration without any restrictions. The custom configuration needs to be defined in a list with the following elements.
list(
list(name="Step_One", range=c(1, 50)),
list(name="Step_Two", range=c(5, 55)),
...
).
(default:
list(
slider_start=1,
slider_range=15,
slider_shift=5,
)).

slider_currentvalue_prefix

prefix to be used for the slider title. Only used if slider=TRUE. (default: "").

slider_step_visible

boolean indicating if the step names should be displayed for the slider. (default: TRUE).

slider_currentvalue_visible

boolean indicating if the currently selected value should be displayed above the slider. (default: TRUE).

slider_tick_visible

boolean indicating if the tickvalues should be displayed below the slider. (default: TRUE).

hover_hide

boolean indicating if the hover label should be hidden or not; (default: FALSE).

color_palette

a color palette vector.

categorical_color_range

if the resulting heatmap holds categorical field values or continuous values that belong to a category; (default: FALSE).

category_items

distinct/unique items of ordered category items

legend_items

distinct/unique items of ordered legend items

text_font_color

the typeface that will be applied by the web browser for the text/annotation. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system; (default: c("Open Sans", "verdana", "arial", "sans-serif")).

categorical_col

if categorical_color_range is TRUE, then this column is used to create categories; (default: FALSE).

Value

plot_ly object


catmaply documentation built on Jan. 6, 2023, 1:22 a.m.