Skip to content
Animated d3 bubble chart
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
inst/htmlwidgets
man
.Rbuildignore
.gitignore
DESCRIPTION
MovingBubbles.Rproj
NAMESPACE
README.md
demo_akb-election.html
demo_olympics.html

README.md

MovingBubbles : Animated d3 bubble chart

The package provides a method to add the second information dimension, which can be either qualitative or quantitative, to the bubble chart by means of animation. The plotting and transitions between frames are handled by d3 library. The package uses htmlwidgets framework to bridge Javascript and R.

Usage & Demo

The function takes in a data.frame with key, value, and frame columns. Optional data.frame with key and color (hex) can be given to specify the bubble color. The frame column will be factorized if not already and the order of factor levels will be used to run the animation sequentially. Thus, the sequence can be defined by manually setting the levels of the frame column.

library(MovingBubbles)
dat <- data.frame(alphabets = rep(letters[1:6],5),
                  time = rep(paste0(1:5, "pm"), each = 6),
                  size = round(runif(30)*100))
dat$time <- factor(dat$time, levels = rep(paste0(1:5, "pm")))
MovingBubbles(dat, key = "alphabets", frame = "time", value = "size")

demo

Installation

devtools::install_github("chengvt/MovingBubbles", dependencies = TRUE)
You can’t perform that action at this time.