Skip to content

Metric charts lose tiny-value precision and collapse date-like category labels #1272

Open

Description

@gael-obin

Metric charts can collapse finite small values and make distinct categorical labels ambiguous.

Reproduced in the selected @codefly-dev/ui 0.12.2-c3221289 package, also present in owner source df044ce:

  • niceTicks(0, 2e-12) returns [0,0,0,0,0] because metric-geometry.ts rounds ticks with toFixed(10). A chart containing 1e-12 and 2e-12 loses its scale. The public ChartSeries contract supplies no minimum finite magnitude.
  • The default metric-chart Intl.NumberFormat renders 0.0001 and 0.0002 both as 0 in tooltips/accessibility tables. Consumers can use the existing formatValue extension; geometry still needs an owner fix.
  • Categorical keys 2025-01-01 and 2026-01-01 both display as Jan 1 in axes and hover titles because formatAxisKey infers date formatting and omits the year. The raw accessible table preserves them, but the visual labels are ambiguous. An existing/public label-format option, if available, should be documented for this consumer; otherwise preserve distinction in owner formatting.

Found while reviewing Robin's execution chart preview. Robin uses formatValue={String} and temporarily refuses extremely small nonzero values and date-shaped categories, with raw output still available in Details. It does not duplicate chart geometry. That restriction is a stopgap, not a fix for the shared renderer.

Searched current issues/PRs; the metric-tier/layout work does not change these chart files. Please cover tiny finite domains and distinct date-like categorical labels with regression tests at the owner.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions