323 lines
14 KiB
JavaScript
323 lines
14 KiB
JavaScript
webpackJsonp([1,4],{
|
|
|
|
/***/ 302:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__ = __webpack_require__(617);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_http__ = __webpack_require__(284);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__line_data__ = __webpack_require__(455);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DataService; });
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
|
|
|
|
|
|
|
|
var DataService = (function () {
|
|
function DataService(http) {
|
|
this.http = http;
|
|
this.baseUrl = 'http://localhost:3000/webapi/data';
|
|
}
|
|
DataService.prototype.get = function () {
|
|
console.log('Getting data');
|
|
var lineChartData$ =
|
|
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
|
|
this.http
|
|
.get(("" + this.baseUrl), { headers: this.getHeaders() })
|
|
.map(mapData);
|
|
return lineChartData$;
|
|
};
|
|
DataService.prototype.getHeaders = function () {
|
|
var headers = new __WEBPACK_IMPORTED_MODULE_2__angular_http__["b" /* Headers */]();
|
|
headers.append('Accept', 'application/json');
|
|
return headers;
|
|
};
|
|
DataService = __decorate([
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
|
|
__metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_2__angular_http__["c" /* Http */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_2__angular_http__["c" /* Http */]) === 'function' && _a) || Object])
|
|
], DataService);
|
|
return DataService;
|
|
var _a;
|
|
}());
|
|
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" });
|
|
return line;
|
|
}
|
|
function toData(r) {
|
|
var num = r.TOE1;
|
|
console.log('Parsed Data:', num);
|
|
return num;
|
|
}
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/data.service.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 344:
|
|
/***/ (function(module, exports) {
|
|
|
|
function webpackEmptyContext(req) {
|
|
throw new Error("Cannot find module '" + req + "'.");
|
|
}
|
|
webpackEmptyContext.keys = function() { return []; };
|
|
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
module.exports = webpackEmptyContext;
|
|
webpackEmptyContext.id = 344;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 345:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(432);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(456);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app_module__ = __webpack_require__(453);
|
|
|
|
|
|
|
|
|
|
if (__WEBPACK_IMPORTED_MODULE_2__environments_environment__["a" /* environment */].production) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["enableProdMode"])();
|
|
}
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* platformBrowserDynamic */])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_3__app_app_module__["a" /* AppModule */]);
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/main.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 452:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppComponent; });
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
|
|
var AppComponent = (function () {
|
|
function AppComponent() {
|
|
this.title = 'app works!';
|
|
}
|
|
AppComponent = __decorate([
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
|
|
selector: 'app-root',
|
|
template: __webpack_require__(614),
|
|
styles: [__webpack_require__(613)]
|
|
}),
|
|
__metadata('design:paramtypes', [])
|
|
], AppComponent);
|
|
return AppComponent;
|
|
}());
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/app.component.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 453:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(191);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(423);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(284);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__ = __webpack_require__(611);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_component__ = __webpack_require__(452);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__chart_component__ = __webpack_require__(454);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__data_service__ = __webpack_require__(302);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AppModule = (function () {
|
|
function AppModule() {
|
|
}
|
|
AppModule = __decorate([
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["NgModule"])({
|
|
declarations: [
|
|
__WEBPACK_IMPORTED_MODULE_5__app_component__["a" /* AppComponent */],
|
|
__WEBPACK_IMPORTED_MODULE_6__chart_component__["a" /* LineChartComponent */]
|
|
],
|
|
imports: [
|
|
__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__["a" /* BrowserModule */],
|
|
__WEBPACK_IMPORTED_MODULE_2__angular_forms__["a" /* FormsModule */],
|
|
__WEBPACK_IMPORTED_MODULE_3__angular_http__["a" /* HttpModule */],
|
|
__WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__["ChartsModule"]
|
|
],
|
|
providers: [__WEBPACK_IMPORTED_MODULE_7__data_service__["a" /* DataService */]],
|
|
bootstrap: [__WEBPACK_IMPORTED_MODULE_5__app_component__["a" /* AppComponent */]]
|
|
}),
|
|
__metadata('design:paramtypes', [])
|
|
], AppModule);
|
|
return AppModule;
|
|
}());
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/app.module.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 454:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data_service__ = __webpack_require__(302);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LineChartComponent; });
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
|
|
|
|
var LineChartComponent = (function () {
|
|
function LineChartComponent(dataService) {
|
|
this.dataService = dataService;
|
|
// lineChart
|
|
this.lineChartData = [
|
|
{ data: [0, 0, 0, 0, 0, 0, 0], label: 'Series A' }
|
|
];
|
|
this.lineChartLabels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
|
|
this.lineChartOptions = {
|
|
responsive: true
|
|
};
|
|
this.lineChartColors = [
|
|
{
|
|
backgroundColor: 'rgba(148,159,177,0.2)',
|
|
borderColor: 'rgba(148,159,177,1)',
|
|
pointBackgroundColor: 'rgba(148,159,177,1)',
|
|
pointBorderColor: '#fff',
|
|
pointHoverBackgroundColor: '#fff',
|
|
pointHoverBorderColor: 'rgba(148,159,177,0.8)'
|
|
}
|
|
];
|
|
this.lineChartLegend = true;
|
|
this.lineChartType = 'line';
|
|
}
|
|
// events
|
|
LineChartComponent.prototype.chartClicked = function (e) {
|
|
console.log(e);
|
|
};
|
|
LineChartComponent.prototype.chartHovered = function (e) {
|
|
console.log(e);
|
|
};
|
|
LineChartComponent.prototype.ngOnInit = function () {
|
|
var _this = this;
|
|
this.dataService
|
|
.get()
|
|
.subscribe(function (res) { return _this.lineChartData[0].data = res.data; });
|
|
};
|
|
LineChartComponent = __decorate([
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
|
|
selector: 'line-chart',
|
|
template: __webpack_require__(615)
|
|
}),
|
|
__metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */]) === 'function' && _a) || Object])
|
|
], LineChartComponent);
|
|
return LineChartComponent;
|
|
var _a;
|
|
}());
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/chart.component.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 455:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LineData; });
|
|
var LineData = (function () {
|
|
function LineData() {
|
|
}
|
|
return LineData;
|
|
}());
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/line-data.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 456:
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return environment; });
|
|
// The file contents for the current environment will overwrite these during build.
|
|
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
|
|
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
|
|
// The list of which env maps to which file can be found in `angular-cli.json`.
|
|
var environment = {
|
|
production: false
|
|
};
|
|
//# sourceMappingURL=C:/Users/martijn/Documents/GitHub/smarthome/mean-app/src/environment.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 613:
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = "h1 {\r\n\tcolor: blue;\r\n}"
|
|
|
|
/***/ }),
|
|
|
|
/***/ 614:
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = "<h1>\r\n {{title}}\r\n\r\n <line-chart></line-chart>\r\n</h1>"
|
|
|
|
/***/ }),
|
|
|
|
/***/ 615:
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = "<div class=\"row\">\r\n <div class=\"col-md-6\">\r\n <div style=\"display: block;\">\r\n <canvas baseChart width=\"400\" height=\"400\"\r\n [datasets]=\"lineChartData\"\r\n [labels]=\"lineChartLabels\"\r\n [options]=\"lineChartOptions\"\r\n [colors]=\"lineChartColors\"\r\n [legend]=\"lineChartLegend\"\r\n [chartType]=\"lineChartType\"\r\n (chartHover)=\"chartHovered($event)\"\r\n (chartClick)=\"chartClicked($event)\"></canvas>\r\n </div>\r\n </div>\r\n</div>"
|
|
|
|
/***/ }),
|
|
|
|
/***/ 630:
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
module.exports = __webpack_require__(345);
|
|
|
|
|
|
/***/ })
|
|
|
|
},[630]);
|
|
//# sourceMappingURL=main.bundle.map
|