Bring Your ggplot to the Board: Authoring CanvasXpress Panels in R
Part 5 of the CanvasXpress Dashboards series. Write a chart in ggplot2, convert it once, and render it on the dashboard as a native, interactive CanvasXpress panel — the R code travels with it.
For a lot of scientists, the chart already exists. It’s in an R script, written in ggplot2, reviewed and trusted. The last thing anyone wants is to redraw it by hand in a different tool and hope it still says the same thing. The dashboards package takes the other path: author the panel in R, and render it on the board unchanged.
ggplot in, native CanvasXpress out
The CanvasXpress R package has long shipped a converter, ggplot.as.list(), that turns a ggplot object into a CanvasXpress spec. Dashboards use it as the authoring path for a whole class of panels:
- Write the chart in ggplot2, the way you already do.
- Convert it once with
ggplot.as.list(). - Drop the result into the dashboard spec as a
ggplotpanel.
On the board it renders as a native, interactive CanvasXpress instance — not an image, not an <iframe> of a rendered plot. It coordinates with the other panels through broadcast, it responds to filters, it participates in saved states, exactly like a panel you built in the customizer. The panel is marked in the spec with isGGPlot: true, so the engine knows it came from the R grammar and renders it on that path.
The payoff is that your authoring language and your runtime are now different things, and each is the best tool for its job: ggplot2 for expressing the chart, CanvasXpress for making it live and linked on the board.
The R code travels with the panel
A ggplot panel isn’t a one-way export that forgets where it came from. The R source rides along. On any such panel, a </> Code control reveals the R code and the data that produced it — right there in the dashboard.
Get Isaac Neuhaus’s stories in your inbox
Join Medium for free to get updates from this writer.
That changes what the board is to a reviewer. A figure in a paper or a report is usually a dead end: you see the result and have to take the method on faith. A ggplot panel here is self-documenting — the reader clicks </> Code and sees the exact ggplot call and data behind the picture. The dashboard carries its own provenance.
Combine that with the series’ recurring theme — the spec is the whole truth — and you get a board where every scientific panel is reproducible by construction. The layout is in the document, the derivations are in the document (Part 4), and the R recipe for each ggplot panel is one click away.
Why render it as CanvasXpress at all?
A fair question: if the chart is already a ggplot, why not just render the ggplot? Because a static plot can’t do what a dashboard panel has to do.
- It has to coordinate. Click a point and the other panels filter to match. That’s CanvasXpress broadcast, and a rendered PNG doesn’t have it.
- It has to stay interactive. Hover for values, zoom, select a cohort — the things that make a board an exploration rather than a slide.
- It has to join the saved-state and filter machinery every other panel uses, so the whole board narrows and resets as one.
Converting to native CanvasXpress is what lets an R-authored chart be a first-class citizen of a live, linked board instead of a picture pinned to it. You keep ggplot’s expressiveness at authoring time and gain interactivity and coordination at runtime.
Who this is for
If your lab lives in R — Bioconductor workflows, RMarkdown reports, a drawer full of ggplot scripts — this is the on-ramp that doesn’t ask you to abandon any of it. You write charts the way you always have, and they become panels on a shareable, self-hostable, coordinated board. The conversion is mechanical and repeatable, so a gallery of ggplot panels is a script over your existing plots, not a manual rebuild.
And it sits inside everything else in this series: those R-authored panels bind to connector and joined sources (Part 4), coordinate through broadcast (Part 1), and live in the one reviewable spec (Part 2) you can run on your own hardware (Part 6).
Try it: the converter ships with the CanvasXpress R package (
ggplot.as.list()); see theggplot-galleryexample in the dashboards repo forisGGPlotpanels in a live board: github.com/neuhausi/canvasxpress-dashboards.
Next: Run It on Your Premises — self-hosting the whole app, and the reference-data packs that ship science-ready boards.











