Skip to content

Add a native zero-inclusive long-tail axis scale #83

Description

@Kastier1

Problem

XY supports linear and logarithmic numeric axes, but common long-tailed measures often contain valid zeros. A linear axis compresses nearly all observations near the origin, while a log axis cannot represent zero.

In a 2.19M-row payroll scatter, preserving zero-pay records while making the long tail legible required transforming every value with log10(max(value, 0) + 1), supplying transformed tick positions manually, and inverting selection bounds back to dollars in application code.

That workaround leaks display transforms into data, hover, selection, linking, formatting, and domain configuration.

Proposed API

Add a native zero-inclusive long-tail scale, such as symlog and/or configurable log1p:

xy.x_axis(type_="symlog", constant=1_000, format="$,.0f")
xy.y_axis(type_="log1p", format="$,.0f")

Expected behavior:

  • Zero remains representable.
  • Positive long tails spread naturally.
  • Optional negative values work with symlog.
  • Ticks and hover expose original values, not transformed coordinates.
  • Pan, zoom, selection, callbacks, and linked views all report original data-space bounds.
  • Direct and density scatter tiers use identical scale semantics.
  • Static SVG/PNG and browser rendering remain consistent.

A native scale would remove error-prone application transforms and keep exact interaction semantics intact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions