-
Notifications
You must be signed in to change notification settings - Fork 0
Improve y-axis display #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this 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".
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; | ||
} | ||
} | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Testing
npm test
npm run lint
https://chatgpt.com/codex/tasks/task_e_68b51d49ede0832da05257475d7be121