Store parsed data more similarly to provided data#6766
Store parsed data more similarly to provided data#6766benmccann wants to merge 1 commit intochartjs:masterfrom
Conversation
|
To me it seems that the internal data structure needs to be array of objects, to work in all use cases. Performance wise I think its better to set For Mapping by scale id leaves room for flexibility. If your data has something other than But lets keep this open. We should measure performance both ways and use the better one! Not that the array maintenance for Chart.js/src/core/core.datasetController.js Line 962 in e5b03a0 Chart.js/src/core/core.datasetController.js Line 979 in e5b03a0 Chart.js/src/core/core.datasetController.js Line 1012 in e5b03a0 We should add tests using |
|
Putting |
This has some of the changes from #6750, which we decided not to move forward with. I'm reopening for discussion purposes even if we decide to go in a different direction
I'd like to be able to skip all parsing if the user provides data in the correct format. Right now that format is essentially an array of objects. Other potential formats such as an array of arrays can be discussed in #6696. Right now, it seems most likely that we'll be accepting data as an array with an entry for each row.
This implements about half the change required to simply utilize user data as passed in. The other half would be to change the keys that the user data is being stored under. Right now we have keys like "x-axis-0" and would need to change that to "x" or change from an object to an array
This is probably about a wash in terms of performance. E.g.
_getParsedis probably slightly faster andcalculateTotalis probably slightly slower. Overall I think these effects are fairly negligible though