UNPKG

neu-charts

Version:

neu-charts is a ngx-charts wrapper and charting framework for Angular 2 and beyond!.

871 lines (861 loc) 86.7 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@swimlane/ngx-charts'), require('d3-shape'), require('d3-scale'), require('@angular/animations'), require('@angular/common'), require('@swimlane/ngx-graph')) : typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@swimlane/ngx-charts', 'd3-shape', 'd3-scale', '@angular/animations', '@angular/common', '@swimlane/ngx-graph'], factory) : (factory((global['neu-charts'] = {}),global.ng.core,global.ngxCharts,global.d3Shape,global.d3Scale,global.ng.animations,global.ng.common,global.ngxGraph)); }(this, (function (exports,core,ngxCharts,d3Shape,d3Scale,animations,common,ngxGraph) { 'use strict'; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } var NeuChartsComponent = /** @class */ (function () { function NeuChartsComponent() { } NeuChartsComponent.prototype.ngOnInit = function () { }; return NeuChartsComponent; }()); NeuChartsComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts', template: "<h3>Neu-charts works!</h3>\n", styles: [""] },] }, ]; NeuChartsComponent.ctorParameters = function () { return []; }; var Options = /** @class */ (function () { function Options(showLegend) { if (showLegend === void 0) { showLegend = true; } this.showLegend = showLegend; } return Options; }()); var PieOptions = /** @class */ (function (_super) { __extends(PieOptions, _super); function PieOptions(showLegend, showLabels, explodeSlices) { if (showLegend === void 0) { showLegend = true; } if (showLabels === void 0) { showLabels = true; } if (explodeSlices === void 0) { explodeSlices = false; } var _this = _super.call(this, showLegend) || this; _this.showLabels = showLabels; _this.explodeSlices = explodeSlices; _this.doughnut = false; return _this; } return PieOptions; }(Options)); var customColorSets = [ { name: 'palatte', domain: ['#9896F8', '#55efc4', '#76B3F9', '#81DD98', '#b867d3', '#f26f96', '#ffeaa7', '#FDBD2D', '#FC8A25', '#4d488c', '#FA4F1E', '#BDC3C7'] } ]; var PieChartComponent = /** @class */ (function () { function PieChartComponent() { this.data = []; this.onSelect = new core.EventEmitter(); this.options = new PieOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } PieChartComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; PieChartComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return PieChartComponent; }()); PieChartComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-pie', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-pie-chart\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [explodeSlices]=\"options.explodeSlices\"\n [labels]=\"options.showLabels\"\n [doughnut]=\"options.doughnut\"\n [gradient]=\"gradient\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-pie-chart>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; PieChartComponent.ctorParameters = function () { return []; }; PieChartComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var DonutOptions = /** @class */ (function (_super) { __extends(DonutOptions, _super); function DonutOptions(showLegend, showLabels, arcWidth) { if (showLegend === void 0) { showLegend = true; } if (showLabels === void 0) { showLabels = true; } if (arcWidth === void 0) { arcWidth = 0.3; } var _this = _super.call(this, showLegend, showLabels, false) || this; _this.doughnut = true; _this.arcWidth = arcWidth; return _this; } return DonutOptions; }(PieOptions)); var DonutChartComponent = /** @class */ (function () { function DonutChartComponent() { this.data = []; this.onSelect = new core.EventEmitter(); this.options = new DonutOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } DonutChartComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.cutomOptions); }; DonutChartComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return DonutChartComponent; }()); DonutChartComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-donut', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-pie-chart\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [explodeSlices]=\"options.explodeSlices\"\n [labels]=\"options.showLabels\"\n [doughnut]=\"options.doughnut\"\n [arcWidth]=\"options.arcWidth\"\n [gradient]=\"gradient\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-pie-chart>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; DonutChartComponent.ctorParameters = function () { return []; }; DonutChartComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "cutomOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var NoDataComponent = /** @class */ (function () { function NoDataComponent() { } NoDataComponent.prototype.ngOnInit = function () { }; return NoDataComponent; }()); NoDataComponent.decorators = [ { type: core.Component, args: [{ selector: 'no-data', template: "<div class=\"no-data-container\">No data found (or) Wrong data format</div>", styles: ["\n .no-data-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n color: lightslategray;\n font-size: 1.2rem;\n }"] },] }, ]; NoDataComponent.ctorParameters = function () { return []; }; var DonutAdvancedComponent = /** @class */ (function () { function DonutAdvancedComponent() { this.data = []; this.onSelect = new core.EventEmitter(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } DonutAdvancedComponent.prototype.ngOnInit = function () { }; DonutAdvancedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return DonutAdvancedComponent; }()); DonutAdvancedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-donut-advanced', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-advanced-pie-chart\n [view]=\"view\"\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-advanced-pie-chart>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}.chart-container /deep/ .total-value{font-size:1.4rem}.chart-container /deep/ .total-label{font-size:1.2rem}.chart-container /deep/ .legend-items{padding-top:10px}.chart-container /deep/ .legend-items .legend-item{line-height:1.4}.chart-container /deep/ .legend-items .legend-item:hover{opacity:.75}.chart-container /deep/ .legend-items .legend-item .item-value{font-size:1.2rem!important}.chart-container /deep/ .legend-items .legend-item .item-percent{font-size:1.1rem!important}"] },] }, ]; DonutAdvancedComponent.ctorParameters = function () { return []; }; DonutAdvancedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "onSelect": [{ type: core.Output },], }; var DonutGridComponent = /** @class */ (function () { function DonutGridComponent() { this.data = []; this.onSelect = new core.EventEmitter(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } DonutGridComponent.prototype.ngOnInit = function () { }; DonutGridComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return DonutGridComponent; }()); DonutGridComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-donut-grid', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-pie-grid\n [view]=\"view\"\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-pie-grid>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; DonutGridComponent.ctorParameters = function () { return []; }; DonutGridComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "onSelect": [{ type: core.Output },], }; var BarOptions = /** @class */ (function (_super) { __extends(BarOptions, _super); function BarOptions(showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) { if (showLegend === void 0) { showLegend = true; } if (showXAxis === void 0) { showXAxis = true; } if (showYAxis === void 0) { showYAxis = true; } if (showXAxisLabel === void 0) { showXAxisLabel = true; } if (showYAxisLabel === void 0) { showYAxisLabel = true; } if (xAxisLabel === void 0) { xAxisLabel = ''; } if (yAxisLabel === void 0) { yAxisLabel = ''; } var _this = _super.call(this, showLegend) || this; _this.showXAxis = showXAxis; _this.showYAxis = showYAxis; _this.showXAxisLabel = showXAxisLabel; _this.showYAxisLabel = showYAxisLabel; _this.xAxisLabel = xAxisLabel.toUpperCase(); _this.yAxisLabel = yAxisLabel.toUpperCase(); _this.barPadding = 3; return _this; } return BarOptions; }(Options)); var BarVerticalComponent = /** @class */ (function () { function BarVerticalComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarVerticalComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarVerticalComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarVerticalComponent; }()); BarVerticalComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-vertical', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-vertical\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-vertical>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarVerticalComponent.ctorParameters = function () { return []; }; BarVerticalComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarHorizontalComponent = /** @class */ (function () { function BarHorizontalComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarHorizontalComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarHorizontalComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarHorizontalComponent; }()); BarHorizontalComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-horizontal', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-horizontal\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-horizontal>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarHorizontalComponent.ctorParameters = function () { return []; }; BarHorizontalComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarGroupedOptions = /** @class */ (function (_super) { __extends(BarGroupedOptions, _super); function BarGroupedOptions(showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) { if (showLegend === void 0) { showLegend = true; } if (showXAxis === void 0) { showXAxis = true; } if (showYAxis === void 0) { showYAxis = true; } if (showXAxisLabel === void 0) { showXAxisLabel = true; } if (showYAxisLabel === void 0) { showYAxisLabel = true; } if (xAxisLabel === void 0) { xAxisLabel = ''; } if (yAxisLabel === void 0) { yAxisLabel = ''; } var _this = _super.call(this, showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) || this; _this.groupPadding = 6; return _this; } return BarGroupedOptions; }(BarOptions)); var BarVerticalGroupedComponent = /** @class */ (function () { function BarVerticalGroupedComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarGroupedOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarVerticalGroupedComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarVerticalGroupedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarVerticalGroupedComponent; }()); BarVerticalGroupedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-vertical-grouped', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-vertical-2d\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n [groupPadding]=\"options.groupPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-vertical-2d>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarVerticalGroupedComponent.ctorParameters = function () { return []; }; BarVerticalGroupedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarHorizontalGroupedComponent = /** @class */ (function () { function BarHorizontalGroupedComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarGroupedOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarHorizontalGroupedComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarHorizontalGroupedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarHorizontalGroupedComponent; }()); BarHorizontalGroupedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-horizontal-grouped', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-horizontal-2d\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n [groupPadding]=\"options.groupPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-horizontal-2d>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarHorizontalGroupedComponent.ctorParameters = function () { return []; }; BarHorizontalGroupedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarHorizontalStackedComponent = /** @class */ (function () { function BarHorizontalStackedComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarHorizontalStackedComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarHorizontalStackedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarHorizontalStackedComponent; }()); BarHorizontalStackedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-horizontal-stacked', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-horizontal-stacked\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-horizontal-stacked>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarHorizontalStackedComponent.ctorParameters = function () { return []; }; BarHorizontalStackedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarVerticalStackedComponent = /** @class */ (function () { function BarVerticalStackedComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarVerticalStackedComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarVerticalStackedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarVerticalStackedComponent; }()); BarVerticalStackedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-vertical-stacked', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-vertical-stacked\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-vertical-stacked>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarVerticalStackedComponent.ctorParameters = function () { return []; }; BarVerticalStackedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarVerticalNormalizedComponent = /** @class */ (function () { function BarVerticalNormalizedComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarVerticalNormalizedComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarVerticalNormalizedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarVerticalNormalizedComponent; }()); BarVerticalNormalizedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-vertical-normalized', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-vertical-normalized\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-vertical-normalized>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarVerticalNormalizedComponent.ctorParameters = function () { return []; }; BarVerticalNormalizedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarHorizontalNormalizedComponent = /** @class */ (function () { function BarHorizontalNormalizedComponent() { this.onSelect = new core.EventEmitter(); this.options = new BarOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarHorizontalNormalizedComponent.prototype.ngOnInit = function () { Object.assign(this.options, this.customOptions); }; BarHorizontalNormalizedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return BarHorizontalNormalizedComponent; }()); BarHorizontalNormalizedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-bar-horizontal-normalized', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-bar-horizontal-normalized\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [legend]=\"options.showLegend\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [barPadding]=\"options.barPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-bar-horizontal-normalized>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; BarHorizontalNormalizedComponent.ctorParameters = function () { return []; }; BarHorizontalNormalizedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var LineOptions = /** @class */ (function (_super) { __extends(LineOptions, _super); function LineOptions(showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel, timeline, isXAxisDate, referenceLines) { if (showLegend === void 0) { showLegend = true; } if (showXAxis === void 0) { showXAxis = true; } if (showYAxis === void 0) { showYAxis = true; } if (showXAxisLabel === void 0) { showXAxisLabel = true; } if (showYAxisLabel === void 0) { showYAxisLabel = true; } if (xAxisLabel === void 0) { xAxisLabel = ''; } if (yAxisLabel === void 0) { yAxisLabel = ''; } if (timeline === void 0) { timeline = false; } if (isXAxisDate === void 0) { isXAxisDate = false; } if (referenceLines === void 0) { referenceLines = []; } var _this = _super.call(this, showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) || this; _this.autoScale = true; _this.roundDomains = true; _this.timeline = timeline; _this.isXAxisDate = isXAxisDate; if (referenceLines.length == 0) { _this.showRefLines = true; } _this.referenceLines = referenceLines; return _this; } return LineOptions; }(BarOptions)); var LineComponent = /** @class */ (function () { function LineComponent() { this.onSelect = new core.EventEmitter(); this.options = new LineOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } LineComponent.prototype.ngOnInit = function () { }; LineComponent.prototype.ngOnChanges = function (changes) { Object.assign(this.options, this.customOptions); if ((this.data && (changes["data"].previousValue != changes["data"].currentValue)) || (this.options.isXAxisDate && (changes["customOptions"].previousValue != changes["customOptions"].currentValue))) { this.data.forEach(function (element) { element.series.forEach(function (seriesData) { seriesData.name = new Date(seriesData.name); }); }); } }; LineComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return LineComponent; }()); LineComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-line', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-line-chart\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [autoScale]=\"options.autoScale\"\n [roundDomains]=\"options.roundDomains\"\n [timeline]=\"options.timeline\"\n (select)=\"mSelectedEvent($event)\"\n [showRefLines]=\"options.showRefLines\"\n [referenceLines]=\"options.referenceLines\">\n </ngx-charts-line-chart>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; LineComponent.ctorParameters = function () { return []; }; LineComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var AreaComponent = /** @class */ (function () { function AreaComponent() { this.onSelect = new core.EventEmitter(); this.options = new LineOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } AreaComponent.prototype.ngOnInit = function () { }; AreaComponent.prototype.ngOnChanges = function (changes) { Object.assign(this.options, this.customOptions); if ((this.data && (changes["data"].previousValue != changes["data"].currentValue)) || (this.options.isXAxisDate && (changes["customOptions"].previousValue != changes["customOptions"].currentValue))) { this.data.forEach(function (element) { element.series.forEach(function (seriesData) { seriesData.name = new Date(seriesData.name); }); }); } }; AreaComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return AreaComponent; }()); AreaComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-area', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-area-chart\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [autoScale]=\"options.autoScale\"\n [timeline]=\"options.timeline\"\n (select)=\"mSelectedEvent($event)\">\n <!-- [roundDomains]=\"options.roundDomains\"> -->\n </ngx-charts-area-chart>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; AreaComponent.ctorParameters = function () { return []; }; AreaComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var AreaStackedComponent = /** @class */ (function () { function AreaStackedComponent() { this.onSelect = new core.EventEmitter(); this.options = new LineOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } AreaStackedComponent.prototype.ngOnInit = function () { }; AreaStackedComponent.prototype.ngOnChanges = function (changes) { Object.assign(this.options, this.customOptions); if ((this.data && (changes["data"].previousValue != changes["data"].currentValue)) || (this.options.isXAxisDate && (changes["customOptions"].previousValue != changes["customOptions"].currentValue))) { this.data.forEach(function (element) { element.series.forEach(function (seriesData) { seriesData.name = new Date(seriesData.name); }); }); } }; AreaStackedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return AreaStackedComponent; }()); AreaStackedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-area-stacked', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-area-chart-stacked\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [timeline]=\"options.timeline\"\n (select)=\"mSelectedEvent($event)\">\n <!-- [autoScale]=\"options.autoScale\"\n [roundDomains]=\"options.roundDomains\"> -->\n </ngx-charts-area-chart-stacked>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; AreaStackedComponent.ctorParameters = function () { return []; }; AreaStackedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var AreaNormalizedComponent = /** @class */ (function () { function AreaNormalizedComponent() { this.onSelect = new core.EventEmitter(); this.options = new LineOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } AreaNormalizedComponent.prototype.ngOnInit = function () { }; AreaNormalizedComponent.prototype.ngOnChanges = function (changes) { Object.assign(this.options, this.customOptions); if ((this.data && (changes["data"].previousValue != changes["data"].currentValue)) || (this.options.isXAxisDate && (changes["customOptions"].previousValue != changes["customOptions"].currentValue))) { this.data.forEach(function (element) { element.series.forEach(function (seriesData) { seriesData.name = new Date(seriesData.name); }); }); } }; AreaNormalizedComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return AreaNormalizedComponent; }()); AreaNormalizedComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-area-normalized', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-area-chart-normalized\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [timeline]=\"options.timeline\"\n (select)=\"mSelectedEvent($event)\">\n <!-- [autoScale]=\"options.autoScale\"\n [roundDomains]=\"options.roundDomains\"> -->\n </ngx-charts-area-chart-normalized>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [".chart-container{width:100%;height:100%}"] },] }, ]; AreaNormalizedComponent.ctorParameters = function () { return []; }; AreaNormalizedComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var MapOptions = /** @class */ (function (_super) { __extends(MapOptions, _super); function MapOptions(showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel, timeline, isXAxisDate, innerPadding, showSkew, colorScheme) { if (showLegend === void 0) { showLegend = true; } if (showXAxis === void 0) { showXAxis = true; } if (showYAxis === void 0) { showYAxis = true; } if (showXAxisLabel === void 0) { showXAxisLabel = true; } if (showYAxisLabel === void 0) { showYAxisLabel = true; } if (xAxisLabel === void 0) { xAxisLabel = ''; } if (yAxisLabel === void 0) { yAxisLabel = ''; } if (timeline === void 0) { timeline = false; } if (isXAxisDate === void 0) { isXAxisDate = false; } if (innerPadding === void 0) { innerPadding = 5; } if (showSkew === void 0) { showSkew = false; } if (colorScheme === void 0) { colorScheme = null; } var _this = _super.call(this, showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) || this; _this.innerPadding = innerPadding; _this.showSkew = showSkew; _this.colorScheme = colorScheme; return _this; } return MapOptions; }(BarOptions)); var HeatComponent = /** @class */ (function () { function HeatComponent() { this.onSelect = new core.EventEmitter(); this.options = new MapOptions(); } HeatComponent.prototype.ngOnInit = function () { }; HeatComponent.prototype.ngOnChanges = function (changes) { Object.assign(this.options, this.customOptions); if (this.options.colorScheme != null) { this.colorScheme = {}; this.colorScheme['domain'] = this.options.colorScheme; } else { this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } if (this.options.showSkew && (changes["customOptions"].previousValue != changes["customOptions"].currentValue)) { this.data.sort(function (current, next) { if (current.series.length > next.series.length) { return -1; } else if (current.series.length < next.series.length) { return 1; } return 0; }); } }; HeatComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return HeatComponent; }()); HeatComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-heat', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-heat-map\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n [legend]=\"options.showLegend\"\n [gradient]=\"gradient\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [innerPadding]=\"options.innerPadding\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-heat-map>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [""] },] }, ]; HeatComponent.ctorParameters = function () { return []; }; HeatComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var TreeComponent = /** @class */ (function () { function TreeComponent() { this.onSelect = new core.EventEmitter(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } TreeComponent.prototype.ngOnInit = function () { }; TreeComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; return TreeComponent; }()); TreeComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-tree', template: "<div class=\"chart-container\" *ngIf=\"data && (data.length > 0)\">\n <ngx-charts-tree-map\n [scheme]=\"colorScheme\"\n [results]=\"data\"\n (select)=\"mSelectedEvent($event)\">\n </ngx-charts-tree-map>\n</div>\n<no-data *ngIf=\"(!data) || (data.length <= 0)\"></no-data>", styles: [""] },] }, ]; TreeComponent.ctorParameters = function () { return []; }; TreeComponent.propDecorators = { "data": [{ type: core.Input, args: ['data',] },], "onSelect": [{ type: core.Output },], }; var BarLineComboOptions = /** @class */ (function (_super) { __extends(BarLineComboOptions, _super); function BarLineComboOptions(showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) { if (showLegend === void 0) { showLegend = true; } if (showXAxis === void 0) { showXAxis = true; } if (showYAxis === void 0) { showYAxis = true; } if (showXAxisLabel === void 0) { showXAxisLabel = true; } if (showYAxisLabel === void 0) { showYAxisLabel = true; } if (xAxisLabel === void 0) { xAxisLabel = ''; } if (yAxisLabel === void 0) { yAxisLabel = ''; } var _this = _super.call(this, showLegend, showXAxis, showYAxis, showXAxisLabel, showYAxisLabel, xAxisLabel, yAxisLabel) || this; _this.showRightYAxisLabel = false; return _this; } return BarLineComboOptions; }(BarOptions)); var BarLineWrapperComponent = /** @class */ (function () { function BarLineWrapperComponent() { this.dataBar = []; this.dataLine = []; this.onSelect = new core.EventEmitter(); this.options = new BarLineComboOptions(); this.colorScheme = customColorSets.find(function (s) { return s.name == 'palatte'; }); } BarLineWrapperComponent.prototype.ngOnInit = function () { console.log(this.dataBar, this.dataLine); Object.assign(this.options, this.customOptions); }; BarLineWrapperComponent.prototype.mSelectedEvent = function (event) { this.onSelect.emit(event); }; BarLineWrapperComponent.prototype.yLeftAxisScale = function (min, max) { return { min: "" + min, max: "" + max }; }; BarLineWrapperComponent.prototype.yRightAxisScale = function (min, max) { return { min: "" + min, max: "" + max }; }; BarLineWrapperComponent.prototype.yLeftTickFormat = function (data) { return "" + data.toLocaleString(); }; BarLineWrapperComponent.prototype.yRightTickFormat = function (data) { return data + "%"; }; return BarLineWrapperComponent; }()); BarLineWrapperComponent.decorators = [ { type: core.Component, args: [{ selector: 'neu-charts-combo-bar-line', template: "\n<div class=\"chart-container\" *ngIf=\"(dataBar && (dataBar.length > 0)) && (dataLine && (dataLine.length > 0))\">\n <neu-charts-combo-bar-line-raw\n [scheme]=\"colorScheme\"\n [colorSchemeLine]=\"lineChartScheme\"\n [results]=\"dataBar\"\n [lineChart]=\"dataLine\"\n [legend]=\"options.showLegend\"\n [xAxis]=\"options.showXAxis\"\n [yAxis]=\"options.showYAxis\"\n [showXAxisLabel]=\"options.showXAxisLabel\"\n [showYAxisLabel]=\"options.showYAxisLabel\"\n [xAxisLabel]=\"options.xAxisLabel\"\n [yAxisLabel]=\"options.yAxisLabel\"\n [showRightYAxisLabel]=\"options.showRightYAxisLabel\"\n [yAxisLabelRight]=\"options.yAxisLabelRight\"\n [yLeftAxisScaleFactor]=\"yLeftAxisScale\"\n [yRightAxisScaleFactor]=\"yRightAxisScale\"\n [yAxisTickFormatting]=\"yLeftTickFormat\"\n [yRightAxisTickFormatting]=\"yRightTickFormat\"\n (select)=\"mSelectedEvent($event)\">\n </neu-charts-combo-bar-line-raw>\n</div>\n<no-data *ngIf=\"(!dataBar) || (dataBar.length <= 0) || (!dataLine) || (dataLine.length <= 0)\"></no-data>" },] }, ]; BarLineWrapperComponent.ctorParameters = function () { return []; }; BarLineWrapperComponent.propDecorators = { "dataBar": [{ type: core.Input, args: ['dataBar',] },], "dataLine": [{ type: core.Input, args: ['dataLine',] },], "customOptions": [{ type: core.Input, args: ['options',] },], "onSelect": [{ type: core.Output },], }; var BarLineComponent = /** @class */ (function (_super) { __extends(BarLineComponent, _super); function BarLineComponent() { var _this = _super.apply(this, __spread(arguments)) || this; _this.curve = d3Shape.curveLinear; _this.legend = false; _this.legendTitle = 'Legend'; _this.tooltipDisabled = false; _this.showGridLines = true; _this.activeEntries = []; _this.schemeType = 'ordinal'; _this.roundDomains = false; _this.animations = true; _this.activate = new core.EventEmitter(); _this.deactivate = new core.EventEmitter(); _this.margin = [10, 20, 10, 20]; _this.xAxisHeight = 0; _this.yAxisWidth = 0; _this.scaleType = 'linear'; _this.yOrientLeft = 'left'; _this.yOrientRight = 'right'; _this.legendSpacing = 0; _this.barPadding = 8; return _this; } BarLineComponent.prototype.trackBy = function (index, item) { return item.name; }; BarLineComponent.prototype.update = function () { _super.prototype.update.call(this); this.dims = ngxCharts.calculateViewDimensions({ width: this.width, height: this.height, margins: this.margin, showXAxis: this.xAxis, showYAxis: this.yAxis, xAxisHeight: this.xAxisHeight, yAxisWidth: this.yAxisWidth, showXLabel: this.showXAxisLabel, showYLabel: this.showYAxisLabel, showLegend: this.legend, legendType: this.schemeType }); if (!this.yAxis) { this.legendSpacing = 0; } else if (this.showYAxisLabel && this.yAxis) { this.legendSpacing = 100; } else { this.legendSpacing = 40; } this.xScale = this.getXScale(); this.yScale = this.getYScale(); this.xDomainLine = this.getXDomainLine(); if (this.filteredDomain) { this.xDomainLine = this.filteredDomain; } this.