Respect configured mantissa on time chart Y-axis tick labels - #3030
Respect configured mantissa on time chart Y-axis tick labels#3030arj22 wants to merge 2 commits into
Conversation
The Y-axis tickFormatter in HDXMultiSeriesTimeChart unconditionally forced mantissa: 0, discarding whatever mantissa/decimals the chart's Number Format configured. Series whose values live under 1 (fractional Prometheus gauges, ratios, etc.) therefore always render every axis tick as "0", even though the tooltip/legend (which calls formatNumber(value, numberFormat) directly, see ChartTooltip.tsx) show the correct value. Extract the formatter into an exported formatAxisTick so an explicit axisNumberFormat.mantissa now wins, falling back to 0 only when unset - preserving the existing compact-abbreviation behavior for the common case of unconfigured, typically-large counts. average and unit remain forced as before.
🦋 Changeset detectedLatest commit: 75c2cb8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@arj22 is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @arj22, thanks for the pull request! Before we review code from a first-time contributor we ask that a maintainer vouches for you, and you're not on our list yet. This PR stays open — it just isn't in the review queue until someone vouches. To get vouched, open an issue saying hello and what you're working on: https://github.com/hyperdxio/hyperdx/issues/new?template=introduce-yourself.md A maintainer will usually reply within a day or two, and then this PR gets picked up as normal. More detail in our contributing guide. |
Greptile SummaryThe PR updates time-chart Y-axis labels to honor an explicitly configured mantissa while preserving the existing zero-decimal fallback and compact formatting.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously missing app changeset is now present, correctly targets
|
| Filename | Overview |
|---|---|
| .changeset/swift-owls-spend.md | Adds a correctly targeted patch changeset, resolving the previously reported release-record omission. |
| packages/app/src/HDXMultiSeriesTimeChart.tsx | Reorders number-format precedence so explicit mantissa settings reach Y-axis tick labels while axis-specific overrides remain forced. |
| packages/app/src/tests/HDXMultiSeriesTimeChart.test.ts | Adds focused coverage for configured and default mantissa behavior and the formatter fallback. |
Reviews (2): Last reviewed commit: "Add changeset for axis tick mantissa fix" | Re-trigger Greptile
Deep Review✅ No critical issues found. The core change is sound. The Y-axis The prior "missing app changeset" review comment is resolved — 🔵 P3 nitpicks (2)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, previous-comments. Testing gaps: (non-blocking, behavior unchanged from pre-fix code)
|
|
@pulpdrew mind vouching + taking a look when you have a moment? |
Summary
HDXMultiSeriesTimeChart's Y-axistickFormatterunconditionally setmantissa: 0, discarding whatever mantissa/decimals the chart's Number Format configured. Any series whose values live under 1 (fractional Prometheus gauges, ratios, sub-1 rates, etc.) therefore renders every axis tick as0, even though the tooltip/legend show the correct value (ChartTooltip.tsxcallsformatNumber(value, numberFormat)directly, with no such override).formatAxisTickand reordered the spread so an explicitaxisNumberFormat.mantissawins, falling back to0only when unset.average: trueandunit: undefinedremain forced as before, so the existing compact-abbreviation behavior for typically-large, unconfigured counts (log/event counts, request rates) is unchanged.Test plan
HDXMultiSeriesTimeChart.test.ts(formatAxisTick) covering: no mantissa configured (unchanged behavior), explicit mantissa honored for sub-1 values, unit stripped/average forced regardless, and the no-axisNumberFormatIntlfallback.yarn jest src/__tests__/HDXMultiSeriesTimeChart.test.ts— 33/33 passing.tsc --noEmitclean.eslintclean on both touched files (pre-existing warnings elsewhere in the file are unrelated to this change).