UNPKG

@swimlane/ngx-charts

Version:

Declarative Charting Framework for Angular

882 lines (740 loc) 1.05 MB
/** * ngx-charts v"12.0.1" (https://github.com/swimlane/ngx-charts) * Copyright 2019 * Licensed under MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("@angular/animations"), require("@angular/common"), require("@angular/core"), require("@angular/platform-browser"), require("d3-array"), require("d3-brush"), require("d3-color"), require("d3-force"), require("d3-format"), require("d3-hierarchy"), require("d3-interpolate"), require("d3-scale"), require("d3-selection"), require("d3-shape"), require("d3-time-format"), require("rxjs"), require("rxjs/operators")); else if(typeof define === 'function' && define.amd) define("ngx-charts", ["@angular/animations", "@angular/common", "@angular/core", "@angular/platform-browser", "d3-array", "d3-brush", "d3-color", "d3-force", "d3-format", "d3-hierarchy", "d3-interpolate", "d3-scale", "d3-selection", "d3-shape", "d3-time-format", "rxjs", "rxjs/operators"], factory); else if(typeof exports === 'object') exports["ngx-charts"] = factory(require("@angular/animations"), require("@angular/common"), require("@angular/core"), require("@angular/platform-browser"), require("d3-array"), require("d3-brush"), require("d3-color"), require("d3-force"), require("d3-format"), require("d3-hierarchy"), require("d3-interpolate"), require("d3-scale"), require("d3-selection"), require("d3-shape"), require("d3-time-format"), require("rxjs"), require("rxjs/operators")); else root["ngx-charts"] = factory(root["@angular/animations"], root["@angular/common"], root["@angular/core"], root["@angular/platform-browser"], root["d3-array"], root["d3-brush"], root["d3-color"], root["d3-force"], root["d3-format"], root["d3-hierarchy"], root["d3-interpolate"], root["d3-scale"], root["d3-selection"], root["d3-shape"], root["d3-time-format"], root["rxjs"], root["rxjs/operators"]); })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__angular_animations__, __WEBPACK_EXTERNAL_MODULE__angular_common__, __WEBPACK_EXTERNAL_MODULE__angular_core__, __WEBPACK_EXTERNAL_MODULE__angular_platform_browser__, __WEBPACK_EXTERNAL_MODULE_d3_array__, __WEBPACK_EXTERNAL_MODULE_d3_brush__, __WEBPACK_EXTERNAL_MODULE_d3_color__, __WEBPACK_EXTERNAL_MODULE_d3_force__, __WEBPACK_EXTERNAL_MODULE_d3_format__, __WEBPACK_EXTERNAL_MODULE_d3_hierarchy__, __WEBPACK_EXTERNAL_MODULE_d3_interpolate__, __WEBPACK_EXTERNAL_MODULE_d3_scale__, __WEBPACK_EXTERNAL_MODULE_d3_selection__, __WEBPACK_EXTERNAL_MODULE_d3_shape__, __WEBPACK_EXTERNAL_MODULE_d3_time_format__, __WEBPACK_EXTERNAL_MODULE_rxjs__, __WEBPACK_EXTERNAL_MODULE_rxjs_operators__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/bar-chart/bar-label.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".textDataLabel {\n font-size: 11px; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/common/base-chart.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".ngx-charts {\n float: left;\n overflow: visible; }\n .ngx-charts .circle,\n .ngx-charts .bar,\n .ngx-charts .arc {\n cursor: pointer; }\n .ngx-charts .bar.active, .ngx-charts .bar:hover,\n .ngx-charts .cell.active,\n .ngx-charts .cell:hover,\n .ngx-charts .arc.active,\n .ngx-charts .arc:hover,\n .ngx-charts .card.active,\n .ngx-charts .card:hover {\n opacity: 0.8;\n transition: opacity 100ms ease-in-out; }\n .ngx-charts .bar:focus,\n .ngx-charts .cell:focus,\n .ngx-charts .arc:focus,\n .ngx-charts .card:focus {\n outline: none; }\n .ngx-charts .bar.hidden,\n .ngx-charts .cell.hidden,\n .ngx-charts .arc.hidden,\n .ngx-charts .card.hidden {\n display: none; }\n .ngx-charts g:focus {\n outline: none; }\n .ngx-charts .line-series.inactive,\n .ngx-charts .line-series-range.inactive,\n .ngx-charts .polar-series-path.inactive,\n .ngx-charts .polar-series-area.inactive,\n .ngx-charts .area-series.inactive {\n transition: opacity 100ms ease-in-out;\n opacity: .2; }\n .ngx-charts .line-highlight {\n display: none; }\n .ngx-charts .line-highlight.active {\n display: block; }\n .ngx-charts .area {\n opacity: 0.6; }\n .ngx-charts .circle:hover {\n cursor: pointer; }\n .ngx-charts .label {\n font-size: 12px;\n font-weight: normal; }\n .ngx-charts .tooltip-anchor {\n fill: black; }\n .ngx-charts .gridline-path {\n stroke: #ddd;\n stroke-width: 1;\n fill: none; }\n .ngx-charts .refline-path {\n stroke: #a8b2c7;\n stroke-width: 1;\n stroke-dasharray: 5;\n stroke-dashoffset: 5; }\n .ngx-charts .refline-label {\n font-size: 9px; }\n .ngx-charts .reference-area {\n fill-opacity: 0.05;\n fill: #000; }\n .ngx-charts .gridline-path-dotted {\n stroke: #ddd;\n stroke-width: 1;\n fill: none;\n stroke-dasharray: 1, 20;\n stroke-dashoffset: 3; }\n .ngx-charts .grid-panel rect {\n fill: none; }\n .ngx-charts .grid-panel.odd rect {\n fill: rgba(0, 0, 0, 0.05); }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/common/legend/advanced-legend.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".advanced-pie-legend {\n float: left;\n position: relative;\n top: 50%;\n transform: translate(0, -50%); }\n .advanced-pie-legend .total-value {\n font-size: 36px; }\n .advanced-pie-legend .total-label {\n font-size: 24px;\n margin-bottom: 19px; }\n .advanced-pie-legend .legend-items-container {\n width: 100%; }\n .advanced-pie-legend .legend-items-container .legend-items {\n white-space: nowrap;\n overflow: auto; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item {\n margin-right: 20px;\n display: inline-block;\n cursor: pointer; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item:focus {\n outline: none; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item:hover {\n color: #000;\n -webkit-transition: 0.2s;\n -moz-transition: 0.2s;\n transition: 0.2s; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item .item-value {\n font-size: 24px;\n margin-top: -6px;\n margin-left: 11px; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item .item-label {\n font-size: 14px;\n opacity: 0.7;\n margin-left: 11px;\n margin-top: -6px; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item .item-percent {\n font-size: 24px;\n opacity: 0.7;\n margin-left: 11px; }\n .advanced-pie-legend .legend-items-container .legend-items .legend-item .item-color {\n border-left: 4px solid;\n width: 4px;\n height: 42px;\n float: left;\n margin-right: 7px; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/common/legend/legend.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".chart-legend {\n display: inline-block;\n padding: 0;\n width: auto !important; }\n .chart-legend .legend-title {\n white-space: nowrap;\n overflow: hidden;\n margin-left: 10px;\n margin-bottom: 5px;\n font-size: 14px;\n font-weight: bold; }\n .chart-legend ul, .chart-legend li {\n padding: 0;\n margin: 0;\n list-style: none; }\n .chart-legend .horizontal-legend li {\n display: inline-block; }\n .chart-legend .legend-wrap {\n width: calc(100% - 10px); }\n .chart-legend .legend-labels {\n line-height: 85%;\n list-style: none;\n text-align: left;\n float: left;\n width: 100%;\n border-radius: 3px;\n overflow-y: auto;\n overflow-x: hidden;\n white-space: nowrap;\n background: rgba(0, 0, 0, 0.05); }\n .chart-legend .legend-label {\n cursor: pointer;\n font-size: 90%;\n margin: 8px;\n color: #AFB7C8; }\n .chart-legend .legend-label:hover {\n color: #000;\n -webkit-transition: 0.2s;\n -moz-transition: 0.2s;\n transition: 0.2s; }\n .chart-legend .legend-label .active .legend-label-text {\n color: #000; }\n .chart-legend .legend-label-color {\n display: inline-block;\n height: 15px;\n width: 15px;\n margin-right: 5px;\n color: #5b646b;\n border-radius: 3px; }\n .chart-legend .legend-label-text {\n display: inline-block;\n vertical-align: top;\n line-height: 15px;\n font-size: 12px;\n width: calc(100% - 20px);\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; }\n .chart-legend .legend-title-text {\n vertical-align: bottom;\n display: inline-block;\n line-height: 16px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/common/legend/scale-legend.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".chart-legend {\n display: inline-block;\n padding: 0;\n width: auto !important; }\n .chart-legend .scale-legend {\n text-align: center;\n display: flex;\n flex-direction: column; }\n .chart-legend .scale-legend-wrap {\n display: inline-block;\n flex: 1;\n width: 30px;\n border-radius: 5px;\n margin: 0 auto; }\n .chart-legend .scale-legend-label {\n font-size: 12px; }\n .chart-legend .horizontal-legend.scale-legend {\n flex-direction: row; }\n .chart-legend .horizontal-legend .scale-legend-wrap {\n width: auto;\n height: 30px;\n margin: 0 16px; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/common/timeline/timeline.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".timeline .brush-background {\n fill: rgba(0, 0, 0, 0.05); }\n\n.timeline .brush .selection {\n fill: rgba(0, 0, 0, 0.1);\n stroke-width: 1px;\n stroke: #888888; }\n\n.timeline .brush .handle {\n fill-opacity: 0; }\n\n.timeline .embedded-chart {\n opacity: 0.6; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/common/tooltip/tooltip.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".ngx-charts-tooltip-content {\n position: fixed;\n border-radius: 3px;\n z-index: 5000;\n display: block;\n font-weight: normal;\n opacity: 0;\n pointer-events: none !important; }\n .ngx-charts-tooltip-content.type-popover {\n background: #fff;\n color: #060709;\n border: 1px solid #72809b;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12);\n font-size: 13px;\n padding: 4px; }\n .ngx-charts-tooltip-content.type-popover .tooltip-caret {\n position: absolute;\n z-index: 5001;\n width: 0;\n height: 0; }\n .ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left {\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n border-left: 7px solid #fff; }\n .ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top {\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-top: 7px solid #fff; }\n .ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right {\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n border-right: 7px solid #fff; }\n .ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom {\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 7px solid #fff; }\n .ngx-charts-tooltip-content.type-tooltip {\n color: #fff;\n background: rgba(0, 0, 0, 0.75);\n font-size: 12px;\n padding: 0 10px;\n text-align: center;\n pointer-events: auto; }\n .ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left {\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n border-left: 7px solid rgba(0, 0, 0, 0.75); }\n .ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top {\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-top: 7px solid rgba(0, 0, 0, 0.75); }\n .ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right {\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n border-right: 7px solid rgba(0, 0, 0, 0.75); }\n .ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom {\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 7px solid rgba(0, 0, 0, 0.75); }\n .ngx-charts-tooltip-content .tooltip-label {\n display: block;\n line-height: 1em;\n padding: 8px 5px 5px 5px;\n font-size: 1em; }\n .ngx-charts-tooltip-content .tooltip-val {\n display: block;\n font-size: 1.3em;\n line-height: 1em;\n padding: 0 5px 8px 5px; }\n .ngx-charts-tooltip-content .tooltip-caret {\n position: absolute;\n z-index: 5001;\n width: 0;\n height: 0; }\n .ngx-charts-tooltip-content.position-right {\n transform: translate3d(10px, 0, 0); }\n .ngx-charts-tooltip-content.position-left {\n transform: translate3d(-10px, 0, 0); }\n .ngx-charts-tooltip-content.position-top {\n transform: translate3d(0, -10px, 0); }\n .ngx-charts-tooltip-content.position-bottom {\n transform: translate3d(0, 10px, 0); }\n .ngx-charts-tooltip-content.animate {\n opacity: 1;\n transition: opacity 0.3s, transform 0.3s;\n transform: translate3d(0, 0, 0);\n pointer-events: auto; }\n\n.area-tooltip-container {\n padding: 5px 0;\n pointer-events: none; }\n\n.tooltip-item {\n text-align: left;\n line-height: 1.2em;\n padding: 5px 0; }\n .tooltip-item .tooltip-item-color {\n display: inline-block;\n height: 12px;\n width: 12px;\n margin-right: 5px;\n color: #5b646b;\n border-radius: 3px; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/force-directed-graph/force-directed-graph.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".force-directed-graph .edge {\n stroke: #333; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/gauge/gauge.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".gauge .background-arc path {\n fill: rgba(0, 0, 0, 0.05); }\n\n.gauge .gauge-tick path {\n stroke: #666; }\n\n.gauge .gauge-tick text {\n font-size: 12px;\n fill: #666;\n font-weight: bold; }\n\n.gauge .gauge-tick-large path {\n stroke-width: 2px; }\n\n.gauge .gauge-tick-small path {\n stroke-width: 1px; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/gauge/linear-gauge.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".linear-gauge {\n cursor: pointer; }\n .linear-gauge .background-bar path {\n fill: rgba(0, 0, 0, 0.05); }\n .linear-gauge .units {\n fill: #666; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/number-card/card.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, "ngx-charts-number-card .cell .trimmed-label {\n font-size: 12px;\n pointer-events: none;\n overflow: hidden;\n text-align: left;\n line-height: 1em; }\n ngx-charts-number-card .cell .trimmed-label p {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n width: 100%;\n padding: 0;\n margin: 0; }\n\nngx-charts-number-card .cell .value-text {\n pointer-events: none; }\n\nngx-charts-number-card .number-card.clickable .cell .card, ngx-charts-number-card .number-card.clickable .cell .card-band {\n cursor: pointer; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/pie-chart/advanced-pie-chart.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".advanced-pie {\n display: inline-block;\n float: left; }\n\n.advanced-pie-legend-wrapper {\n display: inline-block; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/pie-chart/pie-chart.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".pie-label {\n font-size: 11px; }\n .pie-label.animation {\n animation: 750ms ease-in fadeIn; }\n\n@keyframes fadeIn {\n from {\n opacity: 0; }\n to {\n opacity: 1; } }\n\n.pie-label-line {\n stroke-dasharray: 100%; }\n .pie-label-line.animation {\n animation: 3s linear drawOut;\n transition: d 750ms; }\n\n@keyframes drawOut {\n from {\n stroke-dashoffset: 100%; }\n to {\n stroke-dashoffset: 0; } }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/pie-chart/pie-grid.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".pie-grid .arc1 {\n opacity: 0.4; }\n\n.pie-grid .percent-label {\n font-size: 16px;\n font-weight: 400; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/polar-chart/polar-chart.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".polar-chart .polar-chart-background {\n fill: none; }\n\n.polar-chart .radial-gridline-path {\n stroke-dasharray: 10 10;\n fill: none; }\n\n.polar-chart .pie-label-line {\n stroke: #2f3646; }\n\n.polar-charts-series .polar-series-area {\n pointer-events: none; }\n\n.polar-series-path {\n pointer-events: none; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/tree-map/tree-map.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".tree-map .treemap-val {\n font-size: 1.3em;\n padding-top: 5px;\n display: inline-block; }\n\n.tree-map .treemap-label p {\n display: table-cell;\n text-align: center;\n line-height: 1.2em;\n vertical-align: middle; }\n", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/lib/css-base.js": /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function(useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if(item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /***/ "./node_modules/webpack/buildin/global.js": /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1,eval)("this"); } catch(e) { // This works if the window reference is available if(typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /***/ "./src/area-chart/area-chart-normalized.component.ts": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AreaChartNormalizedComponent; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("@angular/core"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_d3_scale__ = __webpack_require__("d3-scale"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_d3_scale___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_d3_scale__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_d3_shape__ = __webpack_require__("d3-shape"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_d3_shape___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_d3_shape__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_view_dimensions_helper__ = __webpack_require__("./src/common/view-dimensions.helper.ts"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_color_helper__ = __webpack_require__("./src/common/color.helper.ts"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_base_chart_component__ = __webpack_require__("./src/common/base-chart.component.ts"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_id__ = __webpack_require__("./src/utils/id.ts"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common_domain_helper__ = __webpack_require__("./src/common/domain.helper.ts"); var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { 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]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); 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 AreaChartNormalizedComponent = /** @class */ (function (_super) { __extends(AreaChartNormalizedComponent, _super); function AreaChartNormalizedComponent() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.legend = false; _this.legendTitle = 'Legend'; _this.legendPosition = 'right'; _this.showGridLines = true; _this.curve = __WEBPACK_IMPORTED_MODULE_2_d3_shape__["curveLinear"]; _this.activeEntries = []; _this.trimXAxisTicks = true; _this.trimYAxisTicks = true; _this.rotateXAxisTicks = true; _this.maxXAxisTickLength = 16; _this.maxYAxisTickLength = 16; _this.roundDomains = false; _this.tooltipDisabled = false; _this.activate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); _this.deactivate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); _this.margin = [10, 20, 10, 20]; _this.xAxisHeight = 0; _this.yAxisWidth = 0; _this.timelineHeight = 50; _this.timelinePadding = 10; return _this; } AreaChartNormalizedComponent.prototype.update = function () { var _this = this; _super.prototype.update.call(this); this.dims = Object(__WEBPACK_IMPORTED_MODULE_3__common_view_dimensions_helper__["a" /* 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, legendPosition: this.legendPosition }); if (this.timeline) { this.dims.height -= this.timelineHeight + this.margin[2] + this.timelinePadding; } this.xDomain = this.getXDomain(); if (this.filteredDomain) { this.xDomain = this.filteredDomain; } this.yDomain = this.getYDomain(); this.seriesDomain = this.getSeriesDomain(); this.xScale = this.getXScale(this.xDomain, this.dims.width); this.yScale = this.getYScale(this.yDomain, this.dims.height); var _loop_1 = function (i) { var val = this_1.xSet[i]; var d0 = 0; var total = 0; for (var _i = 0, _a = this_1.results; _i < _a.length; _i++) { var group = _a[_i]; var d = group.series.find(function (item) { var a = item.name; var b = val; if (_this.scaleType === 'time') { a = a.valueOf(); b = b.valueOf(); } return a === b; }); if (d) { total += d.value; } } for (var _b = 0, _c = this_1.results; _b < _c.length; _b++) { var group = _c[_b]; var d = group.series.find(function (item) { var a = item.name; var b = val; if (_this.scaleType === 'time') { a = a.valueOf(); b = b.valueOf(); } return a === b; }); if (d) { d.d0 = d0; d.d1 = d0 + d.value; d0 += d.value; } else { d = { name: val, value: 0, d0: d0, d1: d0 }; group.series.push(d); } if (total > 0) { d.d0 = (d.d0 * 100) / total; d.d1 = (d.d1 * 100) / total; } else { d.d0 = 0; d.d1 = 0; } } }; var this_1 = this; for (var i = 0; i < this.xSet.length; i++) { _loop_1(i); } this.updateTimeline(); this.setColors(); this.legendOptions = this.getLegendOptions(); this.transform = "translate(" + this.dims.xOffset + " , " + this.margin[0] + ")"; this.clipPathId = 'clip' + Object(__WEBPACK_IMPORTED_MODULE_6__utils_id__["a" /* id */])().toString(); this.clipPath = "url(#" + this.clipPathId + ")"; }; AreaChartNormalizedComponent.prototype.updateTimeline = function () { if (this.timeline) { this.timelineWidth = this.dims.width; this.timelineXDomain = this.getXDomain(); this.timelineXScale = this.getXScale(this.timelineXDomain, this.timelineWidth); this.timelineYScale = this.getYScale(this.yDomain, this.timelineHeight); this.timelineTransform = "translate(" + this.dims.xOffset + ", " + -this.margin[2] + ")"; } }; AreaChartNormalizedComponent.prototype.getXDomain = function () { var values = Object(__WEBPACK_IMPORTED_MODULE_7__common_domain_helper__["b" /* getUniqueXDomainValues */])(this.results); this.scaleType = Object(__WEBPACK_IMPORTED_MODULE_7__common_domain_helper__["a" /* getScaleType */])(values); var domain = []; if (this.scaleType === 'time') { var min = Math.min.apply(Math, values); var max = Math.max.apply(Math, values); domain = [new Date(min), new Date(max)]; this.xSet = values.slice().sort(function (a, b) { var aDate = a.getTime(); var bDate = b.getTime(); if (aDate > bDate) return 1; if (bDate > aDate) return -1; return 0; }); } else if (this.scaleType === 'linear') { values = values.map(function (v) { return Number(v); }); var min = Math.min.apply(Math, values); var max = Math.max.apply(Math, values); domain = [min, max]; // Use compare function to sort numbers numerically this.xSet = values.slice().sort(function (a, b) { return a - b; }); } else { domain = values; this.xSet = values; } return domain; }; AreaChartNormalizedComponent.prototype.getYDomain = function () { return [0, 100]; }; AreaChartNormalizedComponent.prototype.getSeriesDomain = function () { return this.results.map(function (d) { return d.name; }); }; AreaChartNormalizedComponent.prototype.getXScale = function (domain, width) { var scale; if (this.scaleType === 'time') { scale = Object(__WEBPACK_IMPORTED_MODULE_1_d3_scale__["scaleTime"])(); } else if (this.scaleType === 'linear') { scale = Object(__WEBPACK_IMPORTED_MODULE_1_d3_scale__["scaleLinear"])(); } else if (this.scaleType === 'ordinal') { scale = Object(__WEBPACK_IMPORTED_MODULE_1_d3_scale__["scalePoint"])().padding(0.1); } scale.range([0, width]).domain(domain); return this.roundDomains ? scale.nice() : scale; }; AreaChartNormalizedComponent.prototype.getYScale = function (domain, height) { var scale = Object(__WEBPACK_IMPORTED_MODULE_1_d3_scale__["scaleLinear"])() .range([height, 0]) .domain(domain); return this.roundDomains ? scale.nice() : scale; }; AreaChartNormalizedComponent.prototype.updateDomain = function (domain) { this.filteredDomain = domain; this.xDomain = this.filteredDomain; this.xScale = this.getXScale(this.xDomain, this.dims.width); }; AreaChartNormalizedComponent.prototype.updateHoveredVertical = function (item) { this.hoveredVertical = item.value; this.deactivateAll(); }; AreaChartNormalizedComponent.prototype.hideCircles = function () { this.hoveredVertical = null; this.deactivateAll(); }; AreaChartNormalizedComponent.prototype.onClick = function (data, series) { if (series) { data.series = series.name; } this.select.emit(data); }; AreaChartNormalizedComponent.prototype.trackBy = function (index, item) { return item.name; }; AreaChartNormalizedComponent.prototype.setColors = function () { var domain; if (this.schemeType === 'ordinal') { domain = this.seriesDomain; } else { domain = this.yDomain; } this.colors = new __WEBPACK_IMPORTED_MODULE_4__common_color_helper__["a" /* ColorHelper */](this.scheme, this.schemeType, domain, this.customColors); }; AreaChartNormalizedComponent.prototype.getLegendOptions = function () { var opts = { scaleType: this.schemeType, colors: undefined, domain: [], title: undefined, position: this.legendPosition }; if (opts.scaleType === 'ordinal') { opts.domain = this.seriesDomain; opts.colors = this.colors; opts.title = this.legendTitle; } else { opts.domain = this.yDomain; opts.colors = this.colors.scale; } return opts; }; AreaChartNormalizedComponent.prototype.updateYAxisWidth = function (_a) { var width = _a.width; this.yAxisWidth = width; this.update(); }; AreaChartNormalizedComponent.prototype.updateXAxisHeight = function (_a) { var height = _a.height; this.xAxisHeight = height; this.update(); }; AreaChartNormalizedComponent.prototype.onActivate = function (item) { var idx = this.activeEntries.findIndex(function (d) { return d.name === item.name && d.value === item.value; }); if (idx > -1) { return; } this.activeEntries = [item].concat(this.activeEntries); this.activate.emit({ value: item, entries: this.activeEntries }); }; AreaChartNormalizedComponent.prototype.onDeactivate = function (item) { var idx = this.activeEntries.findIndex(function (d) { return d.name === item.name && d.value === item.value; }); this.activeEntries.splice(idx, 1); this.activeEntries = this.activeEntries.slice(); this.deactivate.emit({ value: item, entries: this.activeEntries }); }; AreaChartNormalizedComponent.prototype.deactivateAll = function () { this.activeEntries = this.activeEntries.slice(); for (var _i = 0, _a = this.activeEntries; _i < _a.length; _i++) { var entry = _a[_i]; this.deactivate.emit({ value: entry, entries: [] }); } this.activeEntries = []; }; __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "legend", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", String) ], AreaChartNormalizedComponent.prototype, "legendTitle", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", String) ], AreaChartNormalizedComponent.prototype, "legendPosition", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "xAxis", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "yAxis", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "showXAxisLabel", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "showYAxisLabel", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "xAxisLabel", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "yAxisLabel", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "timeline", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "gradient", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Boolean) ], AreaChartNormalizedComponent.prototype, "showGridLines", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "curve", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Array) ], AreaChartNormalizedComponent.prototype, "activeEntries", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", String) ], AreaChartNormalizedComponent.prototype, "schemeType", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Boolean) ], AreaChartNormalizedComponent.prototype, "trimXAxisTicks", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Boolean) ], AreaChartNormalizedComponent.prototype, "trimYAxisTicks", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Boolean) ], AreaChartNormalizedComponent.prototype, "rotateXAxisTicks", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Number) ], AreaChartNormalizedComponent.prototype, "maxXAxisTickLength", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Number) ], AreaChartNormalizedComponent.prototype, "maxYAxisTickLength", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "xAxisTickFormatting", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Object) ], AreaChartNormalizedComponent.prototype, "yAxisTickFormatting", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Array) ], AreaChartNormalizedComponent.prototype, "xAxisTicks", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Array) ], AreaChartNormalizedComponent.prototype, "yAxisTicks", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Boolean) ], AreaChartNormalizedComponent.prototype, "roundDomains", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __metadata("design:type", Boolean) ], AreaChartNormalizedComponent.prototype, "tooltipDisabled", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"])(), __metadata("design:type", __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]) ], AreaChartNormalizedComponent.prototype, "activate", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"])(), __metadata("design:type", __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]) ], AreaChartNormalizedComponent.prototype, "deactivate", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"])('tooltipTemplate', { static: false }), __metadata("design:type", __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"]) ], AreaChartNormalizedComponent.prototype, "tooltipTemplate", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"])('seriesTooltipTemplate', { static: false }), __metadata("design:type", __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"]) ], AreaChartNormalizedComponent.prototype, "seriesTooltipTemplate", void 0); __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"])('mouseleave'), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], AreaChartNormalizedComponent.prototype, "hideCircles", null); AreaChartNormalizedComponent = __decorate([ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({ selector: 'ngx-charts-area-chart-normalized', template: "\n <ngx-charts-chart\n [view]=\"[width, height]\"\n [showLegend]=\"legend\"\n [legendOptions]=\"legendOptions\"\n [activeEntries]=\"activeEntries\"\n [animations]=\"animations\"\n (legendLabelClick)=\"onClick($event)\"\n (legendLabelActivate)=\"onActivate($event)\"\n (legendLabelDeactivate)=\"onDeactivate($event)\"\n >\n <svg:defs>\n <svg:clipPath [attr.id]=\"clipPathId\">\n <svg:rect\n [attr.width]=\"dims.width + 10\"\n [attr.height]=\"dims.height + 10\"\n [attr.transform]=\"'translate(-5, -5)'\"\n />\n </svg:clipPath>\n </svg:defs>\n <svg:g [attr.transform]=\"transform\" class=\"area-chart chart\">\n <svg:g\n ngx-charts-x-axis\n *ngIf=\"xAxis\"\n [xScale]=\"xScale\"\n [dims]=\"dims\"\n [showGridLines]=\"showGridLines\"\n [showLabel]=\"showXAxisLabel\"\n [labelText]=\"xAxisLabel\"\n [trimTicks]=\"trimXAxisTicks\"\n [rotateTicks]=\"rotateXAxisTicks\"\n [maxTickLength]=\"maxXAxisTickLength\"\n [tickFormatting]=\"xAxisTickFormatting\"\n [ticks]=\"xAxisTicks\"\n (dimensionsChanged)=\"updateXAxisHeight($event)\"\n ></svg:g>\n <svg:g\n ngx-charts-y-axis\n *ngIf=\"yAxis\"\n [yScale]=\"yScale\"\n [dims]=\"dims\"\n [showGridLines]=\"showGridLines\"\n [showLabel]=\"showYAxisLabel\"\n [labelText]=\"yAxisLabel\"\n [trimTicks]=\"trimYAxisTicks\"\n [maxTickLength]=\"maxYAxisTickLength\"\n [tickFormatting]=\"yAxisTickFormatting\"\n [ticks]=\"yAxisTicks\"\n (dimensionsChanged)=\"updateYAxisWidth($event)\"\n ></svg:g>\n <svg:g [attr.clip-path]=\"clipPath\">\n <svg:g *ngFor=\"let series of results; trackBy: trackBy\">\n