getDatumDetails method

  1. @override
List<DatumDetails<D>> getDatumDetails(
  1. SelectionModelType type
)

Returns a list of datum details from selection model of type.

Implementation

@override
List<DatumDetails<D>> getDatumDetails(SelectionModelType type) {
  final entries = <DatumDetails<D>>[];

  getSelectionModel(type).selectedDatum.forEach((seriesDatum) {
    final series = seriesDatum.series;
    final Object? datum = seriesDatum.datum;
    final datumIndex = seriesDatum.index;

    final domain = series.domainFn(datumIndex);
    final domainFormatterFn = series.domainFormatterFn;
    final measure = series.measureFn(datumIndex);
    final measureFormatterFn = series.measureFormatterFn;
    final measureOffset = series.measureOffsetFn!(datumIndex);
    final rawMeasure = series.rawMeasureFn(datumIndex);
    final color = series.colorFn!(datumIndex);

    final renderer = getSeriesRenderer(series.getAttr(rendererIdKey));

    final datumDetails = renderer.addPositionToDetailsForSeriesDatum(
        DatumDetails(
            datum: datum,
            domain: domain,
            domainFormatter: domainFormatterFn?.call(datumIndex),
            index: datumIndex,
            measure: measure,
            measureFormatter: measureFormatterFn?.call(datumIndex),
            measureOffset: measureOffset,
            rawMeasure: rawMeasure,
            series: series,
            color: color),
        seriesDatum);

    entries.add(datumDetails);
  });

  return entries;
}