-
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
buildTicksto 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 thetimescale'sgeneratereturns ticks outside the min/max range andbuildTicksremoves ticks outside the range. But if we move the auto-pruning logic to happen in the auto-skipper instead ofbuildTicksthen 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
timescale'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 of24is2*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 manualdivisionstable 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
timescale- Remove
autoSkip: falsefrom thetimescale (source) source: 'auto'should generate a tick at every minor unit.generateshould not attempt to do anything smartgenerateshould not generate more than 1 tick per pixel
- Remove
Flixbox