Closed pkalita-lbl closed 1 year ago
@ddooley this came up in the context of using DataHarmonizer for a new project. Feel free to assign to me!
This sounds like it aligns perfectly with being able to load and save a sparse JSON data format as you suggest. So happy to assign you to this one!
I believe the array of arrays was just used for Handsontable operations or loading/saving tsv and csv data?
Cheers,
Yeah, Handsontable provides an array of arrays as the output of its getData()
method and DataHarmonizer. getTrimmedData()
is a thin wrapper around that. That format is definitely useful for producing TSV/CSV files. An array of objects format will be useful for working with JSON Schema validators and migrating older data to newer schema versions.
Currently a
DataHarmonizer
object has agetTrimmedData()
method that returns an array of arrays. For some applications it would be convenient to get an array of objects instead. This could be implemented in a new method (getDataObjects()
or something like that) in order to not affect the current API (although we could also consider renaming the existing method to make it more clear about what it returns if compatibility isn't a huge concern).If the spreadsheet contained something like this:
I would expect this method to return:
A client could write their own method to transform the output of
getTrimmedData()
to produce that, but it seems like it would be common enough to add toDataHarmonizer
.