-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix(declarative-chart): Handle 10^N yMax case for rounded ticks #33870
base: master
Are you sure you want to change the base?
Conversation
📊 Bundle size report✅ No changes found |
Pull request demo site: URL |
@@ -0,0 +1,7 @@ | |||
{ |
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.
🕵🏾♀️ visual regressions to review in the fluentuiv8 Visual Regression Report
react-charting-LineChart 1 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
react-charting-LineChart.Gaps.default.chromium.png | 1 | Changed |
return Math.log10(n) % 1 === 0; | ||
} | ||
|
||
function roundIfAlmostInteger(num: number): number { |
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.
Call this handleFloatingPointPrecisionError and add link to this article as comment.
https://docs.python.org/release/2.5.1/tut/node16.html
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.
okay.
@@ -256,6 +256,15 @@ function multiFormat(date: Date, locale?: d3TimeLocaleObject, useUTC?: boolean) | |||
)(date); | |||
} | |||
|
|||
function isPowerOf10(n: number): boolean { | |||
return Math.log10(n) % 1 === 0; |
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.
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.
We are already checking that in 'handleFloatingPointPrecisionError' function. Then is it needed here also? Rounded value will only come here.
@@ -391,6 +391,11 @@ describe('prepareDatapoints for rounded tick value cases', () => { | |||
const result = utils.prepareDatapoints(589030.78, -234.45, 4, false, true); | |||
matchResult(result); | |||
}); | |||
|
|||
it('should return an array with rounded data points when yMax is almost power of 10', () => { |
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.
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.
okay.
New Behavior
Related Issue(s)