CSV2Chart/CSV2JSON

The following code defines a function that parses a CSV (Comma-separated values) file provided as string to the JSON (JavaScript Object Notation) and adds a default color and a default title to each column for the curve to the JSON.

Learning Task
Perform an analysis of the following code:
 * The CSV was loaded with LoadFile4DOM into the browser. How is the loaded string split into lines and how are the line split into the values in the cells.
 * The spreadsheet document might not have number in all cells and therefore the cells may not exist if the CSV is not of an rectangular format. How does code (currentline[j] || " ") replace undefined cell elements in currentline[j].

Advanced Libraries
The code shows a basic approach to parsing CSV string from a file. In CSV2Chart a JQuery plugin was used in AppLSAC.
 * (Parsing with JQuery Plugin) See jquery_csv.js for the imported library in CSV2Chart.
 * (From CSV to JSON) See CSV2JSON converter which was generated to populate the JSON in the JSON editor consistently to the defined JSON Schema.
 * (JSON for MorrisJS) The graph generator MorrisJS for previewing the generated data need again a different JSON format. The MorrisJS-JSON is also generated from JSON in the JSON editor. The MorrisJS-JSON is generated by the library json2morris.js.
 * (Other Chart Javascript Libraries) In this learning resource as an example the library morris.js was used. Select another Chart generating Javascript Libraries like
 * chart.js
 * d3.js

Learning Tasks - Programming

 * (Render with Other Chart Libraries) Create your chart export from the CSV data for other libraries like chart.js or d3.js and publish your results e.g. on a GitLab Repository and replace the json2morris.js by your library json2d3.js or json2chart.js.
 * (Output Rendering) Analyze the output rendering in the Wiki format by adapting the template of Handlebars4Code stored in template4json_tpl.js. Can you adapted the output template to other output formats, e.g. a HTML page for the a specific output syntax of D3.js.