double getStepSize(double t) { if (stepSize > 0) { return stepSize; } var scale = t == 0 ? 0 : min(0, log10(t.abs())).floor(); return pow(10, scale - 2).toDouble(); }