-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Improved auto skipper #4612
Comments
One thing to note is that we're looking for the longest text several places. E.g. in the time scale we have the following:
We also use the longest text a few places in |
#5961 addresses the last issue by caching the longest label width for those methods. |
Yeah, I'm not sure all the sub-classes use it yet though. E.g. timescale has its own implementation |
While
|
Ok, I understand that it could be also expensive to convert timestamps to moment objects (or other time library objects) in |
I'll send a fix to make |
Does this PR still make sense? Seems the underlying issue is already fixed? |
There's a
ticks.autoSkip
feature (docs), which plots only a subset of ticks and labels to avoid overlapping labels.We should make the following improvements to the auto skipper:
buildTicks
to return ticks outside the min/max range. Then we can remove ticks outside the min/max range after callingbuildTicks
. This is very similar to how thetime
scale'sgenerate
returns ticks outside the min/max range andbuildTicks
removes ticks outside the range. But if we move the auto-pruning logic to happen in the auto-skipper instead ofbuildTicks
then it'd make sense to move the min/max enforcement as welltime
scale'sinterval
. Can have different division for integer and time scales. These divisions could possibly be auto-generated by doing a prime factorization and then finding all ways to divide factors into two groups. E.g. the prime factorization of24
is2*2*2*3
. You could choose the following subsets of factors:2
,3
,2*2
,3*2
,2*2*2
,3*2*2
,3*2*2*2
. A manualdivisions
table might look something like like:time
scaleautoSkip: false
from thetime
scale (source)source: 'auto'
should generate a tick at every minor unit.generate
should not attempt to do anything smartgenerate
should not generate more than 1 tick per pixelThe text was updated successfully, but these errors were encountered: