resetDomains method

void resetDomains()

Implementation

void resetDomains() {
  if (lockAxis) {
    return;
  }

  // If the series list changes, clear the cache.
  //
  // There are cases where tick formatter has not "changed", but if measure
  // formatter provided to the tick formatter uses a closure value, the
  // formatter cache needs to be cleared.
  //
  // This type of use case for the measure formatter surfaced where the series
  // list also changes. So this is a round about way to also clear the
  // tick formatter cache.
  //
  // TODO: Measure formatter should be changed from a typedef to
  // a concrete class to force users to create a new tick formatter when
  // formatting is different, so we can recognize when the tick formatter is
  // changed and then clear cache accordingly.
  //
  // Remove this when bug above is fixed, and verify it did not cause
  // regression for b/110371453.
  _formatterValueCache.clear();

  final scale = this.scale!;
  scale.resetDomain();
  reverseOutputRange = false;

  if (autoViewport) {
    scale.resetViewportSettings();
  }

  // TODO: Reset rangeband and step size when we port over config
  //scale.rangeBandConfig = get range band config
  //scale.stepSizeConfig = get step size config
}