| Title: | Lorem-Ipsum-Like Helpers for Fast Shiny Prototyping |
|---|---|
| Description: | Prototype your shiny apps quickly with these Lorem-Ipsum-like Helpers. |
| Authors: | Colin Fay [cre, aut] (ORCID: <https://orcid.org/0000-0001-7343-1846>), Sebastien Rochette [aut] (ORCID: <https://orcid.org/0000-0002-1565-9313>), ThinkR [cph, fnd] |
| Maintainer: | Colin Fay <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-09-17 07:57:12 UTC |
| Source: | https://github.com/ThinkR-open/shinipsum |
Get a shinipsum example
ipsum_examples(which = NULL)ipsum_examples(which = NULL)
which |
The example to run. If empty, all the available examples are listed. |
A path to the example.
ipsum_examples()ipsum_examples()
A long lorem ipsum text
loremlorem
An object of class character of length 1.
A long vector of words
lorem_wordslorem_words
An object of class character of length 13657.
This function creates a random DT::datatable, and can be passed into renderDT & DTOutput.
random_DT( nrow, ncol, type = c("random", "numeric", "character", "numchar"), ... )random_DT( nrow, ncol, type = c("random", "numeric", "character", "numchar"), ... )
nrow |
number of row of the output |
ncol |
number of cols of the output |
type |
type of the columns, can be "random", "numeric", "character", "numchar". Default is random. |
... |
arguments to be passed to DT::datatable |
a DT
This function returns a dygraph object, which can be passed to renderDygraph and dygraphOutput
random_dygraph(...)random_dygraph(...)
... |
args passed to |
a dygraph
This function returns a ggplot object, which can be passed to renderPlot and plotOutput
random_ggplot( type = c("random", "point", "bar", "boxplot", "col", "tile", "line", "bin2d", "contour", "density", "density_2d", "dotplot", "hex", "freqpoly", "histogram", "ribbon", "raster", "violin", "ts"), n_bars = NULL )random_ggplot( type = c("random", "point", "bar", "boxplot", "col", "tile", "line", "bin2d", "contour", "density", "density_2d", "dotplot", "hex", "freqpoly", "histogram", "ribbon", "raster", "violin", "ts"), n_bars = NULL )
type |
type of the geom. Can be any of "random", "point", "bar", "boxplot","col", "tile", "line", "bin2d", "contour", "density", "density_2d", "dotplot", "hex", "freqpoly", "histogram", "ribbon", "raster", "violin", "ts" (alias "timeseries") and defines the geom of the ggplot. Default is "random", and chooses a random geom for you. The "ts" type returns a time-series oriented plot, with a |
n_bars |
number of bars to draw. Only valid together with
|
a ggplot
This function returns a ggplotly object, which can be passed to renderPlotly and plotlyOutput
random_ggplotly(...)random_ggplotly(...)
... |
arg to pass to |
a ggplotly
This function returns a random image that can be passed into renderImage and plotOutput.
random_image(width = NULL, height = NULL, alt = NULL)random_image(width = NULL, height = NULL, alt = NULL)
width |
image width passed through to the rendered |
height |
image height, same semantics as |
alt |
|
a list compatible with shiny::renderImage(): src, plus the
width / height / alt attributes when provided.
Returns an <img> tag pointing at a random image served by the
Lorem Picsum API, ready to be dropped inside a
Shiny UI for quick prototyping. No network request is performed by this
function: only the URL is built, the image is fetched by the browser.
random_image_ext(width = 400, height = 400, seed = NULL)random_image_ext(width = 400, height = 400, seed = NULL)
width, height
|
image dimensions, in pixels. Single positive (finite, whole) numbers. |
seed |
optional seed making the picked image stable across calls. Any
atomic scalar; it is coerced to a string and URL-encoded. When |
an <img> htmltools::tag
random_image_ext() random_image_ext(width = 400, height = 600, seed = "caramba")random_image_ext() random_image_ext(width = 400, height = 600, seed = "caramba")
This function returns a model which can be passed to renderText or renderTable if pre-processed appropriately
random_lm(nobs = 100, nx = 2)random_lm(nobs = 100, nx = 2)
nobs |
Numeric. number of observation |
nx |
Numeric. number of variables. Should be lower that nobs |
a model output
Build a quick "zoning" of a Shiny UI: a row of bootstrap columns, each one drawn as an empty bordered box with a centered label. Handy to sketch the layout of an app before any real content exists.
random_mock(widths, heights = 3, labels = NULL)random_mock(widths, heights = 3, labels = NULL)
widths |
integer vector of bootstrap column widths (each between 1 and 12). Its length defines the number of mock zones. |
heights |
integer vector giving the visual height of each zone, expressed
as a number of blank lines. Recycled to the length of |
labels |
character vector of zone labels. Recycled to the length of
|
The returned object is a htmltools::tagList() (a self-contained CSS <style>
block plus the columns), so it can be dropped directly inside a
shiny::fluidPage() / bslib::page_fluid() and rendered as is.
random_mock(c(4, 8)) random_mock(c(6, 6), labels = c("a plot here", "a table here"))random_mock(c(4, 8)) random_mock(c(6, 6), labels = c("a plot here", "a table here"))
This function returns a random print output that can be passed to renderPrint and verbatimTextOutput.
random_print(type = c("character", "numeric", "integer", "model", "table"))random_print(type = c("character", "numeric", "integer", "model", "table"))
type |
type of the output ("character", "numeric", "model", "table") |
a random print
This function returns a table that can be passed to renderTable and tableOutput.
random_table(nrow, ncol, type = c("random", "numeric", "character", "numchar"))random_table(nrow, ncol, type = c("random", "numeric", "character", "numchar"))
nrow |
number of row of the output |
ncol |
number of cols of the output |
type |
type of the columns, can be "random", "numeric", "character", "numchar". Default is random. |
a table
A Random Lorem Ipsum
random_text(nchars = NULL, nwords = NULL, offset = 0, var = 1)random_text(nchars = NULL, nwords = NULL, offset = 0, var = 1)
nchars |
number of characters. One of the two params should be left NULL. |
nwords |
number of words to return. One of the two params should be left NULL. |
offset |
number of characters or words to offset the result by. Defaults to 0. |
var |
integer >= 1 selecting a "variant" of the text: each value returns
a distinct slice of the lorem-ipsum corpus, so repeated calls (e.g. in a
bulleted list) don't all look alike. Defaults to 1. The corpus wraps around
when |
a text