Button to converts json to csv in Altair and allows the client to save it
npm install altair-graphql-plugin-export-to-csvTo enable the plugin in Altair, enable the plugins feature and then select plugin __altair-export-json-to-csv__. After restarting the application, the __export csv__ button should become available.
The CSV file format is a 2 dimensional data format that accommodates rows and columns but this doesn't translate well when trying to convert json to csv. Hence the following rules will be applied in the conversion:
1. Every leaf in the inputted object is converted to a csv column
2. By default, every index in an array is converted to a row in the outputted csv. Nested arrays will also get there own row.
3. In instances where we have nested arrays, it is inevitable that certain 'cells' on the CSV will have a value of 'undefined'. In such cases, these undefined cells are populated with the values from the previous cell's (in the same column) contents.
This plugin can be found on NPM. Click here