Creates an interactive plot using ggiraph. This function extends
gf_dotplot() with interactive features like tooltips and clickable elements.
gf_dotplot_interactive(
object = NULL,
gformula = NULL,
data = NULL,
...,
alpha,
color,
fill,
group,
binwidth = NULL,
binaxis = "x",
method = "dotdensity",
binpositions = "bygroup",
stackdir = "up",
stackratio = 1,
dotsize = 1,
stackgroups = FALSE,
origin = NULL,
right = TRUE,
width = 0.9,
drop = FALSE,
xlab,
ylab,
title,
subtitle,
caption,
stat = rlang::quo(ggplot2::StatBin),
position = "identity",
show.legend = NA,
show.help = NULL,
inherit = TRUE,
environment = parent.frame()
)A gg object that can be displayed with gf_girafe().
When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. See details and examples.
A formula with shape ~ x. Faceting can be
achieved by including | in the formula.
A data frame with the variables to be plotted.
Additional arguments passed to the underlying interactive
geom. This is where ggiraph's interactive aesthetics are supplied,
including tooltip (text shown on hover), data_id
(identifiers used for interactive selection), and onclick
(JavaScript run on click).
Opacity (0 = invisible, 1 = opaque).
A color or a formula used for mapping color.
A color for filling, or a formula used for mapping fill.
Used for grouping.
When method is "dotdensity", this specifies
maximum bin width. When method is "histodot", this specifies
bin width. Defaults to 1/30 of the range of the data
The axis to bin along, "x" (default) or "y"
"dotdensity" (default) for dot-density binning, or "histodot" for fixed bin widths (like stat_bin)
When method is "dotdensity", "bygroup"
(default) determines positions of the bins for each group separately.
"all" determines positions of the bins with all the data taken
together; this is used for aligning dot stacks across multiple groups.
which direction to stack the dots. "up" (default), "down", "center", "centerwhole" (centered, but with dots aligned)
how close to stack the dots. Default is 1, where dots just touch. Use smaller values for closer, overlapping dots.
The diameter of the dots relative to binwidth,
default 1.
should dots be stacked across groups? This has the
effect that position = "stack" should have, but can't (because
this geom has some odd properties).
When method is "histodot", origin of first bin
When method is "histodot", should intervals be
closed on the right (a, b], or not [a, b)
When binaxis is "y", the spacing of the dot stacks
for dodging.
If TRUE, remove all bins with zero counts
Label for x-axis. See also
gf_labs().
Label for y-axis. See also
gf_labs().
Title, sub-title, and caption for the plot. See also
gf_labs().
Title, sub-title, and caption for the plot. See also
gf_labs().
Title, sub-title, and caption for the plot. See also
gf_labs().
Use to override the default connection between
geom_lm and stat_lm.
Either a character string naming the position function used for the layer or a position object returned from a call to a position function.
A logical indicating whether this layer should be
included in the legends. NA, the default, includes layer in the
legends if any of the attributes of the layer are mapped.
If TRUE, display some minimal help.
A logical indicating whether default attributes are inherited.
An environment in which to look for variables not
found in data.
onclick: JavaScript code (as character string) executed when clicking elements.
Additional ggiraph aesthetics may be available depending on the geom.
gf_dotplot(), gf_girafe()