Skip to contents

Arrange independent ECharts widgets in a row-major grid. Each panel keeps its own legend, tooltips, zoom, axes, and custom layers. No linked zoom or legend selection is implied. SVG export includes all panels in one vector file and uses the same layout calculation as the browser.

Usage

draw_panels(
  plots,
  ncol = 1L,
  gap = 12,
  padding = 0,
  layout = NULL,
  width = 900,
  height = NULL,
  element_id = NULL,
  filename = NULL
)

Arguments

plots

List: One or more ECharts widgets from draw_*() functions.

ncol, gap, padding

See PanelLayout.

layout

Optional PanelLayout: Complete layout overriding the three convenience settings; do not supply both forms.

width

Optional Character or Numeric: Total figure width.

height

Optional Numeric: Total figure height. Unset allocates 360 pixels per row plus padding and gaps.

element_id

Optional Character: Figure DOM identifier.

filename

Optional Character: Export the complete figure with save_drawing().

Value

htmlwidget: A figure containing independent chart panels.

Details

Child widget widths and heights are replaced by equally sized layout cells. Fixed-aspect and square-cell heatmap grids fit within both cell dimensions. Dendrograms remain aligned with their heatmap. Give panels enough space for their labels and legends. Explicit child themes are kept; automatic themes follow the browser, and resolve to light for SVG export. Padding and gaps use the common child background when all panels agree; mixed-background figures remain transparent. This also applies to SVG export. Nested layouts, Sigma/MapLibre, and child JavaScript hooks are not supported by this initial composition API.

Examples

draw_panels(list(draw_bar(c("A", "B"), c(2, 4)),
  draw_boxplot(list(A = 1:5, B = 3:7), boxpoints = "all")), ncol = 2)