preprocessSeries method

  1. @override
void preprocessSeries(
  1. List<MutableSeries<D>> seriesList
)
inherited

Pre-calculates some details for the series that will be needed later during the drawing phase.

Implementation

@override
void preprocessSeries(List<MutableSeries<D>> seriesList) {
  _ensureSingleTree(seriesList);

  // Clears [_treeNodeToRendererElement] map when a new seriesList is passed
  // in for preprocessing. The order in this map matters because the first
  // entry is expected to be the root.
  _treeNodeToRendererElement.clear();

  for (final series in seriesList) {
    final count = series.data.length;

    // Populates [treeNodeToRendererElement] map entries.
    for (var i = 0; i < count; i++) {
      final node = series.data[i] as TreeNode<Object>;
      _treeNodeToRendererElement[node] =
          _createRendererElement(series, i, isLeaf: !node.hasChildren);
    }
    series.setAttr(treeMapElementsKey, _treeNodeToRendererElement.values);
  }
}