
bubbles.
Creates a bubble chart.
bubbles(value, label, key = NULL, tooltip = "", color = "#EEEEEE",
textColor = "#333333", width = NULL, height = NULL)
Numeric vector of values, used for sizing bubbles. The value
will be proportional to the radius, not the area; for area, call
sqrt
on the value.
Character vector of textual labels to use on bubbles
Values that will uniquely identify a bubble across runs. This
doesn't matter for static bubble charts, but if a bubble chart receives
updates (i.e. in a Shiny app) then d3.js will use the key to know which
bubbles in the "before" state correspond with which bubbles in the
"after" state, and perform smooth transitions. If NULL
, then the
key will effectively be the row number.
Character vector of tooltip values, to be shown on hover
Character vector of bubble color values, in "#RRGGBB"
format; can be length 1 or length of value
Character vector of text color values, in "#RRGGBB"
format; can be length 1 or length of value
The width of the widget, or NULL
for default.
The height of the widget, or NULL
for default.
A widget object that can be printed at the console, outputted as part
of an R Markdown document, or used in a Shiny app with
renderBubbles
.
# NOT RUN {
bubbles(runif(10), LETTERS[1:10], color = rainbow(10, alpha = NULL))
# }
Run the code above in your browser using DataLab