Skip to content

blockr.ggplot

Static plots the way R users know them: a chart type, aesthetic mappings, facets. The right choice for a figure; for charts your dashboard users click, see blockr.viz.

Facet

new_facet_block() · plot

Split plots into multiple panels based on categorical variables

ArgumentDescription
facet_type"wrap" (one variable, flexible layout) or "grid" (row/column matrix)
facetsArray of column names for facet_wrap (used when facet_type is wrap)
rowsArray of column names for grid rows (used when facet_type is grid)
colsArray of column names for grid columns (used when facet_type is grid)
ncolNumber of columns for wrap: "1"-"5", or "" for auto
nrowNumber of rows for wrap: "1"-"5", or "" for auto
scales"fixed", "free", "free_x", or "free_y"
labeller"label_value", "label_both", or "label_parsed"
dir"h" (horizontal) or "v" (vertical) -- fill direction for wrap
space"fixed", "free_x", or "free_y" -- panel sizing for grid

ggplot

new_ggplot_block() · plot

Create visualizations including scatter plots, bar charts, line graphs, histograms, and more

ArgumentDescription
typePlot type. Valid values: "point", "bar", "col", "line", "histogram", "density", "boxplot", "violin", "pie". NOTE: "scatter" is NOT valid -- use "point" for scatter plots.
xColumn name from the data (required for all plot types)
yColumn name from the data, or "(none)". For bar and histogram, set y = "(none)" to auto-count. For pie, y = "(none)" means equal slices. All other types require a real column name for y.
colorColumn name for color aesthetic, or "(none)" to omit
fillColumn name for fill aesthetic, or "(none)" to omit
sizeColumn name for size aesthetic, or "(none)" to omit
shapeColumn name for shape aesthetic, or "(none)" to omit
linetypeColumn name for linetype aesthetic, or "(none)" to omit
groupColumn name for group aesthetic, or "(none)" to omit
alphaColumn name for alpha aesthetic, or "(none)" to omit
density_alphaNumber between 0 and 1, opacity for density plots (default 0.8)
position"stack", "dodge", or "fill" -- position adjustment for bar/col/histogram
binsInteger, number of bins for histogram (default 30)
donutBoolean, if true render pie chart as donut (only applies to pie type)

Grid

new_grid_block() · plot

Combine multiple ggplot objects into a grid layout with annotations

ArgumentDescription
ncolNumber of columns: "1", "2", "3", "4", "5", or "" for auto
nrowNumber of rows: "1", "2", "3", "4", "5", or "" for auto
titleOverall grid title string, or "" for none
subtitleGrid subtitle string, or "" for none
captionGrid caption string, or "" for none
tag_levelsPanel tag labels: "A" (uppercase), "a" (lowercase), "1" (numeric), "I" (roman), "i" (roman lower), or "" for none
guides"auto", "collect", or "keep". Use "collect" to share legends across plots

Theme

new_theme_block() · plot

Customize plot appearance including colors, fonts, backgrounds, and grid lines

ArgumentDescription
base_themeBase ggplot2 theme: "auto", "minimal", "classic", "gray", "bw", "light", "dark", "void". Additional themes available if packages installed: "economist", "fivethirtyeight", "tufte", "wsj", "gdocs", "calc", "solarized",...
legend_position"auto", "right", "left", "top", "bottom", "none"
palette_fillFill color palette: "auto", "viridis_d", "viridis_c", "magma_d", "magma_c", "plasma_d", "plasma_c", "ggplot2"
palette_colourColour palette: "auto", "viridis_d", "viridis_c", "magma_d", "magma_c", "plasma_d", "plasma_c", "ggplot2"
base_size"auto" or a numeric string (e.g. "14") for base font size
base_family"auto", "sans", "serif", or "mono"
panel_bgHex color string for panel background (e.g. "#FFFFFF"), or "" for theme default
plot_bgHex color string for plot background, or "" for theme default
grid_colorHex color string for grid lines, or "" for theme default
show_major_grid"auto", "show", or "hide"
show_minor_grid"auto", "show", or "hide"
show_panel_border"auto", "show", or "hide"