Skip to content
Closed
Binary file removed AutoPlots_1.0.0.tar.gz
Binary file not shown.
13 changes: 9 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Package: AutoPlots
Title: Creating Echarts Visualizations as Easy as Possible
Version: 1.0.0
Date: 2025-06-21
Version: 1.0.1
Date: 2026-02-02
Authors@R:
person("Adrian", "Antico", , "adrianantico@gmail.com", role = c("aut", "cre", "cph"))
c(
person("Adrian", "Antico", , "adrianantico@gmail.com", role = c("aut", "cre", "cph")),
person("David", "Munoz Tord", , "david.munoztord@mailbox.org", role = c("ctb"))
)
Author: Adrian Antico [aut, cre, cph]
Maintainer: Adrian Antico <adrianantico@gmail.com>
Description: Create beautiful and interactive visualizations in a single function call. The 'data.table' package is utilized to perform the data wrangling necessary to prepare your data for the plot types you wish to build, along with allowing fast processing for big data. There are two broad classes of plots available: standard plots and machine learning evaluation plots. There are lots of parameters available in each plot type function for customizing the plots (such as faceting) and data wrangling (such as variable transformations and aggregation).
Expand All @@ -19,18 +22,20 @@ Imports:
e1071,
echarts4r,
grDevices,
htmltools,
htmlwidgets,
lubridate,
nortest,
quanteda,
quanteda.textstats,
rlang,
scales,
stats
Contact: Adrian Antico
Encoding: UTF-8
Language: en-US
LazyData: true
NeedsCompilation: no
Packaged: 2025-06-21 14:00:00 UTC
RoxygenNote: 7.3.3
Suggests:
spelling
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ importFrom(data.table,set)
importFrom(data.table,setcolorder)
importFrom(data.table,setnames)
importFrom(data.table,setorderv)
importFrom(utils,head)
importFrom(utils,tail)
46 changes: 3 additions & 43 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
# AutoPlots 1.0.0
Initial version

100% data.table backend for fast data processing

Chart types:

Histogram Plots
Density Plots
Box Plots
Probability Plots
Word Cloud
Pie Charts
Donut Plot
Rosetype Plot
Bar Plots
3D Bar Plots
Stacked Bar Plots
Radar Plots
Line Plots
Step Plots
Area Plots
River Plots
Autocorrelation Plot
Partial Autocorrelation Plot
Scatter Plots
3D Scatter Plots
Copula Plots
3D Copula Plots
Correlation Matrix Plots
Parallel Plots
Heatmaps
Calibration Plots
Calibration Scatter Plots
Partital Dependence Plots
Partital Dependence Heatmaps
Variable Importance Plots
Shapely Importance Plots
ROC Plots
Confusion Matrix Heatmaps
Lift Plots
Gain Plots
BinaryMetrics
# AutoPlots 1.0.1
* Fix: examples
* Fix: Compatibility upgrade for echarts4r 0.5.0
8 changes: 8 additions & 0 deletions R/GlobalVariables.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

utils::globalVariables(
names = c(
".",
".data",
"1 - Recall",
"1 - Specificity",
"Adrian",
"Appointments",
Expand All @@ -30,6 +33,7 @@ utils::globalVariables(
"DateTime",
"FP",
"Gain",
"GroupLevels",
"GroupVariables",
"GroupVars",
"Importance",
Expand All @@ -43,6 +47,7 @@ utils::globalVariables(
"Independent_Variable7",
"Independent_Variable8",
"Independent_Variable9",
"Label",
"Leads",
"Level",
"Lift",
Expand All @@ -58,6 +63,7 @@ utils::globalVariables(
"NormalizedStatistics",
"NumNull",
"P_Predicted",
"PRAUC",
"Percentile",
"Plot.Polar",
"Population",
Expand All @@ -79,6 +85,8 @@ utils::globalVariables(
"Y_Scroll",
"V1",
"ZVar",
"..CorrVars",
"..CorrVars_num",
"classPredict",
"i.Metric",
"metadata_path",
Expand Down
12 changes: 10 additions & 2 deletions R/PlotFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -8831,12 +8831,14 @@ Plot.CorrMatrix <- function(dt = NULL,
xaxis.fontSize = 14,
Debug = FALSE) {

# Filter out bad vars
# Filter out bad vars and keep only numeric columns
x <- c(); for(i in CorrVars) if(dt[, stats::sd(get(i), na.rm = TRUE)] > 0L) x <- c(x, i)
CorrVars <- x
NN <- dt[,.N]
x <- c(); for(i in CorrVars) if(sum(dt[, is.na(get(i))]) / NN <= MaxNAPercent) x <- c(x, i)
CorrVars <- x
# Keep only numeric columns
CorrVars <- CorrVars[sapply(dt[, ..CorrVars], is.numeric)]

# Plot
if(!PreAgg) {
Expand Down Expand Up @@ -8867,7 +8869,7 @@ Plot.CorrMatrix <- function(dt = NULL,
}

p1 <- echarts4r::e_charts(data = corr_mat, width = Width, height = Height)
p1 <- echarts4r::e_correlations(e = p1, order = "hclust")
p1 <- echarts4r::e_correlations(e = p1, order = "hclust", columns = colnames(corr_mat))
p1 <- echarts4r::e_tooltip(e = p1, trigger = "axis", backgroundColor = "aliceblue")
if(MouseScroll && FacetRows == 1L && FacetCols == 1L) {
p1 <- echarts4r::e_datazoom(e = p1, type = "inside", x_index = c(0,1))
Expand Down Expand Up @@ -9026,8 +9028,13 @@ Plot.Parallel <- function(dt = NULL,
# Build Plot
p1 <- echarts4r::e_charts(data = dt1, width = Width, height = Height)

<<<<<<< main
p1 <- echarts4r::e_parallel_(e = p1, columns = CorrVars, opts = list(smooth = TRUE))

=======
# Metaprog because issue with function accepting vector of names
p1 <- echarts4r::e_parallel_(e = p1, vars = names(dt1), opts = list(smooth = TRUE))
>>>>>>> main

p1 <- echarts4r::e_tooltip(e = p1, trigger = "axis", backgroundColor = "aliceblue")
if(MouseScroll && FacetRows == 1L && FacetCols == 1L) {
Expand Down Expand Up @@ -12259,6 +12266,7 @@ Plot.ROC <- function(dt = NULL,
#'
#' @author Adrian Antico
#' @family Model Evaluation
#' @importFrom utils head tail
#'
#' @param dt source data.table
#' @param XVar X-Axis variable name
Expand Down
88 changes: 62 additions & 26 deletions R/PlotFunctions_NEW.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#' @param ShowLabels character
#' @param Theme "auritus","azul","bee-inspired","blue","caravan","carp","chalk","cool","dark-bold","dark","eduardo", #' "essos","forest","fresh-cut","fruit","gray","green","halloween","helianthus","infographic","inspired", #' "jazz","london","dark","macarons","macarons2","mint","purple-passion","red-velvet","red","roma","royal", #' "sakura","shine","tech-blue","vintage","walden","wef","weforum","westeros","wonderland"
#' @param TimeLine logical
#' @param showSymbol logical, show symbols on line
#' @param areaStyle.color hex or color name
#' @param areaStyle.opacity numeric between 0 and 1
#' @param ContainLabel TRUE
#' @param Opacity numeric
#' @param title.text Title name
Expand Down Expand Up @@ -373,6 +376,7 @@ Density <- function(dt = NULL,
FacetLevels = NULL,
TimeLine = FALSE,
showSymbol = FALSE,
Opacity = NULL,
areaStyle.color = NULL,
areaStyle.opacity = NULL,
Height = NULL,
Expand Down Expand Up @@ -678,6 +682,11 @@ Density <- function(dt = NULL,
toolbox.iconStyle.shadowOffsetY = NULL,
Debug = FALSE) {

# Set Opacity if provided
if(!is.null(Opacity)) {
areaStyle.opacity <- Opacity
}

# Cap number of records
if(length(SampleSize) == 0L) SampleSize <- 30000
if(!data.table::is.data.table(dt)) tryCatch({data.table::setDT(dt)}, error = function(x) {
Expand Down Expand Up @@ -986,7 +995,7 @@ Density <- function(dt = NULL,

if(ShowLabels) {
p1 <- echarts4r::e_charts_(
dt1 |> dplyr::group_by(get(GroupVar[1L])),
dt1 |> dplyr::group_by(!!rlang::sym(GroupVar[1L])),
timeline = TimeLine,
dispose = TRUE,
darkMode = TRUE,
Expand All @@ -996,7 +1005,7 @@ Density <- function(dt = NULL,
label = list(show = TRUE))
} else {
p1 <- echarts4r::e_charts_(
dt1 |> dplyr::group_by(get(GroupVar[1L])),
dt1 |> dplyr::group_by(!!rlang::sym(GroupVar[1L])),
timeline = TimeLine,
dispose = TRUE,
darkMode = TRUE,
Expand Down Expand Up @@ -11048,6 +11057,7 @@ Step <- function(dt = NULL,
#' @param TimeLine Logical
#' @param MouseScroll logical, zoom via mouse scroll
#' @param ShowSymbol = FALSE
#' @param itemStyle.color hex or color name
#' @param title.text Title name
#' @param title.subtext Subtitle name
#' @param title.link Title as a link
Expand Down Expand Up @@ -11536,26 +11546,24 @@ River <- function(dt = NULL,
if(Debug) print("Plot.River 3")

# Minimize data before moving on
# DCast -> redefine YVar -> Proceed as normal (for both PreAgg and non-PreAgg cases)
if(length(YVar) > 1L && length(GroupVar) == 0L) {
dt1 <- data.table::melt.data.table(
data = dt1,
id.vars = XVar,
measure.vars = YVar,
variable.name = "Group",
value.name = "Measures")
YVar <- "Measures"
GroupVar <- "Group"
}

if(!PreAgg) {

if(Debug) print("Plot.River 4")

# DCast -> redefine YVar -> Proceed as normal
if(length(YVar) > 1L && length(GroupVar) == 0L) {
dt1 <- data.table::melt.data.table(
data = dt1,
id.vars = XVar,
measure.vars = YVar,
variable.name = "Group",
value.name = "Measures")
YVar <- "Measures"
GroupVar <- "Group"
} else {
dt1 <- data.table::copy(dt)
}

# Define Aggregation function
if(Debug) print("Plot.Calibration.Line # Define Aggregation function")
if(Debug) print("Plot.Calibration.line # Define Aggregation function")
aggFunc <- SummaryFunction(AggMethod)

# Aggregate data
Expand All @@ -11566,6 +11574,11 @@ River <- function(dt = NULL,
dt1 <- dt1[, lapply(.SD, noquote(aggFunc)), by = c(XVar)]
data.table::setorderv(x = dt1, cols = XVar, 1L)
}
} else {
# For PreAgg = TRUE, still need to copy if we haven't melted
if(length(YVar) == 1L || length(GroupVar) > 0L) {
dt1 <- data.table::copy(dt1)
}
}

# Transformation
Expand All @@ -11590,19 +11603,31 @@ River <- function(dt = NULL,

# Build base plot depending on GroupVar availability
if(Debug) print("Line no group Echarts")
p1 <- echarts4r::e_charts_(
data = dt1 |> dplyr::group_by(get(GroupVar)),
x = XVar,
dispose = TRUE,
darkMode = TRUE,
width = Width,
height = Height)

# Create grouping specification based on whether GroupVar exists
if(length(GroupVar) > 0L) {
p1 <- echarts4r::e_charts_(
data = dt1 |> dplyr::group_by(.data[[GroupVar[1L]]]),
x = XVar,
dispose = TRUE,
darkMode = TRUE,
width = Width,
height = Height)
} else {
p1 <- echarts4r::e_charts_(
data = dt1,
x = XVar,
dispose = TRUE,
darkMode = TRUE,
width = Width,
height = Height)
}

p1 <- echarts4r::e_river_(
e = p1,
serie = YVar
)
if (length(itemStyle.color) == length(as.character(unique(dt1[[GroupVar]])))) {
if (length(GroupVar) > 0L && length(itemStyle.color) == length(as.character(unique(dt1[[GroupVar[1L]]])))) {
p1 <- echarts4r::e_color(e = p1, color = itemStyle.color)
}

Expand Down Expand Up @@ -21030,6 +21055,11 @@ CorrMatrix <- function(dt = NULL,
# Filter out bad vars
x <- c(); for(i in CorrVars) if(dt[, stats::sd(get(i), na.rm = TRUE)] > 0L) x <- c(x, i)
CorrVars <- x

# Filter out non-numeric columns
x <- c(); for(i in CorrVars) if(class(dt[[i]])[1L] %in% c('numeric', 'integer', 'double')) x <- c(x, i)
CorrVars <- x

NN <- dt[,.N]
x <- c(); for(i in CorrVars) if(sum(dt[, is.na(get(i))]) / NN <= MaxNAPercent) x <- c(x, i)
CorrVars <- x
Expand All @@ -21053,7 +21083,11 @@ CorrMatrix <- function(dt = NULL,
corr_mat <- stats::cor(method = tolower(Method), x = dt1)
corr_mat <- round(corr_mat, 3)
} else {
corr_mat <- dt
# Use only numeric columns and compute correlation
CorrVars_num <- CorrVars[sapply(dt[, ..CorrVars], is.numeric)]
dt_num <- dt[, ..CorrVars_num]
corr_mat <- stats::cor(dt_num, use = "pairwise.complete.obs", method = tolower(Method))
corr_mat <- round(corr_mat, 3)
}

if(Debug) {
Expand Down Expand Up @@ -21229,6 +21263,7 @@ CorrMatrix <- function(dt = NULL,
#'
#' @param dt source data.table
#' @param SampleSize Sample size
#' @param PreAgg logical; if TRUE, data is pre-aggregated
#' @param CorrVars vector of variable names
#' @param FacetRows Defaults to 1 which causes no faceting to occur vertically. Otherwise, supply a numeric value for the number of output grid rows
#' @param FacetCols Defaults to 1 which causes no faceting to occur horizontally. Otherwise, supply a numeric value for the number of output grid columns
Expand Down Expand Up @@ -21581,6 +21616,7 @@ CorrMatrix <- function(dt = NULL,
#' @export
Parallel <- function(dt = NULL,
SampleSize = 50000,
PreAgg = TRUE,
CorrVars = NULL,
FacetRows = 1,
FacetCols = 1,
Expand Down
1 change: 1 addition & 0 deletions R/revised_echarts4r_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ e_grid_full <- function(
#'
#' @param e An echarts4r object
#' @param serie ZVar XVar YVar
#' @param visualMap.show logical
#' @param visualMap.min min value
#' @param visualMap.max max value
#' @param visualMap.orient 'vertical' 'horizontal'
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 1 note
0 errors | 0 warnings | 0 notes

* This is a new release.
* This release includes compatibility upgrades for echarts4r 0.5.0
Loading