Skip to contents

Renders the full multi-panel Figure Builder interface (sidebar controls plus the free-form A4 canvas) as a namespaced Shiny module. Place this in the UI where you want the builder to appear, using an id that matches the one passed to figureBuilderServer().

Usage

figureBuilderUI(id, title = "VizModules Figure Builder")

Arguments

id

The ID for the Shiny module. Must match the id given to figureBuilderServer().

title

A character string used as the header shown above the builder (default: "VizModules Figure Builder"). Pass NULL to omit the header, which is useful when the host page supplies its own title.

Value

A Shiny tagList containing the Figure Builder UI.

Details

Unlike figureBuilderApp() (which returns a complete, standalone app), this function returns a tagList you can drop into any page, so the builder can be embedded alongside other content and instantiated more than once (each instance keeps its own namespace, canvas, and downloads). The module gallery, moduleGalleryApp(), embeds it this way as its Figure Builder tab.

The returned UI bundles the JavaScript and CSS the canvas needs, and calls shinyjs::useShinyjs(), so no extra setup is required in the host app.

Author

Jared Andrews

Examples

if (FALSE) { # interactive()
library(VizModules)
figureBuilderUI("figure_builder")
}