Configure MAIDR interception and display behavior using R's options system.
Available Options
maidr.auto_showLogical. Master switch for all MAIDR interception. When FALSE, all plotting functions behave as standard R. Default: TRUE.
maidr.base_rLogical. Enable Base R plot interception. When TRUE, Base R plots are captured and displayed in the MAIDR viewer. Default: TRUE.
maidr.ggplot2Logical. Enable ggplot2 auto-display. When TRUE, ggplot2 objects are automatically rendered in the MAIDR viewer instead of the standard graphics device. Default: TRUE.
maidr.startup_messageLogical. Show startup message when package is loaded. Default: TRUE.
maidr.dotpad_sdk_urlCharacter. URL of a copy of the DotPad tactile-display SDK module (
DotPadSDK-3.0.3.js) that you serve yourself. maidr.js does not bundle the SDK, whose braille engine is a 14 MB liblouis build; unless told otherwise it imports the vendor's copy from jsDelivr the first time a DotPad is connected, from a document rendered withuse_cdn = FALSEas much as any other. Set this to keep that path off the network too. Falls back to the environment variableMAIDR_DOTPAD_SDK_URL. Default: unset.maidr.dotpad_asset_base_urlCharacter. URL of the directory holding the SDK's braille engine (
liblouis.js,.wasm,.data), needed only when it is not thelib/folder beside the module. Falls back to the environment variableMAIDR_DOTPAD_ASSET_BASE_URL. Default: unset.maidr.dotpad_sdk_dirCharacter. Directory where
maidr_download_dotpad_sdk()writes the SDK and whereshow()andsave_html()look for it when a document is rendered withuse_cdn = FALSE. Falls back to the environment variableMAIDR_DOTPAD_SDK_DIR, then to a per-user cache directory. Default: unset.
Setting Options
Options can be set in your .Rprofile to persist across sessions:
# Disable ggplot2 interception by default
options(maidr.ggplot2 = FALSE)
# Disable all interception
options(maidr.auto_show = FALSE)
# Suppress startup message
options(maidr.startup_message = FALSE)
# Serve the DotPad SDK from your own server instead of jsDelivr
options(
maidr.dotpad_sdk_url = "https://example.org/vendor/DotPadSDK-3.0.3.js",
maidr.dotpad_asset_base_url = "https://example.org/vendor/lib/"
)DotPad SDK and offline documents
The two maidr.dotpad_*_url options are written into every document
this package produces (show(), save_html(), the htmlwidget,
knitr and Shiny) as the globals window.MAIDR_DOTPAD_SDK_URL and
window.MAIDR_DOTPAD_ASSET_BASE_URL, ahead of maidr.js, which
reads them when a DotPad is connected. Nothing is written when neither is
set. Without them a DotPad needs network access to jsDelivr on first
connect, even from a use_cdn = FALSE document; the rest of the
document works offline either way.
The other way to keep a DotPad off the network is to download the SDK
once with maidr_download_dotpad_sdk(): show() and
save_html() then copy it into lib/dotpad-sdk-<version>/ beside
every use_cdn = FALSE document and declare the globals with that
relative path. A configured URL wins over a downloaded copy. The widget,
knitr and Shiny paths render their charts in srcdoc frames, where a
relative path has nothing to resolve against, so they use only the URL
options.