You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is 'round' option - it helps my use-case tremendously. On the other hand, the x and y axes require different precision. 0.1 for x and 0 for y. Now I would do a Math.round() on the y-axis value given by onDrag(). Therefore, I think it would be useful to be able to set 'round' value on individual axis.
The text was updated successfully, but these errors were encountered:
Thanks for raising an issue!
Is there a particular reason why rounding the value in the onDrag callback wouldn't work for you? I'd argue this gives the greatest flexibility for all use cases, even if you require different rounding strategies for different datasets/indeces.
While the standard rounding option is frequently used, I guess this option would be used too seldom in order to justify the additional code that would need to be maintained in the long run. But maybe I'm missing something?
For the sake of completeness, I created a small fiddle incorporating a custom rounding logic in the onDrag callback just if anyone could use a demo of the functionality: https://jsfiddle.net/jhvp6fbk/1/
Thanks a lot for the effort to explain. For me it is a matter of code re-use and API design. The plugin has already implemented 'round' function, I would guess that it is be relatively trivial to separate them into round-x and round-y, similar to the option dragX and dragY.
There is no problem with doing the separate rounding at onDrag() callback, that is what I have been doing.
Hello,
Currently there is 'round' option - it helps my use-case tremendously. On the other hand, the x and y axes require different precision. 0.1 for x and 0 for y. Now I would do a Math.round() on the y-axis value given by onDrag(). Therefore, I think it would be useful to be able to set 'round' value on individual axis.
The text was updated successfully, but these errors were encountered: