diff --git a/mean-app/dist/inline.bundle.map b/mean-app/dist/inline.bundle.map index d97db5c..8779b09 100644 --- a/mean-app/dist/inline.bundle.map +++ b/mean-app/dist/inline.bundle.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap b78363aeebb7ab106f60"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\thead.appendChild(script);\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b78363aeebb7ab106f60"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap e37f565dbeea05a9a7a9"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\thead.appendChild(script);\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e37f565dbeea05a9a7a9"],"sourceRoot":""} \ No newline at end of file diff --git a/mean-app/dist/main.bundle.js b/mean-app/dist/main.bundle.js index 1a6f1df..d30147e 100644 --- a/mean-app/dist/main.bundle.js +++ b/mean-app/dist/main.bundle.js @@ -53,7 +53,7 @@ function mapData(response) { console.log('Mapping data', __WEBPACK_IMPORTED_MODULE_3__line_data__["a" /* LineData */]); var nums = response.json().map(toData); console.log(nums); - var line = ({ data: nums, label: "Line 1" }); + var line = ({ data: [90, 67, 77, 56, 45, 89, 90], label: "Series A" }); console.log(line); return line; } diff --git a/mean-app/dist/main.bundle.map b/mean-app/dist/main.bundle.map index 87fe7dd..75bf64a 100644 --- a/mean-app/dist/main.bundle.map +++ b/mean-app/dist/main.bundle.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/app/data.service.ts","webpack:///./src async","webpack:///./src/main.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/chart.component.ts","webpack:///./src/app/line-data.ts","webpack:///./src/environments/environment.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/chart.component.html"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAA0C;AAEZ;AACyB;AAEjB;AAGtC;IAGE,qBAAoB,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;QAFvB,YAAO,GAAW,mCAAmC,CAAC;IAE7B,CAAC;IAElC,yBAAG,GAAH;QACE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,IAAI,cAAc;QAChB,wEAAwE;Q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EAAE,MAAM;gBACxB,yBAAyB,EAAE,MAAM;gBACjC,qBAAqB,EAAE,uBAAuB;aAC/C;SACF,CAAC;QACK,oBAAe,GAAW,IAAI,CAAC;QAC/B,kBAAa,GAAU,MAAM,CAAC;IAWU,CAAC;IAThD,SAAS;IACF,yCAAY,GAAnB,UAAoB,CAAK;QACvB,iBAAiB;IACnB,CAAC;IAEM,yCAAY,GAAnB,UAAoB,CAAK;QACvB,iBAAiB;IACnB,CAAC;IAID,qCAAQ,GAAR;QAAA,iBAKC;QAHC,IAAI,CAAC,WAAW;aACb,GAAG,EAAE;aACL,SAAS,CAAC,aAAG,IAAI,YAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAArC,CAAqC,CAAC,CAAC;IAC7D,CAAC;IA1CH;QAAC,+EAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,kCAAqC;SACtC,CAAC;;0BAAA;IAwCF,yBAAC;;AAAD,CAAC;;;;;;;;;;AChDD;IAAA;IAGA,CAAC;IAAD,eAAC;AAAD,CAAC;;;;;;;;;ACHD;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,+EAA+E;AAExE,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;;;;;;;;ACPF,sBAAsB,kBAAkB,KAAK,C;;;;;;;ACA7C,8BAA8B,OAAO,6C;;;;;;;ACArC,uGAAuG,6f","file":"main.bundle.js","sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs/Rx';\r\nimport 'rxjs/add/operator/map'\r\nimport { Http, Response, Headers } from '@angular/http';\r\n\r\nimport { LineData } from './line-data';\r\n\r\n@Injectable()\r\nexport class DataService {\r\n private baseUrl: string = 'http://localhost:3000/webapi/data';\r\n\r\n constructor(private http : Http){}\r\n\r\n get(): Observable {\r\n console.log('Getting data');\r\n let lineChartData$ =\r\n //( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );\r\n this.http\r\n .get((`${this.baseUrl}`)\r\n , {headers: this.getHeaders()})\r\n .map(mapData);\r\n\r\n return lineChartData$;\r\n\r\n }\r\n\r\n private getHeaders(){\r\n let headers = new Headers();\r\n headers.append('Accept', 'application/json');\r\n return headers;\r\n }\r\n}\r\n\r\nfunction mapData(response:Response): LineData {\r\n console.log('Mapping data', LineData);\r\n let nums = response.json().map(toData);\r\n\r\n console.log(nums);\r\n\r\n let line:LineData = ({data: nums, label: \"Line 1\"});\r\n console.log(line);\r\n return line;\r\n}\r\n\r\nfunction toData(r:any){\r\n let num = r.TOE1;\r\n console.log('Parsed Data:', num);\r\n return num;\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/data.service.ts","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 344;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src async\n// module id = 344\n// module chunks = 1","import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { enableProdMode } from '@angular/core';\r\nimport { environment } from './environments/environment';\r\nimport { AppModule } from './app/app.module';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {\r\n title = 'app works!';\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { HttpModule } from '@angular/http';\r\nimport { ChartsModule } from 'ng2-charts/ng2-charts';\r\n\r\nimport { AppComponent } from './app.component';\r\nimport { LineChartComponent } from './chart.component';\r\n\r\nimport { DataService } from './data.service';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n LineChartComponent\r\n ],\r\n imports: [\r\n BrowserModule,\r\n FormsModule,\r\n HttpModule,\r\n ChartsModule\r\n ],\r\n providers: [DataService],\r\n bootstrap: [AppComponent]\r\n})\r\nexport class AppModule { }\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","import { Component, OnInit } from '@angular/core';\r\nimport { DataService } from './data.service';\r\n\r\nimport { LineData } from './line-data';\r\n\r\n@Component({\r\n selector: 'line-chart',\r\n templateUrl: './chart.component.html'\r\n})\r\nexport class LineChartComponent implements OnInit {\r\n // lineChart\r\n public lineChartData:Array = [\r\n {data: [0,0,0,0,0,0,0], label: 'Series A'}\r\n ];\r\n public lineChartLabels:Array = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];\r\n public lineChartOptions:any = {\r\n responsive: true\r\n };\r\n public lineChartColors:Array = [\r\n { // grey\r\n backgroundColor: 'rgba(148,159,177,0.2)',\r\n borderColor: 'rgba(148,159,177,1)',\r\n pointBackgroundColor: 'rgba(148,159,177,1)',\r\n pointBorderColor: '#fff',\r\n pointHoverBackgroundColor: '#fff',\r\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\r\n }\r\n ];\r\n public lineChartLegend:boolean = true;\r\n public lineChartType:string = 'line';\r\n\r\n // events\r\n public chartClicked(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n public chartHovered(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n constructor(private dataService: DataService) {}\r\n\r\n ngOnInit(): void {\r\n\r\n this.dataService\r\n .get()\r\n .subscribe(res => this.lineChartData[0].data = res.data);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/chart.component.ts","export class LineData {\r\n public data: Array;\r\n public label:string;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/line-data.ts","// The file contents for the current environment will overwrite these during build.\r\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\r\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\r\n// The list of which env maps to which file can be found in `angular-cli.json`.\r\n\r\nexport const environment = {\r\n production: false\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/environments/environment.ts","module.exports = \"h1 {\\r\\n\\tcolor: blue;\\r\\n}\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.css\n// module id = 613\n// module chunks = 1","module.exports = \"

\\r\\n {{title}}\\r\\n\\r\\n \\r\\n

\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.html\n// module id = 614\n// module chunks = 1","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/chart.component.html\n// module id = 615\n// module chunks = 1"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/app/data.service.ts","webpack:///./src async","webpack:///./src/main.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/chart.component.ts","webpack:///./src/app/line-data.ts","webpack:///./src/environments/environment.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/chart.component.html"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAA0C;AAEZ;AACyB;AAEjB;AAGtC;IAGE,qBAAoB,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;QAFvB,YAAO,GAAW,mCAAmC,CAAC;IAE7B,CAAC;IAElC,yBAAG,GAAH;QACE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,IAAI,cAAc;QAChB,wEAAwE;QACxE,IAAI,CAAC,IAAI;aACN,GAAG,CAAC,CAAC,KAAG,IAAI,CAAC,OAAS,CAAC,EACpB,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU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AAM;gBACjC,qBAAqB,EAAE,uBAAuB;aAC/C;SACF,CAAC;QACK,oBAAe,GAAW,IAAI,CAAC;QAC/B,kBAAa,GAAU,MAAM,CAAC;IAWU,CAAC;IAThD,SAAS;IACF,yCAAY,GAAnB,UAAoB,CAAK;QACvB,iBAAiB;IACnB,CAAC;IAEM,yCAAY,GAAnB,UAAoB,CAAK;QACvB,iBAAiB;IACnB,CAAC;IAID,qCAAQ,GAAR;QAAA,iBAKC;QAHC,IAAI,CAAC,WAAW;aACb,GAAG,EAAE;aACL,SAAS,CAAC,aAAG,IAAI,YAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAArC,CAAqC,CAAC,CAAC;IAC7D,CAAC;IA1CH;QAAC,+EAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,kCAAqC;SACtC,CAAC;;0BAAA;IAwCF,yBAAC;;AAAD,CAAC;;;;;;;;;;AChDD;IAAA;IAGA,CAAC;IAAD,eAAC;AAAD,CAAC;;;;;;;;;ACHD;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,+EAA+E;AAExE,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;;;;;;;;ACPF,sBAAsB,kBAAkB,KAAK,C;;;;;;;ACA7C,8BAA8B,OAAO,6C;;;;;;;ACArC,uGAAuG,6f","file":"main.bundle.js","sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs/Rx';\r\nimport 'rxjs/add/operator/map'\r\nimport { Http, Response, Headers } from '@angular/http';\r\n\r\nimport { LineData } from './line-data';\r\n\r\n@Injectable()\r\nexport class DataService {\r\n private baseUrl: string = 'http://localhost:3000/webapi/data';\r\n\r\n constructor(private http : Http){}\r\n\r\n get(): Observable {\r\n console.log('Getting data');\r\n let lineChartData$ =\r\n //( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );\r\n this.http\r\n .get((`${this.baseUrl}`)\r\n , {headers: this.getHeaders()})\r\n .map(mapData);\r\n\r\n return lineChartData$;\r\n\r\n }\r\n\r\n private getHeaders(){\r\n let headers = new Headers();\r\n headers.append('Accept', 'application/json');\r\n return headers;\r\n }\r\n}\r\n\r\nfunction mapData(response:Response): LineData {\r\n console.log('Mapping data', LineData);\r\n let nums = response.json().map(toData);\r\n\r\n console.log(nums);\r\n\r\n let line:LineData = ({data: [90,67,77,56,45,89,90], label: \"Series A\"});\r\n console.log(line);\r\n return line;\r\n}\r\n\r\nfunction toData(r:any){\r\n let num = r.TOE1;\r\n console.log('Parsed Data:', num);\r\n return num;\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/data.service.ts","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 344;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src async\n// module id = 344\n// module chunks = 1","import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { enableProdMode } from '@angular/core';\r\nimport { environment } from './environments/environment';\r\nimport { AppModule } from './app/app.module';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {\r\n title = 'app works!';\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { HttpModule } from '@angular/http';\r\nimport { ChartsModule } from 'ng2-charts/ng2-charts';\r\n\r\nimport { AppComponent } from './app.component';\r\nimport { LineChartComponent } from './chart.component';\r\n\r\nimport { DataService } from './data.service';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n LineChartComponent\r\n ],\r\n imports: [\r\n BrowserModule,\r\n FormsModule,\r\n HttpModule,\r\n ChartsModule\r\n ],\r\n providers: [DataService],\r\n bootstrap: [AppComponent]\r\n})\r\nexport class AppModule { }\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","import { Component, OnInit } from '@angular/core';\r\nimport { DataService } from './data.service';\r\n\r\nimport { LineData } from './line-data';\r\n\r\n@Component({\r\n selector: 'line-chart',\r\n templateUrl: './chart.component.html'\r\n})\r\nexport class LineChartComponent implements OnInit {\r\n // lineChart\r\n public lineChartData:Array = [\r\n {data: [0,0,0,0,0,0,0], label: 'Series A'}\r\n ];\r\n public lineChartLabels:Array = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];\r\n public lineChartOptions:any = {\r\n responsive: true\r\n };\r\n public lineChartColors:Array = [\r\n { // grey\r\n backgroundColor: 'rgba(148,159,177,0.2)',\r\n borderColor: 'rgba(148,159,177,1)',\r\n pointBackgroundColor: 'rgba(148,159,177,1)',\r\n pointBorderColor: '#fff',\r\n pointHoverBackgroundColor: '#fff',\r\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\r\n }\r\n ];\r\n public lineChartLegend:boolean = true;\r\n public lineChartType:string = 'line';\r\n\r\n // events\r\n public chartClicked(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n public chartHovered(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n constructor(private dataService: DataService) {}\r\n\r\n ngOnInit(): void {\r\n\r\n this.dataService\r\n .get()\r\n .subscribe(res => this.lineChartData[0].data = res.data);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/chart.component.ts","export class LineData {\r\n public data: number[];\r\n public label:string;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/line-data.ts","// The file contents for the current environment will overwrite these during build.\r\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\r\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\r\n// The list of which env maps to which file can be found in `angular-cli.json`.\r\n\r\nexport const environment = {\r\n production: false\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/environments/environment.ts","module.exports = \"h1 {\\r\\n\\tcolor: blue;\\r\\n}\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.css\n// module id = 613\n// module chunks = 1","module.exports = \"

\\r\\n {{title}}\\r\\n\\r\\n \\r\\n

\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.html\n// module id = 614\n// module chunks = 1","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/chart.component.html\n// module id = 615\n// module chunks = 1"],"sourceRoot":""} \ No newline at end of file diff --git a/mean-app/src/app/data.service.ts b/mean-app/src/app/data.service.ts index c64b49f..0b6be18 100644 --- a/mean-app/src/app/data.service.ts +++ b/mean-app/src/app/data.service.ts @@ -37,7 +37,7 @@ function mapData(response:Response): LineData { console.log(nums); - let line:LineData = ({data: nums, label: "Line 1"}); + let line:LineData = ({data: [90,67,77,56,45,89,90], label: "Series A"}); console.log(line); return line; } diff --git a/mean-app/src/app/line-data.ts b/mean-app/src/app/line-data.ts index 79b2bdf..1cfa29f 100644 --- a/mean-app/src/app/line-data.ts +++ b/mean-app/src/app/line-data.ts @@ -1,4 +1,4 @@ export class LineData { - public data: Array; + public data: number[]; public label:string; }