We used to load the data into columnNames and rowValues, which were inconsistently passed around and stored through the code.
This PR:
Creates a single global object window.INA, that all 'global' variables are now a part of, making it instantly clear when we're using a global variable somewhere
Converts every column name to "Title Case", for consistency in rendering and validity checking. This makes the rowAttributes array obsolete.
Adds an if-statement to only add an Id column if it is not yet present
Changes column name checking to only check for missing columns from those we expect, ignoring any extra columns
Creates statement objects at file upload time that map each column name to the corresponding value <== This gets rid of any fixed array order dependency and lets the rendering happen using the exact columns we want to use, regardless of their order in the file. This is what actually addresses issue #37
Changes the session storage and table/chart re-rendering to use the plain columnNames array and the array of statements objects
As a result, this removes any global references to rowValues, since everything is replaced with the previously mentioned statements objects instead.
Fixes #37, (partially) addresses #43
We used to load the data into
columnNames
androwValues
, which were inconsistently passed around and stored through the code.This PR:
window.INA
, that all 'global' variables are now a part of, making it instantly clear when we're using a global variable somewhererowAttributes
array obsolete.Id
column if it is not yet presentstatement
objects at file upload time that map each column name to the corresponding value <== This gets rid of any fixed array order dependency and lets the rendering happen using the exact columns we want to use, regardless of their order in the file. This is what actually addresses issue #37columnNames
array and the array ofstatements
objectsAs a result, this removes any global references to
rowValues
, since everything is replaced with the previously mentionedstatements
objects instead.