- data
A data frame (optional) or crosstalk::SharedData object.
- ...
Arguments (i.e., attributes) passed along to the trace type
.
See schema()
for a list of acceptable attributes for a given trace type
(by going to traces
-> type
-> attributes
). Note that attributes
provided at this level may override other arguments
(e.g. plot_ly(x = 1:10, y = 1:10, color = I("red"), marker = list(color = "blue"))
).
- type
A character string specifying the trace type (e.g. "scatter"
, "bar"
, "box"
, etc).
If specified, it always creates a trace, otherwise
- name
Values mapped to the trace's name attribute. Since a trace can
only have one name, this argument acts very much like split
in that it
creates one trace for every unique value.
- color
Values mapped to relevant 'fill-color' attribute(s)
(e.g. fillcolor,
marker.color,
textfont.color, etc.).
The mapping from data values to color codes may be controlled using
colors
and alpha
, or avoided altogether via I()
(e.g., color = I("red")
).
Any color understood by grDevices::col2rgb()
may be used in this way.
- colors
Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"),
or a vector of colors to interpolate in hexadecimal "#RRGGBB" format,
or a color interpolation function like colorRamp()
.
- alpha
A number between 0 and 1 specifying the alpha channel applied to color
.
Defaults to 0.5 when mapping to fillcolor and 1 otherwise.
- stroke
Similar to color
, but values are mapped to relevant 'stroke-color' attribute(s)
(e.g., marker.line.color
and line.color
for filled polygons). If not specified, stroke
inherits from color
.
- strokes
Similar to colors
, but controls the stroke
mapping.
- alpha_stroke
Similar to alpha
, but applied to stroke
.
- size
(Numeric) values mapped to relevant 'fill-size' attribute(s)
(e.g., marker.size,
textfont.size,
and error_x.width).
The mapping from data values to symbols may be controlled using
sizes
, or avoided altogether via I()
(e.g., size = I(30)
).
- sizes
A numeric vector of length 2 used to scale size
to pixels.
- span
(Numeric) values mapped to relevant 'stroke-size' attribute(s)
(e.g.,
marker.line.width,
line.width for filled polygons,
and error_x.thickness)
The mapping from data values to symbols may be controlled using
spans
, or avoided altogether via I()
(e.g., span = I(30)
).
- spans
A numeric vector of length 2 used to scale span
to pixels.
- symbol
(Discrete) values mapped to marker.symbol.
The mapping from data values to symbols may be controlled using
symbols
, or avoided altogether via I()
(e.g., symbol = I("pentagon")
).
Any pch value or symbol name may be used in this way.
- symbols
A character vector of pch values or symbol names.
- linetype
(Discrete) values mapped to line.dash.
The mapping from data values to symbols may be controlled using
linetypes
, or avoided altogether via I()
(e.g., linetype = I("dash")
).
Any lty
(see par) value or dash name may be used in this way.
- linetypes
A character vector of lty
values or dash names
- split
(Discrete) values used to create multiple traces (one trace per value).
- frame
(Discrete) values used to create animation frames.
- width
Width in pixels (optional, defaults to automatic sizing).
- height
Height in pixels (optional, defaults to automatic sizing).
- source
a character string of length 1. Match the value of this string
with the source argument in event_data()
to retrieve the
event data corresponding to a specific plot (shiny apps can have multiple plots).