/**
 * @fileoverview added by tsickle
 * Generated from: lib/ui-components/tap-variable-data-popup/tap-variable-data-popup.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __read, __spread } from "tslib";
import { Component, Input } from '@angular/core';
import { ModalController } from '@ionic/angular';
var TapVariableDataPopupComponent = /** @class */ (function () {
    function TapVariableDataPopupComponent(modalController) {
        this.modalController = modalController;
        this.legend = false;
        this.showLabels = false;
        this.animations = true;
        this.xAxis = true;
        this.yAxis = true;
        this.showYAxisLabel = false;
        this.showXAxisLabel = false;
        this.timeline = true;
        this.xAxisLabel = 'Value';
        this.colorScheme = {
            domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
        };
        this.results = [];
        this.currentDate = ''
            + this.digit(+new Date().getHours())
            + ':'
            + this.digit(+new Date().getMinutes())
            + ':'
            + this.digit(+new Date().getSeconds());
    }
    /**
     * @return {?}
     */
    TapVariableDataPopupComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
    };
    Object.defineProperty(TapVariableDataPopupComponent.prototype, "variable", {
        set: /**
         * @param {?} inputs
         * @return {?}
         */
        function (inputs) {
            var _this = this;
            this.results.push({
                name: this.label,
                series: []
            });
            inputs.stream.subscribe((/**
             * @param {?} value
             * @return {?}
             */
            function (value) {
                if (Array.isArray(value)) {
                    _this.currentValue = value[_this.index];
                }
                else {
                    _this.currentValue = value;
                }
                /** @type {?} */
                var seriesData = {
                    name: _this.getCurrentTime(),
                    value: _this.currentValue,
                    extra: 0
                };
                _this.results[0].series.push(seriesData);
                /** @type {?} */
                var itemCount = _this.results[0].series.length;
                if (itemCount > 10) {
                    /** @type {?} */
                    var toRemove = (itemCount - 10);
                    _this.results[0].series.splice(0, toRemove);
                }
                _this.results = __spread(_this.results);
            }));
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    TapVariableDataPopupComponent.prototype.dismissModal = /**
     * @return {?}
     */
    function () {
        this.modalController.dismiss();
    };
    /**
     * @param {?} n
     * @return {?}
     */
    TapVariableDataPopupComponent.prototype.digit = /**
     * @param {?} n
     * @return {?}
     */
    function (n) {
        return n > 9 ? "" + n : "0" + n;
    };
    /**
     * @return {?}
     */
    TapVariableDataPopupComponent.prototype.getCurrentTime = /**
     * @return {?}
     */
    function () {
        return ''
            + this.digit(+new Date().getHours())
            + ':'
            + this.digit(+new Date().getMinutes())
            + ':'
            + this.digit(+new Date().getSeconds());
    };
    TapVariableDataPopupComponent.decorators = [
        { type: Component, args: [{
                    selector: 'tap-tap-variable-data-popup',
                    template: "<ion-header translucent>\r\n  <ion-toolbar>\r\n    <ion-buttons slot=\"start\">\r\n      <ion-button (click)=\"dismissModal()\"><ion-icon name=\"arrow-back-outline\"></ion-icon></ion-button>\r\n    </ion-buttons>\r\n    <ion-title>Details</ion-title>\r\n  </ion-toolbar>\r\n</ion-header>\r\n<ion-content >\r\n      <ion-list>\r\n        <ion-list-header>\r\n          <ion-label><h1>{{label}}</h1></ion-label>\r\n        </ion-list-header>\r\n        <ion-item>\r\n          <ion-label>Value on click</ion-label>\r\n          <ion-note slot=\"end\">{{value}}</ion-note>\r\n        </ion-item>\r\n        <ion-item>\r\n          <ion-label>Time on click</ion-label>\r\n          <ion-note slot=\"end\">{{currentDate}}</ion-note>\r\n        </ion-item>\r\n\r\n        <ion-item>\r\n          <ion-label>Current value</ion-label>\r\n          <ion-note slot=\"end\">{{currentValue}}</ion-note>\r\n        </ion-item>\r\n\r\n        <ion-item>\r\n          <ion-label>Dynamic graphic</ion-label>\r\n          <div #containerRef style=\"height: 50vh; width: 100%;\" >\r\n          <ngx-charts-line-chart\r\n            [view]=\"[containerRef.offsetWidth, containerRef.offsetHeight]\"\r\n            [scheme]=\"colorScheme\"\r\n            [showXAxisLabel]=\"showXAxisLabel\"\r\n            [showYAxisLabel]=\"showYAxisLabel\"\r\n            [legend]=\"legend\"\r\n            [xAxis]=\"xAxis\"\r\n            [yAxis]=\"yAxis\"\r\n            [timeline]=\"timeline\"\r\n            [results]=\"results\">\r\n          </ngx-charts-line-chart>\r\n          </div>\r\n        </ion-item>\r\n      </ion-list>\r\n</ion-content>",
                    styles: [".my-custom-modal-css{--background:transparent!important}"]
                }] }
    ];
    /** @nocollapse */
    TapVariableDataPopupComponent.ctorParameters = function () { return [
        { type: ModalController }
    ]; };
    TapVariableDataPopupComponent.propDecorators = {
        value: [{ type: Input }],
        label: [{ type: Input }],
        index: [{ type: Input }],
        variable: [{ type: Input, args: ['input',] }]
    };
    return TapVariableDataPopupComponent;
}());
export { TapVariableDataPopupComponent };
if (false) {
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.legend;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.showLabels;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.animations;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.xAxis;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.yAxis;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.showYAxisLabel;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.showXAxisLabel;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.timeline;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.xAxisLabel;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.colorScheme;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.results;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.value;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.label;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.index;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.currentValue;
    /** @type {?} */
    TapVariableDataPopupComponent.prototype.currentDate;
    /**
     * @type {?}
     * @private
     */
    TapVariableDataPopupComponent.prototype.modalController;
}
//# sourceMappingURL=data:application/json;base64, 