| gf_curve_interactive | R Documentation |
Creates an interactive plot using ggiraph. These functions extend
gf_segment() and gf_curve() with interactive features like tooltips and
clickable elements.
Creates an interactive plot using ggiraph. This function extends
gf_segment() with interactive features like tooltips and clickable elements.
object |
When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. |
gformula |
A formula with shape |
data |
The data to be displayed in this layer. |
tooltip |
A formula specifying a variable for tooltips, or a character vector. |
data_id |
A formula or character vector specifying data identifiers for interactive selection. |
... |
Additional arguments passed to the underlying geom. |
alpha, color, size, shape, fill, group, stroke |
Aesthetics passed to the geom. |
xlab, ylab, title, subtitle, caption |
Labels for the plot. |
show.legend |
Logical. Should this layer be included in the legends? |
show.help |
Logical. If |
inherit |
Logical. If |
environment |
An environment in which to evaluate the formula. |
A gg object that can be displayed with gf_girafe().
A gg object that can be displayed with gf_girafe().
onclick: JavaScript code (as character string) executed when clicking elements.
Additional ggiraph aesthetics may be available depending on the geom.
onclick: JavaScript code (as character string) executed when clicking elements.
Additional ggiraph aesthetics may be available depending on the geom.
gf_curve(), gf_girafe()
gf_segment(), gf_girafe()
gf_curve_interactive(
1 + 2 ~ 0 + 4, color = "red", curvature = - 0.2,
tooltip = ~ "curvature: -0.2",
data_id = 0.2
) |>
gf_curve_interactive(
1 + 2 ~ 0 + 4, color = "blue", curvature = 0.4,
tooltip = ~ "curvature: 0.4",
data_id = 0.4) |>
gf_segment_interactive(
1 + 2 ~ 0 + 4, color = "green",
tooltip = ~ "curvature: 0",
data_id = 0
) |>
gf_girafe(
options = list(
opts_hover(css = "stroke: black; stroke-width: 3;", nearest_distance = 10)
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.