Skip to content

Commit 9293917

Browse files
committed
chore: grid navigation release
1 parent dab4f5c commit 9293917

57 files changed

Lines changed: 2091 additions & 1079 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
3+
^.*\.Rcheck$
34
^\.git$
45
^\.gitignore$
56
^\.lintr$
@@ -26,5 +27,6 @@
2627
^Meta$
2728
^CRAN-SUBMISSION$
2829
^vignettes/_quarto\.yml$
30+
^vignettes/\.quarto$
2931
^vignettes/articles$
3032
\.DS_Store$

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: maidr
22
Type: Package
33
Title: Multimodal Access and Interactive Data Representation
4-
Version: 0.2.0
4+
Version: 0.3.0
55
Authors@R: c(
66
person("JooYoung", "Seo", email = "jseo1005@illinois.edu", role = c("aut", "cph")),
77
person("Niranjan", "Kalaiselvan", email = "nk46@illinois.edu", role = c("aut", "cre"))
@@ -20,7 +20,7 @@ Description: Provides accessible, interactive visualizations through the 'MAIDR'
2020
<https://maidr.ai/>.
2121
License: GPL (>= 3)
2222
Encoding: UTF-8
23-
LazyData: true
23+
Depends: R (>= 3.5.0)
2424
Imports:
2525
base64enc,
2626
curl,

R/base_r_point_layer_processor.R

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ BaseRPointLayerProcessor <- R6::R6Class(
7676

7777
data_points
7878
},
79-
#' Extract axis information from Base R plot call
80-
#'
81-
#' Returns per-axis objects with label and optional grid navigation fields
82-
#' (min, max, tickStep). Grid fields are derived from xlim/ylim args or
83-
#' data range, and tick intervals via pretty(). Only included when
84-
#' extraction succeeds.
85-
#'
86-
#' @param layer_info Layer information with recorded plot call
87-
#' @return List with x and y per-axis objects
79+
# Extract axis information from Base R plot call
80+
#
81+
# Returns per-axis objects with label and optional grid navigation fields
82+
# (min, max, tickStep). Grid fields are derived from xlim/ylim args or
83+
# data range, and tick intervals via pretty(). Only included when
84+
# extraction succeeds.
85+
#
86+
# @param layer_info Layer information with recorded plot call
87+
# @return List with x and y per-axis objects
8888
extract_axis_titles = function(layer_info) {
8989
if (is.null(layer_info)) {
9090
return(list(
@@ -125,14 +125,14 @@ BaseRPointLayerProcessor <- R6::R6Class(
125125
list(x = x_axis, y = y_axis)
126126
},
127127

128-
#' Extract grid navigation info for a Base R axis
129-
#'
130-
#' Computes min, max from xlim/ylim or data range, and tickStep from
131-
#' pretty() tick positions. Returns NULL if extraction fails.
132-
#'
133-
#' @param data Numeric vector of data values
134-
#' @param lim Optional axis limits (xlim or ylim)
135-
#' @return List with min, max, tickStep or NULL
128+
# Extract grid navigation info for a Base R axis
129+
#
130+
# Computes min, max from xlim/ylim or data range, and tickStep from
131+
# pretty() tick positions. Returns NULL if extraction fails.
132+
#
133+
# @param data Numeric vector of data values
134+
# @param lim Optional axis limits (xlim or ylim)
135+
# @return List with min, max, tickStep or NULL
136136
extract_base_r_axis_grid_info = function(data, lim = NULL) {
137137
tryCatch(
138138
{

R/base_r_processor_factory.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ BaseRProcessorFactory <- R6::R6Class(
8686
"BaseRHistogramLayerProcessor",
8787
"BaseRBoxplotLayerProcessor",
8888
"BaseRUnknownLayerProcessor"
89-
# TODO: Add other processor classes as they are implemented
89+
# Additional processor classes can be registered here as needed
9090
)
9191

9292
available <- sapply(processor_classes, self$is_processor_available)

R/examples.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ run_example <- function(example = NULL, type = c("ggplot2", "base_r")) {
9191
return(invisible(NULL))
9292
}
9393

94+
# Check that we're in interactive mode before running examples
95+
# This ensures examples don't execute in automated testing or package checks
96+
if (!interactive()) {
97+
warning(
98+
"run_example() is designed for interactive use only.\n",
99+
"Examples modify the global environment and require a browser/viewer.\n",
100+
"To see available examples, call run_example() without arguments.",
101+
call. = FALSE
102+
)
103+
return(invisible(NULL))
104+
}
105+
94106
# Check if example exists
95107
if (!example %in% available_examples) {
96108
stop(

R/html_dependencies.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' MAIDR JavaScript library version bundled with this package
22
#'
33
#' @keywords internal
4-
MAIDR_VERSION <- "3.55.2"
4+
MAIDR_VERSION <- "3.59.0"
55

66
#' Get the MAIDR CDN base URL
77
#'

R/maidr-package.R

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#' maidr: Multimodal Access and Interactive Data Representation
2+
#'
3+
#' @description
4+
#' The 'maidr' package provides accessible, interactive visualizations through
5+
#' the MAIDR (Multimodal Access and Interactive Data Representation) system.
6+
#' It converts 'ggplot2' and Base R plots into accessible HTML/SVG formats with
7+
#' keyboard navigation, screen reader support, and sonification capabilities.
8+
#' This enables users with visual impairments to independently explore and
9+
#' understand data visualizations through multiple sensory modalities.
10+
#'
11+
#' @section Main Functions:
12+
#' \itemize{
13+
#' \item \code{\link{show}}: Display an interactive MAIDR plot in the browser or RStudio Viewer
14+
#' \item \code{\link{save_html}}: Save a plot as a standalone HTML file
15+
#' \item \code{\link{run_example}}: Run interactive example plots
16+
#' \item \code{\link{maidr_on}}: Enable automatic MAIDR interception in RMarkdown
17+
#' \item \code{\link{maidr_off}}: Disable automatic MAIDR interception
18+
#' \item \code{\link{render_maidr}}: Render MAIDR plots in Shiny applications
19+
#' \item \code{\link{maidr_output}}: Create MAIDR output container for Shiny UI
20+
#' }
21+
#'
22+
#' @section Supported Plot Types:
23+
#' The package supports a wide variety of plot types from both 'ggplot2' and
24+
#' Base R plotting systems:
25+
#'
26+
#' \strong{ggplot2 plots:}
27+
#' \itemize{
28+
#' \item Bar charts (simple, grouped, stacked) - \code{geom_bar()}, \code{geom_col()}
29+
#' \item Histograms - \code{geom_histogram()}
30+
#' \item Scatter plots - \code{geom_point()}
31+
#' \item Line plots - \code{geom_line()}
32+
#' \item Box plots - \code{geom_boxplot()}
33+
#' \item Violin plots - \code{geom_violin()}
34+
#' \item Heat maps - \code{geom_tile()}
35+
#' \item Density/smooth curves - \code{geom_density()}, \code{geom_smooth()}
36+
#' \item Faceted plots - \code{facet_wrap()}, \code{facet_grid()}
37+
#' \item Multi-panel layouts (via 'patchwork' package)
38+
#' \item Multi-layered plot combinations
39+
#' }
40+
#'
41+
#' \strong{Base R plots:}
42+
#' \itemize{
43+
#' \item Bar plots (simple, grouped, stacked) - \code{barplot()}
44+
#' \item Histograms - \code{hist()}
45+
#' \item Scatter and line plots - \code{plot()}, \code{points()}, \code{lines()}
46+
#' \item Box plots - \code{boxplot()}
47+
#' \item Heat maps - \code{image()}, \code{heatmap()}
48+
#' \item Multi-panel layouts - \code{par(mfrow)}, \code{par(mfcol)}
49+
#' }
50+
#'
51+
#' @section Accessibility Features:
52+
#' \itemize{
53+
#' \item \strong{Keyboard Navigation}: Use arrow keys to explore data points
54+
#' \item \strong{Screen Reader Support}: ARIA labels and live regions for announcements
55+
#' \item \strong{Sonification}: Audio representation of data patterns
56+
#' \item \strong{Text Summaries}: Automatic statistical descriptions
57+
#' \item \strong{Grid Navigation}: Efficient exploration of scatter plots
58+
#' }
59+
#'
60+
#' @section Integration:
61+
#' The package integrates seamlessly with:
62+
#' \itemize{
63+
#' \item \strong{RStudio}: Direct display in the Viewer pane
64+
#' \item \strong{RMarkdown/Quarto}: Automatic rendering with \code{maidr_on()}
65+
#' \item \strong{Shiny}: Interactive plots in Shiny apps via \code{render_maidr()}
66+
#' \item \strong{Standalone HTML}: Export plots for sharing with \code{save_html()}
67+
#' }
68+
#'
69+
#' @section Getting Started:
70+
#' To create your first accessible plot:
71+
#' \preformatted{
72+
#' library(maidr)
73+
#' library(ggplot2)
74+
#'
75+
#' # Create a ggplot2 plot
76+
#' p <- ggplot(mtcars, aes(x = factor(cyl), y = mpg)) +
77+
#' geom_boxplot()
78+
#'
79+
#' # Display as interactive MAIDR plot
80+
#' show(p)
81+
#'
82+
#' # Or save to HTML file
83+
#' save_html(p, file = "my_plot.html")
84+
#' }
85+
#'
86+
#' For Base R plots:
87+
#' \preformatted{
88+
#' library(maidr)
89+
#'
90+
#' # Create a Base R plot
91+
#' barplot(table(mtcars$cyl))
92+
#'
93+
#' # Display as interactive MAIDR plot
94+
#' show()
95+
#' }
96+
#'
97+
#' @section Learn More:
98+
#' \itemize{
99+
#' \item Package website: \url{https://r.maidr.ai/}
100+
#' \item MAIDR project: \url{https://maidr.ai/}
101+
#' \item GitHub repository: \url{https://github.com/xability/r-maidr}
102+
#' \item Get started: \code{vignette("getting-started", package = "maidr")}
103+
#' \item Shiny integration: \code{vignette("shiny-integration", package = "maidr")}
104+
#' }
105+
#'
106+
#' @keywords internal
107+
"_PACKAGE"
108+
109+
## usethis namespace: start
110+
## usethis namespace: end
111+
NULL

cran-comments.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
## New submission
22

3-
This is a minor release (0.2.0) adding violin plot support.
3+
This is a minor release (0.3.0) adding scatter plot grid navigation support and updating the bundled MAIDR JavaScript library.
44

55
### Key changes
66

7-
* Added violin plot support for 'ggplot2' (`geom_violin()`), including both
8-
vertical and horizontal orientations, with box-summary and KDE density layers.
9-
* Added RDP curve simplification and SVG coordinate injection for violin KDE.
10-
* Renamed option `maidr.enabled` to `maidr.auto_show` for clarity.
11-
* Added violin plot examples to documentation and vignettes.
7+
* Added scatter plot grid navigation support for improved accessibility and efficient data exploration.
8+
* Updated bundled MAIDR JavaScript library from v3.55.2 to v3.59.0.
9+
* Improved package documentation with package-level documentation.
10+
* Enhanced code quality and CRAN compliance (removed LazyData field, added R version dependency).
11+
* Minor bug fixes and improvements.
1212

1313
## R CMD check results
1414

inst/htmlwidgets/lib/maidr-3.55.2/maidr.js

Lines changed: 0 additions & 926 deletions
This file was deleted.

inst/htmlwidgets/lib/maidr-3.55.2/maidr.css renamed to inst/htmlwidgets/lib/maidr-3.59.0/maidr.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)