MAIDR Documentation - v4.4.0
    Preparing search index...
    • Removes the float noise that inverting a pixel coordinate introduces.

      The error is absolute rather than relative — it comes from arithmetic across the whole domain, so a bar near zero on a chart that runs to 1200 is wrong in the same decimal place as one near the top. Rounding is therefore sized from the domain span and not from the value: keep ten digits below the span's leading digit, which is far more precision than any plot's pixel resolution can encode and far less than the noise floor.

      Parameters

      • value: number

        The inverted value.

      • span: number

        The domain span from scaleSpan.

      Returns number

      The cleaned value.

      cleanNumber(3.141589999999974, 1246.8); // => 3.14159