draw method

void draw(
  1. List<Series<dynamic, D>> seriesList
)
inherited

Implementation

void draw(List<Series<dynamic, D>> seriesList) {
  // Clear the selection model when [seriesList] changes.
  for (final selectionModel in _selectionModels.values) {
    selectionModel.clearSelection(notifyListeners: false);
  }

  var processedSeriesList =
      List.of(seriesList.map<MutableSeries<D>>(makeSeries));

  // Allow listeners to manipulate the seriesList.
  fireOnDraw(processedSeriesList);

  // Set an index on the series list.
  // This can be used by listeners of selection to determine the order of
  // series, because the selection details are not returned in this order.
  var seriesIndex = 0;
  processedSeriesList.forEach((series) => series.seriesIndex = seriesIndex++);

  // Initially save a reference to processedSeriesList. After drawInternal
  // finishes, we expect _currentSeriesList to contain a new, possibly
  // modified list.
  _currentSeriesList = processedSeriesList;

  // Store off processedSeriesList for use later during redraw calls. This
  // list will not reflect any modifications that were made to
  // _currentSeriesList by behaviors during the draw cycle.
  _originalSeriesList = processedSeriesList;

  drawInternal(processedSeriesList, skipAnimation: false, skipLayout: false);
}