-
Notifications
You must be signed in to change notification settings - Fork 1.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
Decrease filter step size for small domains #958
Conversation
Otherwise the detected filter step size may be larger than the domain, which results in not being able to use the filter. This is applicable when working with small percentages (<0.1%). While changing this I also noticed this will treat negative numbers as very small; I changed `getNumericStepSize` to compute the step size based on absolute value. Signed-off-by: Isaac Brodsky <isaac@isaacbrodsky.com>
06b0d48
to
a1c6d07
Compare
src/utils/filter-utils.js
Outdated
} else if (diff <= 1) { | ||
// Try to get at least 100 steps - and keep the step size below that of | ||
// the (diff > 1) case. | ||
const x = diff / 100; |
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.
can you make this min step to be 1000? currently when 1 < diff < 3
step = 0.001
, and when diff = 1
, step = 0.01
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.
Sure, updated. I also updated tests based on the values I saw
edit: I still have an issue in CI (https://travis-ci.com/keplergl/kepler.gl/jobs/290743951) but I don't get that error locally - any ideas?
Signed-off-by: Isaac Brodsky <isaac@isaacbrodsky.com>
0736886
to
721163e
Compare
From the Travis CI runs, it looks like the results are not consistent between Node 8 and Node 10. Is there an assertion utility for asserting "floating point equal within some epsilon"? |
you can try use |
Signed-off-by: Isaac Brodsky <isaac@isaacbrodsky.com>
8c4f22f
to
a1854f6
Compare
Seems the tests are passing now although I didn't update them to use |
This reverts commit f35c403.
Otherwise the detected filter step size may be larger than the domain,
which results in not being able to use the filter. This is applicable
when working with small percentages (<0.1%).
While changing this I also noticed this will treat negative numbers as
very small; I changed
getNumericStepSize
to compute the step sizebased on absolute value. (Not sure the UI fully supports selecting negative
filter ranges, seemed like it wouldn't let me select them via mouse.)