ggiraph (version 0.4.0)

geom_point_interactive: interactive points

Description

The geometry is based on geom_point. See the documentation for those functions for more details.

Usage

geom_point_interactive(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

mapping

The aesthetic mapping, see geom_point.

data

A data frame, see geom_point.

stat

The statistical transformation to use on the data for this layer, as a string, see geom_point.

position

Postion adjustment, see geom_point.

na.rm
show.legend
inherit.aes
...

other arguments passed on to layer. See geom_point.

See Also

ggiraph

Examples

Run this code
# NOT RUN {
# add interactive points to a ggplot -------
# create dataset
dataset = iris
dataset$tooltip = dataset$Species
dataset$clickjs = paste0("alert(\"",dataset$Species, "\")" )

# plots
gg_point = ggplot(dataset, aes(x = Sepal.Length, y = Petal.Width,
		color = Species, tooltip = tooltip, onclick = clickjs) ) +
	geom_point_interactive()

ggiraph(code = {print(gg_point)})
# }

Run the code above in your browser using DataCamp Workspace