diff --git a/dist/PublicLab.Grapher.js b/dist/PublicLab.Grapher.js index d150a9c..cc8ad80 100644 --- a/dist/PublicLab.Grapher.js +++ b/dist/PublicLab.Grapher.js @@ -22,7 +22,7 @@ var CsvParser = /*#__PURE__*/ function () { //start is variable that will be passed to the function to sort out the columns. start will tell if the existing CSV file has headers or not, therefore, to start the iteration from 0 or 1 Used in header determination - function CsvParser(file, elementId) { + function CsvParser(file, elementId, functionParameter) { _classCallCheck(this, CsvParser); _defineProperty(this, 'use strict', void 0); @@ -43,44 +43,76 @@ function () { _defineProperty(this, "elementId", null); - this.csvFile = file; this.elementId = elementId; - this.parse(); + console.log(functionParameter); + + if (functionParameter=="local"){ + this.csvFile = file; + this.parse(functionParameter); + } + else if (functionParameter=="csvstring"){ + this.csvMatrix=file; + this.parse(functionParameter); + } + else if (functionParameter=="googleSheet"){ + this.completeCsvMatrix=file[0]; + this.csvHeaders=file[1]; + this.parse(functionParameter); + + } } + _createClass(CsvParser, [{ key: "parse", - value: function parse() { + value: function parse(functionParameter) { + console.log("i am in parsing",functionParameter); var _this = this; - - var count = 0; - Papa.parse(this.csvFile, { - download: true, - dynamicTyping: true, - comments: true, - step: function step(row) { - _this.csvMatrix[count] = row.data[0]; - count += 1; - }, - complete: function complete() { - //calling a function to determine headers for columns - _this.startFileProcessing(); - } - }); + if (functionParameter=="local"){ + var count = 0; + Papa.parse(this.csvFile, { + download: true, + dynamicTyping: true, + comments: true, + step: function step(row) { + _this.csvMatrix[count] = row.data[0]; + count += 1; + }, + complete: function complete() { + //calling a function to determine headers for columns + $('.' + this.carousalClass).carousel(1); + _this.startFileProcessing(functionParameter); + } + }); + } + else { + _this.startFileProcessing(functionParameter); + } } }, { key: "startFileProcessing", - value: function startFileProcessing() { - this.determineHeaders(); - this.matrixForCompleteData(); - this.extractSampleData(); - + value: function startFileProcessing(functionParameter) { + console.log("I am in file processing",functionParameter); + if (functionParameter==="local" || functionParameter=="csvstring"){ + this.determineHeaders(); + this.matrixForCompleteData(); + this.extractSampleData(); + + } + else if (functionParameter="googleSheet"){ + this.extractSampleData(); + } + console.log("I am about to go to view"); _SimpleDataGrapher.SimpleDataGrapher.elementIdSimpleDataGraphInstanceMap[this.elementId].view.continueViewManipulation(); } //preparing sample data for the user to choose the columns from }, { key: "extractSampleData", value: function extractSampleData() { + console.log("i am in extraction of sample"); + for (var i=0;i
'; + this.element.innerHTML = '

Simple Data Grapher

Plot and Export Graphs with CSV data

'; } }]); diff --git a/examples/upload_file.css b/examples/upload_file.css index f452516..2a75e57 100644 --- a/examples/upload_file.css +++ b/examples/upload_file.css @@ -1,7 +1,7 @@ .main_container{ margin:0 auto; width: 50%; - margin-top: 300px; + margin-top: 100px; height: 600px; display: flex; flex-direction: column; @@ -62,19 +62,19 @@ width: 350px; } .carousel-indicators{ - top: 200px; + top: 30px; justify-content:space-around; margin:0; display: flex; height: 20px; } .tables{ - margin-top: 300px; + margin-top: 100px; text-align: center; } .graph{ - margin-top: 300px; + margin-top: 100px; } #canvas_container{ width: 50%; @@ -89,12 +89,6 @@ ol.carousel-indicators li{ cursor: pointer; background: #cccccc; } -.carousel_headings{ - justify-content:space-around; - margin:0; - display: flex; - height: 20px; -} .toggle-handle{ background: #f2f2f2; width: 100px; @@ -140,7 +134,8 @@ ol.carousel-indicators li{ flex-direction: row; justify-content: space-around; align-items: center; - margin-bottom: -160px; + list-style: none; + /* margin-bottom: -160px; */ } .check-inputs{ margin-left: 10px; @@ -152,4 +147,33 @@ ol.carousel-indicators li{ .csv_string{ height: 100px; width: 350px; +} +.main_heading{ + font-family: 'Ubuntu Condensed'; + text-align: center; + color: #001a66; + font-size: 40px; +} +.sub_heading{ + font-family: 'Ubuntu Condensed'; + text-align: center; + color: #525357; + font-size: 18px; + padding-top: 5px; +} +.main_heading_container{ + margin-top: 40px; +} +.headings li{ + font-family: 'Ubuntu Condensed'; + font-size: 20px; +} +.heading_container{ + margin-top:80px; +} +.item-1{ + margin-left: 20px; +} +.item-2{ + margin-left: 70px; } \ No newline at end of file diff --git a/examples/upload_file.html b/examples/upload_file.html index 0a38f39..258226f 100644 --- a/examples/upload_file.html +++ b/examples/upload_file.html @@ -21,6 +21,17 @@ +
+

Simple Data Grapher

+

Plot and Export Graphs with CSV data

+
+
+ +