Skip to content
Back to skills

Ggvis

ASecurity

R ggvis package for interactive graphics. Use for creating interactive web graphics with a grammar of graphics.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 4, 2026
datago

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill ggvis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ggvis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ggvis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-ggvis/badge)](https://www.skillsdirectory.com/skills/leolin990405-ggvis)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ggvis
description: R ggvis package for interactive graphics. Use for creating interactive web graphics with a grammar of graphics.
---

# ggvis

Interactive web graphics with grammar of graphics.

## Basic Plots

```r
library(ggvis)

# Scatter plot
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points()

# Line plot
df %>%
  ggvis(~x, ~y) %>%
  layer_lines()

# Bar plot
df %>%
  ggvis(~category) %>%
  layer_bars()
```

## Aesthetics

```r
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points(
    fill = ~factor(cyl),
    size = ~hp,
    opacity := 0.5
  )

# := for fixed values, ~ for mapped values
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points(
    fill := "red",      # Fixed color
    size := 100,        # Fixed size
    stroke := "black"   # Fixed stroke
  )
```

## Multiple Layers

```r
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points() %>%
  layer_smooths(stroke := "red")

# Points with lines
df %>%
  ggvis(~x, ~y) %>%
  layer_points() %>%
  layer_lines()
```

## Interactivity

```r
# Tooltips
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points() %>%
  add_tooltip(function(df) df$mpg)

# Custom tooltip
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points() %>%
  add_tooltip(function(df) {
    paste0("MPG: ", df$mpg, "<br>", "Weight: ", df$wt)
  }, "hover")
```

## Input Controls

```r
# Slider
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points(
    size := input_slider(10, 300, value = 50, label = "Size")
  )

# Select
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points(
    fill := input_select(c("red", "blue", "green"), label = "Color")
  )

# Checkbox
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points(
    opacity := input_checkbox(label = "Transparent", map = function(x) if(x) 0.3 else 1)
  )
```

## Scales

```r
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points(fill = ~factor(cyl)) %>%
  scale_nominal("fill", range = c("red", "blue", "green"))

# Axis customization
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points() %>%
  add_axis("x", title = "Weight") %>%
  add_axis("y", title = "Miles per Gallon")
```

## Legends

```r
mtcars %>%
  ggvis(~wt, ~mpg, fill = ~factor(cyl)) %>%
  layer_points() %>%
  add_legend("fill", title = "Cylinders")
```

## Histograms and Density

```r
# Histogram
mtcars %>%
  ggvis(~mpg) %>%
  layer_histograms(width = 2)

# Density
mtcars %>%
  ggvis(~mpg) %>%
  layer_densities()
```

## Grouping

```r
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points() %>%
  layer_smooths() %>%
  group_by(cyl)
```

## Shiny Integration

```r
# In Shiny UI
ggvisOutput("plot")

# In Shiny server
bind_shiny(
  mtcars %>%
    ggvis(~wt, ~mpg) %>%
    layer_points(),
  "plot"
)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…