-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(dtatsample): fix rate infinity cause range error #16372
Conversation
Thanks for your contribution! |
Why is your chart width zero? |
In our application(datart), we set default container width to zero, and wait dataset back and debounce calculate the frame container width and height. For sure, we could set default is 1px or more, then the chart will reset width to 600px for example, the graph will be twinking. |
@@ -94,7 +94,7 @@ export default function dataSample(seriesType: string): StageHandler { | |||
const size = Math.abs(extent[1] - extent[0]) * (dpr || 1); | |||
const rate = Math.round(count / size); | |||
|
|||
if (rate > 1) { |
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.
Using isFinte(rate)
may be better
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.
Using
isFinte(rate)
may be better
Sure, is it better for if (isFinite(rate) && rate > 1)
?
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.
Yes I think so
…h include special values
Looks good. We didn't suggest initializing a chart with zero width. But I think it's also not expected to have an expection that will break the following |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
Fixed issues
Details
Before: What was the problem?
After: How is it fixed in this PR?
Misc
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information