render#
Drawing figures made of panels.
A figure is a Layout: rows of panels, each panel with a relative width. A Panel is a small function that draws one plot on the axes it is given, from the data in a FigureData, and says which columns it needs.
render() draws every panel of a layout. It never stops because one panel fails: the panel shows a red “Could not generate …” box, the error is logged, and it is returned in the list of problems, so that a report can list the panels that failed. A panel that has nothing to show for this data (e.g. no visual trials) raises NotApplicable, and shows a grey message instead (not a problem).
Example:
@panel("reaction times", needs={"reaction_time", "year_month_day"})
def reaction_times(data, ax): ...
LAYOUT = Layout([Row([(summary, 1), (reaction_times, 2)])], width=15, height=4)
fig, problems = render(LAYOUT, FigureData(prepared_df))
Functions