Labels debug code

This commit is contained in:
2017-04-05 10:03:44 +02:00
parent 7088ac29fc
commit 10923499f3
13 changed files with 356 additions and 403 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+21 -48
View File
@@ -22,7 +22,7 @@ var DashboardComponent = (function () {
DashboardComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'dashboard',
template: __webpack_require__(669)
template: __webpack_require__(668)
}),
__metadata('design:paramtypes', [])
], DashboardComponent);
@@ -37,10 +37,9 @@ var DashboardComponent = (function () {
"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__(673);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__ = __webpack_require__(672);
/* 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__(306);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__graph_data__ = __webpack_require__(508);
/* 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;
@@ -54,20 +53,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
var DataService = (function () {
function DataService(http) {
this.http = http;
this.baseUrl = '/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);
console.log(lineChartData$);
return lineChartData$;
};
DataService.prototype.getHeaders = function () {
@@ -83,24 +79,19 @@ var DataService = (function () {
var _a;
}());
function mapData(response) {
console.log('Mapping data', __WEBPACK_IMPORTED_MODULE_3__graph_data__["a" /* GraphData */]);
var nums = response.json().map(toData);
var times = response.json().map(timeToData);
console.log(nums);
var line = ({ data: nums, label: "Series A" });
var line = ({ data: nums, label: "Energieverbruik" });
var label = ({ data: times });
console.log(line);
var graph = ({ lines: line, labels: label });
return graph;
}
function toData(r) {
var num = r.TOE1;
console.log('Parsed Data:', num);
return num;
}
function timeToData(r) {
var times = r.time.substring(11, 18);
console.log('Parsed Time:', times);
return times;
}
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/data.service.js.map
@@ -128,7 +119,7 @@ webpackEmptyContext.id = 385;
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(473);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(509);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(508);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app_module__ = __webpack_require__(506);
@@ -205,8 +196,8 @@ var AppComponent = (function () {
AppComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'app-root',
template: __webpack_require__(667),
styles: [__webpack_require__(666)]
template: __webpack_require__(666),
styles: [__webpack_require__(665)]
}),
__metadata('design:paramtypes', [])
], AppComponent);
@@ -224,7 +215,7 @@ var AppComponent = (function () {
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(464);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(306);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__ = __webpack_require__(664);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__ = __webpack_require__(663);
/* 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_routing_module__ = __webpack_require__(504);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_component__ = __webpack_require__(505);
@@ -302,9 +293,9 @@ var LineChartComponent = (function () {
this.dataService = dataService;
// lineChart
this.lineChartData = [
{ data: [1, 0, 0, 0, 0, 0, 1], label: 'Series A' }
{ data: [0, 0, 0, 0, 0, 0, 0], label: 'Totaal verbruik' }
];
this.lineChartLabels = ['', '', '', '', '', '', ''];
this.lineChartLabels = ['-1', '-2', '-3', '-4', '-5', '-6', '-7'];
this.lineChartOptions = {
responsive: true,
title: {
@@ -326,18 +317,12 @@ var LineChartComponent = (function () {
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) {
console.log("Received from service:");
console.log(res);
var newDataSet = [];
var newLine = { data: res.lines.data, label: res.lines.label };
@@ -346,13 +331,15 @@ var LineChartComponent = (function () {
var newDataSet2 = [];
newDataSet2.push(res.labels.data.slice());
_this.lineChartLabels = newDataSet2;
console.log("Updated labels array");
console.log(_this.lineChartLabels);
});
console.log("Init");
};
LineChartComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'line-chart',
template: __webpack_require__(668)
template: __webpack_require__(667)
}),
__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);
@@ -366,20 +353,6 @@ var LineChartComponent = (function () {
/***/ 508:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GraphData; });
var GraphData = (function () {
function GraphData() {
}
return GraphData;
}());
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/graph-data.js.map
/***/ }),
/***/ 509:
/***/ (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.
@@ -393,35 +366,35 @@ var environment = {
/***/ }),
/***/ 666:
/***/ 665:
/***/ (function(module, exports) {
module.exports = "h1 {\r\n\tcolor: blue;\r\n}"
module.exports = ""
/***/ }),
/***/ 667:
/***/ 666:
/***/ (function(module, exports) {
module.exports = "<div class=\"container\">\r\n\r\n <nav class=\"navbar navbar-default\">\r\n <div class=\"container-fluid\">\r\n <div class=\"navbar-header\">\r\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\r\n <span class=\"sr-only\">Toggle navigation</span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n </button>\r\n <a class=\"navbar-brand\">Energiemeter</a>\r\n </div>\r\n <div id=\"navbar\" class=\"navbar-collapse collapse\">\r\n <ul class=\"nav navbar-nav\">\r\n <li routerLink=\"/dashboard\" routerLinkActive=\"active\"><a routerLink=\"/dashboard\" routerLinkActive=\"active\">Dashboard</a></li>\r\n </ul>\r\n </div><!--/.nav-collapse -->\r\n </div><!--/.container-fluid -->\r\n </nav>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-12\">\r\n <div class=\"page-header\">\r\n <h1>{{title}} <small>Avans</small></h1>\r\n </div>\r\n </div>\r\n\r\n <router-outlet></router-outlet>\r\n\r\n </div>\r\n</div>\r\n"
/***/ }),
/***/ 668:
/***/ 667:
/***/ (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>"
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\"></canvas>\r\n </div>\r\n </div>\r\n</div>"
/***/ }),
/***/ 669:
/***/ 668:
/***/ (function(module, exports) {
module.exports = "<div>\r\n\t<line-chart></line-chart>\r\n</div>"
/***/ }),
/***/ 688:
/***/ 687:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(386);
@@ -429,5 +402,5 @@ module.exports = __webpack_require__(386);
/***/ })
},[688]);
},[687]);
//# sourceMappingURL=main.bundle.map
+1 -1
View File
File diff suppressed because one or more lines are too long
+269 -270
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -8
View File
@@ -6,10 +6,10 @@ webpackJsonp([2,4],{
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(660);
var content = __webpack_require__(659);
if(typeof content === 'string') content = [[module.i, content, '']];
// add the styles to the DOM
var update = __webpack_require__(686)(content, {});
var update = __webpack_require__(685)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
@@ -27,10 +27,10 @@ if(false) {
/***/ }),
/***/ 660:
/***/ 659:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(661)();
exports = module.exports = __webpack_require__(660)();
// imports
@@ -42,7 +42,7 @@ exports.push([module.i, "/* You can add global styles to this file, and also imp
/***/ }),
/***/ 661:
/***/ 660:
/***/ (function(module, exports) {
/*
@@ -99,7 +99,7 @@ module.exports = function() {
/***/ }),
/***/ 686:
/***/ 685:
/***/ (function(module, exports) {
/*
@@ -352,7 +352,7 @@ function updateLink(linkElement, obj) {
/***/ }),
/***/ 690:
/***/ 689:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(388);
@@ -360,5 +360,5 @@ module.exports = __webpack_require__(388);
/***/ })
},[690]);
},[689]);
//# sourceMappingURL=styles.bundle.map
+1 -1
View File
File diff suppressed because one or more lines are too long
+45 -46
View File
@@ -5063,7 +5063,7 @@ function DomAdapter_tsickle_Closure_declarations() {
"use strict";
var root_1 = __webpack_require__(57);
var toSubscriber_1 = __webpack_require__(684);
var toSubscriber_1 = __webpack_require__(683);
var observable_1 = __webpack_require__(160);
/**
* A representation of any set of values over any amount of time. This the most basic building block
@@ -6926,7 +6926,7 @@ function templateVisitAll(visitor, asts, context) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_operator_toPromise__ = __webpack_require__(681);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_operator_toPromise__ = __webpack_require__(680);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_operator_toPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_operator_toPromise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__facade_collection__ = __webpack_require__(303);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__facade_lang__ = __webpack_require__(76);
@@ -7517,7 +7517,7 @@ function ControlContainer_tsickle_Closure_declarations() {
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatAll__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_every__ = __webpack_require__(376);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_every___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_every__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_last__ = __webpack_require__(678);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_last__ = __webpack_require__(677);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_last__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_map__ = __webpack_require__(110);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_operator_map__);
@@ -11176,7 +11176,7 @@ var Observable_1 = __webpack_require__(17);
var Subscriber_1 = __webpack_require__(30);
var Subscription_1 = __webpack_require__(235);
var ObjectUnsubscribedError_1 = __webpack_require__(378);
var SubjectSubscription_1 = __webpack_require__(672);
var SubjectSubscription_1 = __webpack_require__(671);
var rxSubscriber_1 = __webpack_require__(240);
/**
* @class SubjectSubscriber<T>
@@ -21141,7 +21141,7 @@ var XSRFStrategy = (function () {
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_operator_mergeMap__ = __webpack_require__(111);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_operator_mergeMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_operator_reduce__ = __webpack_require__(680);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_operator_reduce__ = __webpack_require__(679);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_operator_reduce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_operator_reduce__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__apply_redirects__ = __webpack_require__(494);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__config__ = __webpack_require__(495);
@@ -45082,9 +45082,9 @@ exports.OuterSubscriber = OuterSubscriber;
var isArray_1 = __webpack_require__(380);
var isObject_1 = __webpack_require__(383);
var isFunction_1 = __webpack_require__(382);
var tryCatch_1 = __webpack_require__(685);
var tryCatch_1 = __webpack_require__(684);
var errorObject_1 = __webpack_require__(379);
var UnsubscriptionError_1 = __webpack_require__(682);
var UnsubscriptionError_1 = __webpack_require__(681);
/**
* Represents a disposable resource, such as the execution of an Observable. A
* Subscription has one important method, `unsubscribe`, that takes no argument
@@ -45278,7 +45278,7 @@ function flattenUnsubscriptionErrors(errors) {
"use strict";
var FromObservable_1 = __webpack_require__(675);
var FromObservable_1 = __webpack_require__(674);
exports.from = FromObservable_1.FromObservable.create;
//# sourceMappingURL=from.js.map
@@ -45507,7 +45507,7 @@ var isPromise_1 = __webpack_require__(384);
var isObject_1 = __webpack_require__(383);
var Observable_1 = __webpack_require__(17);
var iterator_1 = __webpack_require__(239);
var InnerSubscriber_1 = __webpack_require__(670);
var InnerSubscriber_1 = __webpack_require__(669);
var observable_1 = __webpack_require__(160);
function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {
var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);
@@ -63213,7 +63213,7 @@ function provideRouterInitializer() {
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_catch___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_catch__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_concatMap__ = __webpack_require__(375);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_concatMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_filter__ = __webpack_require__(677);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_filter__ = __webpack_require__(676);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_mergeAll__ = __webpack_require__(238);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_mergeAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_operator_mergeAll__);
@@ -63487,7 +63487,7 @@ var __extends = (this && this.__extends) || function (d, b) {
var Observable_1 = __webpack_require__(17);
var ScalarObservable_1 = __webpack_require__(372);
var EmptyObservable_1 = __webpack_require__(370);
var isScheduler_1 = __webpack_require__(683);
var isScheduler_1 = __webpack_require__(682);
/**
* We need this JSDoc comment for affecting ESDoc.
* @extends {Ignored}
@@ -81241,8 +81241,7 @@ var /** @type {?} */ VERSION = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["
/* 658 */,
/* 659 */,
/* 660 */,
/* 661 */,
/* 662 */
/* 661 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81522,6 +81521,18 @@ var ChartsModule = (function () {
exports.ChartsModule = ChartsModule;
/***/ }),
/* 662 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(__webpack_require__(661));
/***/ }),
/* 663 */
/***/ (function(module, exports, __webpack_require__) {
@@ -81535,24 +81546,12 @@ __export(__webpack_require__(662));
/***/ }),
/* 664 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(__webpack_require__(663));
/***/ }),
/* 664 */,
/* 665 */,
/* 666 */,
/* 667 */,
/* 668 */,
/* 669 */,
/* 670 */
/* 669 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81594,7 +81593,7 @@ exports.InnerSubscriber = InnerSubscriber;
//# sourceMappingURL=InnerSubscriber.js.map
/***/ }),
/* 671 */
/* 670 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81727,7 +81726,7 @@ exports.Notification = Notification;
//# sourceMappingURL=Notification.js.map
/***/ }),
/* 672 */
/* 671 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81773,7 +81772,7 @@ exports.SubjectSubscription = SubjectSubscription;
//# sourceMappingURL=SubjectSubscription.js.map
/***/ }),
/* 673 */
/* 672 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81784,7 +81783,7 @@ Observable_1.Observable.prototype.map = map_1.map;
//# sourceMappingURL=map.js.map
/***/ }),
/* 674 */
/* 673 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81860,7 +81859,7 @@ exports.ArrayLikeObservable = ArrayLikeObservable;
//# sourceMappingURL=ArrayLikeObservable.js.map
/***/ }),
/* 675 */
/* 674 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81874,12 +81873,12 @@ var isArray_1 = __webpack_require__(380);
var isArrayLike_1 = __webpack_require__(381);
var isPromise_1 = __webpack_require__(384);
var PromiseObservable_1 = __webpack_require__(371);
var IteratorObservable_1 = __webpack_require__(676);
var IteratorObservable_1 = __webpack_require__(675);
var ArrayObservable_1 = __webpack_require__(369);
var ArrayLikeObservable_1 = __webpack_require__(674);
var ArrayLikeObservable_1 = __webpack_require__(673);
var iterator_1 = __webpack_require__(239);
var Observable_1 = __webpack_require__(17);
var observeOn_1 = __webpack_require__(679);
var observeOn_1 = __webpack_require__(678);
var observable_1 = __webpack_require__(160);
/**
* We need this JSDoc comment for affecting ESDoc.
@@ -81988,7 +81987,7 @@ exports.FromObservable = FromObservable;
//# sourceMappingURL=FromObservable.js.map
/***/ }),
/* 676 */
/* 675 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82157,7 +82156,7 @@ function sign(value) {
//# sourceMappingURL=IteratorObservable.js.map
/***/ }),
/* 677 */
/* 676 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82256,7 +82255,7 @@ var FilterSubscriber = (function (_super) {
//# sourceMappingURL=filter.js.map
/***/ }),
/* 678 */
/* 677 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82381,7 +82380,7 @@ var LastSubscriber = (function (_super) {
//# sourceMappingURL=last.js.map
/***/ }),
/* 679 */
/* 678 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82392,7 +82391,7 @@ var __extends = (this && this.__extends) || function (d, b) {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Subscriber_1 = __webpack_require__(30);
var Notification_1 = __webpack_require__(671);
var Notification_1 = __webpack_require__(670);
/**
* @see {@link Notification}
*
@@ -82463,7 +82462,7 @@ exports.ObserveOnMessage = ObserveOnMessage;
//# sourceMappingURL=observeOn.js.map
/***/ }),
/* 680 */
/* 679 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82595,7 +82594,7 @@ exports.ReduceSubscriber = ReduceSubscriber;
//# sourceMappingURL=reduce.js.map
/***/ }),
/* 681 */
/* 680 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82673,7 +82672,7 @@ exports.toPromise = toPromise;
//# sourceMappingURL=toPromise.js.map
/***/ }),
/* 682 */
/* 681 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82704,7 +82703,7 @@ exports.UnsubscriptionError = UnsubscriptionError;
//# sourceMappingURL=UnsubscriptionError.js.map
/***/ }),
/* 683 */
/* 682 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82716,7 +82715,7 @@ exports.isScheduler = isScheduler;
//# sourceMappingURL=isScheduler.js.map
/***/ }),
/* 684 */
/* 683 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -82742,7 +82741,7 @@ exports.toSubscriber = toSubscriber;
//# sourceMappingURL=toSubscriber.js.map
/***/ }),
/* 685 */
/* 684 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
+1 -1
View File
File diff suppressed because one or more lines are too long
-3
View File
@@ -1,3 +0,0 @@
h1 {
color: blue;
}
+1 -3
View File
@@ -7,9 +7,7 @@
[options]="lineChartOptions"
[colors]="lineChartColors"
[legend]="lineChartLegend"
[chartType]="lineChartType"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)"></canvas>
[chartType]="lineChartType"></canvas>
</div>
</div>
</div>
+6 -11
View File
@@ -10,9 +10,9 @@ import { LineData } from './line-data';
export class LineChartComponent implements OnInit {
// lineChart
public lineChartData:Array<any> = [
{data: [1,0,0,0,0,0,1], label: 'Series A'}
{data: [0,0,0,0,0,0,0], label: 'Totaal verbruik'}
];
public lineChartLabels:Array<any> = ['', '', '', '', '', '', ''];
public lineChartLabels:Array<any> = ['-1', '-2', '-3', '-4', '-5', '-6', '-7'];
public lineChartOptions:any = {
responsive: true,
title: {
@@ -34,15 +34,6 @@ export class LineChartComponent implements OnInit {
public lineChartLegend:boolean = true;
public lineChartType:string = 'line';
// events
public chartClicked(e:any):void {
//console.log(e);
}
public chartHovered(e:any):void {
//console.log(e);
}
constructor(private dataService: DataService) {}
ngOnInit(): void {
@@ -50,6 +41,7 @@ export class LineChartComponent implements OnInit {
this.dataService
.get()
.subscribe(res => {
console.log("Received from service:");
console.log(res);
const newDataSet = [];
@@ -60,6 +52,9 @@ export class LineChartComponent implements OnInit {
const newDataSet2 = [];
newDataSet2.push(res.labels.data.slice());
this.lineChartLabels = newDataSet2;
console.log("Updated labels array");
console.log(this.lineChartLabels);
});
console.log("Init");
+1 -9
View File
@@ -14,7 +14,6 @@ export class DataService {
constructor(private http : Http){}
get(): Observable<GraphData> {
console.log('Getting data');
let lineChartData$ =
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
this.http
@@ -22,7 +21,6 @@ export class DataService {
, {headers: this.getHeaders()})
.map(mapData);
console.log(lineChartData$);
return lineChartData$;
}
@@ -34,28 +32,22 @@ export class DataService {
}
function mapData(response:Response): GraphData {
console.log('Mapping data', GraphData);
let nums = response.json().map(toData);
let times = response.json().map(timeToData)
console.log(nums);
let line:LineData = <LineData>({data: nums, label: "Series A"});
let line:LineData = <LineData>({data: nums, label: "Energieverbruik"});
let label:LabelData = <LabelData>({data: times});
console.log(line);
let graph:GraphData = <GraphData>({lines:line,labels:label});
return graph;
}
function toData(r:any){
let num = r.TOE1;
console.log('Parsed Data:', num);
return num;
}
function timeToData(r:any){
let times = r.time.substring(11,18);
console.log('Parsed Time:', times);
return times;
}