forestploter.ForestData

class forestploter.ForestData(frame, spans=(), mapping=<factory>, source=None, sheet_name=None, source_rows=(), cell_references=())[source]

Store a renderable long table and its source-cell structure.

Parameters:
framepandas.DataFrame

Source long-table values. Each estimate record describes one series in one CI column with one statistical triple.

spanstuple of ForestCellSpan, default ()

Supported XLSX vertical merges. CSV input always produces an empty tuple.

mappingForestDataMapping, default ForestDataMapping()

Reserved-field mapping.

sourcepathlib.Path or None, default None

Absolute input path. It may be None when constructed directly from a DataFrame.

sheet_namestr or None, default None

XLSX worksheet name; None for CSV.

source_rowstuple of int, default ()

One-based source-file row number for every record.

cell_referencestuple of tuple of str, default ()

Source references with the same shape as frame, for example "Forest!D7" or "D7" for CSV.

Parameters:
  • frame (DataFrame)

  • spans (tuple[ForestCellSpan, ...])

  • mapping (ForestDataMapping)

  • source (Path | None)

  • sheet_name (str | None)

  • source_rows (tuple[int, ...])

  • cell_references (tuple[tuple[str, ...], ...])

Notes

XLSX “what you see is what you enter” applies to values, record order, and supported vertical merges. The plot does not copy Excel fonts, fills, borders, column widths, or row heights. For a conventional parent-child hierarchy, put shared values on a header row and give each series an indented child _plot_row; no merge is required. On the header record, leave _series, _ci_column, and estimate/lower/upper blank; use _indent=0 and _is_summary=False. To show one series in several CI columns, duplicate its record, keep the same _plot_row, and change _ci_column; all CI columns then share the same vertical coordinate.

__init__(frame, spans=(), mapping=<factory>, source=None, sheet_name=None, source_rows=(), cell_references=())
Parameters:
  • frame (DataFrame)

  • spans (tuple[ForestCellSpan, ...])

  • mapping (ForestDataMapping)

  • source (Path | None)

  • sheet_name (str | None)

  • source_rows (tuple[int, ...])

  • cell_references (tuple[tuple[str, ...], ...])

Return type:

None

Methods

__init__(frame[, spans, mapping, source, ...])

cell_reference(record, column)

Return the source-cell reference for one record and field.

Attributes

cell_references

sheet_name

source

source_rows

spans

frame

mapping