Currently, chartlets.js will report any app state change to callbacks that have app state input or state channels.
See impact in xcube-dev/xcube-viewer#490.
While the issue could effectively be addressed in the host application, it is desirable to address it also in chartlets.js by invoking callbacks only, if the callback's input values have changed. An element-wise shallow comparison of a callback's current array of input values with the last one should therefore be sufficient. The memoization can hence take place on the level of individual callbacks identifable by ${contribution[i].callback[j]}.
Currently, chartlets.js will report any app state change to callbacks that have app state input or state channels.
See impact in xcube-dev/xcube-viewer#490.
While the issue could effectively be addressed in the host application, it is desirable to address it also in chartlets.js by invoking callbacks only, if the callback's input values have changed. An element-wise shallow comparison of a callback's current array of input values with the last one should therefore be sufficient. The memoization can hence take place on the level of individual callbacks identifable by
${contribution[i].callback[j]}.