Compare commits
32 Commits
Author | SHA1 | Date |
---|---|---|
pvictor | 85708897b0 | |
pvictor | 9200d918ad | |
pvictor | 58723475cb | |
pvictor | b313b45989 | |
pvictor | 7e4189366e | |
pvictor | 3a3a10369f | |
pvictor | d0fac7c1ee | |
pvictor | 1ac176f30c | |
pvictor | 624ab8b901 | |
pvictor | 57733add33 | |
pvictor | c1560fc9c5 | |
dependabot[bot] | e68f20930c | |
pvictor | 6cff8a9f67 | |
pvictor | 1d94f9d4a6 | |
pvictor | eb228597d8 | |
pvictor | bbda86de93 | |
pvictor | 467be227fc | |
pvictor | 11d244e992 | |
pvictor | 5587cdbef4 | |
pvictor | be187e37f1 | |
Victor Perrier | 34aee9bc96 | |
Victor Perrier | 44ead44178 | |
Victor Perrier | 9baa753c3f | |
pvictor | 24c552ea68 | |
pvictor | b7ed86e556 | |
pvictor | 7705b91e88 | |
pvictor | 70204162f4 | |
dependabot[bot] | 11c6938935 | |
pvictor | f83cb879a8 | |
pvictor | de477fec66 | |
pvictor | 896998074e | |
pvictor | b69b7b7b4d |
|
@ -1,48 +1,50 @@
|
|||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
|
||||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
branches: [main, master]
|
||||
|
||||
name: test-coverage
|
||||
|
||||
jobs:
|
||||
test-coverage:
|
||||
runs-on: macOS-latest
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: r-lib/actions/setup-r@v1
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@v1
|
||||
|
||||
- name: Query dependencies
|
||||
run: |
|
||||
install.packages('remotes')
|
||||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
|
||||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Cache R packages
|
||||
uses: actions/cache@v2
|
||||
- uses: r-lib/actions/setup-r@v2
|
||||
with:
|
||||
path: ${{ env.R_LIBS_USER }}
|
||||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
|
||||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
|
||||
use-public-rspm: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
install.packages(c("remotes"))
|
||||
remotes::install_deps(dependencies = TRUE)
|
||||
remotes::install_cran("covr")
|
||||
shell: Rscript {0}
|
||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||
with:
|
||||
extra-packages: any::covr
|
||||
needs: coverage
|
||||
|
||||
- name: Test coverage
|
||||
run: covr::codecov()
|
||||
run: |
|
||||
covr::codecov(
|
||||
quiet = FALSE,
|
||||
clean = FALSE,
|
||||
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
|
||||
)
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Show testthat output
|
||||
if: always()
|
||||
run: |
|
||||
## --------------------------------------------------------------------
|
||||
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
|
||||
shell: bash
|
||||
|
||||
- name: Upload test results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-test-failures
|
||||
path: ${{ runner.temp }}/package
|
||||
|
|
|
@ -6,3 +6,4 @@ inst/doc
|
|||
data-raw/*.csv
|
||||
node_modules
|
||||
docs
|
||||
data-raw/inputs/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Package: apexcharter
|
||||
Version: 0.4.0
|
||||
Version: 0.4.3
|
||||
Title: Create Interactive Chart with the JavaScript 'ApexCharts' Library
|
||||
Description: Provides an 'htmlwidgets' interface to 'apexcharts.js'.
|
||||
'Apexcharts' is a modern JavaScript charting library to build interactive charts and visualizations with simple API.
|
||||
|
@ -28,7 +28,7 @@ Suggests:
|
|||
scales,
|
||||
rmarkdown,
|
||||
covr
|
||||
RoxygenNote: 7.2.1
|
||||
RoxygenNote: 7.3.1
|
||||
Roxygen: list(markdown = TRUE)
|
||||
URL: https://github.com/dreamRs/apexcharter, https://dreamrs.github.io/apexcharter/
|
||||
BugReports: https://github.com/dreamRs/apexcharter/issues
|
||||
|
|
|
@ -29,6 +29,7 @@ export(ax_dataLabels)
|
|||
export(ax_facet_grid)
|
||||
export(ax_facet_wrap)
|
||||
export(ax_fill)
|
||||
export(ax_forecast_data_points)
|
||||
export(ax_grid)
|
||||
export(ax_labels)
|
||||
export(ax_labels2)
|
||||
|
@ -52,6 +53,7 @@ export(ax_xaxis)
|
|||
export(ax_yaxis)
|
||||
export(ax_yaxis2)
|
||||
export(bar_opts)
|
||||
export(boxplot_opts)
|
||||
export(bubble_opts)
|
||||
export(config_update)
|
||||
export(events_opts)
|
||||
|
@ -81,6 +83,7 @@ export(vars)
|
|||
importFrom(ggplot2,aes)
|
||||
importFrom(ggplot2,label_value)
|
||||
importFrom(ggplot2,vars)
|
||||
importFrom(graphics,boxplot)
|
||||
importFrom(htmltools,css)
|
||||
importFrom(htmltools,renderTags)
|
||||
importFrom(htmltools,resolveDependencies)
|
||||
|
@ -104,6 +107,7 @@ importFrom(rlang,is_function)
|
|||
importFrom(rlang,is_list)
|
||||
importFrom(rlang,is_named)
|
||||
importFrom(rlang,is_null)
|
||||
importFrom(rlang,quo)
|
||||
importFrom(rlang,quos)
|
||||
importFrom(rlang,sym)
|
||||
importFrom(rlang,syms)
|
||||
|
|
26
NEWS.md
26
NEWS.md
|
@ -1,8 +1,32 @@
|
|||
apexcharter 0.4.3
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.49.1 (see https://github.com/apexcharts/apexcharts.js/releases).
|
||||
* New chart type : slope charts.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.4.2
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.46.0 (see https://github.com/apexcharts/apexcharts.js/releases).
|
||||
|
||||
|
||||
|
||||
apexcharter 0.4.1
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.41.0 (new charts type: dumbbell chart and funnel chart).
|
||||
* `apex()` : added support for boxplot.
|
||||
* New function `ax_forecast_data_points()` to mark points as forecasted values.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.4.0
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.36.3.
|
||||
* New chart type : range area charts
|
||||
* New chart type : range area charts.
|
||||
* Facets: correctly manage secondary y axis.
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ events_opts <- function(click = NULL,
|
|||
|
||||
#' @title Bar options
|
||||
#'
|
||||
#' @description Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param horizontal Logical. This option will turn a column chart into a horizontal bar chart.
|
||||
#' @param endingShape Available Options: \code{"flat"} or \code{"rounded"}.
|
||||
|
@ -128,7 +128,7 @@ events_opts <- function(click = NULL,
|
|||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/bar/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
|
@ -170,7 +170,7 @@ bar_opts <- function(horizontal = NULL,
|
|||
|
||||
#' @title Heatmap options
|
||||
#'
|
||||
#' @description Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param radius Numeric. Radius of the rectangle inside heatmap.
|
||||
#' @param enableShades Logical. Enable different shades of color depending on the value
|
||||
|
@ -180,7 +180,7 @@ bar_opts <- function(horizontal = NULL,
|
|||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/heatmap/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
|
@ -228,7 +228,7 @@ heatmap_opts <- function(radius = NULL,
|
|||
|
||||
#' @title Radial bar options
|
||||
#'
|
||||
#' @description Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param size Numeric. Manual size of the radialBars instead of calculating automatically from default height / width.
|
||||
#' @param inverseOrder Logical. Whether to make the first value of series innermost or outermost.
|
||||
|
@ -243,7 +243,7 @@ heatmap_opts <- function(radius = NULL,
|
|||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/radialbar/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
|
@ -301,7 +301,7 @@ radialBar_opts <- function(size = NULL,
|
|||
|
||||
#' @title Pie options
|
||||
#'
|
||||
#' @description Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param size Numeric. Custom size of the pie which will override the default size calculations.
|
||||
#' @param donut List with two fields \code{size} (Donut / ring size in percentage relative to the total pie area.)
|
||||
|
@ -314,7 +314,7 @@ radialBar_opts <- function(size = NULL,
|
|||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/pie/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
|
@ -351,7 +351,7 @@ pie_opts <- function(size = NULL,
|
|||
|
||||
#' @title Bubble options
|
||||
#'
|
||||
#' @description Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param minBubbleRadius Minimum radius size of a bubble.
|
||||
#' If a bubble value is too small to be displayed, this size will be used.
|
||||
|
@ -361,7 +361,7 @@ pie_opts <- function(size = NULL,
|
|||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/bubble/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
|
@ -386,3 +386,36 @@ bubble_opts <- function(minBubbleRadius, maxBubbleRadius, ...) {
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#' @title Boxplot options
|
||||
#'
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param color.upper Color for the upper quartile (Q3 to median) of the box plot.
|
||||
#' @param color.lower Color for the lower quartile (median to Q1) of the box plot.
|
||||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/boxplot/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' data("mpg", package = "ggplot2")
|
||||
#' apex(mpg, aes(class, hwy), "boxplot") %>%
|
||||
#' ax_plotOptions(
|
||||
#' boxPlot = boxplot_opts(color.upper = "#848484", color.lower = "#848484" )
|
||||
#' )
|
||||
boxplot_opts <- function(color.upper, color.lower, ...) {
|
||||
dropNulls(
|
||||
list(
|
||||
colors = dropNulls(list(
|
||||
upper = color.upper,
|
||||
lower = color.lower
|
||||
)),
|
||||
...
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -185,11 +185,12 @@ ax_chart <- function(ax,
|
|||
#' Specific options for chart
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param bar See \code{\link{bar_opts}}.
|
||||
#' @param heatmap See \code{\link{heatmap_opts}}.
|
||||
#' @param radialBar See \code{\link{radialBar_opts}}.
|
||||
#' @param pie See \code{\link{pie_opts}}.
|
||||
#' @param bubble See \code{\link{bubble_opts}}.
|
||||
#' @param bar See [bar_opts()].
|
||||
#' @param heatmap See [heatmap_opts()].
|
||||
#' @param radialBar See [radialBar_opts()].
|
||||
#' @param pie See [pie_opts()].
|
||||
#' @param bubble See [bubble_opts()].
|
||||
#' @param boxPlot See [boxplot_opts()].
|
||||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#'
|
||||
|
@ -234,6 +235,7 @@ ax_plotOptions <- function(ax,
|
|||
radialBar = NULL,
|
||||
pie = NULL,
|
||||
bubble = NULL,
|
||||
boxPlot = NULL,
|
||||
...) {
|
||||
params <- c(as.list(environment()), list(...))[-1]
|
||||
.ax_opt2(ax, "plotOptions", l = dropNulls(params))
|
||||
|
@ -1271,9 +1273,44 @@ ax_nodata <- function(ax,
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' Forecast data points
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param count Number of ending data-points you want to indicate as a forecast or prediction values.
|
||||
#' The ending line/bar will result into a dashed border with a distinct look to differentiate from the rest of the data-points.
|
||||
#' @param fillOpacity Opacity of the fill attribute.
|
||||
#' @param strokeWidth Sets the width of the points.
|
||||
#' @param dashArray Creates dashes in borders of svg path. Higher number creates more space between dashes in the border.
|
||||
#' @param ... Additional arguments (not used).
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' # add 5 predictions to data then plot it
|
||||
#' data.frame(
|
||||
#' time = seq_len(53),
|
||||
#' lh = c(
|
||||
#' as.vector(lh),
|
||||
#' as.vector(predict(arima(lh, order = c(1,0,1)), 5)$pred)
|
||||
#' )
|
||||
#' ) %>%
|
||||
#' apex(aes(time, lh), type = "line") %>%
|
||||
#' ax_xaxis(type = "numeric") %>%
|
||||
#' ax_forecast_data_points(count = 5)
|
||||
ax_forecast_data_points <- function(ax,
|
||||
count = NULL,
|
||||
fillOpacity = NULL,
|
||||
strokeWidth = NULL,
|
||||
dashArray = NULL,
|
||||
...) {
|
||||
params <- list(
|
||||
count = count,
|
||||
fillOpacity = fillOpacity,
|
||||
strokeWidth = strokeWidth,
|
||||
dashArray = dashArray
|
||||
)
|
||||
.ax_opt2(ax, "forecastDataPoints", l = dropNulls(params))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
78
R/apex.R
78
R/apex.R
|
@ -14,7 +14,7 @@
|
|||
#' `"pie"`, `"donut"`,
|
||||
#' `"radialBar"`, `"radar"`, `"scatter"`,
|
||||
#' `"heatmap"`, `"treemap"`,
|
||||
#' `"timeline"`.
|
||||
#' `"timeline"`, `"dumbbell"` and `"slope"`.
|
||||
#' @param ... Other arguments passed on to methods. Not currently used.
|
||||
#' @param synchronize Give a common id to charts to synchronize them (tooltip and zoom).
|
||||
#' @param serie_name Name for the serie displayed in tooltip,
|
||||
|
@ -43,7 +43,8 @@ apex <- function(data, mapping,
|
|||
arg = type,
|
||||
choices = c(
|
||||
"column", "bar",
|
||||
"line", "spline", "step",
|
||||
"rangeBar", "dumbbell",
|
||||
"line", "spline", "step", "slope",
|
||||
"area", "area-spline", "area-step",
|
||||
"rangeArea",
|
||||
"pie", "donut",
|
||||
|
@ -54,7 +55,8 @@ apex <- function(data, mapping,
|
|||
"heatmap",
|
||||
"treemap",
|
||||
"timeline",
|
||||
"candlestick"
|
||||
"candlestick",
|
||||
"boxplot"
|
||||
)
|
||||
)
|
||||
data <- as.data.frame(data)
|
||||
|
@ -67,7 +69,8 @@ apex <- function(data, mapping,
|
|||
type <- "bubble"
|
||||
}
|
||||
mapdata <- lapply(mapping, rlang::eval_tidy, data = data)
|
||||
if (is.null(mapdata$y) & !type %in% c("candlestick", "timeline", "heatmap", "rangeArea")) {
|
||||
type_no_compute <- c("candlestick", "boxplot", "timeline", "heatmap", "rangeArea", "rangeBar", "dumbbell", "slope")
|
||||
if (is.null(mapdata$y) & !type %in% type_no_compute) {
|
||||
mapdata <- compute_count(mapdata)
|
||||
}
|
||||
if (type %in% c("pie", "donut", "radialBar", "polarArea")) {
|
||||
|
@ -118,7 +121,9 @@ apex <- function(data, mapping,
|
|||
# Construct series
|
||||
#' @importFrom rlang %||%
|
||||
make_series <- function(mapdata, mapping, type = NULL, serie_name = NULL, force_datetime_names = FALSE) {
|
||||
if (identical(type, "candlestick")) {
|
||||
if (identical(type, "boxplot")) {
|
||||
series <- parse_boxplot_data(mapdata, serie_name = serie_name)
|
||||
} else if (identical(type, "candlestick")) {
|
||||
if (!all(c("x", "open", "high", "low", "close") %in% names(mapping)))
|
||||
stop("For candlestick charts 'x', 'open', 'high', 'low', and 'close' aesthetics must be provided.", call. = FALSE)
|
||||
if (!is.null(mapdata$group))
|
||||
|
@ -131,6 +136,12 @@ make_series <- function(mapdata, mapping, type = NULL, serie_name = NULL, force_
|
|||
if (is.null(mapdata$group))
|
||||
mapdata$group <- serie_name %||% rlang::as_label(mapping$x)
|
||||
series <- parse_timeline_data(mapdata)
|
||||
} else if (isTRUE(type %in% c("dumbbell"))) {
|
||||
if (!all(c("y", "x", "xend") %in% names(mapping)))
|
||||
stop("For dumbbell charts 'x', 'xend', and 'y' aesthetics must be provided.", call. = FALSE)
|
||||
if (is.null(mapdata$group))
|
||||
mapdata$group <- serie_name %||% rlang::as_label(mapping$x)
|
||||
series <- parse_dumbbell_data(mapdata)
|
||||
} else {
|
||||
mapdata <- as.data.frame(mapdata, stringsAsFactors = FALSE)
|
||||
if (all(rlang::has_name(mapdata, c("ymin", "ymax")))) {
|
||||
|
@ -168,7 +179,7 @@ make_series <- function(mapdata, mapping, type = NULL, serie_name = NULL, force_
|
|||
)))
|
||||
if (is_grouped(mapping)) {
|
||||
mapdata <- rename_aes(mapdata)
|
||||
len_grp <- tapply(mapdata$group, mapdata$group, length)
|
||||
len_grp <- tapply(as.character(mapdata$group), as.character(mapdata$group), length)
|
||||
if (length(unique(len_grp)) > 1 & !isTRUE(type %in% c("scatter", "bubble"))) {
|
||||
warning("apex: all groups must have same length! You can use `tidyr::complete` for this.")
|
||||
}
|
||||
|
@ -201,8 +212,11 @@ is_sized <- function(x) {
|
|||
any(c("size", "z") %in% names(x))
|
||||
}
|
||||
|
||||
|
||||
#' @importFrom rlang quo
|
||||
rename_aes_heatmap <- function(mapping) {
|
||||
if (is.null(mapping["x"]))
|
||||
stop("apex(..., type = 'heatmap') must have an 'x' aesthetic", call. = FALSE)
|
||||
mapping[["x"]] <- quo(as.character(!!mapping[["x"]]))
|
||||
n_mapping <- names(mapping)
|
||||
n_mapping[n_mapping == "y"] <- "group"
|
||||
if ("fill" %in% n_mapping) {
|
||||
|
@ -242,14 +256,16 @@ list1 <- function(x) {
|
|||
|
||||
# Change type of charts for helpers type
|
||||
correct_type <- function(type) {
|
||||
if (identical(type, "column")) {
|
||||
if (isTRUE(type %in% c("column"))) {
|
||||
"bar"
|
||||
} else if (isTRUE(type %in% c("spline", "step"))) {
|
||||
} else if (isTRUE(type %in% c("spline", "step", "slope"))) {
|
||||
"line"
|
||||
} else if (isTRUE(type %in% c("area-spline", "area-step"))) {
|
||||
"area"
|
||||
} else if (identical(type, "timeline")) {
|
||||
} else if (isTRUE(type %in% c("timeline", "dumbbell"))) {
|
||||
"rangeBar"
|
||||
} else if (identical(type, "boxplot")) {
|
||||
"boxPlot"
|
||||
} else {
|
||||
type
|
||||
}
|
||||
|
@ -308,9 +324,13 @@ choose_config <- function(type, mapdata) {
|
|||
datetime <- is_x_datetime(mapdata)
|
||||
range_x <- range_num(mapdata$x)
|
||||
range_y <- range_num(mapdata$y)
|
||||
if (identical(type, "boxplot")) {
|
||||
box_horiz <- !is.numeric(mapdata$y) & is.numeric(mapdata$x)
|
||||
}
|
||||
switch(
|
||||
type,
|
||||
"bar" = config_bar(horizontal = TRUE),
|
||||
"dumbbell" = config_bar(horizontal = TRUE, isDumbbell = TRUE),
|
||||
"column" = config_bar(horizontal = FALSE, datetime = datetime),
|
||||
"line" = config_line(datetime = datetime),
|
||||
"area" = config_line(datetime = datetime),
|
||||
|
@ -323,34 +343,33 @@ choose_config <- function(type, mapdata) {
|
|||
"bubble" = config_scatter(range_x = range_x, range_y = range_y, datetime = datetime),
|
||||
"timeline" = config_timeline(),
|
||||
"candlestick" = config_candlestick(),
|
||||
"boxplot" = config_boxplot(horizontal = box_horiz),
|
||||
"slope" = config_slope(),
|
||||
list()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
# Config for column & bar charts
|
||||
config_bar <- function(horizontal = FALSE, datetime = FALSE) {
|
||||
config_bar <- function(horizontal = FALSE, datetime = FALSE, isDumbbell = FALSE) {
|
||||
config <- list(
|
||||
dataLabels = list(enabled = FALSE),
|
||||
plotOptions = list(
|
||||
bar = list(
|
||||
horizontal = horizontal
|
||||
horizontal = horizontal,
|
||||
isDumbbell = isDumbbell
|
||||
)
|
||||
),
|
||||
tooltip = list(
|
||||
shared = TRUE,
|
||||
intersect = FALSE,
|
||||
followCursor = TRUE
|
||||
),
|
||||
grid = list(
|
||||
yaxis = list(lines = list(show = !isTRUE(horizontal))),
|
||||
xaxis = list(lines = list(show = isTRUE(horizontal)))
|
||||
)
|
||||
)
|
||||
if (isTRUE(horizontal)) {
|
||||
config <- c(config, list(
|
||||
grid = list(
|
||||
yaxis = list(lines = list(show = FALSE)),
|
||||
xaxis = list(lines = list(show = TRUE))
|
||||
)
|
||||
))
|
||||
}
|
||||
if (isTRUE(datetime)) {
|
||||
config$xaxis$type <- "datetime"
|
||||
}
|
||||
|
@ -436,3 +455,22 @@ config_candlestick <- function() {
|
|||
)
|
||||
}
|
||||
|
||||
config_boxplot <- function(horizontal = FALSE) {
|
||||
list(
|
||||
plotOptions = list(
|
||||
bar = list(
|
||||
horizontal = horizontal
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
config_slope <- function() {
|
||||
list(
|
||||
plotOptions = list(
|
||||
line = list(
|
||||
isSlopeChart = TRUE
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
#' to create interactive and modern SVG charts.
|
||||
#'
|
||||
#' @name apexcharter-package
|
||||
#' @docType package
|
||||
#' @author Victor Perrier (@@dreamRs_fr)
|
||||
NULL
|
||||
"_PACKAGE"
|
||||
|
||||
#' apexcharter exported operators and S3 methods
|
||||
#'
|
||||
|
|
42
R/data.R
42
R/data.R
|
@ -11,7 +11,7 @@
|
|||
#' \item{\code{continent_origin}}{Continent of residence of population.}
|
||||
#' \item{\code{n}}{Number of people concerned.}
|
||||
#' }
|
||||
#' @source UNHCR (The UN Refugee Agency) (\url{https://www.unhcr.org/})
|
||||
#' @source UNHCR (The UN Refugee Agency) (\url{https://data.unhcr.org/})
|
||||
"unhcr_ts"
|
||||
|
||||
|
||||
|
@ -58,3 +58,43 @@
|
|||
#' }
|
||||
#' @source Wikipedia (\url{https://fr.wikipedia.org/wiki/Climat_de_Paris})
|
||||
"climate_paris"
|
||||
|
||||
|
||||
#' @title eco2mix data
|
||||
#'
|
||||
#' @description The dataset contains data about electricity consumption and production in France between 2012 and 2022.
|
||||
#'
|
||||
#' @format A data frame with 3,033 observations and 3 variables.
|
||||
#'
|
||||
#' @source Rte (Réseau et transport d'électricité) (\url{https://www.rte-france.com/eco2mix} and \url{https://opendata.reseaux-energies.fr/})
|
||||
"eco2mix"
|
||||
|
||||
|
||||
#' @title Temperature data
|
||||
#'
|
||||
#' @description The dataset contains data about temperatures in France between 2018 and 2022.
|
||||
#'
|
||||
#' @format A data frame with 365 observations and 6 variables.
|
||||
#'
|
||||
#' @source Enedis (\url{https://data.enedis.fr/explore/dataset/donnees-de-temperature-et-de-pseudo-rayonnement/})
|
||||
"temperatures"
|
||||
|
||||
|
||||
#' @title Life expectancy data
|
||||
#'
|
||||
#' @description The dataset contains data about life expectancy in 1972 and 2007 for 10 countries.
|
||||
#'
|
||||
#' @format A data frame with 10 observations and 4 variables.
|
||||
#'
|
||||
#' @source gapminder package (\url{https://jennybc.github.io/gapminder/} and \url{https://www.gapminder.org/data/})
|
||||
"life_expec"
|
||||
|
||||
#' @title Life expectancy data (long format)
|
||||
#'
|
||||
#' @description The dataset contains data about life expectancy in 1972 and 2007 for 10 countries.
|
||||
#'
|
||||
#' @format A data frame with 20 observations and 3 variables.
|
||||
#'
|
||||
#' @source gapminder package (\url{https://jennybc.github.io/gapminder/} and \url{https://www.gapminder.org/data/})
|
||||
"life_expec_long"
|
||||
|
||||
|
|
|
@ -110,6 +110,44 @@ parse_timeline_data <- function(.list) {
|
|||
}
|
||||
|
||||
|
||||
parse_dumbbell_data <- function(.list) {
|
||||
if (is.null(.list$group)) {
|
||||
lapply(
|
||||
X = seq_len(length(.list[[1]])),
|
||||
FUN = function(i) {
|
||||
val <- lapply(.list, `[[`, i)
|
||||
l <- list(
|
||||
x = as.character(val$y),
|
||||
y = list(val$x, val$xend)
|
||||
)
|
||||
if (!is.null(val$fill)) {
|
||||
l$fillColor <- val$fill
|
||||
}
|
||||
l
|
||||
}
|
||||
)
|
||||
} else {
|
||||
grouped <- as.data.frame(.list, stringsAsFactors = FALSE)
|
||||
grouped$group <- NULL
|
||||
grouped <- split(
|
||||
x = grouped,
|
||||
f = .list$group
|
||||
)
|
||||
grouped <- lapply(grouped, as.list)
|
||||
lapply(
|
||||
X = names(grouped),
|
||||
FUN = function(name) {
|
||||
list(
|
||||
name = name,
|
||||
data = parse_dumbbell_data(grouped[[name]])
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
parse_candlestick_data <- function(.list) {
|
||||
list(list(
|
||||
type = "candlestick",
|
||||
|
@ -127,3 +165,30 @@ parse_candlestick_data <- function(.list) {
|
|||
))
|
||||
}
|
||||
|
||||
|
||||
#' @importFrom graphics boxplot
|
||||
parse_boxplot_data <- function(.list, serie_name = NULL) {
|
||||
if (!is.numeric(.list$y) & is.numeric(.list$x)) {
|
||||
.list[c("x", "y")] <- .list[c("y", "x")]
|
||||
}
|
||||
boxed <- boxplot(y ~ x, data = .list, plot = FALSE)
|
||||
list(dropNulls(list(
|
||||
serie_name = serie_name,
|
||||
type = "boxPlot",
|
||||
data = lapply(
|
||||
X = seq_along(boxed$names),
|
||||
FUN = function(i) {
|
||||
list(
|
||||
x = boxed$names[i],
|
||||
y = c(
|
||||
boxed$stats[1, i],
|
||||
boxed$stats[2, i],
|
||||
boxed$stats[3, i],
|
||||
boxed$stats[4, i],
|
||||
boxed$stats[5, i]
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
)))
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@ template:
|
|||
bslib:
|
||||
base_font: {google: "Poppins"}
|
||||
primary: "#112446"
|
||||
navbar-dark-color: "#FFFFFF"
|
||||
secondary: "#DFDFDF"
|
||||
navbar-dark-active-color: "#DFDFDF"
|
||||
|
||||
navbar:
|
||||
bg: primary
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# eCO2mix data
|
||||
# https://www.rte-france.com/eco2mix
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Packages ----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(fasttime)
|
||||
|
||||
|
||||
complete <- function(data, vars, fill = list()) {
|
||||
data <- data[do.call(CJ, c(
|
||||
lapply(
|
||||
X = mget(vars),
|
||||
FUN = function(var) {
|
||||
if (inherits(var, "factor")) {
|
||||
if (anyNA(var)) {
|
||||
factor(c(levels(var), NA_character_), levels = levels(var), ordered = is.ordered(var))
|
||||
} else {
|
||||
factor(levels(var), levels = levels(var), ordered = is.ordered(var))
|
||||
}
|
||||
} else {
|
||||
unique(var)
|
||||
}
|
||||
}
|
||||
),
|
||||
list(sorted = FALSE)
|
||||
)), on = vars]
|
||||
if (length(fill) > 0 && all(nzchar(names(fill)))) {
|
||||
for (fillvar in names(fill)) {
|
||||
data[is.na(get(fillvar)), (fillvar) := fill[[fillvar]]]
|
||||
}
|
||||
}
|
||||
data[]
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Download data -----------------------------------------------------------
|
||||
|
||||
# Source: https://odre.opendatasoft.com/explore/dataset/eco2mix-national-cons-def/
|
||||
# and https://odre.opendatasoft.com/explore/dataset/eco2mix-national-tr
|
||||
|
||||
|
||||
# Read & transform data ---------------------------------------------------
|
||||
|
||||
# eco2mix <- fread(file = "data-raw/inputs/eco2mix-national-cons-def.csv")
|
||||
# eco2mix <- eco2mix[, c(5, 6, 9:17)]
|
||||
# setnames(eco2mix, c("datetime", "consumption", "fuel", "coal", "gas", "nuclear", "wind", "solar", "hydraulic", "pumping", "bioenergies"))
|
||||
|
||||
eco2mix_tr <- fread(file = "data-raw/inputs/eco2mix-national-tr.csv")
|
||||
eco2mix_tr <- eco2mix_tr[, c(5, 6, 9:17)]
|
||||
setnames(eco2mix_tr, c("datetime", "consumption", "fuel", "coal", "gas", "nuclear", "wind", "solar", "hydraulic", "pumping", "bioenergies"))
|
||||
|
||||
eco2mix <- copy(eco2mix_tr)
|
||||
# eco2mix <- rbind(eco2mix, eco2mix_tr)
|
||||
|
||||
eco2mix <- eco2mix[!is.na(consumption)]
|
||||
eco2mix[, consumption := NULL]
|
||||
# eco2mix[, date := as.Date(format(datetime, format = "%Y-%m-%d"))]
|
||||
# eco2mix[, datetime := NULL]
|
||||
# setcolorder(eco2mix, "date")
|
||||
eco2mix <- eco2mix[minute(datetime) != 15]
|
||||
eco2mix <- eco2mix[minute(datetime) != 45]
|
||||
eco2mix <- eco2mix[datetime >= (max(datetime) - 24*60*60*7)]
|
||||
eco2mix <- melt(
|
||||
data = eco2mix,
|
||||
id.vars = 1,
|
||||
variable.name = "source",
|
||||
value.name = "production",
|
||||
na.rm = TRUE,
|
||||
variable.factor = FALSE
|
||||
)
|
||||
eco2mix <- eco2mix[, list(production = round(mean(production))), by = list(datetime, source)]
|
||||
eco2mix[, source := factor(
|
||||
x = source,
|
||||
levels = c("pumping", "wind", "solar", "nuclear", "hydraulic", "gas", "coal", "fuel", "bioenergies"),
|
||||
ordered = TRUE
|
||||
)]
|
||||
eco2mix <- complete(eco2mix, c("datetime", "source"), list(production = 0))
|
||||
setorder(eco2mix, source, datetime)
|
||||
|
||||
eco2mix[]
|
||||
|
||||
|
||||
# Use data ----------------------------------------------------------------
|
||||
|
||||
setDF(eco2mix)
|
||||
usethis::use_data(eco2mix, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Test example ------------------------------------------------------------
|
||||
|
||||
apex(eco2mix[source == "consumption"], aes(date, production), type = "line")
|
||||
|
||||
# data("eco2mix", package = "apexcharter")
|
||||
apex(eco2mix, aes(datetime, production, fill = source), type = "area") %>%
|
||||
ax_chart(animations = list(enabled = FALSE), stacked = TRUE) %>%
|
||||
ax_stroke(width = 1) %>%
|
||||
ax_fill(opacity = 1, type = "solid") %>%
|
||||
ax_tooltip(x = list(format = "dd MMM, HH:mm")) %>%
|
||||
ax_yaxis(labels = list(formatter = format_num("~", suffix = "MW"))) %>%
|
||||
ax_colors_manual(
|
||||
list(
|
||||
"bioenergies" = "#156956",
|
||||
"fuel" = "#80549f",
|
||||
"coal" = "#a68832",
|
||||
"solar" = "#d66b0d",
|
||||
"gas" = "#f20809",
|
||||
"wind" = "#72cbb7",
|
||||
"hydraulic" = "#2672b0",
|
||||
"nuclear" = "#e4a701",
|
||||
"pumping" = "#0e4269"
|
||||
)
|
||||
) %>%
|
||||
ax_labs(
|
||||
title = "Electricity generation by sector in France",
|
||||
subtitle = "Data from \u00e9CO\u2082mix"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
|
||||
|
||||
# Package -----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(gapminder)
|
||||
|
||||
|
||||
|
||||
# Data --------------------------------------------------------------------
|
||||
|
||||
life_expec_long <- as.data.table(gapminder::gapminder)
|
||||
life_expec_long <- life_expec_long[year %in% c(1972, 2007), list(country, year, lifeExp)]
|
||||
|
||||
# life_expec <- life_expec[country %in% sample(unique(country), 10)]
|
||||
life_expec_long <- life_expec_long[country %in% c("Botswana", "Ghana", "Iran", "Liberia", "Malaysia", "Mexico",
|
||||
"Nigeria", "Pakistan", "Philippines", "Zambia")]
|
||||
life_expec_long[, country := as.character(country)]
|
||||
life_expec <- dcast(life_expec_long, country ~ year, value.var = "lifeExp")
|
||||
life_expec[, type := fifelse(`1972` > `2007`, "decreased", "increased")]
|
||||
|
||||
|
||||
|
||||
# Use data ----------------------------------------------------------------
|
||||
|
||||
setDF(life_expec)
|
||||
usethis::use_data(life_expec, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
setDF(life_expec_long)
|
||||
usethis::use_data(life_expec_long, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
|
||||
|
||||
|
||||
# Test example ------------------------------------------------------------
|
||||
|
||||
|
||||
pkgload::load_all()
|
||||
|
||||
apex(life_expec, aes(country, x = `1972`, xend = `2007`), type = "dumbbell") %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(
|
||||
dumbbellColors = list(list("#3d85c6", "#fb6003"))
|
||||
)
|
||||
) %>%
|
||||
ax_colors("#BABABA") %>%
|
||||
ax_labs(
|
||||
title = "Life expectancy : 1972 vs. 2007",
|
||||
subtitle = "Data from Gapminder dataset",
|
||||
x = "Life expectancy at birth, in years"
|
||||
)
|
||||
|
||||
|
||||
|
||||
apex(life_expec, aes(country, x = `1972`, xend = `2007`, group = type), type = "dumbbell") %>%
|
||||
ax_xaxis(type = "category", categories = unique(life_expec$country)) %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(
|
||||
dumbbellColors = list(list("#3d85c6", "#fb6003"), list("#3d85c6", "#fb6003"))
|
||||
)
|
||||
) %>%
|
||||
ax_colors(c("#3d85c6", "#fb6003")) %>%
|
||||
ax_labs(
|
||||
title = "Life expectancy : 1972 vs. 2007",
|
||||
subtitle = "Data from Gapminder dataset",
|
||||
x = "Life expectancy at birth, in years"
|
||||
)
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# temperature data for France
|
||||
# https://data.enedis.fr/explore/dataset/donnees-de-temperature-et-de-pseudo-rayonnement
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Packages ----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(fasttime)
|
||||
|
||||
|
||||
# Data --------------------------------------------------------------------
|
||||
|
||||
temperatures <- fread(file = "data-raw/inputs/donnees-de-temperature-et-de-pseudo-rayonnement.csv")
|
||||
temperatures <- temperatures[, c(6, 7, 8, 2)]
|
||||
setnames(temperatures, c("year", "month", "day", "temperature"))
|
||||
temperatures <- temperatures[year > 2017]
|
||||
temperatures <- temperatures[, list(temperature = round(mean(temperature, na.rm = TRUE), 1)), by = c("year", "month", "day")]
|
||||
temperatures <- dcast(data = temperatures, formula = month + day ~ year, value.var = "temperature")
|
||||
temperatures <- temperatures[!(month == 2 & day == 29)]
|
||||
|
||||
temperatures[, low := do.call(pmin, c(as.list(.SD), na.rm = TRUE)), .SDcols = as.character(2018:2021)]
|
||||
temperatures[, high := do.call(pmax, c(as.list(.SD), na.rm = TRUE)), .SDcols = as.character(2018:2021)]
|
||||
temperatures[, average := rowMeans(.SD, na.rm = TRUE), .SDcols = as.character(2018:2021)]
|
||||
temperatures[, (as.character(2018:2021)) := NULL]
|
||||
# setnames(temperatures, "2022", "temperature")
|
||||
|
||||
temperatures[, date := as.Date("2022-01-01") + (seq_len(.N) - 1)]
|
||||
temperatures[, (c("month", "day")) := NULL]
|
||||
setcolorder(temperatures, "date")
|
||||
|
||||
temperatures[]
|
||||
|
||||
|
||||
# Save --------------------------------------------------------------------
|
||||
|
||||
setDF(temperatures)
|
||||
usethis::use_data(temperatures, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
|
||||
|
||||
# Test example ------------------------------------------------------------
|
||||
|
||||
|
||||
pkgload::load_all()
|
||||
|
||||
apex(temperatures, aes(x = date, ymin = low, ymax = high), type = "rangeArea", serie_name = "Low/High (2018-2021)") %>%
|
||||
add_line(aes(date, `2023`)) %>%
|
||||
ax_chart(animations = list(enabled = FALSE)) %>%
|
||||
ax_yaxis(tickAmount = 7, labels = list(formatter = format_num("~", suffix = "°C"))) %>%
|
||||
ax_colors(c("#8485854D", "#FF0000")) %>%
|
||||
ax_stroke(width = c(1, 2)) %>%
|
||||
ax_fill(opacity = 1, type = "solid") %>%
|
||||
ax_labs(
|
||||
title = "Temperatures in 2023 with range from 2018 to 2021",
|
||||
subtitle = "Data from ENEDIS"
|
||||
)
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,7 +3,7 @@ library(apexcharter)
|
|||
data("presidential", package = "ggplot2")
|
||||
|
||||
# Basic (with formated date in tooltip)
|
||||
apex(presidential, aes(x = name, start = start, end = end), "timeline") %>%
|
||||
apex(presidential, aes(x = name, start = start, end = end), "timeline") %>%
|
||||
ax_tooltip(
|
||||
x = list(
|
||||
format = "yyyy"
|
||||
|
@ -11,20 +11,37 @@ apex(presidential, aes(x = name, start = start, end = end), "timeline") %>%
|
|||
)
|
||||
|
||||
# With groups
|
||||
apex(presidential,
|
||||
aes(x = name, start = start, end = end, group = party),
|
||||
"timeline")
|
||||
apex(
|
||||
presidential,
|
||||
aes(x = name, start = start, end = end, group = party),
|
||||
"timeline"
|
||||
)
|
||||
|
||||
# With groups but force position
|
||||
apex(presidential,
|
||||
aes(x = name, start = start, end = end, group = party),
|
||||
"timeline") %>%
|
||||
ax_xaxis(categories = presidential$name)
|
||||
# Bush appears twice
|
||||
apex(
|
||||
presidential,
|
||||
aes(x = name, start = start, end = end, group = party),
|
||||
"timeline"
|
||||
) %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(rangeBarGroupRows = TRUE)
|
||||
) %>%
|
||||
ax_xaxis(categories = unique(presidential$name))
|
||||
|
||||
|
||||
|
||||
# With custom colors
|
||||
presidential$color <- ifelse(presidential$party == "Democratic", "#00355f", "#c51c22")
|
||||
apex(presidential,
|
||||
aes(x = name, start = start, end = end, fill = color),
|
||||
"timeline")
|
||||
|
||||
apex(
|
||||
presidential,
|
||||
aes(x = name, start = start, end = end, group = party),
|
||||
"timeline"
|
||||
) %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(rangeBarGroupRows = TRUE)
|
||||
) %>%
|
||||
ax_xaxis(categories = unique(presidential$name)) %>%
|
||||
ax_colors_manual(list(
|
||||
Democratic = "#00355f",
|
||||
Republican = "#c51c22"
|
||||
))
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/*!
|
||||
* ApexCharts v3.36.2
|
||||
* (c) 2018-2022 ApexCharts
|
||||
* ApexCharts v3.49.1
|
||||
* (c) 2018-2024 ApexCharts
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ a \code{data.frame}, it will be coerced to with \code{as.data.frame}.}
|
|||
\code{"pie"}, \code{"donut"},
|
||||
\code{"radialBar"}, \code{"radar"}, \code{"scatter"},
|
||||
\code{"heatmap"}, \code{"treemap"},
|
||||
\code{"timeline"}.}
|
||||
\code{"timeline"}, \code{"dumbbell"} and \code{"slope"}.}
|
||||
|
||||
\item{...}{Other arguments passed on to methods. Not currently used.}
|
||||
|
||||
|
|
|
@ -2,12 +2,22 @@
|
|||
% Please edit documentation in R/apexcharter-package.R
|
||||
\docType{package}
|
||||
\name{apexcharter-package}
|
||||
\alias{apexcharter}
|
||||
\alias{apexcharter-package}
|
||||
\title{An \code{htmlwidget} interface to the
|
||||
ApexCharts javascript chart library}
|
||||
\description{
|
||||
This package allow you to use ApexCharts.js (\url{https://apexcharts.com/}),
|
||||
to create interactive and modern SVG charts.
|
||||
}
|
||||
\seealso{
|
||||
Useful links:
|
||||
\itemize{
|
||||
\item \url{https://github.com/dreamRs/apexcharter}
|
||||
\item \url{https://dreamrs.github.io/apexcharter/}
|
||||
\item Report bugs at \url{https://github.com/dreamRs/apexcharter/issues}
|
||||
}
|
||||
|
||||
}
|
||||
\author{
|
||||
Victor Perrier (@dreamRs_fr)
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/apex-utils.R
|
||||
\name{ax_forecast_data_points}
|
||||
\alias{ax_forecast_data_points}
|
||||
\title{Forecast data points}
|
||||
\usage{
|
||||
ax_forecast_data_points(
|
||||
ax,
|
||||
count = NULL,
|
||||
fillOpacity = NULL,
|
||||
strokeWidth = NULL,
|
||||
dashArray = NULL,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{ax}{An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.}
|
||||
|
||||
\item{count}{Number of ending data-points you want to indicate as a forecast or prediction values.
|
||||
The ending line/bar will result into a dashed border with a distinct look to differentiate from the rest of the data-points.}
|
||||
|
||||
\item{fillOpacity}{Opacity of the fill attribute.}
|
||||
|
||||
\item{strokeWidth}{Sets the width of the points.}
|
||||
|
||||
\item{dashArray}{Creates dashes in borders of svg path. Higher number creates more space between dashes in the border.}
|
||||
|
||||
\item{...}{Additional arguments (not used).}
|
||||
}
|
||||
\value{
|
||||
An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.
|
||||
}
|
||||
\description{
|
||||
Forecast data points
|
||||
}
|
||||
\examples{
|
||||
# add 5 predictions to data then plot it
|
||||
data.frame(
|
||||
time = seq_len(53),
|
||||
lh = c(
|
||||
as.vector(lh),
|
||||
as.vector(predict(arima(lh, order = c(1,0,1)), 5)$pred)
|
||||
)
|
||||
) \%>\%
|
||||
apex(aes(time, lh), type = "line") \%>\%
|
||||
ax_xaxis(type = "numeric") \%>\%
|
||||
ax_forecast_data_points(count = 5)
|
||||
}
|
|
@ -11,21 +11,24 @@ ax_plotOptions(
|
|||
radialBar = NULL,
|
||||
pie = NULL,
|
||||
bubble = NULL,
|
||||
boxPlot = NULL,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{ax}{An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.}
|
||||
|
||||
\item{bar}{See \code{\link{bar_opts}}.}
|
||||
\item{bar}{See \code{\link[=bar_opts]{bar_opts()}}.}
|
||||
|
||||
\item{heatmap}{See \code{\link{heatmap_opts}}.}
|
||||
\item{heatmap}{See \code{\link[=heatmap_opts]{heatmap_opts()}}.}
|
||||
|
||||
\item{radialBar}{See \code{\link{radialBar_opts}}.}
|
||||
\item{radialBar}{See \code{\link[=radialBar_opts]{radialBar_opts()}}.}
|
||||
|
||||
\item{pie}{See \code{\link{pie_opts}}.}
|
||||
\item{pie}{See \code{\link[=pie_opts]{pie_opts()}}.}
|
||||
|
||||
\item{bubble}{See \code{\link{bubble_opts}}.}
|
||||
\item{bubble}{See \code{\link[=bubble_opts]{bubble_opts()}}.}
|
||||
|
||||
\item{boxPlot}{See \code{\link[=boxplot_opts]{boxplot_opts()}}.}
|
||||
|
||||
\item{...}{Additional parameters.}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ bar_opts(
|
|||
\item{...}{Additional parameters.}
|
||||
}
|
||||
\value{
|
||||
A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
A \code{list} of options that can be used in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\description{
|
||||
Use these options in \code{\link{ax_plotOptions}}.
|
||||
Use these options in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\note{
|
||||
See \url{https://apexcharts.com/docs/options/plotoptions/bar/}.
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/apex-options.R
|
||||
\name{boxplot_opts}
|
||||
\alias{boxplot_opts}
|
||||
\title{Boxplot options}
|
||||
\usage{
|
||||
boxplot_opts(color.upper, color.lower, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{color.upper}{Color for the upper quartile (Q3 to median) of the box plot.}
|
||||
|
||||
\item{color.lower}{Color for the lower quartile (median to Q1) of the box plot.}
|
||||
|
||||
\item{...}{Additional parameters.}
|
||||
}
|
||||
\value{
|
||||
A \code{list} of options that can be used in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\description{
|
||||
Use these options in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\note{
|
||||
See \url{https://apexcharts.com/docs/options/plotoptions/boxplot/}.
|
||||
}
|
||||
\examples{
|
||||
data("mpg", package = "ggplot2")
|
||||
apex(mpg, aes(class, hwy), "boxplot") \%>\%
|
||||
ax_plotOptions(
|
||||
boxPlot = boxplot_opts(color.upper = "#848484", color.lower = "#848484" )
|
||||
)
|
||||
}
|
|
@ -16,10 +16,10 @@ If a bubble value is too large to cover the chart, this size will be used.}
|
|||
\item{...}{Additional parameters.}
|
||||
}
|
||||
\value{
|
||||
A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
A \code{list} of options that can be used in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\description{
|
||||
Use these options in \code{\link{ax_plotOptions}}.
|
||||
Use these options in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\note{
|
||||
See \url{https://apexcharts.com/docs/options/plotoptions/bubble/}.
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{eco2mix}
|
||||
\alias{eco2mix}
|
||||
\title{eco2mix data}
|
||||
\format{
|
||||
A data frame with 3,033 observations and 3 variables.
|
||||
}
|
||||
\source{
|
||||
Rte (Réseau et transport d'électricité) (\url{https://www.rte-france.com/eco2mix} and \url{https://opendata.reseaux-energies.fr/})
|
||||
}
|
||||
\usage{
|
||||
eco2mix
|
||||
}
|
||||
\description{
|
||||
The dataset contains data about electricity consumption and production in France between 2012 and 2022.
|
||||
}
|
||||
\keyword{datasets}
|
|
@ -24,10 +24,10 @@ heatmap_opts(
|
|||
\item{...}{Additional parameters.}
|
||||
}
|
||||
\value{
|
||||
A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
A \code{list} of options that can be used in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\description{
|
||||
Use these options in \code{\link{ax_plotOptions}}.
|
||||
Use these options in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\note{
|
||||
See \url{https://apexcharts.com/docs/options/plotoptions/heatmap/}.
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{life_expec}
|
||||
\alias{life_expec}
|
||||
\title{Life expectancy data}
|
||||
\format{
|
||||
A data frame with 10 observations and 4 variables.
|
||||
}
|
||||
\source{
|
||||
gapminder package (\url{https://jennybc.github.io/gapminder/} and \url{https://www.gapminder.org/data/})
|
||||
}
|
||||
\usage{
|
||||
life_expec
|
||||
}
|
||||
\description{
|
||||
The dataset contains data about life expectancy in 1972 and 2007 for 10 countries.
|
||||
}
|
||||
\keyword{datasets}
|
|
@ -0,0 +1,19 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{life_expec_long}
|
||||
\alias{life_expec_long}
|
||||
\title{Life expectancy data (long format)}
|
||||
\format{
|
||||
A data frame with 20 observations and 3 variables.
|
||||
}
|
||||
\source{
|
||||
gapminder package (\url{https://jennybc.github.io/gapminder/} and \url{https://www.gapminder.org/data/})
|
||||
}
|
||||
\usage{
|
||||
life_expec_long
|
||||
}
|
||||
\description{
|
||||
The dataset contains data about life expectancy in 1972 and 2007 for 10 countries.
|
||||
}
|
||||
\keyword{datasets}
|
|
@ -31,10 +31,10 @@ and \code{background} (The background color of the pie).}
|
|||
\item{...}{Additional parameters.}
|
||||
}
|
||||
\value{
|
||||
A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
A \code{list} of options that can be used in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\description{
|
||||
Use these options in \code{\link{ax_plotOptions}}.
|
||||
Use these options in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\note{
|
||||
See \url{https://apexcharts.com/docs/options/plotoptions/pie/}.
|
||||
|
|
|
@ -39,10 +39,10 @@ radialBar_opts(
|
|||
\item{...}{Additional parameters.}
|
||||
}
|
||||
\value{
|
||||
A \code{list} of options that can be used in \code{\link{ax_plotOptions}}.
|
||||
A \code{list} of options that can be used in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\description{
|
||||
Use these options in \code{\link{ax_plotOptions}}.
|
||||
Use these options in \code{\link[=ax_plotOptions]{ax_plotOptions()}}.
|
||||
}
|
||||
\note{
|
||||
See \url{https://apexcharts.com/docs/options/plotoptions/radialbar/}.
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{temperatures}
|
||||
\alias{temperatures}
|
||||
\title{Temperature data}
|
||||
\format{
|
||||
A data frame with 365 observations and 6 variables.
|
||||
}
|
||||
\source{
|
||||
Enedis (\url{https://data.enedis.fr/explore/dataset/donnees-de-temperature-et-de-pseudo-rayonnement/})
|
||||
}
|
||||
\usage{
|
||||
temperatures
|
||||
}
|
||||
\description{
|
||||
The dataset contains data about temperatures in France between 2018 and 2022.
|
||||
}
|
||||
\keyword{datasets}
|
|
@ -15,7 +15,7 @@ Returned IDPs, Stateless persons, Others of concern.}
|
|||
}
|
||||
}
|
||||
\source{
|
||||
UNHCR (The UN Refugee Agency) (\url{https://www.unhcr.org/})
|
||||
UNHCR (The UN Refugee Agency) (\url{https://data.unhcr.org/})
|
||||
}
|
||||
\usage{
|
||||
unhcr_ts
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"apexcharts": "^3.36.3",
|
||||
"apexcharts": "^3.49.1",
|
||||
"d3-format": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"css-loader": "^6.5.1",
|
||||
"style-loader": "^3.3.1",
|
||||
"webpack": "^5.64.4",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
}
|
||||
|
@ -88,9 +88,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/eslint": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.0.tgz",
|
||||
"integrity": "sha512-74hbvsnc+7TEDa1z5YLSe4/q8hGYB3USNvCuzHUJrjPV6hXaq8IXcngCrHkuvFt0+8rFz7xYXrHgNayIX0UZvQ==",
|
||||
"version": "8.21.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.2.tgz",
|
||||
"integrity": "sha512-EMpxUyystd3uZVByZap1DACsMXvb82ypQnGn89e1Y0a+LYu3JJscUd/gqhRsVFDkaD2MIiWo0MT8EfXr3DGRKw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "*",
|
||||
|
@ -98,9 +98,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/eslint-scope": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz",
|
||||
"integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==",
|
||||
"version": "3.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz",
|
||||
"integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/eslint": "*",
|
||||
|
@ -108,9 +108,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "0.0.50",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz",
|
||||
"integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==",
|
||||
"version": "0.0.51",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz",
|
||||
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
|
@ -319,10 +319,15 @@
|
|||
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@yr/monotone-cubic-spline": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz",
|
||||
"integrity": "sha512-FQXkOta0XBSUPHndIKON2Y9JeQz5ZeMqLYZVVK93FliNBFm7LNMIZmY6FrMEB9XPcDbE2bekMbZD6kzDkxwYjA=="
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.6.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz",
|
||||
"integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==",
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
"integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
|
@ -366,10 +371,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/apexcharts": {
|
||||
"version": "3.36.3",
|
||||
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.36.3.tgz",
|
||||
"integrity": "sha512-8/FXEs0ohXMff07Gv28XjhPwEJphIUdq2/wii/pcvi54Tw6z1mjrV8ydN8rlWi/ve8BAPBefJkLmRWv7UOBsLw==",
|
||||
"version": "3.49.1",
|
||||
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.49.1.tgz",
|
||||
"integrity": "sha512-MqGtlq/KQuO8j0BBsUJYlRG8VBctKwYdwuBtajHgHTmSgUU3Oai+8oYN/rKCXwXzrUlYA+GiMgotAIbXY2BCGw==",
|
||||
"dependencies": {
|
||||
"@yr/monotone-cubic-spline": "^1.0.3",
|
||||
"svg.draggable.js": "^2.2.2",
|
||||
"svg.easing.js": "^2.0.0",
|
||||
"svg.filter.js": "^2.0.2",
|
||||
|
@ -513,9 +519,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.8.3",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz",
|
||||
"integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==",
|
||||
"version": "5.12.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz",
|
||||
"integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
|
@ -683,9 +689,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
|
||||
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/has": {
|
||||
|
@ -820,10 +826,10 @@
|
|||
"node": ">= 10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/json-parse-better-errors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
|
||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||
"node_modules/json-parse-even-better-errors": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json-schema-traverse": {
|
||||
|
@ -911,10 +917,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
|
||||
"integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
|
||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
|
@ -1040,21 +1052,31 @@
|
|||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.3.11",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.11.tgz",
|
||||
"integrity": "sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==",
|
||||
"version": "8.4.31",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
||||
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/postcss"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"nanoid": "^3.1.30",
|
||||
"nanoid": "^3.3.6",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^0.6.2"
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-modules-extract-imports": {
|
||||
|
@ -1310,9 +1332,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz",
|
||||
"integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
@ -1528,9 +1550,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.0.tgz",
|
||||
"integrity": "sha512-MnN0Q1OsvB/GGHETrFeZPQaOelWh/7O+EiFlj8sM9GPjtQkis7k01aAxrg/18kTfoIVcLL+haEVFlXDaSRwKRw==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
|
@ -1541,35 +1563,35 @@
|
|||
}
|
||||
},
|
||||
"node_modules/webpack": {
|
||||
"version": "5.64.4",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.64.4.tgz",
|
||||
"integrity": "sha512-LWhqfKjCLoYJLKJY8wk2C3h77i8VyHowG3qYNZiIqD6D0ZS40439S/KVuc/PY48jp2yQmy0mhMknq8cys4jFMw==",
|
||||
"version": "5.76.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz",
|
||||
"integrity": "sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/eslint-scope": "^3.7.0",
|
||||
"@types/estree": "^0.0.50",
|
||||
"@types/eslint-scope": "^3.7.3",
|
||||
"@types/estree": "^0.0.51",
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/wasm-edit": "1.11.1",
|
||||
"@webassemblyjs/wasm-parser": "1.11.1",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn": "^8.7.1",
|
||||
"acorn-import-assertions": "^1.7.6",
|
||||
"browserslist": "^4.14.5",
|
||||
"chrome-trace-event": "^1.0.2",
|
||||
"enhanced-resolve": "^5.8.3",
|
||||
"enhanced-resolve": "^5.10.0",
|
||||
"es-module-lexer": "^0.9.0",
|
||||
"eslint-scope": "5.1.1",
|
||||
"events": "^3.2.0",
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"json-parse-better-errors": "^1.0.2",
|
||||
"graceful-fs": "^4.2.9",
|
||||
"json-parse-even-better-errors": "^2.3.1",
|
||||
"loader-runner": "^4.2.0",
|
||||
"mime-types": "^2.1.27",
|
||||
"neo-async": "^2.6.2",
|
||||
"schema-utils": "^3.1.0",
|
||||
"tapable": "^2.1.1",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"watchpack": "^2.3.0",
|
||||
"webpack-sources": "^3.2.2"
|
||||
"watchpack": "^2.4.0",
|
||||
"webpack-sources": "^3.2.3"
|
||||
},
|
||||
"bin": {
|
||||
"webpack": "bin/webpack.js"
|
||||
|
@ -1659,9 +1681,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/webpack-sources": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz",
|
||||
"integrity": "sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==",
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
|
||||
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
|
@ -1752,9 +1774,9 @@
|
|||
}
|
||||
},
|
||||
"@types/eslint": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.0.tgz",
|
||||
"integrity": "sha512-74hbvsnc+7TEDa1z5YLSe4/q8hGYB3USNvCuzHUJrjPV6hXaq8IXcngCrHkuvFt0+8rFz7xYXrHgNayIX0UZvQ==",
|
||||
"version": "8.21.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.2.tgz",
|
||||
"integrity": "sha512-EMpxUyystd3uZVByZap1DACsMXvb82ypQnGn89e1Y0a+LYu3JJscUd/gqhRsVFDkaD2MIiWo0MT8EfXr3DGRKw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/estree": "*",
|
||||
|
@ -1762,9 +1784,9 @@
|
|||
}
|
||||
},
|
||||
"@types/eslint-scope": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz",
|
||||
"integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==",
|
||||
"version": "3.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz",
|
||||
"integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/eslint": "*",
|
||||
|
@ -1772,9 +1794,9 @@
|
|||
}
|
||||
},
|
||||
"@types/estree": {
|
||||
"version": "0.0.50",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz",
|
||||
"integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==",
|
||||
"version": "0.0.51",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz",
|
||||
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/json-schema": {
|
||||
|
@ -1970,10 +1992,15 @@
|
|||
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@yr/monotone-cubic-spline": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz",
|
||||
"integrity": "sha512-FQXkOta0XBSUPHndIKON2Y9JeQz5ZeMqLYZVVK93FliNBFm7LNMIZmY6FrMEB9XPcDbE2bekMbZD6kzDkxwYjA=="
|
||||
},
|
||||
"acorn": {
|
||||
"version": "8.6.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz",
|
||||
"integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==",
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
"integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-import-assertions": {
|
||||
|
@ -2003,10 +2030,11 @@
|
|||
"requires": {}
|
||||
},
|
||||
"apexcharts": {
|
||||
"version": "3.36.3",
|
||||
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.36.3.tgz",
|
||||
"integrity": "sha512-8/FXEs0ohXMff07Gv28XjhPwEJphIUdq2/wii/pcvi54Tw6z1mjrV8ydN8rlWi/ve8BAPBefJkLmRWv7UOBsLw==",
|
||||
"version": "3.49.1",
|
||||
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.49.1.tgz",
|
||||
"integrity": "sha512-MqGtlq/KQuO8j0BBsUJYlRG8VBctKwYdwuBtajHgHTmSgUU3Oai+8oYN/rKCXwXzrUlYA+GiMgotAIbXY2BCGw==",
|
||||
"requires": {
|
||||
"@yr/monotone-cubic-spline": "^1.0.3",
|
||||
"svg.draggable.js": "^2.2.2",
|
||||
"svg.easing.js": "^2.0.0",
|
||||
"svg.filter.js": "^2.0.2",
|
||||
|
@ -2108,9 +2136,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"enhanced-resolve": {
|
||||
"version": "5.8.3",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz",
|
||||
"integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==",
|
||||
"version": "5.12.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz",
|
||||
"integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
|
@ -2238,9 +2266,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
|
||||
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
|
||||
"dev": true
|
||||
},
|
||||
"has": {
|
||||
|
@ -2334,10 +2362,10 @@
|
|||
"supports-color": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"json-parse-better-errors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
|
||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||
"json-parse-even-better-errors": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
|
||||
"dev": true
|
||||
},
|
||||
"json-schema-traverse": {
|
||||
|
@ -2404,9 +2432,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
|
||||
"integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
|
||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
|
||||
"dev": true
|
||||
},
|
||||
"neo-async": {
|
||||
|
@ -2499,14 +2527,14 @@
|
|||
}
|
||||
},
|
||||
"postcss": {
|
||||
"version": "8.3.11",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.11.tgz",
|
||||
"integrity": "sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==",
|
||||
"version": "8.4.31",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
||||
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"nanoid": "^3.1.30",
|
||||
"nanoid": "^3.3.6",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^0.6.2"
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"postcss-modules-extract-imports": {
|
||||
|
@ -2682,9 +2710,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"source-map-js": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz",
|
||||
"integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
|
@ -2830,9 +2858,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.0.tgz",
|
||||
"integrity": "sha512-MnN0Q1OsvB/GGHETrFeZPQaOelWh/7O+EiFlj8sM9GPjtQkis7k01aAxrg/18kTfoIVcLL+haEVFlXDaSRwKRw==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
|
@ -2840,35 +2868,35 @@
|
|||
}
|
||||
},
|
||||
"webpack": {
|
||||
"version": "5.64.4",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.64.4.tgz",
|
||||
"integrity": "sha512-LWhqfKjCLoYJLKJY8wk2C3h77i8VyHowG3qYNZiIqD6D0ZS40439S/KVuc/PY48jp2yQmy0mhMknq8cys4jFMw==",
|
||||
"version": "5.76.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz",
|
||||
"integrity": "sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/eslint-scope": "^3.7.0",
|
||||
"@types/estree": "^0.0.50",
|
||||
"@types/eslint-scope": "^3.7.3",
|
||||
"@types/estree": "^0.0.51",
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/wasm-edit": "1.11.1",
|
||||
"@webassemblyjs/wasm-parser": "1.11.1",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn": "^8.7.1",
|
||||
"acorn-import-assertions": "^1.7.6",
|
||||
"browserslist": "^4.14.5",
|
||||
"chrome-trace-event": "^1.0.2",
|
||||
"enhanced-resolve": "^5.8.3",
|
||||
"enhanced-resolve": "^5.10.0",
|
||||
"es-module-lexer": "^0.9.0",
|
||||
"eslint-scope": "5.1.1",
|
||||
"events": "^3.2.0",
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"json-parse-better-errors": "^1.0.2",
|
||||
"graceful-fs": "^4.2.9",
|
||||
"json-parse-even-better-errors": "^2.3.1",
|
||||
"loader-runner": "^4.2.0",
|
||||
"mime-types": "^2.1.27",
|
||||
"neo-async": "^2.6.2",
|
||||
"schema-utils": "^3.1.0",
|
||||
"tapable": "^2.1.1",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"watchpack": "^2.3.0",
|
||||
"webpack-sources": "^3.2.2"
|
||||
"watchpack": "^2.4.0",
|
||||
"webpack-sources": "^3.2.3"
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
|
@ -2916,9 +2944,9 @@
|
|||
}
|
||||
},
|
||||
"webpack-sources": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz",
|
||||
"integrity": "sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==",
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
|
||||
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
"devDependencies": {
|
||||
"css-loader": "^6.5.1",
|
||||
"style-loader": "^3.3.1",
|
||||
"webpack": "^5.64.4",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"apexcharts": "^3.36.3",
|
||||
"apexcharts": "^3.49.1",
|
||||
"d3-format": "^3.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,16 +82,62 @@ apex(data = economics_long, type = "line", mapping = aes(x = date, y = value01,
|
|||
```
|
||||
|
||||
|
||||
## Area charts
|
||||
|
||||
Create area charts with `type = "area"`:
|
||||
|
||||
```{r area}
|
||||
apex(data = economics_long, type = "area", mapping = aes(x = date, y = value01, fill = variable)) %>%
|
||||
ax_yaxis(decimalsInFloat = 2) %>% # number of decimals to keep
|
||||
ax_chart(stacked = TRUE) %>%
|
||||
ax_yaxis(max = 4, tickAmount = 4)
|
||||
data("eco2mix", package = "apexcharter")
|
||||
|
||||
apex(eco2mix, aes(datetime, production, fill = source), type = "area") %>%
|
||||
ax_chart(animations = list(enabled = FALSE), stacked = TRUE) %>%
|
||||
ax_stroke(width = 1) %>%
|
||||
ax_fill(opacity = 1, type = "solid") %>%
|
||||
ax_tooltip(x = list(format = "dd MMM, HH:mm")) %>%
|
||||
ax_yaxis(labels = list(formatter = format_num("~", suffix = "MW"))) %>%
|
||||
ax_colors_manual(
|
||||
list(
|
||||
"bioenergies" = "#156956",
|
||||
"fuel" = "#80549f",
|
||||
"coal" = "#a68832",
|
||||
"solar" = "#d66b0d",
|
||||
"gas" = "#f20809",
|
||||
"wind" = "#72cbb7",
|
||||
"hydraulic" = "#2672b0",
|
||||
"nuclear" = "#e4a701",
|
||||
"pumping" = "#0e4269"
|
||||
)
|
||||
) %>%
|
||||
ax_labs(
|
||||
title = "Electricity generation by sector in France",
|
||||
subtitle = "Data from \u00e9CO\u2082mix"
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
You can create ribbon charts using `ymin` and `ymax` aesthetics :
|
||||
|
||||
```{r ribbon}
|
||||
data("temperatures", package = "apexcharter")
|
||||
|
||||
apex(
|
||||
temperatures,
|
||||
aes(x = date, ymin = low, ymax = high),
|
||||
type = "rangeArea",
|
||||
serie_name = "Low/High (2018-2021)"
|
||||
) %>%
|
||||
add_line(aes(date, `2023`)) %>%
|
||||
ax_chart(animations = list(enabled = FALSE)) %>%
|
||||
ax_yaxis(tickAmount = 7, labels = list(formatter = format_num("~", suffix = "°C"))) %>%
|
||||
ax_colors(c("#8485854D", "#FF0000")) %>%
|
||||
ax_stroke(width = c(1, 2)) %>%
|
||||
ax_fill(opacity = 1, type = "solid") %>%
|
||||
ax_labs(
|
||||
title = "Temperatures in 2023 with range from 2018 to 2021",
|
||||
subtitle = "Data from ENEDIS"
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -118,7 +164,7 @@ apex(data = mtcars, type = "scatter", mapping = aes(x = wt, y = mpg, z = scales:
|
|||
|
||||
|
||||
|
||||
## Pie charts
|
||||
## Pie & donut charts
|
||||
|
||||
Simple pie charts can be created with:
|
||||
|
||||
|
@ -131,6 +177,12 @@ poll <- data.frame(
|
|||
apex(data = poll, type = "pie", mapping = aes(x = answer, y = n))
|
||||
```
|
||||
|
||||
It's also possible to make donut chart:
|
||||
|
||||
```{r donut}
|
||||
apex(data = poll, type = "donut", mapping = aes(x = answer, y = n))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Radial charts
|
||||
|
@ -244,4 +296,67 @@ apex(
|
|||
|
||||
|
||||
|
||||
## Boxplot
|
||||
|
||||
Create boxplot (without outliers for now) with:
|
||||
|
||||
```{r boxplot}
|
||||
data("mpg", package = "ggplot2")
|
||||
apex(mpg, aes(hwy, class), "boxplot") %>%
|
||||
ax_plotOptions(
|
||||
boxPlot = boxplot_opts(color.upper = "#8BB0A6", color.lower = "#8BB0A6" )
|
||||
) %>%
|
||||
ax_stroke(colors = list("#2A5769")) %>%
|
||||
ax_grid(
|
||||
xaxis = list(lines = list(show = TRUE)),
|
||||
yaxis = list(lines = list(show = FALSE))
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Dumbbell charts
|
||||
|
||||
Create Dumbbell chart with:
|
||||
|
||||
```{r dumbbell}
|
||||
data("life_expec", package = "apexcharter")
|
||||
|
||||
apex(life_expec, aes(country, x = `1972`, xend = `2007`), type = "dumbbell") %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(
|
||||
dumbbellColors = list(list("#3d85c6", "#fb6003"))
|
||||
)
|
||||
) %>%
|
||||
ax_colors("#BABABA") %>%
|
||||
ax_labs(
|
||||
title = "Life expectancy : 1972 vs. 2007",
|
||||
subtitle = "Data from Gapminder dataset",
|
||||
x = "Life expectancy at birth, in years"
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Slope charts
|
||||
|
||||
Create a slope chart with:
|
||||
|
||||
```{r slope}
|
||||
data("life_expec_long", package = "apexcharter")
|
||||
|
||||
apex(
|
||||
life_expec_long,
|
||||
mapping = aes(x = as.character(year), y = lifeExp, fill = country),
|
||||
type = "slope",
|
||||
height = "700px"
|
||||
) %>%
|
||||
ax_colors("#112466") %>%
|
||||
ax_labs(
|
||||
title = "Life expectancy : 1972 vs. 2007",
|
||||
subtitle = "Data from Gapminder dataset",
|
||||
x = "Life expectancy at birth, in years"
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue