ggiraph (version 0.1.0)

ggiraph: ggiraph

Description

Create an interactive graphic to be used in a web browser.

Usage

ggiraph(code, pointsize = 12, width = 6, height = 6,
  hover_css = "{fill:orange;}", ...)

Arguments

code
Plotting code to execute
pointsize
the default pointsize of plotted text in pixels, default to 12.
width
widget width
height
widget height
hover_css
css to apply when mouse is hover and element with a data-id attribute
...
arguments passed on to dsvg

See Also

geom_path_interactive, geom_point_interactive, geom_polygon_interactive, geom_rect_interactive, geom_segment_interactive

Examples

Run this code
# ggiraph simple example -------
# create dataset
dataset = iris
dataset$tooltip = dataset$Species
dataset$clickjs = paste0("function() {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 DataLab