Title: | Create Split Packed Bubble Charts |
---|---|
Description: | By binding R functions and the 'Highcharts' <http://www.highcharts.com/> charting library, 'hpackedbubble' package provides a simple way to draw split packed bubble charts. |
Authors: | Zhenxing Cheng [aut, cre] |
Maintainer: | Zhenxing Cheng <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-02-13 04:43:10 UTC |
Source: | https://github.com/cran/hpackedbubble |
Carbon emissions around the world (2014)
CO2
CO2
A tibble data frame with 116 rows and 3 variables.
By binding R functions and the 'Highcharts' http://www.highcharts.com/ charting library, 'hpackedbubble' package provides a simple way to draw split packed bubble charts.
hpackedbubble(cat, name, value, theme = "sandsignika", width = NULL, height = NULL, title = "", titleAlign = "center", titleSize = "20px", titleColor = "#333333", subtitle = "", subtitleAlign = "center", subtitleSize = "", subtitleColor = "#666666", pointFormat = "<b>{point.name}:</b> {point.y}", split = 1, packedbubbleMinSize = "50%", packedbubbleMaxSize = "250%", packedbubbleZMin = 0, packedbubbleZmax = 1000, gravitational = 0.0625, seriesInteraction = 1, dragBetweenSeries = 1, parentNodeLimit = 1, dataLabels = 1, dataLabelsformat = "{point.name}", dataLabelsFilter = 250, dataLabelsColor = "black")
hpackedbubble(cat, name, value, theme = "sandsignika", width = NULL, height = NULL, title = "", titleAlign = "center", titleSize = "20px", titleColor = "#333333", subtitle = "", subtitleAlign = "center", subtitleSize = "", subtitleColor = "#666666", pointFormat = "<b>{point.name}:</b> {point.y}", split = 1, packedbubbleMinSize = "50%", packedbubbleMaxSize = "250%", packedbubbleZMin = 0, packedbubbleZmax = 1000, gravitational = 0.0625, seriesInteraction = 1, dragBetweenSeries = 1, parentNodeLimit = 1, dataLabels = 1, dataLabelsformat = "{point.name}", dataLabelsFilter = 250, dataLabelsColor = "black")
cat |
category verctor; |
name |
name vector; |
value |
value vector; |
theme |
chart theme, you can use these themes: darkgreen/darkblue/avocado/darkunica/gray/ gridlight/grid/sandsignika/sunset; |
width |
chart width, for example, "100%"; |
height |
chart height, for example, "400px"; |
title |
title; |
titleAlign |
title alignment, left/center/right; |
titleSize |
title size, like "20px"; |
titleColor |
title color, like "#333333"; |
subtitle |
subtitle; |
subtitleAlign |
subtitle alignment, left/center/right; |
subtitleSize |
subtitle size, like "16px"; |
subtitleColor |
subtitle color, like "#666666" |
pointFormat |
The HTML of the point's line in the tooltip. |
split |
Whether to split series into individual groups or to mix all series together. 1 means to split, 0 means to not, defaults to split; |
packedbubbleMinSize |
Minimum bubble size. Defaults to '50%'; |
packedbubbleMaxSize |
Maximum bubble size. Defaults to '250%'; |
packedbubbleZMin |
The minimum for the Z value range. Defaults to 0, you can use the lowest Z value in the data; |
packedbubbleZmax |
The maximum for the Z value range. Defaults to 1000, you can use the highest Z value in the data; |
gravitational |
Gravitational const used in the barycenter force of the algorithm. Defaults to 0.0625. |
seriesInteraction |
Whether series should interact with each other or not. 1 means to true, 0 means to false, defaults to 1; |
dragBetweenSeries |
In case of split series, this option allows user to drag and drop points between series, for changing point related series. 1 means to true, 0 means to false, defaults to 1; |
parentNodeLimit |
Whether bubbles should interact with their parentNode to keep them inside. 1 means to true, 0 means to false, defaults to 1; |
dataLabels |
Options for the series data labels, appearing next to each data point. 1 means to true, 0 means to false, defaults to 1; |
dataLabelsformat |
Data labels' format |
dataLabelsFilter |
Show data labels while 'value' larger than dataLabelsFilter. defaults to 250. |
dataLabelsColor |
Data labels' color, defaults to black. |
library(hpackedbubble) if (interactive()) { hpackedbubble(CO2$continent, CO2$country, CO2$CO2) }
library(hpackedbubble) if (interactive()) { hpackedbubble(CO2$continent, CO2$country, CO2$CO2) }
Output and render functions for using hpackedbubble within Shiny applications and interactive Rmd documents.
hpackedbubbleOutput(outputId, width = "100%", height = "400px") renderHpackedbubble(expr, env = parent.frame(), quoted = FALSE)
hpackedbubbleOutput(outputId, width = "100%", height = "400px") renderHpackedbubble(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a hpackedbubble |
env |
The environment in which to evaluate |
quoted |
Is |