-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
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:
- Make it aware of major ticks. It should first attempt to include all major ticks. It should then attempt to include minor ticks in between. This should fix Time scale only aligns single point #4600
- This is easier if we allow
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 well - Attempt to split major ticks into sub-divisions that make sense similar to
time
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:
- This is easier if we allow
// key is number of minor units between major units
// value is number of minor units to include between major units
divisions: {
"1000": [1000, 500, 200, 100, 50, 25, 20, 10, 5, 4, 2],
"60": [60, 30, 12, 6, 4, 3, 2],
"24": [24, 12, 8, 6, 4, 3, 2],
}
- Use the auto skipper in the
time
scale- Remove
autoSkip: 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 pixel
- Remove
Flixbox