a13n
Build AI agents and run them on cloud.
Functions for Plots in Quarto-based lecture notes projects
Translation pending
Developer toolsLua · RGitHub @Morrison-LabOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗{qnp}The goal of {qnp} (“quarto-notes plots”) is to provide helpers for
including plots in Quarto notes. It currently provides one function,
interactive_plot(), which makes a {ggplot2} plot interactive in HTML
output and leaves it unchanged in other output formats.
You can install the development version of {qnp} from
GitHub with:
# install.packages("pak")
pak::pak("Morrison-Lab/qnp")
interactive_plot() takes a ggplot and a text alternative (alt) for
the plot:
library(ggplot2)
library(qnp)
p <- ggplot(mtcars, aes(wt, mpg)) +
geom_point()
interactive_plot(
plot = p,
alt = "Scatterplot of fuel economy versus car weight",
is_html = FALSE
)
In HTML output (the default, via is_html = knitr::is_html_output()),
the result is an interactive plotly widget
wrapped in a <div> with role = "img" and aria-label = alt, so that
screen readers announce it as a single image. In other output formats,
the original ggplot is returned unchanged. This README is rendered to
GitHub-flavored Markdown, which knitr counts as an HTML output format,
so the example sets is_html = FALSE explicitly to show the static
plot.
See USAGE.md for more details.
This package uses altdoc with Quarto to build its documentation site. To build and preview the documentation locally:
# Load the package
pkgload::load_all()
# Render the documentation
altdoc::render_docs()
# Preview the site
altdoc::preview_docs()
The documentation is automatically built and deployed to GitHub Pages via GitHub Actions when changes are pushed to the main branch.
{qnp} is an R package, and the notes sites that use it are Quarto
websites, so the two live in separate repositories. The decision and its
reasons are in the lab’s repository-template
guidance.
The notes on choosing colors are in the visualization
notes.
Please note that the {qnp} project is released with a Contributor
Code of
Conduct.
By contributing to this project, you agree to abide by its terms.