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
Thanks to @leeoniya for pointing out that hover performance isn't great. Chart.js does quite poorly on the uPlot benchmark which uses mode: 'index', intersect: false
The logic looks pretty suspect to me. It looks like it iterates over every single element from every dataset and computes the distance between the element and the mouse. At least in the x direction a much better thing to do would be to get the index for the corresponding value on the scale rather than computing over all data points. Even if in the worst case you had to compute the distance for every index, that'd still be 3x cheaper than computing for every data point (i.e. compute the nearest index once instead of once per dataset)
The text was updated successfully, but these errors were encountered:
Fixed for the time scale in #6827. Other scales can be fixed by implementing getIndexForPixel that the time scale adds in that PR. Though that method perhaps should be moved to the controller because index is a concept of the dataset, which the scale does not have access to
Thanks to @leeoniya for pointing out that hover performance isn't great. Chart.js does quite poorly on the uPlot benchmark which uses
mode: 'index', intersect: false
The logic looks pretty suspect to me. It looks like it iterates over every single element from every dataset and computes the distance between the element and the mouse. At least in the
x
direction a much better thing to do would be to get the index for the corresponding value on the scale rather than computing over all data points. Even if in the worst case you had to compute the distance for every index, that'd still be 3x cheaper than computing for every data point (i.e. compute the nearest index once instead of once per dataset)The text was updated successfully, but these errors were encountered: