Closed aurbano closed 1 year ago
hmm, it might just be that 0.04 is not part of the internally generated increments. 0.02 works okay: https://jsfiddle.net/ayeu0hsm/
probably something in here:
https://github.com/leeoniya/uPlot/blob/4d9bb330ca0a987564ec15dfc9bbb3e282db64e2/src/opts.js#L47-L60
Thank you for the quick reply!
Sorry I may have missed it but is there anything we can do to render at 0.04
then, or are you saying that this increment is not supported?
i'll look into the cause/fix in the next few days.
you can always override axis.splits
and do your own math to return exactly the tick values that you need.
Thank you so much! I had been looking through all the options but I hadn't realized that I had to remove incrs
if using custom splits
- it's working now cheers!
linked commit should fix this.
at some point i might expose control over the internal const allMults = [1,2,2.5,5];
array so the default increments can be better controlled without unnecessary headaches. as you can tell, the need for this doesn't come up very often :)
but I hadn't realized that I had to remove
incrs
if using customsplits
hmm, that's not intentional.
internally, splits
is always converted to a callback, and increment + minSpace finding runs ahead of splits
(which takes those as args). but this bails if the found space is 0, so never gets to running splits
:
i would have to store a flag that the axis has an explicit splits
array before it is converted to callback, and then skip the getIncrSpace finding.
it's a bug, but also really hard to hit. e.g. you wouldn't have hit it if incrs: [0.04]
worked for you originally, as it now does.
Thank you for the quick resolution! Any idea when this should be released?
So once this fix is released I would be able to just use 0.04
as an incr
, or would I still need to define a custom splits
method?
A downside I've just found with the custom splits
is that now the axis doesn't "follow" the plot when panning, in case anyone has a similar issue this is my current splits method to ensure that the grid stays consistent:
// incr = 0.04 in my case
splits: (_, __, scaleMin, scaleMax) => {
// Temporary workaround to support small increments
const startingPoint = Math.floor(scaleMin);
const totalSplits = Math.ceil((scaleMax - startingPoint) / incr);
const splits = [];
for (let i = 0; i < totalSplits; i++) {
splits.push(startingPoint + i * incr);
}
return splits;
},
Thank you for the quick resolution! Any idea when this should be released?
i'll aim for this week.
So once this fix is released I would be able to just use 0.04 as an incr
yep
@leeoniya any updates on releasing this? Unless I'm missing something it looks like there haven't been any releases since 1.6.24
?
i've been on vacation for a couple weeks. but will be back in next few days. will need to dig through new issue reports but should be a release soon after that.
Thank you for the quick reply! Hope you had a great time off 😄
I'll keep an eye out, thanks again
I must be missing something but I can't get it to render grid lines at
0.04
incrs,0.05
seems to be the smallest that is rendered.See this https://jsfiddle.net/pnoh14aq/ - it should show red grid lines at
0.05
(shown), and blue grid lines at0.04
(not shown)I've trying playing around with the
space
property but couldn't get this to work, any ideas?Sample axes configuration: