Skip to content

Conversation

JavaZeroo
Copy link
Owner

Summary

  • always include 0 in chart y-axis range
  • derive y-axis tick precision from parsed log data
  • format tooltip values with the same precision

Testing

  • npm test
  • npm run lint

https://chatgpt.com/codex/tasks/task_e_68b51d49ede0832da05257475d7be121

@github-actions
Copy link

github-actions bot commented Sep 1, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://log.javazero.top/pr-preview/pr-50/

Built to branch gh-pages at 2025-09-01 07:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +431 to +446
const yDecimalPlaces = useMemo(() => {
let maxDecimals = 0;
parsedData.forEach(file => {
Object.values(file.metricsData).forEach(points => {
points.forEach(p => {
const str = p.y.toString();
const decimalPart = str.split('.')[1];
if (decimalPart) {
const decimals = decimalPart.replace(/e.+/i, '').length;
if (decimals > maxDecimals) {
maxDecimals = decimals;
}
}
});
});
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Handle exponent-formatted values when deriving decimal places

The new yDecimalPlaces logic counts fractional digits by splitting p.y.toString() on a decimal point, but numbers whose string representation is in scientific notation (1e-7, 3.2E-5, etc.) never enter the if (decimalPart) branch. When such values exist in parsedData, maxDecimals remains 0 and both tooltips and tick labels format them with toFixed(0), displaying 0 for every small-magnitude point and making the chart misleading. Consider parsing the exponent and counting digits from the mantissa so that values like 1e-7 retain at least seven decimals.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant